From e31af2046667a4cb30f410317c5f87be681dea63 Mon Sep 17 00:00:00 2001 From: Gaeel Bradshaw-Rodriguez Date: Sun, 2 May 2021 01:23:15 +0200 Subject: [PATCH] Chown files to a custom user after building (fix file ownership) (#250) * Chown files to a custom user after building * Better describe `chownFilesTo` input As suggested by @webbertakken: https://github.com/game-ci/unity-builder/pull/250#discussion_r624575666 Co-authored-by: Webber Takken * Simplify chown step in `build.sh` Co-authored-by: Webber Takken Co-authored-by: Webber Takken --- action.yml | 4 + dist/index.js | 997 +++++++++++++++++----------------- dist/index.js.map | 2 +- dist/steps/build.sh | 6 + src/model/__mocks__/input.ts | 1 + src/model/aws.ts | 4 + src/model/build-parameters.ts | 1 + src/model/docker.ts | 2 + src/model/input.ts | 4 + src/model/kubernetes.ts | 4 + 10 files changed, 532 insertions(+), 493 deletions(-) diff --git a/action.yml b/action.yml index aafb3a990..839b1b50e 100644 --- a/action.yml +++ b/action.yml @@ -106,6 +106,10 @@ inputs: Parameters must start with a hyphen (-) and may be followed by a value (without hyphen). Parameters without a value will be considered booleans (with a value of true). + chownFilesTo: + required: false + default: '' + description: 'User and optionally group (user or user:group or uid:gid) to give ownership of the resulting build artifacts' allowDirtyBuild: required: false default: '' diff --git a/dist/index.js b/dist/index.js index 7b8c7e2b9..ddf1a0e4e 100644 --- a/dist/index.js +++ b/dist/index.js @@ -347,6 +347,10 @@ class AWS { name: 'CUSTOM_PARAMETERS', value: buildParameters.customParameters, }, + { + name: 'CHOWN_FILES_TO', + value: buildParameters.chownFilesTo, + }, { name: 'BUILD_TARGET', value: buildParameters.platform, @@ -776,6 +780,7 @@ class BuildParameters { androidKeyaliasName: input_1.default.androidKeyaliasName, androidKeyaliasPass: input_1.default.androidKeyaliasPass, customParameters: input_1.default.customParameters, + chownFilesTo: input_1.default.chownFilesTo, remoteBuildCluster: input_1.default.remoteBuildCluster, awsStackName: input_1.default.awsStackName, kubeConfig: input_1.default.kubeConfig, @@ -892,7 +897,7 @@ class Docker { } static run(image, parameters, silent = false) { return __awaiter(this, void 0, void 0, function* () { - const { version, workspace, runnerTempPath, platform, projectPath, buildName, buildPath, buildFile, buildMethod, buildVersion, androidVersionCode, androidKeystoreName, androidKeystoreBase64, androidKeystorePass, androidKeyaliasName, androidKeyaliasPass, customParameters, } = parameters; + const { version, workspace, runnerTempPath, platform, projectPath, buildName, buildPath, buildFile, buildMethod, buildVersion, androidVersionCode, androidKeystoreName, androidKeystoreBase64, androidKeystorePass, androidKeyaliasName, androidKeyaliasPass, customParameters, chownFilesTo, } = parameters; const command = `docker run \ --workdir /github/workspace \ --rm \ @@ -917,6 +922,7 @@ class Docker { --env ANDROID_KEYALIAS_NAME="${androidKeyaliasName}" \ --env ANDROID_KEYALIAS_PASS="${androidKeyaliasPass}" \ --env CUSTOM_PARAMETERS="${customParameters}" \ + --env CHOWN_FILES_TO="${chownFilesTo}" \ --env GITHUB_REF \ --env GITHUB_SHA \ --env GITHUB_REPOSITORY \ @@ -1207,6 +1213,9 @@ class Input { static get customParameters() { return core.getInput('customParameters') || ''; } + static get chownFilesTo() { + return core.getInput('chownFilesTo') || ''; + } static get remoteBuildCluster() { return core.getInput('remoteBuildCluster') || ''; } @@ -1468,6 +1477,10 @@ class Kubernetes { name: 'CUSTOM_PARAMETERS', value: this.buildParameters.customParameters, }, + { + name: 'CHOWN_FILES_TO', + value: this.buildParameters.chownFilesTo, + }, { name: 'BUILD_TARGET', value: this.buildParameters.platform, @@ -147442,279 +147455,279 @@ function escapeJsonPtr(str) { /***/ 21328: /***/ (function(module) { -/** - * JSONSchema Validator - Validates JavaScript objects using JSON Schemas - * (http://www.json.com/json-schema-proposal/) - * - * Copyright (c) 2007 Kris Zyp SitePen (www.sitepen.com) - * Licensed under the MIT (MIT-LICENSE.txt) license. -To use the validator call the validate function with an instance object and an optional schema object. -If a schema is provided, it will be used to validate. If the instance object refers to a schema (self-validating), -that schema will be used to validate and the schema parameter is not necessary (if both exist, -both validations will occur). -The validate method will return an array of validation errors. If there are no errors, then an -empty list will be returned. A validation error will have two properties: -"property" which indicates which property had the error -"message" which indicates what the error was - */ -(function (root, factory) { - if (typeof define === 'function' && define.amd) { - // AMD. Register as an anonymous module. - define([], function () { - return factory(); - }); - } else if ( true && module.exports) { - // Node. Does not work with strict CommonJS, but - // only CommonJS-like environments that support module.exports, - // like Node. - module.exports = factory(); - } else { - // Browser globals - root.jsonSchema = factory(); - } -}(this, function () {// setup primitive classes to be JSON Schema types -var exports = validate -exports.Integer = {type:"integer"}; -var primitiveConstructors = { - String: String, - Boolean: Boolean, - Number: Number, - Object: Object, - Array: Array, - Date: Date -} -exports.validate = validate; -function validate(/*Any*/instance,/*Object*/schema) { - // Summary: - // To use the validator call JSONSchema.validate with an instance object and an optional schema object. - // If a schema is provided, it will be used to validate. If the instance object refers to a schema (self-validating), - // that schema will be used to validate and the schema parameter is not necessary (if both exist, - // both validations will occur). - // The validate method will return an object with two properties: - // valid: A boolean indicating if the instance is valid by the schema - // errors: An array of validation errors. If there are no errors, then an - // empty list will be returned. A validation error will have two properties: - // property: which indicates which property had the error - // message: which indicates what the error was - // - return validate(instance, schema, {changing: false});//, coerce: false, existingOnly: false}); - }; -exports.checkPropertyChange = function(/*Any*/value,/*Object*/schema, /*String*/property) { - // Summary: - // The checkPropertyChange method will check to see if an value can legally be in property with the given schema - // This is slightly different than the validate method in that it will fail if the schema is readonly and it will - // not check for self-validation, it is assumed that the passed in value is already internally valid. - // The checkPropertyChange method will return the same object type as validate, see JSONSchema.validate for - // information. - // - return validate(value, schema, {changing: property || "property"}); - }; -var validate = exports._validate = function(/*Any*/instance,/*Object*/schema,/*Object*/options) { - - if (!options) options = {}; - var _changing = options.changing; - - function getType(schema){ - return schema.type || (primitiveConstructors[schema.name] == schema && schema.name.toLowerCase()); - } - var errors = []; - // validate a value against a property definition - function checkProp(value, schema, path,i){ - - var l; - path += path ? typeof i == 'number' ? '[' + i + ']' : typeof i == 'undefined' ? '' : '.' + i : i; - function addError(message){ - errors.push({property:path,message:message}); - } - - if((typeof schema != 'object' || schema instanceof Array) && (path || typeof schema != 'function') && !(schema && getType(schema))){ - if(typeof schema == 'function'){ - if(!(value instanceof schema)){ - addError("is not an instance of the class/constructor " + schema.name); - } - }else if(schema){ - addError("Invalid schema/property definition " + schema); - } - return null; - } - if(_changing && schema.readonly){ - addError("is a readonly field, it can not be changed"); - } - if(schema['extends']){ // if it extends another schema, it must pass that schema as well - checkProp(value,schema['extends'],path,i); - } - // validate a value against a type definition - function checkType(type,value){ - if(type){ - if(typeof type == 'string' && type != 'any' && - (type == 'null' ? value !== null : typeof value != type) && - !(value instanceof Array && type == 'array') && - !(value instanceof Date && type == 'date') && - !(type == 'integer' && value%1===0)){ - return [{property:path,message:(typeof value) + " value found, but a " + type + " is required"}]; - } - if(type instanceof Array){ - var unionErrors=[]; - for(var j = 0; j < type.length; j++){ // a union type - if(!(unionErrors=checkType(type[j],value)).length){ - break; - } - } - if(unionErrors.length){ - return unionErrors; - } - }else if(typeof type == 'object'){ - var priorErrors = errors; - errors = []; - checkProp(value,type,path); - var theseErrors = errors; - errors = priorErrors; - return theseErrors; - } - } - return []; - } - if(value === undefined){ - if(schema.required){ - addError("is missing and it is required"); - } - }else{ - errors = errors.concat(checkType(getType(schema),value)); - if(schema.disallow && !checkType(schema.disallow,value).length){ - addError(" disallowed value was matched"); - } - if(value !== null){ - if(value instanceof Array){ - if(schema.items){ - var itemsIsArray = schema.items instanceof Array; - var propDef = schema.items; - for (i = 0, l = value.length; i < l; i += 1) { - if (itemsIsArray) - propDef = schema.items[i]; - if (options.coerce) - value[i] = options.coerce(value[i], propDef); - errors.concat(checkProp(value[i],propDef,path,i)); - } - } - if(schema.minItems && value.length < schema.minItems){ - addError("There must be a minimum of " + schema.minItems + " in the array"); - } - if(schema.maxItems && value.length > 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)){ - var value = instance[i]; - // 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:(typeof value) + "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; -})); +/** + * JSONSchema Validator - Validates JavaScript objects using JSON Schemas + * (http://www.json.com/json-schema-proposal/) + * + * Copyright (c) 2007 Kris Zyp SitePen (www.sitepen.com) + * Licensed under the MIT (MIT-LICENSE.txt) license. +To use the validator call the validate function with an instance object and an optional schema object. +If a schema is provided, it will be used to validate. If the instance object refers to a schema (self-validating), +that schema will be used to validate and the schema parameter is not necessary (if both exist, +both validations will occur). +The validate method will return an array of validation errors. If there are no errors, then an +empty list will be returned. A validation error will have two properties: +"property" which indicates which property had the error +"message" which indicates what the error was + */ +(function (root, factory) { + if (typeof define === 'function' && define.amd) { + // AMD. Register as an anonymous module. + define([], function () { + return factory(); + }); + } else if ( true && module.exports) { + // Node. Does not work with strict CommonJS, but + // only CommonJS-like environments that support module.exports, + // like Node. + module.exports = factory(); + } else { + // Browser globals + root.jsonSchema = factory(); + } +}(this, function () {// setup primitive classes to be JSON Schema types +var exports = validate +exports.Integer = {type:"integer"}; +var primitiveConstructors = { + String: String, + Boolean: Boolean, + Number: Number, + Object: Object, + Array: Array, + Date: Date +} +exports.validate = validate; +function validate(/*Any*/instance,/*Object*/schema) { + // Summary: + // To use the validator call JSONSchema.validate with an instance object and an optional schema object. + // If a schema is provided, it will be used to validate. If the instance object refers to a schema (self-validating), + // that schema will be used to validate and the schema parameter is not necessary (if both exist, + // both validations will occur). + // The validate method will return an object with two properties: + // valid: A boolean indicating if the instance is valid by the schema + // errors: An array of validation errors. If there are no errors, then an + // empty list will be returned. A validation error will have two properties: + // property: which indicates which property had the error + // message: which indicates what the error was + // + return validate(instance, schema, {changing: false});//, coerce: false, existingOnly: false}); + }; +exports.checkPropertyChange = function(/*Any*/value,/*Object*/schema, /*String*/property) { + // Summary: + // The checkPropertyChange method will check to see if an value can legally be in property with the given schema + // This is slightly different than the validate method in that it will fail if the schema is readonly and it will + // not check for self-validation, it is assumed that the passed in value is already internally valid. + // The checkPropertyChange method will return the same object type as validate, see JSONSchema.validate for + // information. + // + return validate(value, schema, {changing: property || "property"}); + }; +var validate = exports._validate = function(/*Any*/instance,/*Object*/schema,/*Object*/options) { + + if (!options) options = {}; + var _changing = options.changing; + + function getType(schema){ + return schema.type || (primitiveConstructors[schema.name] == schema && schema.name.toLowerCase()); + } + var errors = []; + // validate a value against a property definition + function checkProp(value, schema, path,i){ + + var l; + path += path ? typeof i == 'number' ? '[' + i + ']' : typeof i == 'undefined' ? '' : '.' + i : i; + function addError(message){ + errors.push({property:path,message:message}); + } + + if((typeof schema != 'object' || schema instanceof Array) && (path || typeof schema != 'function') && !(schema && getType(schema))){ + if(typeof schema == 'function'){ + if(!(value instanceof schema)){ + addError("is not an instance of the class/constructor " + schema.name); + } + }else if(schema){ + addError("Invalid schema/property definition " + schema); + } + return null; + } + if(_changing && schema.readonly){ + addError("is a readonly field, it can not be changed"); + } + if(schema['extends']){ // if it extends another schema, it must pass that schema as well + checkProp(value,schema['extends'],path,i); + } + // validate a value against a type definition + function checkType(type,value){ + if(type){ + if(typeof type == 'string' && type != 'any' && + (type == 'null' ? value !== null : typeof value != type) && + !(value instanceof Array && type == 'array') && + !(value instanceof Date && type == 'date') && + !(type == 'integer' && value%1===0)){ + return [{property:path,message:(typeof value) + " value found, but a " + type + " is required"}]; + } + if(type instanceof Array){ + var unionErrors=[]; + for(var j = 0; j < type.length; j++){ // a union type + if(!(unionErrors=checkType(type[j],value)).length){ + break; + } + } + if(unionErrors.length){ + return unionErrors; + } + }else if(typeof type == 'object'){ + var priorErrors = errors; + errors = []; + checkProp(value,type,path); + var theseErrors = errors; + errors = priorErrors; + return theseErrors; + } + } + return []; + } + if(value === undefined){ + if(schema.required){ + addError("is missing and it is required"); + } + }else{ + errors = errors.concat(checkType(getType(schema),value)); + if(schema.disallow && !checkType(schema.disallow,value).length){ + addError(" disallowed value was matched"); + } + if(value !== null){ + if(value instanceof Array){ + if(schema.items){ + var itemsIsArray = schema.items instanceof Array; + var propDef = schema.items; + for (i = 0, l = value.length; i < l; i += 1) { + if (itemsIsArray) + propDef = schema.items[i]; + if (options.coerce) + value[i] = options.coerce(value[i], propDef); + errors.concat(checkProp(value[i],propDef,path,i)); + } + } + if(schema.minItems && value.length < schema.minItems){ + addError("There must be a minimum of " + schema.minItems + " in the array"); + } + if(schema.maxItems && value.length > 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)){ + var value = instance[i]; + // 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:(typeof value) + "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; +})); /***/ }), @@ -182319,224 +182332,224 @@ __webpack_require__.r(__webpack_exports__); /* 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; -} +/*! ***************************************************************************** +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; +} /***/ }), diff --git a/dist/index.js.map b/dist/index.js.map index fb6a57dee..f77a99a01 100644 --- a/dist/index.js.map +++ b/dist/index.js.map @@ -1 +1 @@ -{"version":3,"file":"index.js","sources":["../webpack://unity-builder/./lib/index.js","../webpack://unity-builder/./lib/model/action.js","../webpack://unity-builder/./lib/model/android-versioning.js","../webpack://unity-builder/./lib/model/aws.js","../webpack://unity-builder/./lib/model/build-parameters.js","../webpack://unity-builder/./lib/model/cache.js","../webpack://unity-builder/./lib/model/docker.js","../webpack://unity-builder/./lib/model/error/not-implemented-exception.js","../webpack://unity-builder/./lib/model/error/validation-error.js","../webpack://unity-builder/./lib/model/image-tag.js","../webpack://unity-builder/./lib/model/index.js","../webpack://unity-builder/./lib/model/input.js","../webpack://unity-builder/./lib/model/kubernetes.js","../webpack://unity-builder/./lib/model/output.js","../webpack://unity-builder/./lib/model/platform.js","../webpack://unity-builder/./lib/model/project.js","../webpack://unity-builder/./lib/model/system.js","../webpack://unity-builder/./lib/model/unity-versioning.js","../webpack://unity-builder/./lib/model/unity.js","../webpack://unity-builder/./lib/model/versioning.js","../webpack://unity-builder/./node_modules/@actions/core/lib/command.js","../webpack://unity-builder/./node_modules/@actions/core/lib/core.js","../webpack://unity-builder/./node_modules/@actions/core/lib/file-command.js","../webpack://unity-builder/./node_modules/@actions/core/lib/utils.js","../webpack://unity-builder/./node_modules/@actions/exec/lib/exec.js","../webpack://unity-builder/./node_modules/@actions/exec/lib/toolrunner.js","../webpack://unity-builder/./node_modules/@actions/io/lib/io-util.js","../webpack://unity-builder/./node_modules/@actions/io/lib/io.js","../webpack://unity-builder/./node_modules/@kubernetes/client-node/dist/api.js","../webpack://unity-builder/./node_modules/@kubernetes/client-node/dist/attach.js","../webpack://unity-builder/./node_modules/@kubernetes/client-node/dist/cache.js","../webpack://unity-builder/./node_modules/@kubernetes/client-node/dist/cloud_auth.js","../webpack://unity-builder/./node_modules/@kubernetes/client-node/dist/config.js","../webpack://unity-builder/./node_modules/@kubernetes/client-node/dist/config_types.js","../webpack://unity-builder/./node_modules/@kubernetes/client-node/dist/exec.js","../webpack://unity-builder/./node_modules/@kubernetes/client-node/dist/exec_auth.js","../webpack://unity-builder/./node_modules/@kubernetes/client-node/dist/index.js","../webpack://unity-builder/./node_modules/@kubernetes/client-node/dist/informer.js","../webpack://unity-builder/./node_modules/@kubernetes/client-node/dist/log.js","../webpack://unity-builder/./node_modules/@kubernetes/client-node/dist/portforward.js","../webpack://unity-builder/./node_modules/@kubernetes/client-node/dist/terminal-size-queue.js","../webpack://unity-builder/./node_modules/@kubernetes/client-node/dist/watch.js","../webpack://unity-builder/./node_modules/@kubernetes/client-node/dist/web-socket-handler.js","../webpack://unity-builder/./node_modules/@kubernetes/client-node/dist/yaml.js","../webpack://unity-builder/./node_modules/@panva/asn1.js/lib/asn1.js","../webpack://unity-builder/./node_modules/@panva/asn1.js/lib/asn1/api.js","../webpack://unity-builder/./node_modules/@panva/asn1.js/lib/asn1/base/buffer.js","../webpack://unity-builder/./node_modules/@panva/asn1.js/lib/asn1/base/index.js","../webpack://unity-builder/./node_modules/@panva/asn1.js/lib/asn1/base/node.js","../webpack://unity-builder/./node_modules/@panva/asn1.js/lib/asn1/base/reporter.js","../webpack://unity-builder/./node_modules/@panva/asn1.js/lib/asn1/constants/der.js","../webpack://unity-builder/./node_modules/@panva/asn1.js/lib/asn1/constants/index.js","../webpack://unity-builder/./node_modules/@panva/asn1.js/lib/asn1/decoders/der.js","../webpack://unity-builder/./node_modules/@panva/asn1.js/lib/asn1/decoders/index.js","../webpack://unity-builder/./node_modules/@panva/asn1.js/lib/asn1/decoders/pem.js","../webpack://unity-builder/./node_modules/@panva/asn1.js/lib/asn1/encoders/der.js","../webpack://unity-builder/./node_modules/@panva/asn1.js/lib/asn1/encoders/index.js","../webpack://unity-builder/./node_modules/@panva/asn1.js/lib/asn1/encoders/pem.js","../webpack://unity-builder/./node_modules/@sindresorhus/is/dist/index.js","../webpack://unity-builder/./node_modules/@szmarczak/http-timer/source/index.js","../webpack://unity-builder/./node_modules/aggregate-error/index.js","../webpack://unity-builder/./node_modules/ajv/lib/ajv.js","../webpack://unity-builder/./node_modules/ajv/lib/cache.js","../webpack://unity-builder/./node_modules/ajv/lib/compile/async.js","../webpack://unity-builder/./node_modules/ajv/lib/compile/error_classes.js","../webpack://unity-builder/./node_modules/ajv/lib/compile/formats.js","../webpack://unity-builder/./node_modules/ajv/lib/compile/index.js","../webpack://unity-builder/./node_modules/ajv/lib/compile/resolve.js","../webpack://unity-builder/./node_modules/ajv/lib/compile/rules.js","../webpack://unity-builder/./node_modules/ajv/lib/compile/schema_obj.js","../webpack://unity-builder/./node_modules/ajv/lib/compile/ucs2length.js","../webpack://unity-builder/./node_modules/ajv/lib/compile/util.js","../webpack://unity-builder/./node_modules/ajv/lib/data.js","../webpack://unity-builder/./node_modules/ajv/lib/definition_schema.js","../webpack://unity-builder/./node_modules/ajv/lib/dotjs/_limit.js","../webpack://unity-builder/./node_modules/ajv/lib/dotjs/_limitItems.js","../webpack://unity-builder/./node_modules/ajv/lib/dotjs/_limitLength.js","../webpack://unity-builder/./node_modules/ajv/lib/dotjs/_limitProperties.js","../webpack://unity-builder/./node_modules/ajv/lib/dotjs/allOf.js","../webpack://unity-builder/./node_modules/ajv/lib/dotjs/anyOf.js","../webpack://unity-builder/./node_modules/ajv/lib/dotjs/comment.js","../webpack://unity-builder/./node_modules/ajv/lib/dotjs/const.js","../webpack://unity-builder/./node_modules/ajv/lib/dotjs/contains.js","../webpack://unity-builder/./node_modules/ajv/lib/dotjs/custom.js","../webpack://unity-builder/./node_modules/ajv/lib/dotjs/dependencies.js","../webpack://unity-builder/./node_modules/ajv/lib/dotjs/enum.js","../webpack://unity-builder/./node_modules/ajv/lib/dotjs/format.js","../webpack://unity-builder/./node_modules/ajv/lib/dotjs/if.js","../webpack://unity-builder/./node_modules/ajv/lib/dotjs/index.js","../webpack://unity-builder/./node_modules/ajv/lib/dotjs/items.js","../webpack://unity-builder/./node_modules/ajv/lib/dotjs/multipleOf.js","../webpack://unity-builder/./node_modules/ajv/lib/dotjs/not.js","../webpack://unity-builder/./node_modules/ajv/lib/dotjs/oneOf.js","../webpack://unity-builder/./node_modules/ajv/lib/dotjs/pattern.js","../webpack://unity-builder/./node_modules/ajv/lib/dotjs/properties.js","../webpack://unity-builder/./node_modules/ajv/lib/dotjs/propertyNames.js","../webpack://unity-builder/./node_modules/ajv/lib/dotjs/ref.js","../webpack://unity-builder/./node_modules/ajv/lib/dotjs/required.js","../webpack://unity-builder/./node_modules/ajv/lib/dotjs/uniqueItems.js","../webpack://unity-builder/./node_modules/ajv/lib/dotjs/validate.js","../webpack://unity-builder/./node_modules/ajv/lib/keyword.js","../webpack://unity-builder/./node_modules/asn1/lib/ber/errors.js","../webpack://unity-builder/./node_modules/asn1/lib/ber/index.js","../webpack://unity-builder/./node_modules/asn1/lib/ber/reader.js","../webpack://unity-builder/./node_modules/asn1/lib/ber/types.js","../webpack://unity-builder/./node_modules/asn1/lib/ber/writer.js","../webpack://unity-builder/./node_modules/asn1/lib/index.js","../webpack://unity-builder/./node_modules/assert-plus/assert.js","../webpack://unity-builder/./node_modules/async-limiter/index.js","../webpack://unity-builder/./node_modules/asynckit/index.js","../webpack://unity-builder/./node_modules/asynckit/lib/abort.js","../webpack://unity-builder/./node_modules/asynckit/lib/async.js","../webpack://unity-builder/./node_modules/asynckit/lib/defer.js","../webpack://unity-builder/./node_modules/asynckit/lib/iterate.js","../webpack://unity-builder/./node_modules/asynckit/lib/state.js","../webpack://unity-builder/./node_modules/asynckit/lib/terminator.js","../webpack://unity-builder/./node_modules/asynckit/parallel.js","../webpack://unity-builder/./node_modules/asynckit/serial.js","../webpack://unity-builder/./node_modules/asynckit/serialOrdered.js","../webpack://unity-builder/./node_modules/aws-sdk/clients/accessanalyzer.js","../webpack://unity-builder/./node_modules/aws-sdk/clients/acm.js","../webpack://unity-builder/./node_modules/aws-sdk/clients/acmpca.js","../webpack://unity-builder/./node_modules/aws-sdk/clients/alexaforbusiness.js","../webpack://unity-builder/./node_modules/aws-sdk/clients/all.js","../webpack://unity-builder/./node_modules/aws-sdk/clients/amp.js","../webpack://unity-builder/./node_modules/aws-sdk/clients/amplify.js","../webpack://unity-builder/./node_modules/aws-sdk/clients/amplifybackend.js","../webpack://unity-builder/./node_modules/aws-sdk/clients/apigateway.js","../webpack://unity-builder/./node_modules/aws-sdk/clients/apigatewaymanagementapi.js","../webpack://unity-builder/./node_modules/aws-sdk/clients/apigatewayv2.js","../webpack://unity-builder/./node_modules/aws-sdk/clients/appconfig.js","../webpack://unity-builder/./node_modules/aws-sdk/clients/appflow.js","../webpack://unity-builder/./node_modules/aws-sdk/clients/appintegrations.js","../webpack://unity-builder/./node_modules/aws-sdk/clients/applicationautoscaling.js","../webpack://unity-builder/./node_modules/aws-sdk/clients/applicationinsights.js","../webpack://unity-builder/./node_modules/aws-sdk/clients/appmesh.js","../webpack://unity-builder/./node_modules/aws-sdk/clients/appstream.js","../webpack://unity-builder/./node_modules/aws-sdk/clients/appsync.js","../webpack://unity-builder/./node_modules/aws-sdk/clients/athena.js","../webpack://unity-builder/./node_modules/aws-sdk/clients/auditmanager.js","../webpack://unity-builder/./node_modules/aws-sdk/clients/augmentedairuntime.js","../webpack://unity-builder/./node_modules/aws-sdk/clients/autoscaling.js","../webpack://unity-builder/./node_modules/aws-sdk/clients/autoscalingplans.js","../webpack://unity-builder/./node_modules/aws-sdk/clients/backup.js","../webpack://unity-builder/./node_modules/aws-sdk/clients/batch.js","../webpack://unity-builder/./node_modules/aws-sdk/clients/braket.js","../webpack://unity-builder/./node_modules/aws-sdk/clients/budgets.js","../webpack://unity-builder/./node_modules/aws-sdk/clients/chime.js","../webpack://unity-builder/./node_modules/aws-sdk/clients/cloud9.js","../webpack://unity-builder/./node_modules/aws-sdk/clients/clouddirectory.js","../webpack://unity-builder/./node_modules/aws-sdk/clients/cloudformation.js","../webpack://unity-builder/./node_modules/aws-sdk/clients/cloudfront.js","../webpack://unity-builder/./node_modules/aws-sdk/clients/cloudhsm.js","../webpack://unity-builder/./node_modules/aws-sdk/clients/cloudhsmv2.js","../webpack://unity-builder/./node_modules/aws-sdk/clients/cloudsearch.js","../webpack://unity-builder/./node_modules/aws-sdk/clients/cloudsearchdomain.js","../webpack://unity-builder/./node_modules/aws-sdk/clients/cloudtrail.js","../webpack://unity-builder/./node_modules/aws-sdk/clients/cloudwatch.js","../webpack://unity-builder/./node_modules/aws-sdk/clients/cloudwatchevents.js","../webpack://unity-builder/./node_modules/aws-sdk/clients/cloudwatchlogs.js","../webpack://unity-builder/./node_modules/aws-sdk/clients/codeartifact.js","../webpack://unity-builder/./node_modules/aws-sdk/clients/codebuild.js","../webpack://unity-builder/./node_modules/aws-sdk/clients/codecommit.js","../webpack://unity-builder/./node_modules/aws-sdk/clients/codedeploy.js","../webpack://unity-builder/./node_modules/aws-sdk/clients/codeguruprofiler.js","../webpack://unity-builder/./node_modules/aws-sdk/clients/codegurureviewer.js","../webpack://unity-builder/./node_modules/aws-sdk/clients/codepipeline.js","../webpack://unity-builder/./node_modules/aws-sdk/clients/codestar.js","../webpack://unity-builder/./node_modules/aws-sdk/clients/codestarconnections.js","../webpack://unity-builder/./node_modules/aws-sdk/clients/codestarnotifications.js","../webpack://unity-builder/./node_modules/aws-sdk/clients/cognitoidentity.js","../webpack://unity-builder/./node_modules/aws-sdk/clients/cognitoidentityserviceprovider.js","../webpack://unity-builder/./node_modules/aws-sdk/clients/cognitosync.js","../webpack://unity-builder/./node_modules/aws-sdk/clients/comprehend.js","../webpack://unity-builder/./node_modules/aws-sdk/clients/comprehendmedical.js","../webpack://unity-builder/./node_modules/aws-sdk/clients/computeoptimizer.js","../webpack://unity-builder/./node_modules/aws-sdk/clients/configservice.js","../webpack://unity-builder/./node_modules/aws-sdk/clients/connect.js","../webpack://unity-builder/./node_modules/aws-sdk/clients/connectcontactlens.js","../webpack://unity-builder/./node_modules/aws-sdk/clients/connectparticipant.js","../webpack://unity-builder/./node_modules/aws-sdk/clients/costexplorer.js","../webpack://unity-builder/./node_modules/aws-sdk/clients/cur.js","../webpack://unity-builder/./node_modules/aws-sdk/clients/customerprofiles.js","../webpack://unity-builder/./node_modules/aws-sdk/clients/databrew.js","../webpack://unity-builder/./node_modules/aws-sdk/clients/dataexchange.js","../webpack://unity-builder/./node_modules/aws-sdk/clients/datapipeline.js","../webpack://unity-builder/./node_modules/aws-sdk/clients/datasync.js","../webpack://unity-builder/./node_modules/aws-sdk/clients/dax.js","../webpack://unity-builder/./node_modules/aws-sdk/clients/detective.js","../webpack://unity-builder/./node_modules/aws-sdk/clients/devicefarm.js","../webpack://unity-builder/./node_modules/aws-sdk/clients/devopsguru.js","../webpack://unity-builder/./node_modules/aws-sdk/clients/directconnect.js","../webpack://unity-builder/./node_modules/aws-sdk/clients/directoryservice.js","../webpack://unity-builder/./node_modules/aws-sdk/clients/discovery.js","../webpack://unity-builder/./node_modules/aws-sdk/clients/dlm.js","../webpack://unity-builder/./node_modules/aws-sdk/clients/dms.js","../webpack://unity-builder/./node_modules/aws-sdk/clients/docdb.js","../webpack://unity-builder/./node_modules/aws-sdk/clients/dynamodb.js","../webpack://unity-builder/./node_modules/aws-sdk/clients/dynamodbstreams.js","../webpack://unity-builder/./node_modules/aws-sdk/clients/ebs.js","../webpack://unity-builder/./node_modules/aws-sdk/clients/ec2.js","../webpack://unity-builder/./node_modules/aws-sdk/clients/ec2instanceconnect.js","../webpack://unity-builder/./node_modules/aws-sdk/clients/ecr.js","../webpack://unity-builder/./node_modules/aws-sdk/clients/ecrpublic.js","../webpack://unity-builder/./node_modules/aws-sdk/clients/ecs.js","../webpack://unity-builder/./node_modules/aws-sdk/clients/efs.js","../webpack://unity-builder/./node_modules/aws-sdk/clients/eks.js","../webpack://unity-builder/./node_modules/aws-sdk/clients/elasticache.js","../webpack://unity-builder/./node_modules/aws-sdk/clients/elasticbeanstalk.js","../webpack://unity-builder/./node_modules/aws-sdk/clients/elasticinference.js","../webpack://unity-builder/./node_modules/aws-sdk/clients/elastictranscoder.js","../webpack://unity-builder/./node_modules/aws-sdk/clients/elb.js","../webpack://unity-builder/./node_modules/aws-sdk/clients/elbv2.js","../webpack://unity-builder/./node_modules/aws-sdk/clients/emr.js","../webpack://unity-builder/./node_modules/aws-sdk/clients/emrcontainers.js","../webpack://unity-builder/./node_modules/aws-sdk/clients/es.js","../webpack://unity-builder/./node_modules/aws-sdk/clients/eventbridge.js","../webpack://unity-builder/./node_modules/aws-sdk/clients/firehose.js","../webpack://unity-builder/./node_modules/aws-sdk/clients/fis.js","../webpack://unity-builder/./node_modules/aws-sdk/clients/fms.js","../webpack://unity-builder/./node_modules/aws-sdk/clients/forecastqueryservice.js","../webpack://unity-builder/./node_modules/aws-sdk/clients/forecastservice.js","../webpack://unity-builder/./node_modules/aws-sdk/clients/frauddetector.js","../webpack://unity-builder/./node_modules/aws-sdk/clients/fsx.js","../webpack://unity-builder/./node_modules/aws-sdk/clients/gamelift.js","../webpack://unity-builder/./node_modules/aws-sdk/clients/glacier.js","../webpack://unity-builder/./node_modules/aws-sdk/clients/globalaccelerator.js","../webpack://unity-builder/./node_modules/aws-sdk/clients/glue.js","../webpack://unity-builder/./node_modules/aws-sdk/clients/greengrass.js","../webpack://unity-builder/./node_modules/aws-sdk/clients/greengrassv2.js","../webpack://unity-builder/./node_modules/aws-sdk/clients/groundstation.js","../webpack://unity-builder/./node_modules/aws-sdk/clients/guardduty.js","../webpack://unity-builder/./node_modules/aws-sdk/clients/health.js","../webpack://unity-builder/./node_modules/aws-sdk/clients/healthlake.js","../webpack://unity-builder/./node_modules/aws-sdk/clients/honeycode.js","../webpack://unity-builder/./node_modules/aws-sdk/clients/iam.js","../webpack://unity-builder/./node_modules/aws-sdk/clients/identitystore.js","../webpack://unity-builder/./node_modules/aws-sdk/clients/imagebuilder.js","../webpack://unity-builder/./node_modules/aws-sdk/clients/importexport.js","../webpack://unity-builder/./node_modules/aws-sdk/clients/inspector.js","../webpack://unity-builder/./node_modules/aws-sdk/clients/iot.js","../webpack://unity-builder/./node_modules/aws-sdk/clients/iot1clickdevicesservice.js","../webpack://unity-builder/./node_modules/aws-sdk/clients/iot1clickprojects.js","../webpack://unity-builder/./node_modules/aws-sdk/clients/iotanalytics.js","../webpack://unity-builder/./node_modules/aws-sdk/clients/iotdata.js","../webpack://unity-builder/./node_modules/aws-sdk/clients/iotdeviceadvisor.js","../webpack://unity-builder/./node_modules/aws-sdk/clients/iotevents.js","../webpack://unity-builder/./node_modules/aws-sdk/clients/ioteventsdata.js","../webpack://unity-builder/./node_modules/aws-sdk/clients/iotfleethub.js","../webpack://unity-builder/./node_modules/aws-sdk/clients/iotjobsdataplane.js","../webpack://unity-builder/./node_modules/aws-sdk/clients/iotsecuretunneling.js","../webpack://unity-builder/./node_modules/aws-sdk/clients/iotsitewise.js","../webpack://unity-builder/./node_modules/aws-sdk/clients/iotthingsgraph.js","../webpack://unity-builder/./node_modules/aws-sdk/clients/iotwireless.js","../webpack://unity-builder/./node_modules/aws-sdk/clients/ivs.js","../webpack://unity-builder/./node_modules/aws-sdk/clients/kafka.js","../webpack://unity-builder/./node_modules/aws-sdk/clients/kendra.js","../webpack://unity-builder/./node_modules/aws-sdk/clients/kinesis.js","../webpack://unity-builder/./node_modules/aws-sdk/clients/kinesisanalytics.js","../webpack://unity-builder/./node_modules/aws-sdk/clients/kinesisanalyticsv2.js","../webpack://unity-builder/./node_modules/aws-sdk/clients/kinesisvideo.js","../webpack://unity-builder/./node_modules/aws-sdk/clients/kinesisvideoarchivedmedia.js","../webpack://unity-builder/./node_modules/aws-sdk/clients/kinesisvideomedia.js","../webpack://unity-builder/./node_modules/aws-sdk/clients/kinesisvideosignalingchannels.js","../webpack://unity-builder/./node_modules/aws-sdk/clients/kms.js","../webpack://unity-builder/./node_modules/aws-sdk/clients/lakeformation.js","../webpack://unity-builder/./node_modules/aws-sdk/clients/lambda.js","../webpack://unity-builder/./node_modules/aws-sdk/clients/lexmodelbuildingservice.js","../webpack://unity-builder/./node_modules/aws-sdk/clients/lexmodelsv2.js","../webpack://unity-builder/./node_modules/aws-sdk/clients/lexruntime.js","../webpack://unity-builder/./node_modules/aws-sdk/clients/lexruntimev2.js","../webpack://unity-builder/./node_modules/aws-sdk/clients/licensemanager.js","../webpack://unity-builder/./node_modules/aws-sdk/clients/lightsail.js","../webpack://unity-builder/./node_modules/aws-sdk/clients/location.js","../webpack://unity-builder/./node_modules/aws-sdk/clients/lookoutequipment.js","../webpack://unity-builder/./node_modules/aws-sdk/clients/lookoutmetrics.js","../webpack://unity-builder/./node_modules/aws-sdk/clients/lookoutvision.js","../webpack://unity-builder/./node_modules/aws-sdk/clients/machinelearning.js","../webpack://unity-builder/./node_modules/aws-sdk/clients/macie.js","../webpack://unity-builder/./node_modules/aws-sdk/clients/macie2.js","../webpack://unity-builder/./node_modules/aws-sdk/clients/managedblockchain.js","../webpack://unity-builder/./node_modules/aws-sdk/clients/marketplacecatalog.js","../webpack://unity-builder/./node_modules/aws-sdk/clients/marketplacecommerceanalytics.js","../webpack://unity-builder/./node_modules/aws-sdk/clients/marketplaceentitlementservice.js","../webpack://unity-builder/./node_modules/aws-sdk/clients/marketplacemetering.js","../webpack://unity-builder/./node_modules/aws-sdk/clients/mediaconnect.js","../webpack://unity-builder/./node_modules/aws-sdk/clients/mediaconvert.js","../webpack://unity-builder/./node_modules/aws-sdk/clients/medialive.js","../webpack://unity-builder/./node_modules/aws-sdk/clients/mediapackage.js","../webpack://unity-builder/./node_modules/aws-sdk/clients/mediapackagevod.js","../webpack://unity-builder/./node_modules/aws-sdk/clients/mediastore.js","../webpack://unity-builder/./node_modules/aws-sdk/clients/mediastoredata.js","../webpack://unity-builder/./node_modules/aws-sdk/clients/mediatailor.js","../webpack://unity-builder/./node_modules/aws-sdk/clients/mgn.js","../webpack://unity-builder/./node_modules/aws-sdk/clients/migrationhub.js","../webpack://unity-builder/./node_modules/aws-sdk/clients/migrationhubconfig.js","../webpack://unity-builder/./node_modules/aws-sdk/clients/mobile.js","../webpack://unity-builder/./node_modules/aws-sdk/clients/mobileanalytics.js","../webpack://unity-builder/./node_modules/aws-sdk/clients/mq.js","../webpack://unity-builder/./node_modules/aws-sdk/clients/mturk.js","../webpack://unity-builder/./node_modules/aws-sdk/clients/mwaa.js","../webpack://unity-builder/./node_modules/aws-sdk/clients/neptune.js","../webpack://unity-builder/./node_modules/aws-sdk/clients/networkfirewall.js","../webpack://unity-builder/./node_modules/aws-sdk/clients/networkmanager.js","../webpack://unity-builder/./node_modules/aws-sdk/clients/opsworks.js","../webpack://unity-builder/./node_modules/aws-sdk/clients/opsworkscm.js","../webpack://unity-builder/./node_modules/aws-sdk/clients/organizations.js","../webpack://unity-builder/./node_modules/aws-sdk/clients/outposts.js","../webpack://unity-builder/./node_modules/aws-sdk/clients/personalize.js","../webpack://unity-builder/./node_modules/aws-sdk/clients/personalizeevents.js","../webpack://unity-builder/./node_modules/aws-sdk/clients/personalizeruntime.js","../webpack://unity-builder/./node_modules/aws-sdk/clients/pi.js","../webpack://unity-builder/./node_modules/aws-sdk/clients/pinpoint.js","../webpack://unity-builder/./node_modules/aws-sdk/clients/pinpointemail.js","../webpack://unity-builder/./node_modules/aws-sdk/clients/pinpointsmsvoice.js","../webpack://unity-builder/./node_modules/aws-sdk/clients/polly.js","../webpack://unity-builder/./node_modules/aws-sdk/clients/pricing.js","../webpack://unity-builder/./node_modules/aws-sdk/clients/qldb.js","../webpack://unity-builder/./node_modules/aws-sdk/clients/qldbsession.js","../webpack://unity-builder/./node_modules/aws-sdk/clients/quicksight.js","../webpack://unity-builder/./node_modules/aws-sdk/clients/ram.js","../webpack://unity-builder/./node_modules/aws-sdk/clients/rds.js","../webpack://unity-builder/./node_modules/aws-sdk/clients/rdsdataservice.js","../webpack://unity-builder/./node_modules/aws-sdk/clients/redshift.js","../webpack://unity-builder/./node_modules/aws-sdk/clients/redshiftdata.js","../webpack://unity-builder/./node_modules/aws-sdk/clients/rekognition.js","../webpack://unity-builder/./node_modules/aws-sdk/clients/resourcegroups.js","../webpack://unity-builder/./node_modules/aws-sdk/clients/resourcegroupstaggingapi.js","../webpack://unity-builder/./node_modules/aws-sdk/clients/robomaker.js","../webpack://unity-builder/./node_modules/aws-sdk/clients/route53.js","../webpack://unity-builder/./node_modules/aws-sdk/clients/route53domains.js","../webpack://unity-builder/./node_modules/aws-sdk/clients/route53resolver.js","../webpack://unity-builder/./node_modules/aws-sdk/clients/s3.js","../webpack://unity-builder/./node_modules/aws-sdk/clients/s3control.js","../webpack://unity-builder/./node_modules/aws-sdk/clients/s3outposts.js","../webpack://unity-builder/./node_modules/aws-sdk/clients/sagemaker.js","../webpack://unity-builder/./node_modules/aws-sdk/clients/sagemakeredge.js","../webpack://unity-builder/./node_modules/aws-sdk/clients/sagemakerfeaturestoreruntime.js","../webpack://unity-builder/./node_modules/aws-sdk/clients/sagemakerruntime.js","../webpack://unity-builder/./node_modules/aws-sdk/clients/savingsplans.js","../webpack://unity-builder/./node_modules/aws-sdk/clients/schemas.js","../webpack://unity-builder/./node_modules/aws-sdk/clients/secretsmanager.js","../webpack://unity-builder/./node_modules/aws-sdk/clients/securityhub.js","../webpack://unity-builder/./node_modules/aws-sdk/clients/serverlessapplicationrepository.js","../webpack://unity-builder/./node_modules/aws-sdk/clients/servicecatalog.js","../webpack://unity-builder/./node_modules/aws-sdk/clients/servicecatalogappregistry.js","../webpack://unity-builder/./node_modules/aws-sdk/clients/servicediscovery.js","../webpack://unity-builder/./node_modules/aws-sdk/clients/servicequotas.js","../webpack://unity-builder/./node_modules/aws-sdk/clients/ses.js","../webpack://unity-builder/./node_modules/aws-sdk/clients/sesv2.js","../webpack://unity-builder/./node_modules/aws-sdk/clients/shield.js","../webpack://unity-builder/./node_modules/aws-sdk/clients/signer.js","../webpack://unity-builder/./node_modules/aws-sdk/clients/simpledb.js","../webpack://unity-builder/./node_modules/aws-sdk/clients/sms.js","../webpack://unity-builder/./node_modules/aws-sdk/clients/snowball.js","../webpack://unity-builder/./node_modules/aws-sdk/clients/sns.js","../webpack://unity-builder/./node_modules/aws-sdk/clients/sqs.js","../webpack://unity-builder/./node_modules/aws-sdk/clients/ssm.js","../webpack://unity-builder/./node_modules/aws-sdk/clients/sso.js","../webpack://unity-builder/./node_modules/aws-sdk/clients/ssoadmin.js","../webpack://unity-builder/./node_modules/aws-sdk/clients/ssooidc.js","../webpack://unity-builder/./node_modules/aws-sdk/clients/stepfunctions.js","../webpack://unity-builder/./node_modules/aws-sdk/clients/storagegateway.js","../webpack://unity-builder/./node_modules/aws-sdk/clients/sts.js","../webpack://unity-builder/./node_modules/aws-sdk/clients/support.js","../webpack://unity-builder/./node_modules/aws-sdk/clients/swf.js","../webpack://unity-builder/./node_modules/aws-sdk/clients/synthetics.js","../webpack://unity-builder/./node_modules/aws-sdk/clients/textract.js","../webpack://unity-builder/./node_modules/aws-sdk/clients/timestreamquery.js","../webpack://unity-builder/./node_modules/aws-sdk/clients/timestreamwrite.js","../webpack://unity-builder/./node_modules/aws-sdk/clients/transcribeservice.js","../webpack://unity-builder/./node_modules/aws-sdk/clients/transfer.js","../webpack://unity-builder/./node_modules/aws-sdk/clients/translate.js","../webpack://unity-builder/./node_modules/aws-sdk/clients/waf.js","../webpack://unity-builder/./node_modules/aws-sdk/clients/wafregional.js","../webpack://unity-builder/./node_modules/aws-sdk/clients/wafv2.js","../webpack://unity-builder/./node_modules/aws-sdk/clients/wellarchitected.js","../webpack://unity-builder/./node_modules/aws-sdk/clients/workdocs.js","../webpack://unity-builder/./node_modules/aws-sdk/clients/worklink.js","../webpack://unity-builder/./node_modules/aws-sdk/clients/workmail.js","../webpack://unity-builder/./node_modules/aws-sdk/clients/workmailmessageflow.js","../webpack://unity-builder/./node_modules/aws-sdk/clients/workspaces.js","../webpack://unity-builder/./node_modules/aws-sdk/clients/xray.js","../webpack://unity-builder/./node_modules/aws-sdk/lib/api_loader.js","../webpack://unity-builder/./node_modules/aws-sdk/lib/aws.js","../webpack://unity-builder/./node_modules/aws-sdk/lib/cloudfront/signer.js","../webpack://unity-builder/./node_modules/aws-sdk/lib/config.js","../webpack://unity-builder/./node_modules/aws-sdk/lib/config_regional_endpoint.js","../webpack://unity-builder/./node_modules/aws-sdk/lib/core.js","../webpack://unity-builder/./node_modules/aws-sdk/lib/credentials.js","../webpack://unity-builder/./node_modules/aws-sdk/lib/credentials/chainable_temporary_credentials.js","../webpack://unity-builder/./node_modules/aws-sdk/lib/credentials/cognito_identity_credentials.js","../webpack://unity-builder/./node_modules/aws-sdk/lib/credentials/credential_provider_chain.js","../webpack://unity-builder/./node_modules/aws-sdk/lib/credentials/ec2_metadata_credentials.js","../webpack://unity-builder/./node_modules/aws-sdk/lib/credentials/ecs_credentials.js","../webpack://unity-builder/./node_modules/aws-sdk/lib/credentials/environment_credentials.js","../webpack://unity-builder/./node_modules/aws-sdk/lib/credentials/file_system_credentials.js","../webpack://unity-builder/./node_modules/aws-sdk/lib/credentials/process_credentials.js","../webpack://unity-builder/./node_modules/aws-sdk/lib/credentials/remote_credentials.js","../webpack://unity-builder/./node_modules/aws-sdk/lib/credentials/saml_credentials.js","../webpack://unity-builder/./node_modules/aws-sdk/lib/credentials/shared_ini_file_credentials.js","../webpack://unity-builder/./node_modules/aws-sdk/lib/credentials/temporary_credentials.js","../webpack://unity-builder/./node_modules/aws-sdk/lib/credentials/token_file_web_identity_credentials.js","../webpack://unity-builder/./node_modules/aws-sdk/lib/credentials/web_identity_credentials.js","../webpack://unity-builder/./node_modules/aws-sdk/lib/discover_endpoint.js","../webpack://unity-builder/./node_modules/aws-sdk/lib/dynamodb/converter.js","../webpack://unity-builder/./node_modules/aws-sdk/lib/dynamodb/document_client.js","../webpack://unity-builder/./node_modules/aws-sdk/lib/dynamodb/numberValue.js","../webpack://unity-builder/./node_modules/aws-sdk/lib/dynamodb/set.js","../webpack://unity-builder/./node_modules/aws-sdk/lib/dynamodb/translator.js","../webpack://unity-builder/./node_modules/aws-sdk/lib/dynamodb/types.js","../webpack://unity-builder/./node_modules/aws-sdk/lib/event-stream/buffered-create-event-stream.js","../webpack://unity-builder/./node_modules/aws-sdk/lib/event-stream/event-message-chunker-stream.js","../webpack://unity-builder/./node_modules/aws-sdk/lib/event-stream/event-message-chunker.js","../webpack://unity-builder/./node_modules/aws-sdk/lib/event-stream/event-message-unmarshaller-stream.js","../webpack://unity-builder/./node_modules/aws-sdk/lib/event-stream/int64.js","../webpack://unity-builder/./node_modules/aws-sdk/lib/event-stream/parse-event.js","../webpack://unity-builder/./node_modules/aws-sdk/lib/event-stream/parse-message.js","../webpack://unity-builder/./node_modules/aws-sdk/lib/event-stream/split-message.js","../webpack://unity-builder/./node_modules/aws-sdk/lib/event-stream/streaming-create-event-stream.js","../webpack://unity-builder/./node_modules/aws-sdk/lib/event_listeners.js","../webpack://unity-builder/./node_modules/aws-sdk/lib/http.js","../webpack://unity-builder/./node_modules/aws-sdk/lib/http/node.js","../webpack://unity-builder/./node_modules/aws-sdk/lib/json/builder.js","../webpack://unity-builder/./node_modules/aws-sdk/lib/json/parser.js","../webpack://unity-builder/./node_modules/aws-sdk/lib/metadata_service.js","../webpack://unity-builder/./node_modules/aws-sdk/lib/model/api.js","../webpack://unity-builder/./node_modules/aws-sdk/lib/model/collection.js","../webpack://unity-builder/./node_modules/aws-sdk/lib/model/operation.js","../webpack://unity-builder/./node_modules/aws-sdk/lib/model/paginator.js","../webpack://unity-builder/./node_modules/aws-sdk/lib/model/resource_waiter.js","../webpack://unity-builder/./node_modules/aws-sdk/lib/model/shape.js","../webpack://unity-builder/./node_modules/aws-sdk/lib/node_loader.js","../webpack://unity-builder/./node_modules/aws-sdk/lib/param_validator.js","../webpack://unity-builder/./node_modules/aws-sdk/lib/polly/presigner.js","../webpack://unity-builder/./node_modules/aws-sdk/lib/protocol/helpers.js","../webpack://unity-builder/./node_modules/aws-sdk/lib/protocol/json.js","../webpack://unity-builder/./node_modules/aws-sdk/lib/protocol/query.js","../webpack://unity-builder/./node_modules/aws-sdk/lib/protocol/rest.js","../webpack://unity-builder/./node_modules/aws-sdk/lib/protocol/rest_json.js","../webpack://unity-builder/./node_modules/aws-sdk/lib/protocol/rest_xml.js","../webpack://unity-builder/./node_modules/aws-sdk/lib/publisher/configuration.js","../webpack://unity-builder/./node_modules/aws-sdk/lib/publisher/index.js","../webpack://unity-builder/./node_modules/aws-sdk/lib/query/query_param_serializer.js","../webpack://unity-builder/./node_modules/aws-sdk/lib/rds/signer.js","../webpack://unity-builder/./node_modules/aws-sdk/lib/realclock/nodeClock.js","../webpack://unity-builder/./node_modules/aws-sdk/lib/region_config.js","../webpack://unity-builder/./node_modules/aws-sdk/lib/request.js","../webpack://unity-builder/./node_modules/aws-sdk/lib/resource_waiter.js","../webpack://unity-builder/./node_modules/aws-sdk/lib/response.js","../webpack://unity-builder/./node_modules/aws-sdk/lib/s3/managed_upload.js","../webpack://unity-builder/./node_modules/aws-sdk/lib/sequential_executor.js","../webpack://unity-builder/./node_modules/aws-sdk/lib/service.js","../webpack://unity-builder/./node_modules/aws-sdk/lib/services/apigateway.js","../webpack://unity-builder/./node_modules/aws-sdk/lib/services/cloudfront.js","../webpack://unity-builder/./node_modules/aws-sdk/lib/services/cloudsearchdomain.js","../webpack://unity-builder/./node_modules/aws-sdk/lib/services/docdb.js","../webpack://unity-builder/./node_modules/aws-sdk/lib/services/dynamodb.js","../webpack://unity-builder/./node_modules/aws-sdk/lib/services/ec2.js","../webpack://unity-builder/./node_modules/aws-sdk/lib/services/glacier.js","../webpack://unity-builder/./node_modules/aws-sdk/lib/services/iotdata.js","../webpack://unity-builder/./node_modules/aws-sdk/lib/services/lambda.js","../webpack://unity-builder/./node_modules/aws-sdk/lib/services/lexmodelsv2.js","../webpack://unity-builder/./node_modules/aws-sdk/lib/services/lookoutmetrics.js","../webpack://unity-builder/./node_modules/aws-sdk/lib/services/machinelearning.js","../webpack://unity-builder/./node_modules/aws-sdk/lib/services/neptune.js","../webpack://unity-builder/./node_modules/aws-sdk/lib/services/polly.js","../webpack://unity-builder/./node_modules/aws-sdk/lib/services/rds.js","../webpack://unity-builder/./node_modules/aws-sdk/lib/services/rdsdataservice.js","../webpack://unity-builder/./node_modules/aws-sdk/lib/services/rdsutil.js","../webpack://unity-builder/./node_modules/aws-sdk/lib/services/route53.js","../webpack://unity-builder/./node_modules/aws-sdk/lib/services/s3.js","../webpack://unity-builder/./node_modules/aws-sdk/lib/services/s3control.js","../webpack://unity-builder/./node_modules/aws-sdk/lib/services/s3util.js","../webpack://unity-builder/./node_modules/aws-sdk/lib/services/sqs.js","../webpack://unity-builder/./node_modules/aws-sdk/lib/services/sts.js","../webpack://unity-builder/./node_modules/aws-sdk/lib/services/swf.js","../webpack://unity-builder/./node_modules/aws-sdk/lib/shared-ini/index.js","../webpack://unity-builder/./node_modules/aws-sdk/lib/shared-ini/ini-loader.js","../webpack://unity-builder/./node_modules/aws-sdk/lib/signers/presign.js","../webpack://unity-builder/./node_modules/aws-sdk/lib/signers/request_signer.js","../webpack://unity-builder/./node_modules/aws-sdk/lib/signers/s3.js","../webpack://unity-builder/./node_modules/aws-sdk/lib/signers/v2.js","../webpack://unity-builder/./node_modules/aws-sdk/lib/signers/v3.js","../webpack://unity-builder/./node_modules/aws-sdk/lib/signers/v3https.js","../webpack://unity-builder/./node_modules/aws-sdk/lib/signers/v4.js","../webpack://unity-builder/./node_modules/aws-sdk/lib/signers/v4_credentials.js","../webpack://unity-builder/./node_modules/aws-sdk/lib/state_machine.js","../webpack://unity-builder/./node_modules/aws-sdk/lib/util.js","../webpack://unity-builder/./node_modules/aws-sdk/lib/xml/builder.js","../webpack://unity-builder/./node_modules/aws-sdk/lib/xml/escape-attribute.js","../webpack://unity-builder/./node_modules/aws-sdk/lib/xml/escape-element.js","../webpack://unity-builder/./node_modules/aws-sdk/lib/xml/node_parser.js","../webpack://unity-builder/./node_modules/aws-sdk/lib/xml/xml-node.js","../webpack://unity-builder/./node_modules/aws-sdk/lib/xml/xml-text.js","../webpack://unity-builder/./node_modules/aws-sdk/vendor/endpoint-cache/index.js","../webpack://unity-builder/./node_modules/aws-sdk/vendor/endpoint-cache/utils/LRU.js","../webpack://unity-builder/./node_modules/aws-sign2/index.js","../webpack://unity-builder/./node_modules/aws4/aws4.js","../webpack://unity-builder/./node_modules/aws4/lru.js","../webpack://unity-builder/./node_modules/balanced-match/index.js","../webpack://unity-builder/./node_modules/base-64/base64.js","../webpack://unity-builder/./node_modules/base64url/dist/base64url.js","../webpack://unity-builder/./node_modules/base64url/dist/pad-string.js","../webpack://unity-builder/./node_modules/base64url/index.js","../webpack://unity-builder/./node_modules/bcrypt-pbkdf/index.js","../webpack://unity-builder/./node_modules/brace-expansion/index.js","../webpack://unity-builder/./node_modules/cacheable-request/node_modules/get-stream/buffer-stream.js","../webpack://unity-builder/./node_modules/cacheable-request/node_modules/get-stream/index.js","../webpack://unity-builder/./node_modules/cacheable-request/node_modules/lowercase-keys/index.js","../webpack://unity-builder/./node_modules/cacheable-request/src/index.js","../webpack://unity-builder/./node_modules/call-bind/callBound.js","../webpack://unity-builder/./node_modules/call-bind/index.js","../webpack://unity-builder/./node_modules/caseless/index.js","../webpack://unity-builder/./node_modules/clean-stack/index.js","../webpack://unity-builder/./node_modules/clone-response/src/index.js","../webpack://unity-builder/./node_modules/combined-stream/lib/combined_stream.js","../webpack://unity-builder/./node_modules/concat-map/index.js","../webpack://unity-builder/./node_modules/core-util-is/lib/util.js","../webpack://unity-builder/./node_modules/decompress-response/index.js","../webpack://unity-builder/./node_modules/deepmerge/dist/cjs.js","../webpack://unity-builder/./node_modules/defer-to-connect/dist/index.js","../webpack://unity-builder/./node_modules/delayed-stream/lib/delayed_stream.js","../webpack://unity-builder/./node_modules/depd/index.js","../webpack://unity-builder/./node_modules/duplexer3/index.js","../webpack://unity-builder/./node_modules/ecc-jsbn/index.js","../webpack://unity-builder/./node_modules/ecc-jsbn/lib/ec.js","../webpack://unity-builder/./node_modules/ecc-jsbn/lib/sec.js","../webpack://unity-builder/./node_modules/end-of-stream/index.js","../webpack://unity-builder/./node_modules/extend/index.js","../webpack://unity-builder/./node_modules/extsprintf/lib/extsprintf.js","../webpack://unity-builder/./node_modules/fast-deep-equal/index.js","../webpack://unity-builder/./node_modules/fast-json-stable-stringify/index.js","../webpack://unity-builder/./node_modules/forever-agent/index.js","../webpack://unity-builder/./node_modules/fs.realpath/index.js","../webpack://unity-builder/./node_modules/fs.realpath/old.js","../webpack://unity-builder/./node_modules/function-bind/implementation.js","../webpack://unity-builder/./node_modules/function-bind/index.js","../webpack://unity-builder/./node_modules/get-intrinsic/index.js","../webpack://unity-builder/./node_modules/get-stream/buffer-stream.js","../webpack://unity-builder/./node_modules/get-stream/index.js","../webpack://unity-builder/./node_modules/glob/common.js","../webpack://unity-builder/./node_modules/glob/glob.js","../webpack://unity-builder/./node_modules/glob/sync.js","../webpack://unity-builder/./node_modules/got/node_modules/p-cancelable/index.js","../webpack://unity-builder/./node_modules/got/source/as-promise.js","../webpack://unity-builder/./node_modules/got/source/as-stream.js","../webpack://unity-builder/./node_modules/got/source/create.js","../webpack://unity-builder/./node_modules/got/source/errors.js","../webpack://unity-builder/./node_modules/got/source/get-response.js","../webpack://unity-builder/./node_modules/got/source/index.js","../webpack://unity-builder/./node_modules/got/source/known-hook-events.js","../webpack://unity-builder/./node_modules/got/source/merge.js","../webpack://unity-builder/./node_modules/got/source/normalize-arguments.js","../webpack://unity-builder/./node_modules/got/source/progress.js","../webpack://unity-builder/./node_modules/got/source/request-as-event-emitter.js","../webpack://unity-builder/./node_modules/got/source/utils/deep-freeze.js","../webpack://unity-builder/./node_modules/got/source/utils/get-body-size.js","../webpack://unity-builder/./node_modules/got/source/utils/is-form-data.js","../webpack://unity-builder/./node_modules/got/source/utils/timed-out.js","../webpack://unity-builder/./node_modules/got/source/utils/url-to-options.js","../webpack://unity-builder/./node_modules/har-schema/lib/index.js","../webpack://unity-builder/./node_modules/har-validator/lib/error.js","../webpack://unity-builder/./node_modules/har-validator/lib/promise.js","../webpack://unity-builder/./node_modules/has-symbols/index.js","../webpack://unity-builder/./node_modules/has-symbols/shams.js","../webpack://unity-builder/./node_modules/has/src/index.js","../webpack://unity-builder/./node_modules/http-cache-semantics/index.js","../webpack://unity-builder/./node_modules/http-signature/lib/index.js","../webpack://unity-builder/./node_modules/http-signature/lib/parser.js","../webpack://unity-builder/./node_modules/http-signature/lib/signer.js","../webpack://unity-builder/./node_modules/http-signature/lib/utils.js","../webpack://unity-builder/./node_modules/http-signature/lib/verify.js","../webpack://unity-builder/./node_modules/indent-string/index.js","../webpack://unity-builder/./node_modules/inflight/inflight.js","../webpack://unity-builder/./node_modules/inherits/inherits.js","../webpack://unity-builder/./node_modules/inherits/inherits_browser.js","../webpack://unity-builder/./node_modules/is-typedarray/index.js","../webpack://unity-builder/./node_modules/isomorphic-ws/node.js","../webpack://unity-builder/./node_modules/isstream/isstream.js","../webpack://unity-builder/./node_modules/jmespath/jmespath.js","../webpack://unity-builder/./node_modules/jose/lib/errors.js","../webpack://unity-builder/./node_modules/jose/lib/help/asn1/algorithm_identifier.js","../webpack://unity-builder/./node_modules/jose/lib/help/asn1/ec_private_key.js","../webpack://unity-builder/./node_modules/jose/lib/help/asn1/index.js","../webpack://unity-builder/./node_modules/jose/lib/help/asn1/oids.js","../webpack://unity-builder/./node_modules/jose/lib/help/asn1/one_asymmetric_key.js","../webpack://unity-builder/./node_modules/jose/lib/help/asn1/private_key.js","../webpack://unity-builder/./node_modules/jose/lib/help/asn1/private_key_info.js","../webpack://unity-builder/./node_modules/jose/lib/help/asn1/public_key_info.js","../webpack://unity-builder/./node_modules/jose/lib/help/asn1/rsa_private_key.js","../webpack://unity-builder/./node_modules/jose/lib/help/asn1/rsa_public_key.js","../webpack://unity-builder/./node_modules/jose/lib/help/base64url.js","../webpack://unity-builder/./node_modules/jose/lib/help/consts.js","../webpack://unity-builder/./node_modules/jose/lib/help/deep_clone.js","../webpack://unity-builder/./node_modules/jose/lib/help/ecdsa_signatures.js","../webpack://unity-builder/./node_modules/jose/lib/help/epoch.js","../webpack://unity-builder/./node_modules/jose/lib/help/generate_iv.js","../webpack://unity-builder/./node_modules/jose/lib/help/get_key.js","../webpack://unity-builder/./node_modules/jose/lib/help/is_disjoint.js","../webpack://unity-builder/./node_modules/jose/lib/help/is_object.js","../webpack://unity-builder/./node_modules/jose/lib/help/key_object.js","../webpack://unity-builder/./node_modules/jose/lib/help/key_utils.js","../webpack://unity-builder/./node_modules/jose/lib/help/node_alg.js","../webpack://unity-builder/./node_modules/jose/lib/help/rsa_primes.js","../webpack://unity-builder/./node_modules/jose/lib/help/runtime_support.js","../webpack://unity-builder/./node_modules/jose/lib/help/secs.js","../webpack://unity-builder/./node_modules/jose/lib/help/timing_safe_equal.js","../webpack://unity-builder/./node_modules/jose/lib/help/uint64be.js","../webpack://unity-builder/./node_modules/jose/lib/help/validate_crit.js","../webpack://unity-builder/./node_modules/jose/lib/index.js","../webpack://unity-builder/./node_modules/jose/lib/jwa/aes_cbc_hmac_sha2.js","../webpack://unity-builder/./node_modules/jose/lib/jwa/aes_gcm.js","../webpack://unity-builder/./node_modules/jose/lib/jwa/aes_gcm_kw.js","../webpack://unity-builder/./node_modules/jose/lib/jwa/aes_kw.js","../webpack://unity-builder/./node_modules/jose/lib/jwa/ecdh/compute_secret.js","../webpack://unity-builder/./node_modules/jose/lib/jwa/ecdh/derive.js","../webpack://unity-builder/./node_modules/jose/lib/jwa/ecdh/dir.js","../webpack://unity-builder/./node_modules/jose/lib/jwa/ecdh/kw.js","../webpack://unity-builder/./node_modules/jose/lib/jwa/ecdsa.js","../webpack://unity-builder/./node_modules/jose/lib/jwa/eddsa.js","../webpack://unity-builder/./node_modules/jose/lib/jwa/hmac.js","../webpack://unity-builder/./node_modules/jose/lib/jwa/index.js","../webpack://unity-builder/./node_modules/jose/lib/jwa/none.js","../webpack://unity-builder/./node_modules/jose/lib/jwa/pbes2.js","../webpack://unity-builder/./node_modules/jose/lib/jwa/rsaes.js","../webpack://unity-builder/./node_modules/jose/lib/jwa/rsassa.js","../webpack://unity-builder/./node_modules/jose/lib/jwa/rsassa_pss.js","../webpack://unity-builder/./node_modules/jose/lib/jwe/decrypt.js","../webpack://unity-builder/./node_modules/jose/lib/jwe/encrypt.js","../webpack://unity-builder/./node_modules/jose/lib/jwe/generate_cek.js","../webpack://unity-builder/./node_modules/jose/lib/jwe/index.js","../webpack://unity-builder/./node_modules/jose/lib/jwe/serializers.js","../webpack://unity-builder/./node_modules/jose/lib/jwe/validate_headers.js","../webpack://unity-builder/./node_modules/jose/lib/jwk/generate.js","../webpack://unity-builder/./node_modules/jose/lib/jwk/import.js","../webpack://unity-builder/./node_modules/jose/lib/jwk/index.js","../webpack://unity-builder/./node_modules/jose/lib/jwk/key/base.js","../webpack://unity-builder/./node_modules/jose/lib/jwk/key/ec.js","../webpack://unity-builder/./node_modules/jose/lib/jwk/key/embedded.jwk.js","../webpack://unity-builder/./node_modules/jose/lib/jwk/key/embedded.x5c.js","../webpack://unity-builder/./node_modules/jose/lib/jwk/key/none.js","../webpack://unity-builder/./node_modules/jose/lib/jwk/key/oct.js","../webpack://unity-builder/./node_modules/jose/lib/jwk/key/okp.js","../webpack://unity-builder/./node_modules/jose/lib/jwk/key/rsa.js","../webpack://unity-builder/./node_modules/jose/lib/jwk/key/secp256k1_crv.js","../webpack://unity-builder/./node_modules/jose/lib/jwk/thumbprint.js","../webpack://unity-builder/./node_modules/jose/lib/jwks/index.js","../webpack://unity-builder/./node_modules/jose/lib/jwks/keystore.js","../webpack://unity-builder/./node_modules/jose/lib/jws/index.js","../webpack://unity-builder/./node_modules/jose/lib/jws/serializers.js","../webpack://unity-builder/./node_modules/jose/lib/jws/sign.js","../webpack://unity-builder/./node_modules/jose/lib/jws/verify.js","../webpack://unity-builder/./node_modules/jose/lib/jwt/decode.js","../webpack://unity-builder/./node_modules/jose/lib/jwt/index.js","../webpack://unity-builder/./node_modules/jose/lib/jwt/profiles.js","../webpack://unity-builder/./node_modules/jose/lib/jwt/shared_validations.js","../webpack://unity-builder/./node_modules/jose/lib/jwt/sign.js","../webpack://unity-builder/./node_modules/jose/lib/jwt/verify.js","../webpack://unity-builder/./node_modules/jose/lib/registry/ec_curves.js","../webpack://unity-builder/./node_modules/jose/lib/registry/ecdh_derive_lengths.js","../webpack://unity-builder/./node_modules/jose/lib/registry/index.js","../webpack://unity-builder/./node_modules/jose/lib/registry/iv_lengths.js","../webpack://unity-builder/./node_modules/jose/lib/registry/jwa.js","../webpack://unity-builder/./node_modules/jose/lib/registry/jwk.js","../webpack://unity-builder/./node_modules/jose/lib/registry/key_lengths.js","../webpack://unity-builder/./node_modules/jose/lib/registry/okp_curves.js","../webpack://unity-builder/./node_modules/js-yaml/index.js","../webpack://unity-builder/./node_modules/js-yaml/lib/js-yaml.js","../webpack://unity-builder/./node_modules/js-yaml/lib/js-yaml/common.js","../webpack://unity-builder/./node_modules/js-yaml/lib/js-yaml/dumper.js","../webpack://unity-builder/./node_modules/js-yaml/lib/js-yaml/exception.js","../webpack://unity-builder/./node_modules/js-yaml/lib/js-yaml/loader.js","../webpack://unity-builder/./node_modules/js-yaml/lib/js-yaml/mark.js","../webpack://unity-builder/./node_modules/js-yaml/lib/js-yaml/schema.js","../webpack://unity-builder/./node_modules/js-yaml/lib/js-yaml/schema/core.js","../webpack://unity-builder/./node_modules/js-yaml/lib/js-yaml/schema/default_full.js","../webpack://unity-builder/./node_modules/js-yaml/lib/js-yaml/schema/default_safe.js","../webpack://unity-builder/./node_modules/js-yaml/lib/js-yaml/schema/failsafe.js","../webpack://unity-builder/./node_modules/js-yaml/lib/js-yaml/schema/json.js","../webpack://unity-builder/./node_modules/js-yaml/lib/js-yaml/type.js","../webpack://unity-builder/./node_modules/js-yaml/lib/js-yaml/type/binary.js","../webpack://unity-builder/./node_modules/js-yaml/lib/js-yaml/type/bool.js","../webpack://unity-builder/./node_modules/js-yaml/lib/js-yaml/type/float.js","../webpack://unity-builder/./node_modules/js-yaml/lib/js-yaml/type/int.js","../webpack://unity-builder/./node_modules/js-yaml/lib/js-yaml/type/js/function.js","../webpack://unity-builder/./node_modules/js-yaml/lib/js-yaml/type/js/regexp.js","../webpack://unity-builder/./node_modules/js-yaml/lib/js-yaml/type/js/undefined.js","../webpack://unity-builder/./node_modules/js-yaml/lib/js-yaml/type/map.js","../webpack://unity-builder/./node_modules/js-yaml/lib/js-yaml/type/merge.js","../webpack://unity-builder/./node_modules/js-yaml/lib/js-yaml/type/null.js","../webpack://unity-builder/./node_modules/js-yaml/lib/js-yaml/type/omap.js","../webpack://unity-builder/./node_modules/js-yaml/lib/js-yaml/type/pairs.js","../webpack://unity-builder/./node_modules/js-yaml/lib/js-yaml/type/seq.js","../webpack://unity-builder/./node_modules/js-yaml/lib/js-yaml/type/set.js","../webpack://unity-builder/./node_modules/js-yaml/lib/js-yaml/type/str.js","../webpack://unity-builder/./node_modules/js-yaml/lib/js-yaml/type/timestamp.js","../webpack://unity-builder/./node_modules/jsbn/index.js","../webpack://unity-builder/./node_modules/json-buffer/index.js","../webpack://unity-builder/./node_modules/json-schema-traverse/index.js","../webpack://unity-builder/./node_modules/json-schema/lib/validate.js","../webpack://unity-builder/./node_modules/json-stream/lib/json-stream.js","../webpack://unity-builder/./node_modules/json-stringify-safe/stringify.js","../webpack://unity-builder/./node_modules/jsonpath-plus/dist/index-umd.js","../webpack://unity-builder/./node_modules/jsprim/lib/jsprim.js","../webpack://unity-builder/./node_modules/keyv/src/index.js","../webpack://unity-builder/./node_modules/kubernetes-client/backends/request/auth-providers/cmd.js","../webpack://unity-builder/./node_modules/kubernetes-client/backends/request/auth-providers/openid.js","../webpack://unity-builder/./node_modules/kubernetes-client/backends/request/client.js","../webpack://unity-builder/./node_modules/kubernetes-client/backends/request/config.js","../webpack://unity-builder/./node_modules/kubernetes-client/backends/request/index.js","../webpack://unity-builder/./node_modules/kubernetes-client/lib/alias.js","../webpack://unity-builder/./node_modules/kubernetes-client/lib/config.js","../webpack://unity-builder/./node_modules/kubernetes-client/lib/index.js","../webpack://unity-builder/./node_modules/kubernetes-client/lib/swagger-client.js","../webpack://unity-builder/./node_modules/kubernetes-client/node_modules/ws/index.js","../webpack://unity-builder/./node_modules/kubernetes-client/node_modules/ws/lib/buffer-util.js","../webpack://unity-builder/./node_modules/kubernetes-client/node_modules/ws/lib/constants.js","../webpack://unity-builder/./node_modules/kubernetes-client/node_modules/ws/lib/event-target.js","../webpack://unity-builder/./node_modules/kubernetes-client/node_modules/ws/lib/extension.js","../webpack://unity-builder/./node_modules/kubernetes-client/node_modules/ws/lib/limiter.js","../webpack://unity-builder/./node_modules/kubernetes-client/node_modules/ws/lib/permessage-deflate.js","../webpack://unity-builder/./node_modules/kubernetes-client/node_modules/ws/lib/receiver.js","../webpack://unity-builder/./node_modules/kubernetes-client/node_modules/ws/lib/sender.js","../webpack://unity-builder/./node_modules/kubernetes-client/node_modules/ws/lib/stream.js","../webpack://unity-builder/./node_modules/kubernetes-client/node_modules/ws/lib/validation.js","../webpack://unity-builder/./node_modules/kubernetes-client/node_modules/ws/lib/websocket-server.js","../webpack://unity-builder/./node_modules/kubernetes-client/node_modules/ws/lib/websocket.js","../webpack://unity-builder/./node_modules/lowercase-keys/index.js","../webpack://unity-builder/./node_modules/lru-cache/index.js","../webpack://unity-builder/./node_modules/make-error/index.js","../webpack://unity-builder/./node_modules/mime-db/index.js","../webpack://unity-builder/./node_modules/mime-types/index.js","../webpack://unity-builder/./node_modules/mimic-response/index.js","../webpack://unity-builder/./node_modules/minimatch/minimatch.js","../webpack://unity-builder/./node_modules/normalize-url/index.js","../webpack://unity-builder/./node_modules/oauth-sign/index.js","../webpack://unity-builder/./node_modules/object-hash/index.js","../webpack://unity-builder/./node_modules/object-inspect/index.js","../webpack://unity-builder/./node_modules/object-inspect/util.inspect.js","../webpack://unity-builder/./node_modules/oidc-token-hash/lib/index.js","../webpack://unity-builder/./node_modules/oidc-token-hash/lib/shake256.js","../webpack://unity-builder/./node_modules/once/once.js","../webpack://unity-builder/./node_modules/openid-client/lib/client.js","../webpack://unity-builder/./node_modules/openid-client/lib/device_flow_handle.js","../webpack://unity-builder/./node_modules/openid-client/lib/errors.js","../webpack://unity-builder/./node_modules/openid-client/lib/helpers/assert.js","../webpack://unity-builder/./node_modules/openid-client/lib/helpers/client.js","../webpack://unity-builder/./node_modules/openid-client/lib/helpers/consts.js","../webpack://unity-builder/./node_modules/openid-client/lib/helpers/deep_clone.js","../webpack://unity-builder/./node_modules/openid-client/lib/helpers/defaults.js","../webpack://unity-builder/./node_modules/openid-client/lib/helpers/generators.js","../webpack://unity-builder/./node_modules/openid-client/lib/helpers/is_absolute_url.js","../webpack://unity-builder/./node_modules/openid-client/lib/helpers/is_plain_object.js","../webpack://unity-builder/./node_modules/openid-client/lib/helpers/merge.js","../webpack://unity-builder/./node_modules/openid-client/lib/helpers/pick.js","../webpack://unity-builder/./node_modules/openid-client/lib/helpers/process_response.js","../webpack://unity-builder/./node_modules/openid-client/lib/helpers/request.js","../webpack://unity-builder/./node_modules/openid-client/lib/helpers/unix_timestamp.js","../webpack://unity-builder/./node_modules/openid-client/lib/helpers/weak_cache.js","../webpack://unity-builder/./node_modules/openid-client/lib/helpers/webfinger_normalize.js","../webpack://unity-builder/./node_modules/openid-client/lib/index.js","../webpack://unity-builder/./node_modules/openid-client/lib/issuer.js","../webpack://unity-builder/./node_modules/openid-client/lib/issuer_registry.js","../webpack://unity-builder/./node_modules/openid-client/lib/passport_strategy.js","../webpack://unity-builder/./node_modules/openid-client/lib/token_set.js","../webpack://unity-builder/./node_modules/p-any/index.js","../webpack://unity-builder/./node_modules/p-cancelable/index.js","../webpack://unity-builder/./node_modules/p-some/index.js","../webpack://unity-builder/./node_modules/path-is-absolute/index.js","../webpack://unity-builder/./node_modules/performance-now/lib/performance-now.js","../webpack://unity-builder/./node_modules/prepend-http/index.js","../webpack://unity-builder/./node_modules/psl/index.js","../webpack://unity-builder/./node_modules/pump/index.js","../webpack://unity-builder/./node_modules/qs/lib/formats.js","../webpack://unity-builder/./node_modules/qs/lib/index.js","../webpack://unity-builder/./node_modules/qs/lib/parse.js","../webpack://unity-builder/./node_modules/qs/lib/stringify.js","../webpack://unity-builder/./node_modules/qs/lib/utils.js","../webpack://unity-builder/./node_modules/request/index.js","../webpack://unity-builder/./node_modules/request/lib/auth.js","../webpack://unity-builder/./node_modules/request/lib/cookies.js","../webpack://unity-builder/./node_modules/request/lib/getProxyFromURI.js","../webpack://unity-builder/./node_modules/request/lib/har.js","../webpack://unity-builder/./node_modules/request/lib/hawk.js","../webpack://unity-builder/./node_modules/request/lib/helpers.js","../webpack://unity-builder/./node_modules/request/lib/multipart.js","../webpack://unity-builder/./node_modules/request/lib/oauth.js","../webpack://unity-builder/./node_modules/request/lib/querystring.js","../webpack://unity-builder/./node_modules/request/lib/redirect.js","../webpack://unity-builder/./node_modules/request/lib/tunnel.js","../webpack://unity-builder/./node_modules/request/node_modules/form-data/lib/form_data.js","../webpack://unity-builder/./node_modules/request/node_modules/form-data/lib/populate.js","../webpack://unity-builder/./node_modules/request/node_modules/qs/lib/formats.js","../webpack://unity-builder/./node_modules/request/node_modules/qs/lib/index.js","../webpack://unity-builder/./node_modules/request/node_modules/qs/lib/parse.js","../webpack://unity-builder/./node_modules/request/node_modules/qs/lib/stringify.js","../webpack://unity-builder/./node_modules/request/node_modules/qs/lib/utils.js","../webpack://unity-builder/./node_modules/request/node_modules/uuid/lib/bytesToUuid.js","../webpack://unity-builder/./node_modules/request/node_modules/uuid/lib/rng.js","../webpack://unity-builder/./node_modules/request/node_modules/uuid/v4.js","../webpack://unity-builder/./node_modules/request/request.js","../webpack://unity-builder/./node_modules/responselike/src/index.js","../webpack://unity-builder/./node_modules/safe-buffer/index.js","../webpack://unity-builder/./node_modules/safer-buffer/safer.js","../webpack://unity-builder/./node_modules/semver/classes/comparator.js","../webpack://unity-builder/./node_modules/semver/classes/range.js","../webpack://unity-builder/./node_modules/semver/classes/semver.js","../webpack://unity-builder/./node_modules/semver/functions/clean.js","../webpack://unity-builder/./node_modules/semver/functions/cmp.js","../webpack://unity-builder/./node_modules/semver/functions/coerce.js","../webpack://unity-builder/./node_modules/semver/functions/compare-build.js","../webpack://unity-builder/./node_modules/semver/functions/compare-loose.js","../webpack://unity-builder/./node_modules/semver/functions/compare.js","../webpack://unity-builder/./node_modules/semver/functions/diff.js","../webpack://unity-builder/./node_modules/semver/functions/eq.js","../webpack://unity-builder/./node_modules/semver/functions/gt.js","../webpack://unity-builder/./node_modules/semver/functions/gte.js","../webpack://unity-builder/./node_modules/semver/functions/inc.js","../webpack://unity-builder/./node_modules/semver/functions/lt.js","../webpack://unity-builder/./node_modules/semver/functions/lte.js","../webpack://unity-builder/./node_modules/semver/functions/major.js","../webpack://unity-builder/./node_modules/semver/functions/minor.js","../webpack://unity-builder/./node_modules/semver/functions/neq.js","../webpack://unity-builder/./node_modules/semver/functions/parse.js","../webpack://unity-builder/./node_modules/semver/functions/patch.js","../webpack://unity-builder/./node_modules/semver/functions/prerelease.js","../webpack://unity-builder/./node_modules/semver/functions/rcompare.js","../webpack://unity-builder/./node_modules/semver/functions/rsort.js","../webpack://unity-builder/./node_modules/semver/functions/satisfies.js","../webpack://unity-builder/./node_modules/semver/functions/sort.js","../webpack://unity-builder/./node_modules/semver/functions/valid.js","../webpack://unity-builder/./node_modules/semver/index.js","../webpack://unity-builder/./node_modules/semver/internal/constants.js","../webpack://unity-builder/./node_modules/semver/internal/debug.js","../webpack://unity-builder/./node_modules/semver/internal/identifiers.js","../webpack://unity-builder/./node_modules/semver/internal/parse-options.js","../webpack://unity-builder/./node_modules/semver/internal/re.js","../webpack://unity-builder/./node_modules/semver/ranges/gtr.js","../webpack://unity-builder/./node_modules/semver/ranges/intersects.js","../webpack://unity-builder/./node_modules/semver/ranges/ltr.js","../webpack://unity-builder/./node_modules/semver/ranges/max-satisfying.js","../webpack://unity-builder/./node_modules/semver/ranges/min-satisfying.js","../webpack://unity-builder/./node_modules/semver/ranges/min-version.js","../webpack://unity-builder/./node_modules/semver/ranges/outside.js","../webpack://unity-builder/./node_modules/semver/ranges/simplify.js","../webpack://unity-builder/./node_modules/semver/ranges/subset.js","../webpack://unity-builder/./node_modules/semver/ranges/to-comparators.js","../webpack://unity-builder/./node_modules/semver/ranges/valid.js","../webpack://unity-builder/./node_modules/shelljs/commands.js","../webpack://unity-builder/./node_modules/shelljs/shell.js","../webpack://unity-builder/./node_modules/shelljs/src/cat.js","../webpack://unity-builder/./node_modules/shelljs/src/cd.js","../webpack://unity-builder/./node_modules/shelljs/src/chmod.js","../webpack://unity-builder/./node_modules/shelljs/src/common.js","../webpack://unity-builder/./node_modules/shelljs/src/cp.js","../webpack://unity-builder/./node_modules/shelljs/src/dirs.js","../webpack://unity-builder/./node_modules/shelljs/src/echo.js","../webpack://unity-builder/./node_modules/shelljs/src/error.js","../webpack://unity-builder/./node_modules/shelljs/src/exec-child.js","../webpack://unity-builder/./node_modules/shelljs/src/exec.js","../webpack://unity-builder/./node_modules/shelljs/src/find.js","../webpack://unity-builder/./node_modules/shelljs/src/grep.js","../webpack://unity-builder/./node_modules/shelljs/src/head.js","../webpack://unity-builder/./node_modules/shelljs/src/ln.js","../webpack://unity-builder/./node_modules/shelljs/src/ls.js","../webpack://unity-builder/./node_modules/shelljs/src/mkdir.js","../webpack://unity-builder/./node_modules/shelljs/src/mv.js","../webpack://unity-builder/./node_modules/shelljs/src/popd.js","../webpack://unity-builder/./node_modules/shelljs/src/pushd.js","../webpack://unity-builder/./node_modules/shelljs/src/pwd.js","../webpack://unity-builder/./node_modules/shelljs/src/rm.js","../webpack://unity-builder/./node_modules/shelljs/src/sed.js","../webpack://unity-builder/./node_modules/shelljs/src/set.js","../webpack://unity-builder/./node_modules/shelljs/src/sort.js","../webpack://unity-builder/./node_modules/shelljs/src/tail.js","../webpack://unity-builder/./node_modules/shelljs/src/tempdir.js","../webpack://unity-builder/./node_modules/shelljs/src/test.js","../webpack://unity-builder/./node_modules/shelljs/src/to.js","../webpack://unity-builder/./node_modules/shelljs/src/toEnd.js","../webpack://unity-builder/./node_modules/shelljs/src/touch.js","../webpack://unity-builder/./node_modules/shelljs/src/uniq.js","../webpack://unity-builder/./node_modules/shelljs/src/which.js","../webpack://unity-builder/./node_modules/side-channel/index.js","../webpack://unity-builder/./node_modules/sshpk/lib/algs.js","../webpack://unity-builder/./node_modules/sshpk/lib/certificate.js","../webpack://unity-builder/./node_modules/sshpk/lib/dhe.js","../webpack://unity-builder/./node_modules/sshpk/lib/ed-compat.js","../webpack://unity-builder/./node_modules/sshpk/lib/errors.js","../webpack://unity-builder/./node_modules/sshpk/lib/fingerprint.js","../webpack://unity-builder/./node_modules/sshpk/lib/formats/auto.js","../webpack://unity-builder/./node_modules/sshpk/lib/formats/dnssec.js","../webpack://unity-builder/./node_modules/sshpk/lib/formats/openssh-cert.js","../webpack://unity-builder/./node_modules/sshpk/lib/formats/pem.js","../webpack://unity-builder/./node_modules/sshpk/lib/formats/pkcs1.js","../webpack://unity-builder/./node_modules/sshpk/lib/formats/pkcs8.js","../webpack://unity-builder/./node_modules/sshpk/lib/formats/putty.js","../webpack://unity-builder/./node_modules/sshpk/lib/formats/rfc4253.js","../webpack://unity-builder/./node_modules/sshpk/lib/formats/ssh-private.js","../webpack://unity-builder/./node_modules/sshpk/lib/formats/ssh.js","../webpack://unity-builder/./node_modules/sshpk/lib/formats/x509-pem.js","../webpack://unity-builder/./node_modules/sshpk/lib/formats/x509.js","../webpack://unity-builder/./node_modules/sshpk/lib/identity.js","../webpack://unity-builder/./node_modules/sshpk/lib/index.js","../webpack://unity-builder/./node_modules/sshpk/lib/key.js","../webpack://unity-builder/./node_modules/sshpk/lib/private-key.js","../webpack://unity-builder/./node_modules/sshpk/lib/signature.js","../webpack://unity-builder/./node_modules/sshpk/lib/ssh-buffer.js","../webpack://unity-builder/./node_modules/sshpk/lib/utils.js","../webpack://unity-builder/./node_modules/swagger-fluent/lib/client.js","../webpack://unity-builder/./node_modules/swagger-fluent/lib/index.js","../webpack://unity-builder/./node_modules/swagger-fluent/lib/loader.js","../webpack://unity-builder/./node_modules/swagger-fluent/node_modules/is-plain-object/index.cjs.js","../webpack://unity-builder/./node_modules/to-readable-stream/index.js","../webpack://unity-builder/./node_modules/tough-cookie/lib/cookie.js","../webpack://unity-builder/./node_modules/tough-cookie/lib/memstore.js","../webpack://unity-builder/./node_modules/tough-cookie/lib/pathMatch.js","../webpack://unity-builder/./node_modules/tough-cookie/lib/permuteDomain.js","../webpack://unity-builder/./node_modules/tough-cookie/lib/pubsuffix-psl.js","../webpack://unity-builder/./node_modules/tough-cookie/lib/store.js","../webpack://unity-builder/./node_modules/tough-cookie/lib/version.js","../webpack://unity-builder/./node_modules/tslib/tslib.es6.js","../webpack://unity-builder/./node_modules/tunnel-agent/index.js","../webpack://unity-builder/./node_modules/tweetnacl/nacl-fast.js","../webpack://unity-builder/./node_modules/uri-js/dist/es5/uri.all.js","../webpack://unity-builder/./node_modules/url-join/lib/url-join.js","../webpack://unity-builder/./node_modules/url-parse-lax/index.js","../webpack://unity-builder/./node_modules/uuid/index.js","../webpack://unity-builder/./node_modules/uuid/lib/bytesToUuid.js","../webpack://unity-builder/./node_modules/uuid/lib/rng.js","../webpack://unity-builder/./node_modules/uuid/v1.js","../webpack://unity-builder/./node_modules/uuid/v4.js","../webpack://unity-builder/./node_modules/verror/lib/verror.js","../webpack://unity-builder/./node_modules/verror/node_modules/extsprintf/lib/extsprintf.js","../webpack://unity-builder/./node_modules/wrappy/wrappy.js","../webpack://unity-builder/./node_modules/ws/index.js","../webpack://unity-builder/./node_modules/ws/lib/buffer-util.js","../webpack://unity-builder/./node_modules/ws/lib/constants.js","../webpack://unity-builder/./node_modules/ws/lib/event-target.js","../webpack://unity-builder/./node_modules/ws/lib/extension.js","../webpack://unity-builder/./node_modules/ws/lib/permessage-deflate.js","../webpack://unity-builder/./node_modules/ws/lib/receiver.js","../webpack://unity-builder/./node_modules/ws/lib/sender.js","../webpack://unity-builder/./node_modules/ws/lib/validation.js","../webpack://unity-builder/./node_modules/ws/lib/websocket-server.js","../webpack://unity-builder/./node_modules/ws/lib/websocket.js","../webpack://unity-builder/./node_modules/xml2js/lib/bom.js","../webpack://unity-builder/./node_modules/xml2js/lib/builder.js","../webpack://unity-builder/./node_modules/xml2js/lib/defaults.js","../webpack://unity-builder/./node_modules/xml2js/lib/parser.js","../webpack://unity-builder/./node_modules/xml2js/lib/processors.js","../webpack://unity-builder/./node_modules/xml2js/lib/xml2js.js","../webpack://unity-builder/./node_modules/xml2js/node_modules/sax/lib/sax.js","../webpack://unity-builder/./node_modules/xmlbuilder/lib/Utility.js","../webpack://unity-builder/./node_modules/xmlbuilder/lib/XMLAttribute.js","../webpack://unity-builder/./node_modules/xmlbuilder/lib/XMLCData.js","../webpack://unity-builder/./node_modules/xmlbuilder/lib/XMLComment.js","../webpack://unity-builder/./node_modules/xmlbuilder/lib/XMLDTDAttList.js","../webpack://unity-builder/./node_modules/xmlbuilder/lib/XMLDTDElement.js","../webpack://unity-builder/./node_modules/xmlbuilder/lib/XMLDTDEntity.js","../webpack://unity-builder/./node_modules/xmlbuilder/lib/XMLDTDNotation.js","../webpack://unity-builder/./node_modules/xmlbuilder/lib/XMLDeclaration.js","../webpack://unity-builder/./node_modules/xmlbuilder/lib/XMLDocType.js","../webpack://unity-builder/./node_modules/xmlbuilder/lib/XMLDocument.js","../webpack://unity-builder/./node_modules/xmlbuilder/lib/XMLDocumentCB.js","../webpack://unity-builder/./node_modules/xmlbuilder/lib/XMLElement.js","../webpack://unity-builder/./node_modules/xmlbuilder/lib/XMLNode.js","../webpack://unity-builder/./node_modules/xmlbuilder/lib/XMLProcessingInstruction.js","../webpack://unity-builder/./node_modules/xmlbuilder/lib/XMLRaw.js","../webpack://unity-builder/./node_modules/xmlbuilder/lib/XMLStreamWriter.js","../webpack://unity-builder/./node_modules/xmlbuilder/lib/XMLStringWriter.js","../webpack://unity-builder/./node_modules/xmlbuilder/lib/XMLStringifier.js","../webpack://unity-builder/./node_modules/xmlbuilder/lib/XMLText.js","../webpack://unity-builder/./node_modules/xmlbuilder/lib/XMLWriterBase.js","../webpack://unity-builder/./node_modules/xmlbuilder/lib/index.js","../webpack://unity-builder/./node_modules/yallist/iterator.js","../webpack://unity-builder/./node_modules/yallist/yallist.js","../webpack://unity-builder/./node_modules/@vercel/ncc/dist/ncc/@@notfound.js","../webpack://unity-builder/./node_modules/nanoid/index.cjs","../webpack://unity-builder/./node_modules/nanoid/url-alphabet/index.cjs","../webpack://unity-builder/./node_modules/underscore/underscore-node-f.cjs","../webpack://unity-builder/./node_modules/underscore/underscore-node.cjs","../webpack://unity-builder/external \"assert\"","../webpack://unity-builder/external \"buffer\"","../webpack://unity-builder/external \"child_process\"","../webpack://unity-builder/external \"crypto\"","../webpack://unity-builder/external \"dgram\"","../webpack://unity-builder/external \"domain\"","../webpack://unity-builder/external \"events\"","../webpack://unity-builder/external \"fs\"","../webpack://unity-builder/external \"http\"","../webpack://unity-builder/external \"https\"","../webpack://unity-builder/external \"net\"","../webpack://unity-builder/external \"os\"","../webpack://unity-builder/external \"path\"","../webpack://unity-builder/external \"punycode\"","../webpack://unity-builder/external \"querystring\"","../webpack://unity-builder/external \"stream\"","../webpack://unity-builder/external \"string_decoder\"","../webpack://unity-builder/external \"timers\"","../webpack://unity-builder/external \"tls\"","../webpack://unity-builder/external \"url\"","../webpack://unity-builder/external \"util\"","../webpack://unity-builder/external \"vm\"","../webpack://unity-builder/external \"zlib\"","../webpack://unity-builder/webpack/bootstrap","../webpack://unity-builder/webpack/runtime/define property getters","../webpack://unity-builder/webpack/runtime/hasOwnProperty shorthand","../webpack://unity-builder/webpack/runtime/make namespace object","../webpack://unity-builder/webpack/runtime/node module decorator","../webpack://unity-builder/webpack/runtime/compat","../webpack://unity-builder/webpack/startup"],"sourcesContent":["\"use strict\";\r\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\r\n}) : (function(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n o[k2] = m[k];\r\n}));\r\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\r\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\r\n}) : function(o, v) {\r\n o[\"default\"] = v;\r\n});\r\nvar __importStar = (this && this.__importStar) || function (mod) {\r\n if (mod && mod.__esModule) return mod;\r\n var result = {};\r\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\r\n __setModuleDefault(result, mod);\r\n return result;\r\n};\r\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\r\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\r\n return new (P || (P = Promise))(function (resolve, reject) {\r\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\r\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\r\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\r\n step((generator = generator.apply(thisArg, _arguments || [])).next());\r\n });\r\n};\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nconst core = __importStar(require(\"@actions/core\"));\r\nconst model_1 = require(\"./model\");\r\nfunction run() {\r\n return __awaiter(this, void 0, void 0, function* () {\r\n try {\r\n model_1.Action.checkCompatibility();\r\n model_1.Cache.verify();\r\n const { dockerfile, workspace, actionFolder } = model_1.Action;\r\n const buildParameters = yield model_1.BuildParameters.create();\r\n const baseImage = new model_1.ImageTag(buildParameters);\r\n let builtImage;\r\n switch (buildParameters.remoteBuildCluster) {\r\n case 'k8s':\r\n core.info('Building with Kubernetes');\r\n yield model_1.Kubernetes.runBuildJob(buildParameters, baseImage);\r\n break;\r\n case 'aws':\r\n core.info('Building with AWS');\r\n yield model_1.AWS.runBuildJob(buildParameters, baseImage);\r\n break;\r\n // default and local case\r\n default:\r\n core.info('Building locally');\r\n builtImage = yield model_1.Docker.build({ path: actionFolder, dockerfile, baseImage });\r\n yield model_1.Docker.run(builtImage, Object.assign({ workspace }, buildParameters));\r\n break;\r\n }\r\n // Set output\r\n yield model_1.Output.setBuildVersion(buildParameters.buildVersion);\r\n }\r\n catch (error) {\r\n core.setFailed(error.message);\r\n }\r\n });\r\n}\r\nrun();\r\n","\"use strict\";\r\nvar __importDefault = (this && this.__importDefault) || function (mod) {\r\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\r\n};\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nconst path_1 = __importDefault(require(\"path\"));\r\nclass Action {\r\n static get supportedPlatforms() {\r\n return ['linux'];\r\n }\r\n static get isRunningLocally() {\r\n return process.env.RUNNER_WORKSPACE === undefined;\r\n }\r\n static get isRunningFromSource() {\r\n return path_1.default.basename(__dirname) === 'model';\r\n }\r\n static get canonicalName() {\r\n return 'unity-builder';\r\n }\r\n static get rootFolder() {\r\n if (Action.isRunningFromSource) {\r\n return path_1.default.dirname(path_1.default.dirname(path_1.default.dirname(__filename)));\r\n }\r\n return path_1.default.dirname(path_1.default.dirname(__filename));\r\n }\r\n static get actionFolder() {\r\n return `${Action.rootFolder}/dist`;\r\n }\r\n static get dockerfile() {\r\n return `${Action.actionFolder}/Dockerfile`;\r\n }\r\n static get workspace() {\r\n return process.env.GITHUB_WORKSPACE;\r\n }\r\n static checkCompatibility() {\r\n const currentPlatform = process.platform;\r\n if (!Action.supportedPlatforms.includes(currentPlatform)) {\r\n throw new Error(`Currently ${currentPlatform}-platform is not supported`);\r\n }\r\n }\r\n}\r\nexports.default = Action;\r\n","\"use strict\";\r\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\r\n}) : (function(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n o[k2] = m[k];\r\n}));\r\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\r\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\r\n}) : function(o, v) {\r\n o[\"default\"] = v;\r\n});\r\nvar __importStar = (this && this.__importStar) || function (mod) {\r\n if (mod && mod.__esModule) return mod;\r\n var result = {};\r\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\r\n __setModuleDefault(result, mod);\r\n return result;\r\n};\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nconst core = __importStar(require(\"@actions/core\"));\r\nconst semver = __importStar(require(\"semver\"));\r\nclass AndroidVersioning {\r\n static determineVersionCode(version, inputVersionCode) {\r\n if (!inputVersionCode) {\r\n return AndroidVersioning.versionToVersionCode(version);\r\n }\r\n return inputVersionCode;\r\n }\r\n static versionToVersionCode(version) {\r\n const parsedVersion = semver.parse(version);\r\n if (!parsedVersion) {\r\n core.warning(`Could not parse \"${version}\" to semver, defaulting android version code to 1`);\r\n return 1;\r\n }\r\n // The greatest value Google Plays allows is 2100000000.\r\n // Allow for 3 patch digits, 3 minor digits and 3 major digits.\r\n const versionCode = parsedVersion.major * 1000000 + parsedVersion.minor * 1000 + parsedVersion.patch;\r\n if (versionCode >= 1000000000) {\r\n 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.`);\r\n }\r\n core.info(`Using android versionCode ${versionCode}`);\r\n return versionCode;\r\n }\r\n}\r\nexports.default = AndroidVersioning;\r\n","\"use strict\";\r\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\r\n}) : (function(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n o[k2] = m[k];\r\n}));\r\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\r\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\r\n}) : function(o, v) {\r\n o[\"default\"] = v;\r\n});\r\nvar __importStar = (this && this.__importStar) || function (mod) {\r\n if (mod && mod.__esModule) return mod;\r\n var result = {};\r\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\r\n __setModuleDefault(result, mod);\r\n return result;\r\n};\r\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\r\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\r\n return new (P || (P = Promise))(function (resolve, reject) {\r\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\r\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\r\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\r\n step((generator = generator.apply(thisArg, _arguments || [])).next());\r\n });\r\n};\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nconst SDK = __importStar(require(\"aws-sdk\"));\r\nconst nanoid_1 = require(\"nanoid\");\r\nconst fs = __importStar(require(\"fs\"));\r\nconst core = __importStar(require(\"@actions/core\"));\r\nconst zlib = __importStar(require(\"zlib\"));\r\nconst alphabet = '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz';\r\nconst repositoryDirectoryName = 'repo';\r\nconst efsDirectoryName = 'data';\r\nconst cacheDirectoryName = 'cache';\r\nclass AWS {\r\n static runBuildJob(buildParameters, baseImage) {\r\n var _a;\r\n return __awaiter(this, void 0, void 0, function* () {\r\n try {\r\n const nanoid = nanoid_1.customAlphabet(alphabet, 4);\r\n const buildUid = `${process.env.GITHUB_RUN_NUMBER}-${buildParameters.platform\r\n .replace('Standalone', '')\r\n .replace('standalone', '')}-${nanoid()}`;\r\n const branchName = (_a = process.env.GITHUB_REF) === null || _a === void 0 ? void 0 : _a.split('/').reverse()[0];\r\n core.info('Starting part 1/4 (clone from github and restore cache)');\r\n yield this.run(buildUid, buildParameters.awsStackName, 'alpine/git', ['/bin/sh'], [\r\n '-c',\r\n `apk update;\r\n apk add unzip;\r\n apk add git-lfs;\r\n apk add jq;\r\n # Get source repo for project to be built and game-ci repo for utilties\r\n git clone https://${buildParameters.githubToken}@github.com/${process.env.GITHUB_REPOSITORY}.git ${buildUid}/${repositoryDirectoryName} -q\r\n git clone https://${buildParameters.githubToken}@github.com/game-ci/unity-builder.git ${buildUid}/builder -q\r\n cd /${efsDirectoryName}/${buildUid}/${repositoryDirectoryName}/\r\n git checkout $GITHUB_SHA\r\n cd /${efsDirectoryName}/\r\n # Look for usable cache\r\n if [ ! -d ${cacheDirectoryName} ]; then\r\n mkdir ${cacheDirectoryName}\r\n fi\r\n cd ${cacheDirectoryName}\r\n if [ ! -d \"${branchName}\" ]; then\r\n mkdir \"${branchName}\"\r\n fi\r\n cd \"${branchName}\"\r\n echo \" \"\r\n echo \"Cached Libraries for ${branchName} from previous builds:\"\r\n ls\r\n echo \" \"\r\n libDir=\"/${efsDirectoryName}/${buildUid}/${repositoryDirectoryName}/${buildParameters.projectPath}/Library\"\r\n if [ -d \"$libDir\" ]; then\r\n rm -r \"$libDir\"\r\n echo \"Setup .gitignore to ignore Library folder and remove it from builds\"\r\n fi\r\n echo 'Checking cache'\r\n # Restore cache\r\n latest=$(ls -t | head -1)\r\n if [ ! -z \"$latest\" ]; then\r\n echo \"Library cache exists from build $latest from ${branchName}\"\r\n echo 'Creating empty Library folder for cache'\r\n mkdir \"$libDir\"\r\n unzip -q $latest -d '/${efsDirectoryName}/${buildUid}/${repositoryDirectoryName}/${buildParameters.projectPath}/Library/.'\r\n else\r\n echo 'Cache does not exist'\r\n fi\r\n # Print out important directories\r\n echo ' '\r\n echo 'Repo:'\r\n ls /${efsDirectoryName}/${buildUid}/${repositoryDirectoryName}/\r\n echo ' '\r\n echo 'Project:'\r\n ls /${efsDirectoryName}/${buildUid}/${repositoryDirectoryName}/${buildParameters.projectPath}\r\n echo ' '\r\n echo 'Library:'\r\n ls /${efsDirectoryName}/${buildUid}/${repositoryDirectoryName}/${buildParameters.projectPath}/Library/\r\n echo ' '\r\n `,\r\n ], `/${efsDirectoryName}`, `/${efsDirectoryName}/`, [\r\n {\r\n name: 'GITHUB_SHA',\r\n value: process.env.GITHUB_SHA,\r\n },\r\n ], [\r\n {\r\n ParameterKey: 'GithubToken',\r\n ParameterValue: buildParameters.githubToken,\r\n },\r\n ]);\r\n core.info('Starting part 2/4 (build unity project)');\r\n yield this.run(buildUid, buildParameters.awsStackName, baseImage.toString(), ['/bin/sh'], [\r\n '-c',\r\n `\r\n cp -r /${efsDirectoryName}/${buildUid}/builder/dist/default-build-script/ /UnityBuilderAction;\r\n cp -r /${efsDirectoryName}/${buildUid}/builder/dist/entrypoint.sh /entrypoint.sh;\r\n cp -r /${efsDirectoryName}/${buildUid}/builder/dist/steps/ /steps;\r\n chmod -R +x /entrypoint.sh;\r\n chmod -R +x /steps;\r\n /entrypoint.sh;\r\n `,\r\n ], `/${efsDirectoryName}`, `/${efsDirectoryName}/${buildUid}/${repositoryDirectoryName}/`, [\r\n {\r\n name: 'ContainerMemory',\r\n value: buildParameters.remoteBuildMemory,\r\n },\r\n {\r\n name: 'ContainerCpu',\r\n value: buildParameters.remoteBuildCpu,\r\n },\r\n {\r\n name: 'GITHUB_WORKSPACE',\r\n value: `/${efsDirectoryName}/${buildUid}/${repositoryDirectoryName}/`,\r\n },\r\n {\r\n name: 'PROJECT_PATH',\r\n value: buildParameters.projectPath,\r\n },\r\n {\r\n name: 'BUILD_PATH',\r\n value: buildParameters.buildPath,\r\n },\r\n {\r\n name: 'BUILD_FILE',\r\n value: buildParameters.buildFile,\r\n },\r\n {\r\n name: 'BUILD_NAME',\r\n value: buildParameters.buildName,\r\n },\r\n {\r\n name: 'BUILD_METHOD',\r\n value: buildParameters.buildMethod,\r\n },\r\n {\r\n name: 'CUSTOM_PARAMETERS',\r\n value: buildParameters.customParameters,\r\n },\r\n {\r\n name: 'BUILD_TARGET',\r\n value: buildParameters.platform,\r\n },\r\n {\r\n name: 'ANDROID_VERSION_CODE',\r\n value: buildParameters.androidVersionCode.toString(),\r\n },\r\n {\r\n name: 'ANDROID_KEYSTORE_NAME',\r\n value: buildParameters.androidKeystoreName,\r\n },\r\n {\r\n name: 'ANDROID_KEYALIAS_NAME',\r\n value: buildParameters.androidKeyaliasName,\r\n },\r\n ], [\r\n {\r\n ParameterKey: 'GithubToken',\r\n ParameterValue: buildParameters.githubToken,\r\n },\r\n {\r\n ParameterKey: 'UnityLicense',\r\n ParameterValue: process.env.UNITY_LICENSE ? process.env.UNITY_LICENSE : '0',\r\n },\r\n {\r\n ParameterKey: 'UnityEmail',\r\n ParameterValue: process.env.UNITY_EMAIL ? process.env.UNITY_EMAIL : '0',\r\n },\r\n {\r\n ParameterKey: 'UnityPassword',\r\n ParameterValue: process.env.UNITY_PASSWORD ? process.env.UNITY_PASSWORD : '0',\r\n },\r\n {\r\n ParameterKey: 'UnitySerial',\r\n ParameterValue: process.env.UNITY_SERIAL ? process.env.UNITY_SERIAL : '0',\r\n },\r\n {\r\n ParameterKey: 'AndroidKeystoreBase64',\r\n ParameterValue: buildParameters.androidKeystoreBase64 ? buildParameters.androidKeystoreBase64 : '0',\r\n },\r\n {\r\n ParameterKey: 'AndroidKeystorePass',\r\n ParameterValue: buildParameters.androidKeystorePass ? buildParameters.androidKeystorePass : '0',\r\n },\r\n {\r\n ParameterKey: 'AndroidKeyAliasPass',\r\n ParameterValue: buildParameters.androidKeyaliasPass ? buildParameters.androidKeyaliasPass : '0',\r\n },\r\n ]);\r\n core.info('Starting part 3/4 (zip unity build and Library for caching)');\r\n // Cleanup\r\n yield this.run(buildUid, buildParameters.awsStackName, 'alpine', ['/bin/sh'], [\r\n '-c',\r\n `\r\n apk update\r\n apk add zip\r\n cd Library\r\n zip -q -r lib-${buildUid}.zip .*\r\n mv lib-${buildUid}.zip /${efsDirectoryName}/${cacheDirectoryName}/${branchName}/lib-${buildUid}.zip\r\n cd ../../\r\n zip -q -r build-${buildUid}.zip ${buildParameters.buildPath}/*\r\n mv build-${buildUid}.zip /${efsDirectoryName}/${buildUid}/build-${buildUid}.zip\r\n `,\r\n ], `/${efsDirectoryName}`, `/${efsDirectoryName}/${buildUid}/${repositoryDirectoryName}/${buildParameters.projectPath}`, [\r\n {\r\n name: 'GITHUB_SHA',\r\n value: process.env.GITHUB_SHA,\r\n },\r\n ], [\r\n {\r\n ParameterKey: 'GithubToken',\r\n ParameterValue: buildParameters.githubToken,\r\n },\r\n ]);\r\n core.info('Starting part 4/4 (upload build to s3)');\r\n yield this.run(buildUid, buildParameters.awsStackName, 'amazon/aws-cli', ['/bin/sh'], [\r\n '-c',\r\n `\r\n aws s3 cp ${buildUid}/build-${buildUid}.zip s3://game-ci-storage/\r\n # no need to upload Library cache for now\r\n # aws s3 cp /${efsDirectoryName}/${cacheDirectoryName}/${branchName}/lib-${buildUid}.zip s3://game-ci-storage/\r\n rm -r ${buildUid}\r\n `,\r\n ], `/${efsDirectoryName}`, `/${efsDirectoryName}/`, [\r\n {\r\n name: 'GITHUB_SHA',\r\n value: process.env.GITHUB_SHA,\r\n },\r\n {\r\n name: 'AWS_DEFAULT_REGION',\r\n value: process.env.AWS_DEFAULT_REGION,\r\n },\r\n ], [\r\n {\r\n ParameterKey: 'GithubToken',\r\n ParameterValue: buildParameters.githubToken,\r\n },\r\n {\r\n ParameterKey: 'AWSAccessKeyID',\r\n ParameterValue: process.env.AWS_ACCESS_KEY_ID,\r\n },\r\n {\r\n ParameterKey: 'AWSSecretAccessKey',\r\n ParameterValue: process.env.AWS_SECRET_ACCESS_KEY,\r\n },\r\n ]);\r\n }\r\n catch (error) {\r\n core.setFailed(error);\r\n core.error(error);\r\n }\r\n });\r\n }\r\n static run(buildUid, stackName, image, entrypoint, commands, mountdir, workingdir, environment, secrets) {\r\n return __awaiter(this, void 0, void 0, function* () {\r\n const ECS = new SDK.ECS();\r\n const CF = new SDK.CloudFormation();\r\n const taskDef = yield this.setupCloudFormations(CF, buildUid, stackName, image, entrypoint, commands, mountdir, workingdir, secrets);\r\n yield this.runTask(taskDef, ECS, CF, environment, buildUid);\r\n yield this.cleanupResources(CF, taskDef);\r\n });\r\n }\r\n static setupCloudFormations(CF, buildUid, stackName, image, entrypoint, commands, mountdir, workingdir, secrets) {\r\n return __awaiter(this, void 0, void 0, function* () {\r\n const logid = nanoid_1.customAlphabet(alphabet, 9)();\r\n commands[1] += `\r\n echo \"${logid}\"\r\n `;\r\n const taskDefStackName = `${stackName}-${buildUid}`;\r\n const taskDefCloudFormation = fs.readFileSync(`${__dirname}/cloud-formations/task-def-formation.yml`, 'utf8');\r\n yield CF.createStack({\r\n StackName: taskDefStackName,\r\n TemplateBody: taskDefCloudFormation,\r\n Parameters: [\r\n {\r\n ParameterKey: 'ImageUrl',\r\n ParameterValue: image,\r\n },\r\n {\r\n ParameterKey: 'ServiceName',\r\n ParameterValue: taskDefStackName,\r\n },\r\n {\r\n ParameterKey: 'Command',\r\n ParameterValue: commands.join(','),\r\n },\r\n {\r\n ParameterKey: 'EntryPoint',\r\n ParameterValue: entrypoint.join(','),\r\n },\r\n {\r\n ParameterKey: 'WorkingDirectory',\r\n ParameterValue: workingdir,\r\n },\r\n {\r\n ParameterKey: 'EFSMountDirectory',\r\n ParameterValue: mountdir,\r\n },\r\n {\r\n ParameterKey: 'BUILDID',\r\n ParameterValue: buildUid,\r\n },\r\n ...secrets,\r\n ],\r\n }).promise();\r\n core.info('Creating worker cluster...');\r\n const cleanupTaskDefStackName = `${taskDefStackName}-cleanup`;\r\n const cleanupCloudFormation = fs.readFileSync(`${__dirname}/cloud-formations/cloudformation-stack-ttl.yml`, 'utf8');\r\n yield CF.createStack({\r\n StackName: cleanupTaskDefStackName,\r\n TemplateBody: cleanupCloudFormation,\r\n Capabilities: ['CAPABILITY_IAM'],\r\n Parameters: [\r\n {\r\n ParameterKey: 'StackName',\r\n ParameterValue: taskDefStackName,\r\n },\r\n {\r\n ParameterKey: 'DeleteStackName',\r\n ParameterValue: cleanupTaskDefStackName,\r\n },\r\n {\r\n ParameterKey: 'TTL',\r\n ParameterValue: '100',\r\n },\r\n {\r\n ParameterKey: 'BUILDID',\r\n ParameterValue: buildUid,\r\n },\r\n ],\r\n }).promise();\r\n core.info('Creating cleanup cluster...');\r\n try {\r\n yield CF.waitFor('stackCreateComplete', { StackName: taskDefStackName }).promise();\r\n }\r\n catch (error) {\r\n core.error(error);\r\n }\r\n const taskDefResources = yield CF.describeStackResources({\r\n StackName: taskDefStackName,\r\n }).promise();\r\n const baseResources = yield CF.describeStackResources({ StackName: stackName }).promise();\r\n // in the future we should offer a parameter to choose if you want the guarnteed shutdown.\r\n core.info('Worker cluster created successfully (skipping wait for cleanup cluster to be ready)');\r\n return {\r\n taskDefStackName,\r\n taskDefCloudFormation,\r\n taskDefStackNameTTL: cleanupTaskDefStackName,\r\n ttlCloudFormation: cleanupCloudFormation,\r\n taskDefResources,\r\n baseResources,\r\n logid,\r\n };\r\n });\r\n }\r\n static runTask(taskDef, ECS, CF, environment, buildUid) {\r\n var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s;\r\n return __awaiter(this, void 0, void 0, function* () {\r\n const cluster = ((_b = (_a = taskDef.baseResources.StackResources) === null || _a === void 0 ? void 0 : _a.find((x) => x.LogicalResourceId === 'ECSCluster')) === null || _b === void 0 ? void 0 : _b.PhysicalResourceId) || '';\r\n const taskDefinition = ((_d = (_c = taskDef.taskDefResources.StackResources) === null || _c === void 0 ? void 0 : _c.find((x) => x.LogicalResourceId === 'TaskDefinition')) === null || _d === void 0 ? void 0 : _d.PhysicalResourceId) || '';\r\n const SubnetOne = ((_f = (_e = taskDef.baseResources.StackResources) === null || _e === void 0 ? void 0 : _e.find((x) => x.LogicalResourceId === 'PublicSubnetOne')) === null || _f === void 0 ? void 0 : _f.PhysicalResourceId) || '';\r\n const SubnetTwo = ((_h = (_g = taskDef.baseResources.StackResources) === null || _g === void 0 ? void 0 : _g.find((x) => x.LogicalResourceId === 'PublicSubnetTwo')) === null || _h === void 0 ? void 0 : _h.PhysicalResourceId) || '';\r\n const ContainerSecurityGroup = ((_k = (_j = taskDef.baseResources.StackResources) === null || _j === void 0 ? void 0 : _j.find((x) => x.LogicalResourceId === 'ContainerSecurityGroup')) === null || _k === void 0 ? void 0 : _k.PhysicalResourceId) || '';\r\n const streamName = ((_m = (_l = taskDef.taskDefResources.StackResources) === null || _l === void 0 ? void 0 : _l.find((x) => x.LogicalResourceId === 'KinesisStream')) === null || _m === void 0 ? void 0 : _m.PhysicalResourceId) || '';\r\n const task = yield ECS.runTask({\r\n cluster,\r\n taskDefinition,\r\n platformVersion: '1.4.0',\r\n overrides: {\r\n containerOverrides: [\r\n {\r\n name: taskDef.taskDefStackName,\r\n environment: [...environment, { name: 'BUILDID', value: buildUid }],\r\n },\r\n ],\r\n },\r\n launchType: 'FARGATE',\r\n networkConfiguration: {\r\n awsvpcConfiguration: {\r\n subnets: [SubnetOne, SubnetTwo],\r\n assignPublicIp: 'ENABLED',\r\n securityGroups: [ContainerSecurityGroup],\r\n },\r\n },\r\n }).promise();\r\n core.info('Task is starting on worker cluster');\r\n const taskArn = ((_o = task.tasks) === null || _o === void 0 ? void 0 : _o[0].taskArn) || '';\r\n try {\r\n yield ECS.waitFor('tasksRunning', { tasks: [taskArn], cluster }).promise();\r\n }\r\n catch (error) {\r\n yield new Promise((resolve) => setTimeout(resolve, 3000));\r\n const describeTasks = yield ECS.describeTasks({\r\n tasks: [taskArn],\r\n cluster,\r\n }).promise();\r\n 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}`);\r\n core.setFailed(error);\r\n core.error(error);\r\n }\r\n core.info(`Task is running on worker cluster`);\r\n yield this.streamLogsUntilTaskStops(ECS, CF, taskDef, cluster, taskArn, streamName);\r\n yield ECS.waitFor('tasksStopped', { cluster, tasks: [taskArn] }).promise();\r\n const exitCode = (_s = (_r = (yield ECS.describeTasks({\r\n tasks: [taskArn],\r\n cluster,\r\n }).promise()).tasks) === null || _r === void 0 ? void 0 : _r[0].containers) === null || _s === void 0 ? void 0 : _s[0].exitCode;\r\n if (exitCode !== 0) {\r\n try {\r\n yield this.cleanupResources(CF, taskDef);\r\n }\r\n catch (error) {\r\n core.warning(`failed to cleanup ${error}`);\r\n }\r\n core.error(`job failed with exit code ${exitCode}`);\r\n throw new Error(`job failed with exit code ${exitCode}`);\r\n }\r\n else {\r\n core.info(`Task has finished successfully`);\r\n }\r\n });\r\n }\r\n static streamLogsUntilTaskStops(ECS, CF, taskDef, clusterName, taskArn, kinesisStreamName) {\r\n var _a;\r\n return __awaiter(this, void 0, void 0, function* () {\r\n // watching logs\r\n const kinesis = new SDK.Kinesis();\r\n const getTaskData = () => __awaiter(this, void 0, void 0, function* () {\r\n var _b;\r\n const tasks = yield ECS.describeTasks({\r\n cluster: clusterName,\r\n tasks: [taskArn],\r\n }).promise();\r\n return (_b = tasks.tasks) === null || _b === void 0 ? void 0 : _b[0];\r\n });\r\n const stream = yield kinesis\r\n .describeStream({\r\n StreamName: kinesisStreamName,\r\n })\r\n .promise();\r\n let iterator = (yield kinesis\r\n .getShardIterator({\r\n ShardIteratorType: 'TRIM_HORIZON',\r\n StreamName: stream.StreamDescription.StreamName,\r\n ShardId: stream.StreamDescription.Shards[0].ShardId,\r\n })\r\n .promise()).ShardIterator || '';\r\n yield CF.waitFor('stackCreateComplete', { StackName: taskDef.taskDefStackNameTTL }).promise();\r\n core.info(`Task status is ${(_a = (yield getTaskData())) === null || _a === void 0 ? void 0 : _a.lastStatus}`);\r\n const logBaseUrl = `https://${SDK.config.region}.console.aws.amazon.com/cloudwatch/home?region=${SDK.config.region}#logsV2:log-groups/log-group/${taskDef.taskDefStackName}`;\r\n core.info(`You can also see the logs at AWS Cloud Watch: ${logBaseUrl}`);\r\n let readingLogs = true;\r\n let timestamp = 0;\r\n while (readingLogs) {\r\n yield new Promise((resolve) => setTimeout(resolve, 1500));\r\n const taskData = yield getTaskData();\r\n if ((taskData === null || taskData === void 0 ? void 0 : taskData.lastStatus) !== 'RUNNING') {\r\n if (timestamp === 0) {\r\n core.info('Task stopped, streaming end of logs');\r\n timestamp = Date.now();\r\n }\r\n if (timestamp !== 0 && Date.now() - timestamp < 30000) {\r\n core.info('Task status is not RUNNING for 30 seconds, last query for logs');\r\n readingLogs = false;\r\n }\r\n }\r\n const records = yield kinesis\r\n .getRecords({\r\n ShardIterator: iterator,\r\n })\r\n .promise();\r\n iterator = records.NextShardIterator || '';\r\n if (records.Records.length > 0 && iterator) {\r\n for (let index = 0; index < records.Records.length; index++) {\r\n const json = JSON.parse(zlib.gunzipSync(Buffer.from(records.Records[index].Data, 'base64')).toString('utf8'));\r\n if (json.messageType === 'DATA_MESSAGE') {\r\n for (let logEventsIndex = 0; logEventsIndex < json.logEvents.length; logEventsIndex++) {\r\n if (json.logEvents[logEventsIndex].message.includes(taskDef.logid)) {\r\n core.info('End of task logs');\r\n readingLogs = false;\r\n }\r\n else {\r\n core.info(json.logEvents[logEventsIndex].message);\r\n }\r\n }\r\n }\r\n }\r\n }\r\n }\r\n });\r\n }\r\n static cleanupResources(CF, taskDef) {\r\n return __awaiter(this, void 0, void 0, function* () {\r\n yield CF.deleteStack({\r\n StackName: taskDef.taskDefStackName,\r\n }).promise();\r\n yield CF.deleteStack({\r\n StackName: taskDef.taskDefStackNameTTL,\r\n }).promise();\r\n yield CF.waitFor('stackDeleteComplete', {\r\n StackName: taskDef.taskDefStackName,\r\n }).promise();\r\n // Currently too slow and causes too much waiting\r\n yield CF.waitFor('stackDeleteComplete', {\r\n StackName: taskDef.taskDefStackNameTTL,\r\n }).promise();\r\n core.info('Cleanup complete');\r\n });\r\n }\r\n static onlog(batch) {\r\n for (const log of batch) {\r\n core.info(`log: ${log}`);\r\n }\r\n }\r\n}\r\nexports.default = AWS;\r\n","\"use strict\";\r\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\r\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\r\n return new (P || (P = Promise))(function (resolve, reject) {\r\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\r\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\r\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\r\n step((generator = generator.apply(thisArg, _arguments || [])).next());\r\n });\r\n};\r\nvar __importDefault = (this && this.__importDefault) || function (mod) {\r\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\r\n};\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nconst android_versioning_1 = __importDefault(require(\"./android-versioning\"));\r\nconst input_1 = __importDefault(require(\"./input\"));\r\nconst platform_1 = __importDefault(require(\"./platform\"));\r\nconst unity_versioning_1 = __importDefault(require(\"./unity-versioning\"));\r\nconst versioning_1 = __importDefault(require(\"./versioning\"));\r\nclass BuildParameters {\r\n static create() {\r\n return __awaiter(this, void 0, void 0, function* () {\r\n const buildFile = this.parseBuildFile(input_1.default.buildName, input_1.default.targetPlatform, input_1.default.androidAppBundle);\r\n const unityVersion = unity_versioning_1.default.determineUnityVersion(input_1.default.projectPath, input_1.default.unityVersion);\r\n const buildVersion = yield versioning_1.default.determineVersion(input_1.default.versioningStrategy, input_1.default.specifiedVersion);\r\n const androidVersionCode = android_versioning_1.default.determineVersionCode(buildVersion, input_1.default.androidVersionCode);\r\n return {\r\n version: unityVersion,\r\n customImage: input_1.default.customImage,\r\n runnerTempPath: process.env.RUNNER_TEMP,\r\n platform: input_1.default.targetPlatform,\r\n projectPath: input_1.default.projectPath,\r\n buildName: input_1.default.buildName,\r\n buildPath: `${input_1.default.buildsPath}/${input_1.default.targetPlatform}`,\r\n buildFile,\r\n buildMethod: input_1.default.buildMethod,\r\n buildVersion,\r\n androidVersionCode,\r\n androidKeystoreName: input_1.default.androidKeystoreName,\r\n androidKeystoreBase64: input_1.default.androidKeystoreBase64,\r\n androidKeystorePass: input_1.default.androidKeystorePass,\r\n androidKeyaliasName: input_1.default.androidKeyaliasName,\r\n androidKeyaliasPass: input_1.default.androidKeyaliasPass,\r\n customParameters: input_1.default.customParameters,\r\n remoteBuildCluster: input_1.default.remoteBuildCluster,\r\n awsStackName: input_1.default.awsStackName,\r\n kubeConfig: input_1.default.kubeConfig,\r\n githubToken: input_1.default.githubToken,\r\n remoteBuildMemory: input_1.default.remoteBuildMemory,\r\n remoteBuildCpu: input_1.default.remoteBuildCpu,\r\n kubeVolumeSize: input_1.default.kubeVolumeSize,\r\n kubeVolume: input_1.default.kubeVolume,\r\n };\r\n });\r\n }\r\n static parseBuildFile(filename, platform, androidAppBundle) {\r\n if (platform_1.default.isWindows(platform)) {\r\n return `${filename}.exe`;\r\n }\r\n if (platform_1.default.isAndroid(platform)) {\r\n return androidAppBundle ? `${filename}.aab` : `${filename}.apk`;\r\n }\r\n return filename;\r\n }\r\n}\r\nexports.default = BuildParameters;\r\n","\"use strict\";\r\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\r\n}) : (function(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n o[k2] = m[k];\r\n}));\r\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\r\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\r\n}) : function(o, v) {\r\n o[\"default\"] = v;\r\n});\r\nvar __importStar = (this && this.__importStar) || function (mod) {\r\n if (mod && mod.__esModule) return mod;\r\n var result = {};\r\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\r\n __setModuleDefault(result, mod);\r\n return result;\r\n};\r\nvar __importDefault = (this && this.__importDefault) || function (mod) {\r\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\r\n};\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nconst core = __importStar(require(\"@actions/core\"));\r\nconst fs_1 = __importDefault(require(\"fs\"));\r\nconst action_1 = __importDefault(require(\"./action\"));\r\nconst project_1 = __importDefault(require(\"./project\"));\r\nclass Cache {\r\n static verify() {\r\n if (!fs_1.default.existsSync(project_1.default.libraryFolder)) {\r\n this.notifyAboutCachingPossibility();\r\n }\r\n }\r\n static notifyAboutCachingPossibility() {\r\n if (action_1.default.isRunningLocally) {\r\n return;\r\n }\r\n core.warning(`\r\n Library folder does not exist.\r\n Consider setting up caching to speed up your workflow,\r\n if this is not your first build.\r\n `);\r\n }\r\n}\r\nexports.default = Cache;\r\n","\"use strict\";\r\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\r\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\r\n return new (P || (P = Promise))(function (resolve, reject) {\r\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\r\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\r\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\r\n step((generator = generator.apply(thisArg, _arguments || [])).next());\r\n });\r\n};\r\nvar __importDefault = (this && this.__importDefault) || function (mod) {\r\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\r\n};\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nconst exec_1 = require(\"@actions/exec\");\r\nconst image_tag_1 = __importDefault(require(\"./image-tag\"));\r\nclass Docker {\r\n static build(buildParameters, silent = false) {\r\n return __awaiter(this, void 0, void 0, function* () {\r\n const { path, dockerfile, baseImage } = buildParameters;\r\n const { version, platform } = baseImage;\r\n const tag = new image_tag_1.default({ repository: '', name: 'unity-builder', version, platform });\r\n const command = `docker build ${path} \\\r\n --file ${dockerfile} \\\r\n --build-arg IMAGE=${baseImage} \\\r\n --tag ${tag}`;\r\n yield exec_1.exec(command, undefined, { silent });\r\n return tag;\r\n });\r\n }\r\n static run(image, parameters, silent = false) {\r\n return __awaiter(this, void 0, void 0, function* () {\r\n const { version, workspace, runnerTempPath, platform, projectPath, buildName, buildPath, buildFile, buildMethod, buildVersion, androidVersionCode, androidKeystoreName, androidKeystoreBase64, androidKeystorePass, androidKeyaliasName, androidKeyaliasPass, customParameters, } = parameters;\r\n const command = `docker run \\\r\n --workdir /github/workspace \\\r\n --rm \\\r\n --env UNITY_LICENSE \\\r\n --env UNITY_LICENSE_FILE \\\r\n --env UNITY_EMAIL \\\r\n --env UNITY_PASSWORD \\\r\n --env UNITY_SERIAL \\\r\n --env UNITY_VERSION=\"${version}\" \\\r\n --env USYM_UPLOAD_AUTH_TOKEN \\\r\n --env PROJECT_PATH=\"${projectPath}\" \\\r\n --env BUILD_TARGET=\"${platform}\" \\\r\n --env BUILD_NAME=\"${buildName}\" \\\r\n --env BUILD_PATH=\"${buildPath}\" \\\r\n --env BUILD_FILE=\"${buildFile}\" \\\r\n --env BUILD_METHOD=\"${buildMethod}\" \\\r\n --env VERSION=\"${buildVersion}\" \\\r\n --env ANDROID_VERSION_CODE=\"${androidVersionCode}\" \\\r\n --env ANDROID_KEYSTORE_NAME=\"${androidKeystoreName}\" \\\r\n --env ANDROID_KEYSTORE_BASE64=\"${androidKeystoreBase64}\" \\\r\n --env ANDROID_KEYSTORE_PASS=\"${androidKeystorePass}\" \\\r\n --env ANDROID_KEYALIAS_NAME=\"${androidKeyaliasName}\" \\\r\n --env ANDROID_KEYALIAS_PASS=\"${androidKeyaliasPass}\" \\\r\n --env CUSTOM_PARAMETERS=\"${customParameters}\" \\\r\n --env GITHUB_REF \\\r\n --env GITHUB_SHA \\\r\n --env GITHUB_REPOSITORY \\\r\n --env GITHUB_ACTOR \\\r\n --env GITHUB_WORKFLOW \\\r\n --env GITHUB_HEAD_REF \\\r\n --env GITHUB_BASE_REF \\\r\n --env GITHUB_EVENT_NAME \\\r\n --env GITHUB_WORKSPACE=/github/workspace \\\r\n --env GITHUB_ACTION \\\r\n --env GITHUB_EVENT_PATH \\\r\n --env RUNNER_OS \\\r\n --env RUNNER_TOOL_CACHE \\\r\n --env RUNNER_TEMP \\\r\n --env RUNNER_WORKSPACE \\\r\n --volume \"/var/run/docker.sock\":\"/var/run/docker.sock\" \\\r\n --volume \"${runnerTempPath}/_github_home\":\"/root\" \\\r\n --volume \"${runnerTempPath}/_github_workflow\":\"/github/workflow\" \\\r\n --volume \"${workspace}\":\"/github/workspace\" \\\r\n ${image}`;\r\n yield exec_1.exec(command, undefined, { silent });\r\n });\r\n }\r\n}\r\nexports.default = Docker;\r\n","\"use strict\";\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nclass NotImplementedException extends Error {\r\n constructor(message = '') {\r\n super(message);\r\n this.name = 'NotImplementedException';\r\n }\r\n}\r\nexports.default = NotImplementedException;\r\n","\"use strict\";\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nclass ValidationError extends Error {\r\n constructor(message = '') {\r\n super(message);\r\n this.name = 'ValidationError';\r\n }\r\n}\r\nexports.default = ValidationError;\r\n","\"use strict\";\r\nvar __importDefault = (this && this.__importDefault) || function (mod) {\r\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\r\n};\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nconst platform_1 = __importDefault(require(\"./platform\"));\r\nclass ImageTag {\r\n constructor(imageProperties) {\r\n const { repository = 'unityci', name = 'editor', version = '2019.2.11f1', platform, customImage } = imageProperties;\r\n if (!ImageTag.versionPattern.test(version)) {\r\n throw new Error(`Invalid version \"${version}\".`);\r\n }\r\n const builderPlatform = ImageTag.getTargetPlatformToImageSuffixMap(platform, version);\r\n this.repository = repository;\r\n this.name = name;\r\n this.version = version;\r\n this.platform = platform;\r\n this.builderPlatform = builderPlatform;\r\n this.customImage = customImage;\r\n }\r\n static get versionPattern() {\r\n return /^20\\d{2}\\.\\d\\.\\w{3,4}|3$/;\r\n }\r\n static get imageSuffixes() {\r\n return {\r\n generic: '',\r\n webgl: 'webgl',\r\n mac: 'mac-mono',\r\n windows: 'windows-mono',\r\n linux: 'base',\r\n linuxIl2cpp: 'linux-il2cpp',\r\n android: 'android',\r\n ios: 'ios',\r\n facebook: 'facebook',\r\n };\r\n }\r\n static getTargetPlatformToImageSuffixMap(platform, version) {\r\n const { generic, webgl, mac, windows, linux, linuxIl2cpp, android, ios, facebook } = ImageTag.imageSuffixes;\r\n const [major, minor] = version.split('.').map((digit) => Number(digit));\r\n // @see: https://docs.unity3d.com/ScriptReference/BuildTarget.html\r\n switch (platform) {\r\n case platform_1.default.types.StandaloneOSX:\r\n return mac;\r\n case platform_1.default.types.StandaloneWindows:\r\n return windows;\r\n case platform_1.default.types.StandaloneWindows64:\r\n return windows;\r\n case platform_1.default.types.StandaloneLinux64: {\r\n // Unity versions before 2019.3 do not support il2cpp\r\n if (major >= 2020 || (major === 2019 && minor >= 3)) {\r\n return linuxIl2cpp;\r\n }\r\n return linux;\r\n }\r\n case platform_1.default.types.iOS:\r\n return ios;\r\n case platform_1.default.types.Android:\r\n return android;\r\n case platform_1.default.types.WebGL:\r\n return webgl;\r\n case platform_1.default.types.WSAPlayer:\r\n return windows;\r\n case platform_1.default.types.PS4:\r\n return windows;\r\n case platform_1.default.types.XboxOne:\r\n return windows;\r\n case platform_1.default.types.tvOS:\r\n return windows;\r\n case platform_1.default.types.Switch:\r\n return windows;\r\n // Unsupported\r\n case platform_1.default.types.Lumin:\r\n return windows;\r\n case platform_1.default.types.BJM:\r\n return windows;\r\n case platform_1.default.types.Stadia:\r\n return windows;\r\n case platform_1.default.types.Facebook:\r\n return facebook;\r\n case platform_1.default.types.NoTarget:\r\n return generic;\r\n // Test specific\r\n case platform_1.default.types.Test:\r\n return generic;\r\n default:\r\n throw new Error(`\r\n Platform must be one of the ones described in the documentation.\r\n \"${platform}\" is currently not supported.`);\r\n }\r\n }\r\n get tag() {\r\n return `${this.version}-${this.builderPlatform}`.replace(/-+$/, '');\r\n }\r\n get image() {\r\n return `${this.repository}/${this.name}`.replace(/^\\/+/, '');\r\n }\r\n toString() {\r\n const { image, tag, customImage } = this;\r\n if (customImage && customImage !== '') {\r\n return customImage;\r\n }\r\n return `${image}:${tag}-0`; // '0' here represents the docker repo version\r\n }\r\n}\r\nexports.default = ImageTag;\r\n","\"use strict\";\r\nvar __importDefault = (this && this.__importDefault) || function (mod) {\r\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\r\n};\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nexports.AWS = 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;\r\nconst action_1 = __importDefault(require(\"./action\"));\r\nexports.Action = action_1.default;\r\nconst build_parameters_1 = __importDefault(require(\"./build-parameters\"));\r\nexports.BuildParameters = build_parameters_1.default;\r\nconst cache_1 = __importDefault(require(\"./cache\"));\r\nexports.Cache = cache_1.default;\r\nconst docker_1 = __importDefault(require(\"./docker\"));\r\nexports.Docker = docker_1.default;\r\nconst input_1 = __importDefault(require(\"./input\"));\r\nexports.Input = input_1.default;\r\nconst image_tag_1 = __importDefault(require(\"./image-tag\"));\r\nexports.ImageTag = image_tag_1.default;\r\nconst output_1 = __importDefault(require(\"./output\"));\r\nexports.Output = output_1.default;\r\nconst platform_1 = __importDefault(require(\"./platform\"));\r\nexports.Platform = platform_1.default;\r\nconst project_1 = __importDefault(require(\"./project\"));\r\nexports.Project = project_1.default;\r\nconst unity_1 = __importDefault(require(\"./unity\"));\r\nexports.Unity = unity_1.default;\r\nconst versioning_1 = __importDefault(require(\"./versioning\"));\r\nexports.Versioning = versioning_1.default;\r\nconst kubernetes_1 = __importDefault(require(\"./kubernetes\"));\r\nexports.Kubernetes = kubernetes_1.default;\r\nconst aws_1 = __importDefault(require(\"./aws\"));\r\nexports.AWS = aws_1.default;\r\n","\"use strict\";\r\nvar __importDefault = (this && this.__importDefault) || function (mod) {\r\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\r\n};\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nconst platform_1 = __importDefault(require(\"./platform\"));\r\nconst core = require('@actions/core');\r\n/**\r\n * Input variables specified in workflows using \"with\" prop.\r\n *\r\n * Note that input is always passed as a string, even booleans.\r\n */\r\nclass Input {\r\n static get unityVersion() {\r\n return core.getInput('unityVersion') || 'auto';\r\n }\r\n static get customImage() {\r\n return core.getInput('customImage');\r\n }\r\n static get targetPlatform() {\r\n return core.getInput('targetPlatform') || platform_1.default.default;\r\n }\r\n static get projectPath() {\r\n const rawProjectPath = core.getInput('projectPath') || '.';\r\n return rawProjectPath.replace(/\\/$/, '');\r\n }\r\n static get buildName() {\r\n return core.getInput('buildName') || this.targetPlatform;\r\n }\r\n static get buildsPath() {\r\n return core.getInput('buildsPath') || 'build';\r\n }\r\n static get buildMethod() {\r\n return core.getInput('buildMethod'); // processed in docker file\r\n }\r\n static get versioningStrategy() {\r\n return core.getInput('versioning') || 'Semantic';\r\n }\r\n static get specifiedVersion() {\r\n return core.getInput('version') || '';\r\n }\r\n static get androidVersionCode() {\r\n return core.getInput('androidVersionCode');\r\n }\r\n static get androidAppBundle() {\r\n const input = core.getInput('androidAppBundle') || false;\r\n return input === 'true';\r\n }\r\n static get androidKeystoreName() {\r\n return core.getInput('androidKeystoreName') || '';\r\n }\r\n static get androidKeystoreBase64() {\r\n return core.getInput('androidKeystoreBase64') || '';\r\n }\r\n static get androidKeystorePass() {\r\n return core.getInput('androidKeystorePass') || '';\r\n }\r\n static get androidKeyaliasName() {\r\n return core.getInput('androidKeyaliasName') || '';\r\n }\r\n static get androidKeyaliasPass() {\r\n return core.getInput('androidKeyaliasPass') || '';\r\n }\r\n static get allowDirtyBuild() {\r\n const input = core.getInput('allowDirtyBuild') || false;\r\n return input === 'true';\r\n }\r\n static get customParameters() {\r\n return core.getInput('customParameters') || '';\r\n }\r\n static get remoteBuildCluster() {\r\n return core.getInput('remoteBuildCluster') || '';\r\n }\r\n static get awsStackName() {\r\n return core.getInput('awsStackName') || '';\r\n }\r\n static get kubeConfig() {\r\n return core.getInput('kubeConfig') || '';\r\n }\r\n static get githubToken() {\r\n return core.getInput('githubToken') || '';\r\n }\r\n static get remoteBuildMemory() {\r\n return core.getInput('remoteBuildMemory') || '800M';\r\n }\r\n static get remoteBuildCpu() {\r\n return core.getInput('remoteBuildCpu') || '0.25';\r\n }\r\n static get kubeVolumeSize() {\r\n return core.getInput('kubeVolumeSize') || '5Gi';\r\n }\r\n static get kubeVolume() {\r\n return core.getInput('kubeVolume') || '';\r\n }\r\n}\r\nexports.default = Input;\r\n","\"use strict\";\r\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\r\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\r\n return new (P || (P = Promise))(function (resolve, reject) {\r\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\r\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\r\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\r\n step((generator = generator.apply(thisArg, _arguments || [])).next());\r\n });\r\n};\r\nvar __importDefault = (this && this.__importDefault) || function (mod) {\r\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\r\n};\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\n// @ts-ignore\r\nconst kubernetes_client_1 = require(\"kubernetes-client\");\r\nconst request_1 = __importDefault(require(\"kubernetes-client/backends/request\"));\r\nconst core = require('@actions/core');\r\nconst base64 = require('base-64');\r\nconst pollInterval = 10000;\r\nclass Kubernetes {\r\n static runBuildJob(buildParameters, baseImage) {\r\n return __awaiter(this, void 0, void 0, function* () {\r\n const kubeconfig = new kubernetes_client_1.KubeConfig();\r\n kubeconfig.loadFromString(base64.decode(buildParameters.kubeConfig));\r\n const backend = new request_1.default({ kubeconfig });\r\n const kubeClient = new kubernetes_client_1.Client(backend);\r\n yield kubeClient.loadSpec();\r\n const buildId = Kubernetes.uuidv4();\r\n const pvcName = `unity-builder-pvc-${buildId}`;\r\n const secretName = `build-credentials-${buildId}`;\r\n const jobName = `unity-builder-job-${buildId}`;\r\n const namespace = 'default';\r\n this.kubeClient = kubeClient;\r\n this.buildId = buildId;\r\n this.buildParameters = buildParameters;\r\n this.baseImage = baseImage;\r\n this.pvcName = pvcName;\r\n this.secretName = secretName;\r\n this.jobName = jobName;\r\n this.namespace = namespace;\r\n yield Kubernetes.createSecret();\r\n yield Kubernetes.createPersistentVolumeClaim();\r\n yield Kubernetes.scheduleBuildJob();\r\n yield Kubernetes.watchBuildJobUntilFinished();\r\n yield Kubernetes.cleanup();\r\n core.setOutput('volume', pvcName);\r\n });\r\n }\r\n static createSecret() {\r\n return __awaiter(this, void 0, void 0, function* () {\r\n const secretManifest = {\r\n apiVersion: 'v1',\r\n kind: 'Secret',\r\n metadata: {\r\n name: this.secretName,\r\n },\r\n type: 'Opaque',\r\n data: {\r\n GITHUB_TOKEN: base64.encode(this.buildParameters.githubToken),\r\n UNITY_LICENSE: base64.encode(process.env.UNITY_LICENSE),\r\n ANDROID_KEYSTORE_BASE64: base64.encode(this.buildParameters.androidKeystoreBase64),\r\n ANDROID_KEYSTORE_PASS: base64.encode(this.buildParameters.androidKeystorePass),\r\n ANDROID_KEYALIAS_PASS: base64.encode(this.buildParameters.androidKeyaliasPass),\r\n },\r\n };\r\n yield this.kubeClient.api.v1.namespaces(this.namespace).secrets.post({ body: secretManifest });\r\n });\r\n }\r\n static createPersistentVolumeClaim() {\r\n return __awaiter(this, void 0, void 0, function* () {\r\n if (this.buildParameters.kubeVolume) {\r\n core.info(this.buildParameters.kubeVolume);\r\n this.pvcName = this.buildParameters.kubeVolume;\r\n return;\r\n }\r\n const pvcManifest = {\r\n apiVersion: 'v1',\r\n kind: 'PersistentVolumeClaim',\r\n metadata: {\r\n name: this.pvcName,\r\n },\r\n spec: {\r\n accessModes: ['ReadWriteOnce'],\r\n volumeMode: 'Filesystem',\r\n resources: {\r\n requests: {\r\n storage: this.buildParameters.kubeVolumeSize,\r\n },\r\n },\r\n },\r\n };\r\n yield this.kubeClient.api.v1.namespaces(this.namespace).persistentvolumeclaims.post({ body: pvcManifest });\r\n core.info('Persistent Volume created, waiting for ready state...');\r\n yield Kubernetes.watchPersistentVolumeClaimUntilReady();\r\n core.info('Persistent Volume ready for claims');\r\n });\r\n }\r\n static watchPersistentVolumeClaimUntilReady() {\r\n return __awaiter(this, void 0, void 0, function* () {\r\n yield new Promise((resolve) => setTimeout(resolve, pollInterval));\r\n const queryResult = yield this.kubeClient.api.v1\r\n .namespaces(this.namespace)\r\n .persistentvolumeclaims(this.pvcName)\r\n .get();\r\n if (queryResult.body.status.phase === 'Pending') {\r\n yield Kubernetes.watchPersistentVolumeClaimUntilReady();\r\n }\r\n });\r\n }\r\n static scheduleBuildJob() {\r\n return __awaiter(this, void 0, void 0, function* () {\r\n core.info('Creating build job');\r\n const jobManifest = {\r\n apiVersion: 'batch/v1',\r\n kind: 'Job',\r\n metadata: {\r\n name: this.jobName,\r\n labels: {\r\n app: 'unity-builder',\r\n },\r\n },\r\n spec: {\r\n template: {\r\n backoffLimit: 1,\r\n spec: {\r\n volumes: [\r\n {\r\n name: 'data',\r\n persistentVolumeClaim: {\r\n claimName: this.pvcName,\r\n },\r\n },\r\n {\r\n name: 'credentials',\r\n secret: {\r\n secretName: this.secretName,\r\n },\r\n },\r\n ],\r\n initContainers: [\r\n {\r\n name: 'clone',\r\n image: 'alpine/git',\r\n command: [\r\n '/bin/sh',\r\n '-c',\r\n `apk update;\r\n apk add git-lfs;\r\n export GITHUB_TOKEN=$(cat /credentials/GITHUB_TOKEN);\r\n cd /data;\r\n git clone https://github.com/${process.env.GITHUB_REPOSITORY}.git repo;\r\n git clone https://github.com/webbertakken/unity-builder.git builder;\r\n cd repo;\r\n git checkout $GITHUB_SHA;\r\n ls`,\r\n ],\r\n volumeMounts: [\r\n {\r\n name: 'data',\r\n mountPath: '/data',\r\n },\r\n {\r\n name: 'credentials',\r\n mountPath: '/credentials',\r\n readOnly: true,\r\n },\r\n ],\r\n env: [\r\n {\r\n name: 'GITHUB_SHA',\r\n value: this.buildId,\r\n },\r\n ],\r\n },\r\n ],\r\n containers: [\r\n {\r\n name: 'main',\r\n image: `${this.baseImage.toString()}`,\r\n command: [\r\n 'bin/bash',\r\n '-c',\r\n `for f in ./credentials/*; do export $(basename $f)=\"$(cat $f)\"; done\r\n cp -r /data/builder/action/default-build-script /UnityBuilderAction\r\n cp -r /data/builder/action/entrypoint.sh /entrypoint.sh\r\n cp -r /data/builder/action/steps /steps\r\n chmod -R +x /entrypoint.sh;\r\n chmod -R +x /steps;\r\n /entrypoint.sh;\r\n `,\r\n ],\r\n resources: {\r\n requests: {\r\n memory: this.buildParameters.kubeContainerMemory,\r\n cpu: this.buildParameters.kubeContainerCPU,\r\n },\r\n },\r\n env: [\r\n {\r\n name: 'GITHUB_WORKSPACE',\r\n value: '/data/repo',\r\n },\r\n {\r\n name: 'PROJECT_PATH',\r\n value: this.buildParameters.projectPath,\r\n },\r\n {\r\n name: 'BUILD_PATH',\r\n value: this.buildParameters.buildPath,\r\n },\r\n {\r\n name: 'BUILD_FILE',\r\n value: this.buildParameters.buildFile,\r\n },\r\n {\r\n name: 'BUILD_NAME',\r\n value: this.buildParameters.buildName,\r\n },\r\n {\r\n name: 'BUILD_METHOD',\r\n value: this.buildParameters.buildMethod,\r\n },\r\n {\r\n name: 'CUSTOM_PARAMETERS',\r\n value: this.buildParameters.customParameters,\r\n },\r\n {\r\n name: 'BUILD_TARGET',\r\n value: this.buildParameters.platform,\r\n },\r\n {\r\n name: 'ANDROID_VERSION_CODE',\r\n value: this.buildParameters.androidVersionCode.toString(),\r\n },\r\n {\r\n name: 'ANDROID_KEYSTORE_NAME',\r\n value: this.buildParameters.androidKeystoreName,\r\n },\r\n {\r\n name: 'ANDROID_KEYALIAS_NAME',\r\n value: this.buildParameters.androidKeyaliasName,\r\n },\r\n ],\r\n volumeMounts: [\r\n {\r\n name: 'data',\r\n mountPath: '/data',\r\n },\r\n {\r\n name: 'credentials',\r\n mountPath: '/credentials',\r\n readOnly: true,\r\n },\r\n ],\r\n lifeCycle: {\r\n preStop: {\r\n exec: {\r\n command: [\r\n 'bin/bash',\r\n '-c',\r\n `cd /data/builder/action/steps;\r\n chmod +x /return_license.sh;\r\n /return_license.sh;`,\r\n ],\r\n },\r\n },\r\n },\r\n },\r\n ],\r\n restartPolicy: 'Never',\r\n },\r\n },\r\n },\r\n };\r\n yield this.kubeClient.apis.batch.v1.namespaces(this.namespace).jobs.post({ body: jobManifest });\r\n core.info('Job created');\r\n });\r\n }\r\n static watchBuildJobUntilFinished() {\r\n return __awaiter(this, void 0, void 0, function* () {\r\n let podname;\r\n let ready = false;\r\n while (!ready) {\r\n yield new Promise((resolve) => setTimeout(resolve, pollInterval));\r\n const pods = yield this.kubeClient.api.v1.namespaces(this.namespace).pods.get();\r\n for (let index = 0; index < pods.body.items.length; index++) {\r\n const element = pods.body.items[index];\r\n if (element.metadata.labels['job-name'] === this.jobName && element.status.phase !== 'Pending') {\r\n core.info('Pod no longer pending');\r\n if (element.status.phase === 'Failure') {\r\n core.error('Kubernetes job failed');\r\n }\r\n else {\r\n ready = true;\r\n podname = element.metadata.name;\r\n }\r\n }\r\n }\r\n }\r\n core.info(`Watching build job ${podname}`);\r\n let logQueryTime;\r\n let complete = false;\r\n while (!complete) {\r\n yield new Promise((resolve) => setTimeout(resolve, pollInterval));\r\n const podStatus = yield this.kubeClient.api.v1.namespaces(this.namespace).pod(podname).get();\r\n if (podStatus.body.status.phase !== 'Running') {\r\n complete = true;\r\n }\r\n const logs = yield this.kubeClient.api.v1\r\n .namespaces(this.namespace)\r\n .pod(podname)\r\n .log.get({\r\n qs: {\r\n sinceTime: logQueryTime,\r\n timestamps: true,\r\n },\r\n });\r\n if (logs.body !== undefined) {\r\n const arrayOfLines = logs.body.match(/[^\\n\\r]+/g).reverse();\r\n for (const element of arrayOfLines) {\r\n const [time, ...line] = element.split(' ');\r\n if (time !== logQueryTime) {\r\n core.info(line.join(' '));\r\n }\r\n else {\r\n break;\r\n }\r\n }\r\n if (podStatus.body.status.phase === 'Failed') {\r\n throw new Error('Kubernetes job failed');\r\n }\r\n logQueryTime = arrayOfLines[0].split(' ')[0];\r\n }\r\n }\r\n });\r\n }\r\n static cleanup() {\r\n return __awaiter(this, void 0, void 0, function* () {\r\n yield this.kubeClient.apis.batch.v1.namespaces(this.namespace).jobs(this.jobName).delete();\r\n yield this.kubeClient.api.v1.namespaces(this.namespace).secrets(this.secretName).delete();\r\n });\r\n }\r\n static uuidv4() {\r\n return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, (c) => {\r\n const r = Math.trunc(Math.random() * 16);\r\n const v = c === 'x' ? r : (r & 0x3) | 0x8;\r\n return v.toString(16);\r\n });\r\n }\r\n}\r\nexports.default = Kubernetes;\r\n","\"use strict\";\r\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\r\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\r\n return new (P || (P = Promise))(function (resolve, reject) {\r\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\r\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\r\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\r\n step((generator = generator.apply(thisArg, _arguments || [])).next());\r\n });\r\n};\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nconst core = require('@actions/core');\r\nclass Output {\r\n static setBuildVersion(buildVersion) {\r\n return __awaiter(this, void 0, void 0, function* () {\r\n yield core.setOutput('buildVersion', buildVersion);\r\n });\r\n }\r\n}\r\nexports.default = Output;\r\n","\"use strict\";\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nclass Platform {\r\n static get default() {\r\n return Platform.types.StandaloneWindows64;\r\n }\r\n static get types() {\r\n return {\r\n StandaloneOSX: 'StandaloneOSX',\r\n StandaloneWindows: 'StandaloneWindows',\r\n StandaloneWindows64: 'StandaloneWindows64',\r\n StandaloneLinux64: 'StandaloneLinux64',\r\n iOS: 'iOS',\r\n Android: 'Android',\r\n WebGL: 'WebGL',\r\n WSAPlayer: 'WSAPlayer',\r\n PS4: 'PS4',\r\n XboxOne: 'XboxOne',\r\n tvOS: 'tvOS',\r\n Switch: 'Switch',\r\n // Unsupported\r\n Lumin: 'Lumin',\r\n BJM: 'BJM',\r\n Stadia: 'Stadia',\r\n Facebook: 'Facebook',\r\n NoTarget: 'NoTarget',\r\n // Test specific\r\n Test: 'Test',\r\n };\r\n }\r\n static isWindows(platform) {\r\n switch (platform) {\r\n case Platform.types.StandaloneWindows:\r\n case Platform.types.StandaloneWindows64:\r\n return true;\r\n default:\r\n return false;\r\n }\r\n }\r\n static isAndroid(platform) {\r\n switch (platform) {\r\n case Platform.types.Android:\r\n return true;\r\n default:\r\n return false;\r\n }\r\n }\r\n}\r\nexports.default = Platform;\r\n","\"use strict\";\r\nvar __importDefault = (this && this.__importDefault) || function (mod) {\r\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\r\n};\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nconst input_1 = __importDefault(require(\"./input\"));\r\nconst unity_1 = __importDefault(require(\"./unity\"));\r\nconst action_1 = __importDefault(require(\"./action\"));\r\nclass Project {\r\n static get relativePath() {\r\n const { projectPath } = input_1.default;\r\n return `${projectPath}`;\r\n }\r\n static get absolutePath() {\r\n const { workspace } = action_1.default;\r\n return `${workspace}/${this.relativePath}`;\r\n }\r\n static get libraryFolder() {\r\n return `${this.relativePath}/${unity_1.default.libraryFolder}`;\r\n }\r\n}\r\nexports.default = Project;\r\n","\"use strict\";\r\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\r\n}) : (function(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n o[k2] = m[k];\r\n}));\r\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\r\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\r\n}) : function(o, v) {\r\n o[\"default\"] = v;\r\n});\r\nvar __importStar = (this && this.__importStar) || function (mod) {\r\n if (mod && mod.__esModule) return mod;\r\n var result = {};\r\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\r\n __setModuleDefault(result, mod);\r\n return result;\r\n};\r\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\r\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\r\n return new (P || (P = Promise))(function (resolve, reject) {\r\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\r\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\r\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\r\n step((generator = generator.apply(thisArg, _arguments || [])).next());\r\n });\r\n};\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nconst core = __importStar(require(\"@actions/core\"));\r\nconst exec_1 = require(\"@actions/exec\");\r\nclass System {\r\n static run(command, arguments_ = [], options = {}) {\r\n return __awaiter(this, void 0, void 0, function* () {\r\n let result = '';\r\n let error = '';\r\n let debug = '';\r\n const listeners = {\r\n stdout: (dataBuffer) => {\r\n result += dataBuffer.toString();\r\n },\r\n stderr: (dataBuffer) => {\r\n error += dataBuffer.toString();\r\n },\r\n debug: (dataString) => {\r\n debug += dataString.toString();\r\n },\r\n };\r\n const showOutput = () => {\r\n if (debug !== '') {\r\n core.debug(debug);\r\n }\r\n if (result !== '') {\r\n core.info(result);\r\n }\r\n if (error !== '') {\r\n core.warning(error);\r\n }\r\n };\r\n const throwContextualError = (message) => {\r\n let commandAsString = command;\r\n if (Array.isArray(arguments_)) {\r\n commandAsString += ` ${arguments_.join(' ')}`;\r\n }\r\n else if (typeof arguments_ === 'string') {\r\n commandAsString += ` ${arguments_}`;\r\n }\r\n throw new Error(`Failed to run \"${commandAsString}\".\\n ${message}`);\r\n };\r\n try {\r\n const exitCode = yield exec_1.exec(command, arguments_, Object.assign({ silent: true, listeners }, options));\r\n showOutput();\r\n if (exitCode !== 0) {\r\n throwContextualError(`Command returned non-zero exit code.\\nError: ${error}`);\r\n }\r\n }\r\n catch (inCommandError) {\r\n showOutput();\r\n throwContextualError(`In-command error caught: ${inCommandError}`);\r\n }\r\n return result;\r\n });\r\n }\r\n}\r\nexports.default = System;\r\n","\"use strict\";\r\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\r\n}) : (function(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n o[k2] = m[k];\r\n}));\r\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\r\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\r\n}) : function(o, v) {\r\n o[\"default\"] = v;\r\n});\r\nvar __importStar = (this && this.__importStar) || function (mod) {\r\n if (mod && mod.__esModule) return mod;\r\n var result = {};\r\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\r\n __setModuleDefault(result, mod);\r\n return result;\r\n};\r\nvar __importDefault = (this && this.__importDefault) || function (mod) {\r\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\r\n};\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nconst core = __importStar(require(\"@actions/core\"));\r\nconst fs = __importStar(require(\"fs\"));\r\nconst path_1 = __importDefault(require(\"path\"));\r\nclass UnityVersioning {\r\n static get versionPattern() {\r\n return /20\\d{2}\\.\\d\\.\\w{3,4}|3/;\r\n }\r\n static determineUnityVersion(projectPath, unityVersion) {\r\n if (unityVersion === 'auto') {\r\n return UnityVersioning.read(projectPath);\r\n }\r\n return unityVersion;\r\n }\r\n static read(projectPath) {\r\n const filePath = path_1.default.join(projectPath, 'ProjectSettings', 'ProjectVersion.txt');\r\n if (!fs.existsSync(filePath)) {\r\n core.warning(`Could not find \"${filePath}\", keeping unityVersion as \"auto\"`);\r\n return 'auto';\r\n }\r\n return UnityVersioning.parse(fs.readFileSync(filePath, 'utf8'));\r\n }\r\n static parse(projectVersionTxt) {\r\n const matches = projectVersionTxt.match(UnityVersioning.versionPattern);\r\n if (!matches || matches.length === 0) {\r\n throw new Error(`Failed to parse version from \"${projectVersionTxt}\".`);\r\n }\r\n return matches[0];\r\n }\r\n}\r\nexports.default = UnityVersioning;\r\n","\"use strict\";\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nclass Unity {\r\n static get libraryFolder() {\r\n return 'Library';\r\n }\r\n}\r\nexports.default = Unity;\r\n","\"use strict\";\r\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\r\n}) : (function(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n o[k2] = m[k];\r\n}));\r\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\r\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\r\n}) : function(o, v) {\r\n o[\"default\"] = v;\r\n});\r\nvar __importStar = (this && this.__importStar) || function (mod) {\r\n if (mod && mod.__esModule) return mod;\r\n var result = {};\r\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\r\n __setModuleDefault(result, mod);\r\n return result;\r\n};\r\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\r\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\r\n return new (P || (P = Promise))(function (resolve, reject) {\r\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\r\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\r\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\r\n step((generator = generator.apply(thisArg, _arguments || [])).next());\r\n });\r\n};\r\nvar __importDefault = (this && this.__importDefault) || function (mod) {\r\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\r\n};\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nconst core = __importStar(require(\"@actions/core\"));\r\nconst not_implemented_exception_1 = __importDefault(require(\"./error/not-implemented-exception\"));\r\nconst validation_error_1 = __importDefault(require(\"./error/validation-error\"));\r\nconst input_1 = __importDefault(require(\"./input\"));\r\nconst system_1 = __importDefault(require(\"./system\"));\r\nclass Versioning {\r\n static get projectPath() {\r\n return input_1.default.projectPath;\r\n }\r\n static get isDirtyAllowed() {\r\n return input_1.default.allowDirtyBuild;\r\n }\r\n static get strategies() {\r\n return { None: 'None', Semantic: 'Semantic', Tag: 'Tag', Custom: 'Custom' };\r\n }\r\n /**\r\n * Get the branch name of the (related) branch\r\n */\r\n static get branch() {\r\n // Todo - use optional chaining (https://github.com/zeit/ncc/issues/534)\r\n return this.headRef || (this.ref && this.ref.slice(11));\r\n }\r\n /**\r\n * For pull requests we can reliably use GITHUB_HEAD_REF\r\n */\r\n static get headRef() {\r\n return process.env.GITHUB_HEAD_REF;\r\n }\r\n /**\r\n * For branches GITHUB_REF will have format `refs/heads/feature-branch-1`\r\n */\r\n static get ref() {\r\n return process.env.GITHUB_REF;\r\n }\r\n /**\r\n * The commit SHA that triggered the workflow run.\r\n */\r\n static get sha() {\r\n return process.env.GITHUB_SHA;\r\n }\r\n /**\r\n * Maximum number of lines to print when logging the git diff\r\n */\r\n static get maxDiffLines() {\r\n return 60;\r\n }\r\n /**\r\n * Log up to maxDiffLines of the git diff.\r\n */\r\n static logDiff() {\r\n return __awaiter(this, void 0, void 0, function* () {\r\n const diffCommand = `git --no-pager diff | head -n ${this.maxDiffLines.toString()}`;\r\n yield system_1.default.run('sh', undefined, {\r\n input: Buffer.from(diffCommand),\r\n silent: true,\r\n });\r\n });\r\n }\r\n /**\r\n * Regex to parse version description into separate fields\r\n */\r\n static get descriptionRegex1() {\r\n return /^v([\\d.]+)-(\\d+)-g(\\w+)-?(\\w+)*/g;\r\n }\r\n static get descriptionRegex2() {\r\n return /^v([\\d.]+-\\w+)-(\\d+)-g(\\w+)-?(\\w+)*/g;\r\n }\r\n static get descriptionRegex3() {\r\n return /^v([\\d.]+-\\w+\\.\\d+)-(\\d+)-g(\\w+)-?(\\w+)*/g;\r\n }\r\n static determineVersion(strategy, inputVersion) {\r\n return __awaiter(this, void 0, void 0, function* () {\r\n // Validate input\r\n if (!Object.hasOwnProperty.call(this.strategies, strategy)) {\r\n throw new validation_error_1.default(`Versioning strategy should be one of ${Object.values(this.strategies).join(', ')}.`);\r\n }\r\n let version;\r\n switch (strategy) {\r\n case this.strategies.None:\r\n version = 'none';\r\n break;\r\n case this.strategies.Custom:\r\n version = inputVersion;\r\n break;\r\n case this.strategies.Semantic:\r\n version = yield this.generateSemanticVersion();\r\n break;\r\n case this.strategies.Tag:\r\n version = yield this.generateTagVersion();\r\n break;\r\n default:\r\n throw new not_implemented_exception_1.default(`Strategy ${strategy} is not implemented.`);\r\n }\r\n return version;\r\n });\r\n }\r\n /**\r\n * Automatically generates a version based on SemVer out of the box.\r\n *\r\n * The version works as follows: `..` for example `0.1.2`.\r\n *\r\n * The latest tag dictates `.`\r\n * The number of commits since that tag dictates``.\r\n *\r\n * @See: https://semver.org/\r\n */\r\n static generateSemanticVersion() {\r\n return __awaiter(this, void 0, void 0, function* () {\r\n if (yield this.isShallow()) {\r\n yield this.fetch();\r\n }\r\n yield this.logDiff();\r\n if ((yield this.isDirty()) && !this.isDirtyAllowed) {\r\n throw new Error('Branch is dirty. Refusing to base semantic version on uncommitted changes');\r\n }\r\n if (!(yield this.hasAnyVersionTags())) {\r\n const version = `0.0.${yield this.getTotalNumberOfCommits()}`;\r\n core.info(`Generated version ${version} (no version tags found).`);\r\n return version;\r\n }\r\n const versionDescriptor = yield this.parseSemanticVersion();\r\n if (versionDescriptor) {\r\n const { tag, commits, hash } = versionDescriptor;\r\n // Ensure 3 digits (commits should always be patch level)\r\n const [major, minor, patch] = `${tag}.${commits}`.split('.');\r\n const threeDigitVersion = /^\\d+$/.test(patch) ? `${major}.${minor}.${patch}` : `${major}.0.${minor}`;\r\n core.info(`Found semantic version ${threeDigitVersion} for ${this.branch}@${hash}`);\r\n return `${threeDigitVersion}`;\r\n }\r\n const version = `0.0.${yield this.getTotalNumberOfCommits()}`;\r\n core.info(`Generated version ${version} (semantic version couldn't be determined).`);\r\n return version;\r\n });\r\n }\r\n /**\r\n * Generate the proper version for unity based on an existing tag.\r\n */\r\n static generateTagVersion() {\r\n return __awaiter(this, void 0, void 0, function* () {\r\n let tag = yield this.getTag();\r\n if (tag.charAt(0) === 'v') {\r\n tag = tag.slice(1);\r\n }\r\n return tag;\r\n });\r\n }\r\n /**\r\n * Parses the versionDescription into their named parts.\r\n */\r\n static parseSemanticVersion() {\r\n return __awaiter(this, void 0, void 0, function* () {\r\n const description = yield this.getVersionDescription();\r\n try {\r\n const [match, tag, commits, hash] = this.descriptionRegex1.exec(description);\r\n return {\r\n match,\r\n tag,\r\n commits,\r\n hash,\r\n };\r\n }\r\n catch (_a) {\r\n try {\r\n const [match, tag, commits, hash] = this.descriptionRegex2.exec(description);\r\n return {\r\n match,\r\n tag,\r\n commits,\r\n hash,\r\n };\r\n }\r\n catch (_b) {\r\n try {\r\n const [match, tag, commits, hash] = this.descriptionRegex3.exec(description);\r\n return {\r\n match,\r\n tag,\r\n commits,\r\n hash,\r\n };\r\n }\r\n catch (_c) {\r\n core.warning(`Failed to parse git describe output or version can not be determined through: \"${description}\".`);\r\n return false;\r\n }\r\n }\r\n }\r\n });\r\n }\r\n /**\r\n * Returns whether the repository is shallow.\r\n */\r\n static isShallow() {\r\n return __awaiter(this, void 0, void 0, function* () {\r\n const output = yield this.git(['rev-parse', '--is-shallow-repository']);\r\n return output !== 'false\\n';\r\n });\r\n }\r\n /**\r\n * Retrieves refs from the configured remote.\r\n *\r\n * Fetch unshallow for incomplete repository, but fall back to normal fetch.\r\n *\r\n * Note: `--all` should not be used, and would break fetching for push event.\r\n */\r\n static fetch() {\r\n return __awaiter(this, void 0, void 0, function* () {\r\n try {\r\n yield this.git(['fetch', '--unshallow']);\r\n }\r\n catch (error) {\r\n core.warning(`Fetch --unshallow caught: ${error}`);\r\n yield this.git(['fetch']);\r\n }\r\n });\r\n }\r\n /**\r\n * Retrieves information about the branch.\r\n *\r\n * Format: `v0.12-24-gd2198ab`\r\n *\r\n * In this format v0.12 is the latest tag, 24 are the number of commits since, and gd2198ab\r\n * identifies the current commit.\r\n */\r\n static getVersionDescription() {\r\n return __awaiter(this, void 0, void 0, function* () {\r\n return this.git(['describe', '--long', '--tags', '--always', this.sha]);\r\n });\r\n }\r\n /**\r\n * Returns whether there are uncommitted changes that are not ignored.\r\n */\r\n static isDirty() {\r\n return __awaiter(this, void 0, void 0, function* () {\r\n const output = yield this.git(['status', '--porcelain']);\r\n return output !== '';\r\n });\r\n }\r\n /**\r\n * Get the tag if there is one pointing at HEAD\r\n */\r\n static getTag() {\r\n return __awaiter(this, void 0, void 0, function* () {\r\n return this.git(['tag', '--points-at', 'HEAD']);\r\n });\r\n }\r\n /**\r\n * Whether or not the repository has any version tags yet.\r\n */\r\n static hasAnyVersionTags() {\r\n return __awaiter(this, void 0, void 0, function* () {\r\n const numberOfCommitsAsString = yield system_1.default.run('sh', undefined, {\r\n input: Buffer.from('git tag --list --merged HEAD | grep v[0-9]* | wc -l'),\r\n silent: false,\r\n });\r\n const numberOfCommits = Number.parseInt(numberOfCommitsAsString, 10);\r\n return numberOfCommits !== 0;\r\n });\r\n }\r\n /**\r\n * Get the total number of commits on head.\r\n *\r\n * Note: HEAD should not be used, as it may be detached, resulting in an additional count.\r\n */\r\n static getTotalNumberOfCommits() {\r\n return __awaiter(this, void 0, void 0, function* () {\r\n const numberOfCommitsAsString = yield this.git(['rev-list', '--count', this.sha]);\r\n return Number.parseInt(numberOfCommitsAsString, 10);\r\n });\r\n }\r\n /**\r\n * Run git in the specified project path\r\n */\r\n static git(arguments_, options = {}) {\r\n return __awaiter(this, void 0, void 0, function* () {\r\n return system_1.default.run('git', arguments_, Object.assign({ cwd: this.projectPath }, options));\r\n });\r\n }\r\n}\r\nexports.default = Versioning;\r\n","\"use strict\";\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];\n result[\"default\"] = mod;\n return result;\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst os = __importStar(require(\"os\"));\nconst utils_1 = require(\"./utils\");\n/**\n * Commands\n *\n * Command Format:\n * ::name key=value,key=value::message\n *\n * Examples:\n * ::warning::This is the message\n * ::set-env name=MY_VAR::some value\n */\nfunction issueCommand(command, properties, message) {\n const cmd = new Command(command, properties, message);\n process.stdout.write(cmd.toString() + os.EOL);\n}\nexports.issueCommand = issueCommand;\nfunction issue(name, message = '') {\n issueCommand(name, {}, message);\n}\nexports.issue = issue;\nconst CMD_STRING = '::';\nclass Command {\n constructor(command, properties, message) {\n if (!command) {\n command = 'missing.command';\n }\n this.command = command;\n this.properties = properties;\n this.message = message;\n }\n toString() {\n let cmdStr = CMD_STRING + this.command;\n if (this.properties && Object.keys(this.properties).length > 0) {\n cmdStr += ' ';\n let first = true;\n for (const key in this.properties) {\n if (this.properties.hasOwnProperty(key)) {\n const val = this.properties[key];\n if (val) {\n if (first) {\n first = false;\n }\n else {\n cmdStr += ',';\n }\n cmdStr += `${key}=${escapeProperty(val)}`;\n }\n }\n }\n }\n cmdStr += `${CMD_STRING}${escapeData(this.message)}`;\n return cmdStr;\n }\n}\nfunction escapeData(s) {\n return utils_1.toCommandValue(s)\n .replace(/%/g, '%25')\n .replace(/\\r/g, '%0D')\n .replace(/\\n/g, '%0A');\n}\nfunction escapeProperty(s) {\n return utils_1.toCommandValue(s)\n .replace(/%/g, '%25')\n .replace(/\\r/g, '%0D')\n .replace(/\\n/g, '%0A')\n .replace(/:/g, '%3A')\n .replace(/,/g, '%2C');\n}\n//# sourceMappingURL=command.js.map","\"use strict\";\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];\n result[\"default\"] = mod;\n return result;\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst command_1 = require(\"./command\");\nconst file_command_1 = require(\"./file-command\");\nconst utils_1 = require(\"./utils\");\nconst os = __importStar(require(\"os\"));\nconst path = __importStar(require(\"path\"));\n/**\n * The code to exit an action\n */\nvar ExitCode;\n(function (ExitCode) {\n /**\n * A code indicating that the action was successful\n */\n ExitCode[ExitCode[\"Success\"] = 0] = \"Success\";\n /**\n * A code indicating that the action was a failure\n */\n ExitCode[ExitCode[\"Failure\"] = 1] = \"Failure\";\n})(ExitCode = exports.ExitCode || (exports.ExitCode = {}));\n//-----------------------------------------------------------------------\n// Variables\n//-----------------------------------------------------------------------\n/**\n * Sets env variable for this action and future actions in the job\n * @param name the name of the variable to set\n * @param val the value of the variable. Non-string values will be converted to a string via JSON.stringify\n */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nfunction exportVariable(name, val) {\n const convertedVal = utils_1.toCommandValue(val);\n process.env[name] = convertedVal;\n const filePath = process.env['GITHUB_ENV'] || '';\n if (filePath) {\n const delimiter = '_GitHubActionsFileCommandDelimeter_';\n const commandValue = `${name}<<${delimiter}${os.EOL}${convertedVal}${os.EOL}${delimiter}`;\n file_command_1.issueCommand('ENV', commandValue);\n }\n else {\n command_1.issueCommand('set-env', { name }, convertedVal);\n }\n}\nexports.exportVariable = exportVariable;\n/**\n * Registers a secret which will get masked from logs\n * @param secret value of the secret\n */\nfunction setSecret(secret) {\n command_1.issueCommand('add-mask', {}, secret);\n}\nexports.setSecret = setSecret;\n/**\n * Prepends inputPath to the PATH (for this action and future actions)\n * @param inputPath\n */\nfunction addPath(inputPath) {\n const filePath = process.env['GITHUB_PATH'] || '';\n if (filePath) {\n file_command_1.issueCommand('PATH', inputPath);\n }\n else {\n command_1.issueCommand('add-path', {}, inputPath);\n }\n process.env['PATH'] = `${inputPath}${path.delimiter}${process.env['PATH']}`;\n}\nexports.addPath = addPath;\n/**\n * Gets the value of an input. The value is also trimmed.\n *\n * @param name name of the input to get\n * @param options optional. See InputOptions.\n * @returns string\n */\nfunction getInput(name, options) {\n const val = process.env[`INPUT_${name.replace(/ /g, '_').toUpperCase()}`] || '';\n if (options && options.required && !val) {\n throw new Error(`Input required and not supplied: ${name}`);\n }\n return val.trim();\n}\nexports.getInput = getInput;\n/**\n * Sets the value of an output.\n *\n * @param name name of the output to set\n * @param value value to store. Non-string values will be converted to a string via JSON.stringify\n */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nfunction setOutput(name, value) {\n process.stdout.write(os.EOL);\n command_1.issueCommand('set-output', { name }, value);\n}\nexports.setOutput = setOutput;\n/**\n * Enables or disables the echoing of commands into stdout for the rest of the step.\n * Echoing is disabled by default if ACTIONS_STEP_DEBUG is not set.\n *\n */\nfunction setCommandEcho(enabled) {\n command_1.issue('echo', enabled ? 'on' : 'off');\n}\nexports.setCommandEcho = setCommandEcho;\n//-----------------------------------------------------------------------\n// Results\n//-----------------------------------------------------------------------\n/**\n * Sets the action status to failed.\n * When the action exits it will be with an exit code of 1\n * @param message add error issue message\n */\nfunction setFailed(message) {\n process.exitCode = ExitCode.Failure;\n error(message);\n}\nexports.setFailed = setFailed;\n//-----------------------------------------------------------------------\n// Logging Commands\n//-----------------------------------------------------------------------\n/**\n * Gets whether Actions Step Debug is on or not\n */\nfunction isDebug() {\n return process.env['RUNNER_DEBUG'] === '1';\n}\nexports.isDebug = isDebug;\n/**\n * Writes debug message to user log\n * @param message debug message\n */\nfunction debug(message) {\n command_1.issueCommand('debug', {}, message);\n}\nexports.debug = debug;\n/**\n * Adds an error issue\n * @param message error issue message. Errors will be converted to string via toString()\n */\nfunction error(message) {\n command_1.issue('error', message instanceof Error ? message.toString() : message);\n}\nexports.error = error;\n/**\n * Adds an warning issue\n * @param message warning issue message. Errors will be converted to string via toString()\n */\nfunction warning(message) {\n command_1.issue('warning', message instanceof Error ? message.toString() : message);\n}\nexports.warning = warning;\n/**\n * Writes info to log with console.log.\n * @param message info message\n */\nfunction info(message) {\n process.stdout.write(message + os.EOL);\n}\nexports.info = info;\n/**\n * Begin an output group.\n *\n * Output until the next `groupEnd` will be foldable in this group\n *\n * @param name The name of the output group\n */\nfunction startGroup(name) {\n command_1.issue('group', name);\n}\nexports.startGroup = startGroup;\n/**\n * End an output group.\n */\nfunction endGroup() {\n command_1.issue('endgroup');\n}\nexports.endGroup = endGroup;\n/**\n * Wrap an asynchronous function call in a group.\n *\n * Returns the same type as the function itself.\n *\n * @param name The name of the group\n * @param fn The function to wrap in the group\n */\nfunction group(name, fn) {\n return __awaiter(this, void 0, void 0, function* () {\n startGroup(name);\n let result;\n try {\n result = yield fn();\n }\n finally {\n endGroup();\n }\n return result;\n });\n}\nexports.group = group;\n//-----------------------------------------------------------------------\n// Wrapper action state\n//-----------------------------------------------------------------------\n/**\n * Saves state for current action, the state can only be retrieved by this action's post job execution.\n *\n * @param name name of the state to store\n * @param value value to store. Non-string values will be converted to a string via JSON.stringify\n */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nfunction saveState(name, value) {\n command_1.issueCommand('save-state', { name }, value);\n}\nexports.saveState = saveState;\n/**\n * Gets the value of an state set by this action's main execution.\n *\n * @param name name of the state to get\n * @returns string\n */\nfunction getState(name) {\n return process.env[`STATE_${name}`] || '';\n}\nexports.getState = getState;\n//# sourceMappingURL=core.js.map","\"use strict\";\n// For internal use, subject to change.\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];\n result[\"default\"] = mod;\n return result;\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\n// We use any as a valid input type\n/* eslint-disable @typescript-eslint/no-explicit-any */\nconst fs = __importStar(require(\"fs\"));\nconst os = __importStar(require(\"os\"));\nconst utils_1 = require(\"./utils\");\nfunction issueCommand(command, message) {\n const filePath = process.env[`GITHUB_${command}`];\n if (!filePath) {\n throw new Error(`Unable to find environment variable for file command ${command}`);\n }\n if (!fs.existsSync(filePath)) {\n throw new Error(`Missing file at path: ${filePath}`);\n }\n fs.appendFileSync(filePath, `${utils_1.toCommandValue(message)}${os.EOL}`, {\n encoding: 'utf8'\n });\n}\nexports.issueCommand = issueCommand;\n//# sourceMappingURL=file-command.js.map","\"use strict\";\n// We use any as a valid input type\n/* eslint-disable @typescript-eslint/no-explicit-any */\nObject.defineProperty(exports, \"__esModule\", { value: true });\n/**\n * Sanitizes an input into a string so it can be passed into issueCommand safely\n * @param input input to sanitize into a string\n */\nfunction toCommandValue(input) {\n if (input === null || input === undefined) {\n return '';\n }\n else if (typeof input === 'string' || input instanceof String) {\n return input;\n }\n return JSON.stringify(input);\n}\nexports.toCommandValue = toCommandValue;\n//# sourceMappingURL=utils.js.map","\"use strict\";\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];\n result[\"default\"] = mod;\n return result;\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst tr = __importStar(require(\"./toolrunner\"));\n/**\n * Exec a command.\n * Output will be streamed to the live console.\n * Returns promise with return code\n *\n * @param commandLine command to execute (can include additional args). Must be correctly escaped.\n * @param args optional arguments for tool. Escaping is handled by the lib.\n * @param options optional exec options. See ExecOptions\n * @returns Promise exit code\n */\nfunction exec(commandLine, args, options) {\n return __awaiter(this, void 0, void 0, function* () {\n const commandArgs = tr.argStringToArray(commandLine);\n if (commandArgs.length === 0) {\n throw new Error(`Parameter 'commandLine' cannot be null or empty.`);\n }\n // Path to tool to execute should be first arg\n const toolPath = commandArgs[0];\n args = commandArgs.slice(1).concat(args || []);\n const runner = new tr.ToolRunner(toolPath, args, options);\n return runner.exec();\n });\n}\nexports.exec = exec;\n//# sourceMappingURL=exec.js.map","\"use strict\";\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];\n result[\"default\"] = mod;\n return result;\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst os = __importStar(require(\"os\"));\nconst events = __importStar(require(\"events\"));\nconst child = __importStar(require(\"child_process\"));\nconst path = __importStar(require(\"path\"));\nconst io = __importStar(require(\"@actions/io\"));\nconst ioUtil = __importStar(require(\"@actions/io/lib/io-util\"));\n/* eslint-disable @typescript-eslint/unbound-method */\nconst IS_WINDOWS = process.platform === 'win32';\n/*\n * Class for running command line tools. Handles quoting and arg parsing in a platform agnostic way.\n */\nclass ToolRunner extends events.EventEmitter {\n constructor(toolPath, args, options) {\n super();\n if (!toolPath) {\n throw new Error(\"Parameter 'toolPath' cannot be null or empty.\");\n }\n this.toolPath = toolPath;\n this.args = args || [];\n this.options = options || {};\n }\n _debug(message) {\n if (this.options.listeners && this.options.listeners.debug) {\n this.options.listeners.debug(message);\n }\n }\n _getCommandString(options, noPrefix) {\n const toolPath = this._getSpawnFileName();\n const args = this._getSpawnArgs(options);\n let cmd = noPrefix ? '' : '[command]'; // omit prefix when piped to a second tool\n if (IS_WINDOWS) {\n // Windows + cmd file\n if (this._isCmdFile()) {\n cmd += toolPath;\n for (const a of args) {\n cmd += ` ${a}`;\n }\n }\n // Windows + verbatim\n else if (options.windowsVerbatimArguments) {\n cmd += `\"${toolPath}\"`;\n for (const a of args) {\n cmd += ` ${a}`;\n }\n }\n // Windows (regular)\n else {\n cmd += this._windowsQuoteCmdArg(toolPath);\n for (const a of args) {\n cmd += ` ${this._windowsQuoteCmdArg(a)}`;\n }\n }\n }\n else {\n // OSX/Linux - this can likely be improved with some form of quoting.\n // creating processes on Unix is fundamentally different than Windows.\n // on Unix, execvp() takes an arg array.\n cmd += toolPath;\n for (const a of args) {\n cmd += ` ${a}`;\n }\n }\n return cmd;\n }\n _processLineBuffer(data, strBuffer, onLine) {\n try {\n let s = strBuffer + data.toString();\n let n = s.indexOf(os.EOL);\n while (n > -1) {\n const line = s.substring(0, n);\n onLine(line);\n // the rest of the string ...\n s = s.substring(n + os.EOL.length);\n n = s.indexOf(os.EOL);\n }\n strBuffer = s;\n }\n catch (err) {\n // streaming lines to console is best effort. Don't fail a build.\n this._debug(`error processing line. Failed with error ${err}`);\n }\n }\n _getSpawnFileName() {\n if (IS_WINDOWS) {\n if (this._isCmdFile()) {\n return process.env['COMSPEC'] || 'cmd.exe';\n }\n }\n return this.toolPath;\n }\n _getSpawnArgs(options) {\n if (IS_WINDOWS) {\n if (this._isCmdFile()) {\n let argline = `/D /S /C \"${this._windowsQuoteCmdArg(this.toolPath)}`;\n for (const a of this.args) {\n argline += ' ';\n argline += options.windowsVerbatimArguments\n ? a\n : this._windowsQuoteCmdArg(a);\n }\n argline += '\"';\n return [argline];\n }\n }\n return this.args;\n }\n _endsWith(str, end) {\n return str.endsWith(end);\n }\n _isCmdFile() {\n const upperToolPath = this.toolPath.toUpperCase();\n return (this._endsWith(upperToolPath, '.CMD') ||\n this._endsWith(upperToolPath, '.BAT'));\n }\n _windowsQuoteCmdArg(arg) {\n // for .exe, apply the normal quoting rules that libuv applies\n if (!this._isCmdFile()) {\n return this._uvQuoteCmdArg(arg);\n }\n // otherwise apply quoting rules specific to the cmd.exe command line parser.\n // the libuv rules are generic and are not designed specifically for cmd.exe\n // command line parser.\n //\n // for a detailed description of the cmd.exe command line parser, refer to\n // http://stackoverflow.com/questions/4094699/how-does-the-windows-command-interpreter-cmd-exe-parse-scripts/7970912#7970912\n // need quotes for empty arg\n if (!arg) {\n return '\"\"';\n }\n // determine whether the arg needs to be quoted\n const cmdSpecialChars = [\n ' ',\n '\\t',\n '&',\n '(',\n ')',\n '[',\n ']',\n '{',\n '}',\n '^',\n '=',\n ';',\n '!',\n \"'\",\n '+',\n ',',\n '`',\n '~',\n '|',\n '<',\n '>',\n '\"'\n ];\n let needsQuotes = false;\n for (const char of arg) {\n if (cmdSpecialChars.some(x => x === char)) {\n needsQuotes = true;\n break;\n }\n }\n // short-circuit if quotes not needed\n if (!needsQuotes) {\n return arg;\n }\n // the following quoting rules are very similar to the rules that by libuv applies.\n //\n // 1) wrap the string in quotes\n //\n // 2) double-up quotes - i.e. \" => \"\"\n //\n // this is different from the libuv quoting rules. libuv replaces \" with \\\", which unfortunately\n // doesn't work well with a cmd.exe command line.\n //\n // note, replacing \" with \"\" also works well if the arg is passed to a downstream .NET console app.\n // for example, the command line:\n // foo.exe \"myarg:\"\"my val\"\"\"\n // is parsed by a .NET console app into an arg array:\n // [ \"myarg:\\\"my val\\\"\" ]\n // which is the same end result when applying libuv quoting rules. although the actual\n // command line from libuv quoting rules would look like:\n // foo.exe \"myarg:\\\"my val\\\"\"\n //\n // 3) double-up slashes that precede a quote,\n // e.g. hello \\world => \"hello \\world\"\n // hello\\\"world => \"hello\\\\\"\"world\"\n // hello\\\\\"world => \"hello\\\\\\\\\"\"world\"\n // hello world\\ => \"hello world\\\\\"\n //\n // technically this is not required for a cmd.exe command line, or the batch argument parser.\n // the reasons for including this as a .cmd quoting rule are:\n //\n // a) this is optimized for the scenario where the argument is passed from the .cmd file to an\n // external program. many programs (e.g. .NET console apps) rely on the slash-doubling rule.\n //\n // b) it's what we've been doing previously (by deferring to node default behavior) and we\n // haven't heard any complaints about that aspect.\n //\n // note, a weakness of the quoting rules chosen here, is that % is not escaped. in fact, % cannot be\n // escaped when used on the command line directly - even though within a .cmd file % can be escaped\n // by using %%.\n //\n // the saving grace is, on the command line, %var% is left as-is if var is not defined. this contrasts\n // the line parsing rules within a .cmd file, where if var is not defined it is replaced with nothing.\n //\n // one option that was explored was replacing % with ^% - i.e. %var% => ^%var^%. this hack would\n // often work, since it is unlikely that var^ would exist, and the ^ character is removed when the\n // variable is used. the problem, however, is that ^ is not removed when %* is used to pass the args\n // to an external program.\n //\n // an unexplored potential solution for the % escaping problem, is to create a wrapper .cmd file.\n // % can be escaped within a .cmd file.\n let reverse = '\"';\n let quoteHit = true;\n for (let i = arg.length; i > 0; i--) {\n // walk the string in reverse\n reverse += arg[i - 1];\n if (quoteHit && arg[i - 1] === '\\\\') {\n reverse += '\\\\'; // double the slash\n }\n else if (arg[i - 1] === '\"') {\n quoteHit = true;\n reverse += '\"'; // double the quote\n }\n else {\n quoteHit = false;\n }\n }\n reverse += '\"';\n return reverse\n .split('')\n .reverse()\n .join('');\n }\n _uvQuoteCmdArg(arg) {\n // Tool runner wraps child_process.spawn() and needs to apply the same quoting as\n // Node in certain cases where the undocumented spawn option windowsVerbatimArguments\n // is used.\n //\n // Since this function is a port of quote_cmd_arg from Node 4.x (technically, lib UV,\n // see https://github.com/nodejs/node/blob/v4.x/deps/uv/src/win/process.c for details),\n // pasting copyright notice from Node within this function:\n //\n // Copyright Joyent, Inc. and other Node contributors. All rights reserved.\n //\n // Permission is hereby granted, free of charge, to any person obtaining a copy\n // of this software and associated documentation files (the \"Software\"), to\n // deal in the Software without restriction, including without limitation the\n // rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n // sell copies of the Software, and to permit persons to whom the Software is\n // furnished to do so, subject to the following conditions:\n //\n // The above copyright notice and this permission notice shall be included in\n // all copies or substantial portions of the Software.\n //\n // THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\n // IN THE SOFTWARE.\n if (!arg) {\n // Need double quotation for empty argument\n return '\"\"';\n }\n if (!arg.includes(' ') && !arg.includes('\\t') && !arg.includes('\"')) {\n // No quotation needed\n return arg;\n }\n if (!arg.includes('\"') && !arg.includes('\\\\')) {\n // No embedded double quotes or backslashes, so I can just wrap\n // quote marks around the whole thing.\n return `\"${arg}\"`;\n }\n // Expected input/output:\n // input : hello\"world\n // output: \"hello\\\"world\"\n // input : hello\"\"world\n // output: \"hello\\\"\\\"world\"\n // input : hello\\world\n // output: hello\\world\n // input : hello\\\\world\n // output: hello\\\\world\n // input : hello\\\"world\n // output: \"hello\\\\\\\"world\"\n // input : hello\\\\\"world\n // output: \"hello\\\\\\\\\\\"world\"\n // input : hello world\\\n // output: \"hello world\\\\\" - note the comment in libuv actually reads \"hello world\\\"\n // but it appears the comment is wrong, it should be \"hello world\\\\\"\n let reverse = '\"';\n let quoteHit = true;\n for (let i = arg.length; i > 0; i--) {\n // walk the string in reverse\n reverse += arg[i - 1];\n if (quoteHit && arg[i - 1] === '\\\\') {\n reverse += '\\\\';\n }\n else if (arg[i - 1] === '\"') {\n quoteHit = true;\n reverse += '\\\\';\n }\n else {\n quoteHit = false;\n }\n }\n reverse += '\"';\n return reverse\n .split('')\n .reverse()\n .join('');\n }\n _cloneExecOptions(options) {\n options = options || {};\n const result = {\n cwd: options.cwd || process.cwd(),\n env: options.env || process.env,\n silent: options.silent || false,\n windowsVerbatimArguments: options.windowsVerbatimArguments || false,\n failOnStdErr: options.failOnStdErr || false,\n ignoreReturnCode: options.ignoreReturnCode || false,\n delay: options.delay || 10000\n };\n result.outStream = options.outStream || process.stdout;\n result.errStream = options.errStream || process.stderr;\n return result;\n }\n _getSpawnOptions(options, toolPath) {\n options = options || {};\n const result = {};\n result.cwd = options.cwd;\n result.env = options.env;\n result['windowsVerbatimArguments'] =\n options.windowsVerbatimArguments || this._isCmdFile();\n if (options.windowsVerbatimArguments) {\n result.argv0 = `\"${toolPath}\"`;\n }\n return result;\n }\n /**\n * Exec a tool.\n * Output will be streamed to the live console.\n * Returns promise with return code\n *\n * @param tool path to tool to exec\n * @param options optional exec options. See ExecOptions\n * @returns number\n */\n exec() {\n return __awaiter(this, void 0, void 0, function* () {\n // root the tool path if it is unrooted and contains relative pathing\n if (!ioUtil.isRooted(this.toolPath) &&\n (this.toolPath.includes('/') ||\n (IS_WINDOWS && this.toolPath.includes('\\\\')))) {\n // prefer options.cwd if it is specified, however options.cwd may also need to be rooted\n this.toolPath = path.resolve(process.cwd(), this.options.cwd || process.cwd(), this.toolPath);\n }\n // if the tool is only a file name, then resolve it from the PATH\n // otherwise verify it exists (add extension on Windows if necessary)\n this.toolPath = yield io.which(this.toolPath, true);\n return new Promise((resolve, reject) => {\n this._debug(`exec tool: ${this.toolPath}`);\n this._debug('arguments:');\n for (const arg of this.args) {\n this._debug(` ${arg}`);\n }\n const optionsNonNull = this._cloneExecOptions(this.options);\n if (!optionsNonNull.silent && optionsNonNull.outStream) {\n optionsNonNull.outStream.write(this._getCommandString(optionsNonNull) + os.EOL);\n }\n const state = new ExecState(optionsNonNull, this.toolPath);\n state.on('debug', (message) => {\n this._debug(message);\n });\n const fileName = this._getSpawnFileName();\n const cp = child.spawn(fileName, this._getSpawnArgs(optionsNonNull), this._getSpawnOptions(this.options, fileName));\n const stdbuffer = '';\n if (cp.stdout) {\n cp.stdout.on('data', (data) => {\n if (this.options.listeners && this.options.listeners.stdout) {\n this.options.listeners.stdout(data);\n }\n if (!optionsNonNull.silent && optionsNonNull.outStream) {\n optionsNonNull.outStream.write(data);\n }\n this._processLineBuffer(data, stdbuffer, (line) => {\n if (this.options.listeners && this.options.listeners.stdline) {\n this.options.listeners.stdline(line);\n }\n });\n });\n }\n const errbuffer = '';\n if (cp.stderr) {\n cp.stderr.on('data', (data) => {\n state.processStderr = true;\n if (this.options.listeners && this.options.listeners.stderr) {\n this.options.listeners.stderr(data);\n }\n if (!optionsNonNull.silent &&\n optionsNonNull.errStream &&\n optionsNonNull.outStream) {\n const s = optionsNonNull.failOnStdErr\n ? optionsNonNull.errStream\n : optionsNonNull.outStream;\n s.write(data);\n }\n this._processLineBuffer(data, errbuffer, (line) => {\n if (this.options.listeners && this.options.listeners.errline) {\n this.options.listeners.errline(line);\n }\n });\n });\n }\n cp.on('error', (err) => {\n state.processError = err.message;\n state.processExited = true;\n state.processClosed = true;\n state.CheckComplete();\n });\n cp.on('exit', (code) => {\n state.processExitCode = code;\n state.processExited = true;\n this._debug(`Exit code ${code} received from tool '${this.toolPath}'`);\n state.CheckComplete();\n });\n cp.on('close', (code) => {\n state.processExitCode = code;\n state.processExited = true;\n state.processClosed = true;\n this._debug(`STDIO streams have closed for tool '${this.toolPath}'`);\n state.CheckComplete();\n });\n state.on('done', (error, exitCode) => {\n if (stdbuffer.length > 0) {\n this.emit('stdline', stdbuffer);\n }\n if (errbuffer.length > 0) {\n this.emit('errline', errbuffer);\n }\n cp.removeAllListeners();\n if (error) {\n reject(error);\n }\n else {\n resolve(exitCode);\n }\n });\n if (this.options.input) {\n if (!cp.stdin) {\n throw new Error('child process missing stdin');\n }\n cp.stdin.end(this.options.input);\n }\n });\n });\n }\n}\nexports.ToolRunner = ToolRunner;\n/**\n * Convert an arg string to an array of args. Handles escaping\n *\n * @param argString string of arguments\n * @returns string[] array of arguments\n */\nfunction argStringToArray(argString) {\n const args = [];\n let inQuotes = false;\n let escaped = false;\n let arg = '';\n function append(c) {\n // we only escape double quotes.\n if (escaped && c !== '\"') {\n arg += '\\\\';\n }\n arg += c;\n escaped = false;\n }\n for (let i = 0; i < argString.length; i++) {\n const c = argString.charAt(i);\n if (c === '\"') {\n if (!escaped) {\n inQuotes = !inQuotes;\n }\n else {\n append(c);\n }\n continue;\n }\n if (c === '\\\\' && escaped) {\n append(c);\n continue;\n }\n if (c === '\\\\' && inQuotes) {\n escaped = true;\n continue;\n }\n if (c === ' ' && !inQuotes) {\n if (arg.length > 0) {\n args.push(arg);\n arg = '';\n }\n continue;\n }\n append(c);\n }\n if (arg.length > 0) {\n args.push(arg.trim());\n }\n return args;\n}\nexports.argStringToArray = argStringToArray;\nclass ExecState extends events.EventEmitter {\n constructor(options, toolPath) {\n super();\n this.processClosed = false; // tracks whether the process has exited and stdio is closed\n this.processError = '';\n this.processExitCode = 0;\n this.processExited = false; // tracks whether the process has exited\n this.processStderr = false; // tracks whether stderr was written to\n this.delay = 10000; // 10 seconds\n this.done = false;\n this.timeout = null;\n if (!toolPath) {\n throw new Error('toolPath must not be empty');\n }\n this.options = options;\n this.toolPath = toolPath;\n if (options.delay) {\n this.delay = options.delay;\n }\n }\n CheckComplete() {\n if (this.done) {\n return;\n }\n if (this.processClosed) {\n this._setResult();\n }\n else if (this.processExited) {\n this.timeout = setTimeout(ExecState.HandleTimeout, this.delay, this);\n }\n }\n _debug(message) {\n this.emit('debug', message);\n }\n _setResult() {\n // determine whether there is an error\n let error;\n if (this.processExited) {\n if (this.processError) {\n error = new Error(`There was an error when attempting to execute the process '${this.toolPath}'. This may indicate the process failed to start. Error: ${this.processError}`);\n }\n else if (this.processExitCode !== 0 && !this.options.ignoreReturnCode) {\n error = new Error(`The process '${this.toolPath}' failed with exit code ${this.processExitCode}`);\n }\n else if (this.processStderr && this.options.failOnStdErr) {\n error = new Error(`The process '${this.toolPath}' failed because one or more lines were written to the STDERR stream`);\n }\n }\n // clear the timeout\n if (this.timeout) {\n clearTimeout(this.timeout);\n this.timeout = null;\n }\n this.done = true;\n this.emit('done', error, this.processExitCode);\n }\n static HandleTimeout(state) {\n if (state.done) {\n return;\n }\n if (!state.processClosed && state.processExited) {\n const message = `The STDIO streams did not close within ${state.delay /\n 1000} seconds of the exit event from process '${state.toolPath}'. This may indicate a child process inherited the STDIO streams and has not yet exited.`;\n state._debug(message);\n }\n state._setResult();\n }\n}\n//# sourceMappingURL=toolrunner.js.map","\"use strict\";\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];\n result[\"default\"] = mod;\n return result;\n};\nvar _a;\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst assert_1 = require(\"assert\");\nconst fs = __importStar(require(\"fs\"));\nconst path = __importStar(require(\"path\"));\n_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;\nexports.IS_WINDOWS = process.platform === 'win32';\nfunction exists(fsPath) {\n return __awaiter(this, void 0, void 0, function* () {\n try {\n yield exports.stat(fsPath);\n }\n catch (err) {\n if (err.code === 'ENOENT') {\n return false;\n }\n throw err;\n }\n return true;\n });\n}\nexports.exists = exists;\nfunction isDirectory(fsPath, useStat = false) {\n return __awaiter(this, void 0, void 0, function* () {\n const stats = useStat ? yield exports.stat(fsPath) : yield exports.lstat(fsPath);\n return stats.isDirectory();\n });\n}\nexports.isDirectory = isDirectory;\n/**\n * On OSX/Linux, true if path starts with '/'. On Windows, true for paths like:\n * \\, \\hello, \\\\hello\\share, C:, and C:\\hello (and corresponding alternate separator cases).\n */\nfunction isRooted(p) {\n p = normalizeSeparators(p);\n if (!p) {\n throw new Error('isRooted() parameter \"p\" cannot be empty');\n }\n if (exports.IS_WINDOWS) {\n return (p.startsWith('\\\\') || /^[A-Z]:/i.test(p) // e.g. \\ or \\hello or \\\\hello\n ); // e.g. C: or C:\\hello\n }\n return p.startsWith('/');\n}\nexports.isRooted = isRooted;\n/**\n * Recursively create a directory at `fsPath`.\n *\n * This implementation is optimistic, meaning it attempts to create the full\n * path first, and backs up the path stack from there.\n *\n * @param fsPath The path to create\n * @param maxDepth The maximum recursion depth\n * @param depth The current recursion depth\n */\nfunction mkdirP(fsPath, maxDepth = 1000, depth = 1) {\n return __awaiter(this, void 0, void 0, function* () {\n assert_1.ok(fsPath, 'a path argument must be provided');\n fsPath = path.resolve(fsPath);\n if (depth >= maxDepth)\n return exports.mkdir(fsPath);\n try {\n yield exports.mkdir(fsPath);\n return;\n }\n catch (err) {\n switch (err.code) {\n case 'ENOENT': {\n yield mkdirP(path.dirname(fsPath), maxDepth, depth + 1);\n yield exports.mkdir(fsPath);\n return;\n }\n default: {\n let stats;\n try {\n stats = yield exports.stat(fsPath);\n }\n catch (err2) {\n throw err;\n }\n if (!stats.isDirectory())\n throw err;\n }\n }\n }\n });\n}\nexports.mkdirP = mkdirP;\n/**\n * Best effort attempt to determine whether a file exists and is executable.\n * @param filePath file path to check\n * @param extensions additional file extensions to try\n * @return if file exists and is executable, returns the file path. otherwise empty string.\n */\nfunction tryGetExecutablePath(filePath, extensions) {\n return __awaiter(this, void 0, void 0, function* () {\n let stats = undefined;\n try {\n // test file exists\n stats = yield exports.stat(filePath);\n }\n catch (err) {\n if (err.code !== 'ENOENT') {\n // eslint-disable-next-line no-console\n console.log(`Unexpected error attempting to determine if executable file exists '${filePath}': ${err}`);\n }\n }\n if (stats && stats.isFile()) {\n if (exports.IS_WINDOWS) {\n // on Windows, test for valid extension\n const upperExt = path.extname(filePath).toUpperCase();\n if (extensions.some(validExt => validExt.toUpperCase() === upperExt)) {\n return filePath;\n }\n }\n else {\n if (isUnixExecutable(stats)) {\n return filePath;\n }\n }\n }\n // try each extension\n const originalFilePath = filePath;\n for (const extension of extensions) {\n filePath = originalFilePath + extension;\n stats = undefined;\n try {\n stats = yield exports.stat(filePath);\n }\n catch (err) {\n if (err.code !== 'ENOENT') {\n // eslint-disable-next-line no-console\n console.log(`Unexpected error attempting to determine if executable file exists '${filePath}': ${err}`);\n }\n }\n if (stats && stats.isFile()) {\n if (exports.IS_WINDOWS) {\n // preserve the case of the actual file (since an extension was appended)\n try {\n const directory = path.dirname(filePath);\n const upperName = path.basename(filePath).toUpperCase();\n for (const actualName of yield exports.readdir(directory)) {\n if (upperName === actualName.toUpperCase()) {\n filePath = path.join(directory, actualName);\n break;\n }\n }\n }\n catch (err) {\n // eslint-disable-next-line no-console\n console.log(`Unexpected error attempting to determine the actual case of the file '${filePath}': ${err}`);\n }\n return filePath;\n }\n else {\n if (isUnixExecutable(stats)) {\n return filePath;\n }\n }\n }\n }\n return '';\n });\n}\nexports.tryGetExecutablePath = tryGetExecutablePath;\nfunction normalizeSeparators(p) {\n p = p || '';\n if (exports.IS_WINDOWS) {\n // convert slashes on Windows\n p = p.replace(/\\//g, '\\\\');\n // remove redundant slashes\n return p.replace(/\\\\\\\\+/g, '\\\\');\n }\n // remove redundant slashes\n return p.replace(/\\/\\/+/g, '/');\n}\n// on Mac/Linux, test the execute bit\n// R W X R W X R W X\n// 256 128 64 32 16 8 4 2 1\nfunction isUnixExecutable(stats) {\n return ((stats.mode & 1) > 0 ||\n ((stats.mode & 8) > 0 && stats.gid === process.getgid()) ||\n ((stats.mode & 64) > 0 && stats.uid === process.getuid()));\n}\n//# sourceMappingURL=io-util.js.map","\"use strict\";\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];\n result[\"default\"] = mod;\n return result;\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst childProcess = __importStar(require(\"child_process\"));\nconst path = __importStar(require(\"path\"));\nconst util_1 = require(\"util\");\nconst ioUtil = __importStar(require(\"./io-util\"));\nconst exec = util_1.promisify(childProcess.exec);\n/**\n * Copies a file or folder.\n * Based off of shelljs - https://github.com/shelljs/shelljs/blob/9237f66c52e5daa40458f94f9565e18e8132f5a6/src/cp.js\n *\n * @param source source path\n * @param dest destination path\n * @param options optional. See CopyOptions.\n */\nfunction cp(source, dest, options = {}) {\n return __awaiter(this, void 0, void 0, function* () {\n const { force, recursive } = readCopyOptions(options);\n const destStat = (yield ioUtil.exists(dest)) ? yield ioUtil.stat(dest) : null;\n // Dest is an existing file, but not forcing\n if (destStat && destStat.isFile() && !force) {\n return;\n }\n // If dest is an existing directory, should copy inside.\n const newDest = destStat && destStat.isDirectory()\n ? path.join(dest, path.basename(source))\n : dest;\n if (!(yield ioUtil.exists(source))) {\n throw new Error(`no such file or directory: ${source}`);\n }\n const sourceStat = yield ioUtil.stat(source);\n if (sourceStat.isDirectory()) {\n if (!recursive) {\n throw new Error(`Failed to copy. ${source} is a directory, but tried to copy without recursive flag.`);\n }\n else {\n yield cpDirRecursive(source, newDest, 0, force);\n }\n }\n else {\n if (path.relative(source, newDest) === '') {\n // a file cannot be copied to itself\n throw new Error(`'${newDest}' and '${source}' are the same file`);\n }\n yield copyFile(source, newDest, force);\n }\n });\n}\nexports.cp = cp;\n/**\n * Moves a path.\n *\n * @param source source path\n * @param dest destination path\n * @param options optional. See MoveOptions.\n */\nfunction mv(source, dest, options = {}) {\n return __awaiter(this, void 0, void 0, function* () {\n if (yield ioUtil.exists(dest)) {\n let destExists = true;\n if (yield ioUtil.isDirectory(dest)) {\n // If dest is directory copy src into dest\n dest = path.join(dest, path.basename(source));\n destExists = yield ioUtil.exists(dest);\n }\n if (destExists) {\n if (options.force == null || options.force) {\n yield rmRF(dest);\n }\n else {\n throw new Error('Destination already exists');\n }\n }\n }\n yield mkdirP(path.dirname(dest));\n yield ioUtil.rename(source, dest);\n });\n}\nexports.mv = mv;\n/**\n * Remove a path recursively with force\n *\n * @param inputPath path to remove\n */\nfunction rmRF(inputPath) {\n return __awaiter(this, void 0, void 0, function* () {\n if (ioUtil.IS_WINDOWS) {\n // Node doesn't provide a delete operation, only an unlink function. This means that if the file is being used by another\n // program (e.g. antivirus), it won't be deleted. To address this, we shell out the work to rd/del.\n try {\n if (yield ioUtil.isDirectory(inputPath, true)) {\n yield exec(`rd /s /q \"${inputPath}\"`);\n }\n else {\n yield exec(`del /f /a \"${inputPath}\"`);\n }\n }\n catch (err) {\n // if you try to delete a file that doesn't exist, desired result is achieved\n // other errors are valid\n if (err.code !== 'ENOENT')\n throw err;\n }\n // Shelling out fails to remove a symlink folder with missing source, this unlink catches that\n try {\n yield ioUtil.unlink(inputPath);\n }\n catch (err) {\n // if you try to delete a file that doesn't exist, desired result is achieved\n // other errors are valid\n if (err.code !== 'ENOENT')\n throw err;\n }\n }\n else {\n let isDir = false;\n try {\n isDir = yield ioUtil.isDirectory(inputPath);\n }\n catch (err) {\n // if you try to delete a file that doesn't exist, desired result is achieved\n // other errors are valid\n if (err.code !== 'ENOENT')\n throw err;\n return;\n }\n if (isDir) {\n yield exec(`rm -rf \"${inputPath}\"`);\n }\n else {\n yield ioUtil.unlink(inputPath);\n }\n }\n });\n}\nexports.rmRF = rmRF;\n/**\n * Make a directory. Creates the full path with folders in between\n * Will throw if it fails\n *\n * @param fsPath path to create\n * @returns Promise\n */\nfunction mkdirP(fsPath) {\n return __awaiter(this, void 0, void 0, function* () {\n yield ioUtil.mkdirP(fsPath);\n });\n}\nexports.mkdirP = mkdirP;\n/**\n * Returns path of a tool had the tool actually been invoked. Resolves via paths.\n * If you check and the tool does not exist, it will throw.\n *\n * @param tool name of the tool\n * @param check whether to check if tool exists\n * @returns Promise path to tool\n */\nfunction which(tool, check) {\n return __awaiter(this, void 0, void 0, function* () {\n if (!tool) {\n throw new Error(\"parameter 'tool' is required\");\n }\n // recursive when check=true\n if (check) {\n const result = yield which(tool, false);\n if (!result) {\n if (ioUtil.IS_WINDOWS) {\n throw new Error(`Unable to locate executable file: ${tool}. Please verify either the file path exists or the file can be found within a directory specified by the PATH environment variable. Also verify the file has a valid extension for an executable file.`);\n }\n else {\n throw new Error(`Unable to locate executable file: ${tool}. Please verify either the file path exists or the file can be found within a directory specified by the PATH environment variable. Also check the file mode to verify the file is executable.`);\n }\n }\n return result;\n }\n const matches = yield findInPath(tool);\n if (matches && matches.length > 0) {\n return matches[0];\n }\n return '';\n });\n}\nexports.which = which;\n/**\n * Returns a list of all occurrences of the given tool on the system path.\n *\n * @returns Promise the paths of the tool\n */\nfunction findInPath(tool) {\n return __awaiter(this, void 0, void 0, function* () {\n if (!tool) {\n throw new Error(\"parameter 'tool' is required\");\n }\n // build the list of extensions to try\n const extensions = [];\n if (ioUtil.IS_WINDOWS && process.env['PATHEXT']) {\n for (const extension of process.env['PATHEXT'].split(path.delimiter)) {\n if (extension) {\n extensions.push(extension);\n }\n }\n }\n // if it's rooted, return it if exists. otherwise return empty.\n if (ioUtil.isRooted(tool)) {\n const filePath = yield ioUtil.tryGetExecutablePath(tool, extensions);\n if (filePath) {\n return [filePath];\n }\n return [];\n }\n // if any path separators, return empty\n if (tool.includes(path.sep)) {\n return [];\n }\n // build the list of directories\n //\n // Note, technically \"where\" checks the current directory on Windows. From a toolkit perspective,\n // it feels like we should not do this. Checking the current directory seems like more of a use\n // case of a shell, and the which() function exposed by the toolkit should strive for consistency\n // across platforms.\n const directories = [];\n if (process.env.PATH) {\n for (const p of process.env.PATH.split(path.delimiter)) {\n if (p) {\n directories.push(p);\n }\n }\n }\n // find all matches\n const matches = [];\n for (const directory of directories) {\n const filePath = yield ioUtil.tryGetExecutablePath(path.join(directory, tool), extensions);\n if (filePath) {\n matches.push(filePath);\n }\n }\n return matches;\n });\n}\nexports.findInPath = findInPath;\nfunction readCopyOptions(options) {\n const force = options.force == null ? true : options.force;\n const recursive = Boolean(options.recursive);\n return { force, recursive };\n}\nfunction cpDirRecursive(sourceDir, destDir, currentDepth, force) {\n return __awaiter(this, void 0, void 0, function* () {\n // Ensure there is not a run away recursive copy\n if (currentDepth >= 255)\n return;\n currentDepth++;\n yield mkdirP(destDir);\n const files = yield ioUtil.readdir(sourceDir);\n for (const fileName of files) {\n const srcFile = `${sourceDir}/${fileName}`;\n const destFile = `${destDir}/${fileName}`;\n const srcFileStat = yield ioUtil.lstat(srcFile);\n if (srcFileStat.isDirectory()) {\n // Recurse\n yield cpDirRecursive(srcFile, destFile, currentDepth, force);\n }\n else {\n yield copyFile(srcFile, destFile, force);\n }\n }\n // Change the mode for the newly created directory\n yield ioUtil.chmod(destDir, (yield ioUtil.stat(sourceDir)).mode);\n });\n}\n// Buffered file copy\nfunction copyFile(srcFile, destFile, force) {\n return __awaiter(this, void 0, void 0, function* () {\n if ((yield ioUtil.lstat(srcFile)).isSymbolicLink()) {\n // unlink/re-link it\n try {\n yield ioUtil.lstat(destFile);\n yield ioUtil.unlink(destFile);\n }\n catch (e) {\n // Try to override file permission\n if (e.code === 'EPERM') {\n yield ioUtil.chmod(destFile, '0666');\n yield ioUtil.unlink(destFile);\n }\n // other errors = it doesn't exist, no work to do\n }\n // Copy over symlink\n const symlinkFull = yield ioUtil.readlink(srcFile);\n yield ioUtil.symlink(symlinkFull, destFile, ioUtil.IS_WINDOWS ? 'junction' : null);\n }\n else if (!(yield ioUtil.exists(destFile)) || force) {\n yield ioUtil.copyFile(srcFile, destFile);\n }\n });\n}\n//# sourceMappingURL=io.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)\n *\n * OpenAPI spec version: v1.13.7\n *\n *\n * NOTE: This class is auto generated by the swagger code generator program.\n * https://github.com/swagger-api/swagger-codegen.git\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst localVarRequest = require(\"request\");\nlet defaultBasePath = 'https://localhost';\n// ===============================================\n// This file is autogenerated - Please do not edit\n// ===============================================\n/* tslint:disable:no-unused-variable */\nlet primitives = [\n \"string\",\n \"boolean\",\n \"double\",\n \"integer\",\n \"long\",\n \"float\",\n \"number\",\n \"any\"\n];\nclass ObjectSerializer {\n static findCorrectType(data, expectedType) {\n if (data == undefined) {\n return expectedType;\n }\n else if (primitives.indexOf(expectedType.toLowerCase()) !== -1) {\n return expectedType;\n }\n else if (expectedType === \"Date\") {\n return expectedType;\n }\n else {\n if (enumsMap[expectedType]) {\n return expectedType;\n }\n if (!typeMap[expectedType]) {\n return expectedType; // w/e we don't know the type\n }\n // Check the discriminator\n let discriminatorProperty = typeMap[expectedType].discriminator;\n if (discriminatorProperty == null) {\n return expectedType; // the type does not have a discriminator. use it.\n }\n else {\n if (data[discriminatorProperty]) {\n return data[discriminatorProperty]; // use the type given in the discriminator\n }\n else {\n return expectedType; // discriminator was not present (or an empty string)\n }\n }\n }\n }\n static serialize(data, type) {\n if (data == undefined) {\n return data;\n }\n else if (primitives.indexOf(type.toLowerCase()) !== -1) {\n return data;\n }\n else if (type.lastIndexOf(\"Array<\", 0) === 0) { // string.startsWith pre es6\n let subType = type.replace(\"Array<\", \"\"); // Array => Type>\n subType = subType.substring(0, subType.length - 1); // Type> => Type\n let transformedData = [];\n for (let index in data) {\n let date = data[index];\n transformedData.push(ObjectSerializer.serialize(date, subType));\n }\n return transformedData;\n }\n else if (type === \"Date\") {\n return data.toString();\n }\n else {\n if (enumsMap[type]) {\n return data;\n }\n if (!typeMap[type]) { // in case we dont know the type\n return data;\n }\n // get the map for the correct type.\n let attributeTypes = typeMap[type].getAttributeTypeMap();\n let instance = {};\n for (let index in attributeTypes) {\n let attributeType = attributeTypes[index];\n instance[attributeType.baseName] = ObjectSerializer.serialize(data[attributeType.name], attributeType.type);\n }\n return instance;\n }\n }\n static deserialize(data, type) {\n // polymorphism may change the actual type.\n type = ObjectSerializer.findCorrectType(data, type);\n if (data == undefined) {\n return data;\n }\n else if (primitives.indexOf(type.toLowerCase()) !== -1) {\n return data;\n }\n else if (type.lastIndexOf(\"Array<\", 0) === 0) { // string.startsWith pre es6\n let subType = type.replace(\"Array<\", \"\"); // Array => Type>\n subType = subType.substring(0, subType.length - 1); // Type> => Type\n let transformedData = [];\n for (let index in data) {\n let date = data[index];\n transformedData.push(ObjectSerializer.deserialize(date, subType));\n }\n return transformedData;\n }\n else if (type === \"Date\") {\n return new Date(data);\n }\n else {\n if (enumsMap[type]) { // is Enum\n return data;\n }\n if (!typeMap[type]) { // dont know the type\n return data;\n }\n let instance = new typeMap[type]();\n let attributeTypes = typeMap[type].getAttributeTypeMap();\n for (let index in attributeTypes) {\n let attributeType = attributeTypes[index];\n instance[attributeType.name] = ObjectSerializer.deserialize(data[attributeType.baseName], attributeType.type);\n }\n return instance;\n }\n }\n}\n/**\n* ServiceReference holds a reference to Service.legacy.k8s.io\n*/\nclass AdmissionregistrationV1beta1ServiceReference {\n static getAttributeTypeMap() {\n return AdmissionregistrationV1beta1ServiceReference.attributeTypeMap;\n }\n}\nAdmissionregistrationV1beta1ServiceReference.discriminator = undefined;\nAdmissionregistrationV1beta1ServiceReference.attributeTypeMap = [\n {\n \"name\": \"name\",\n \"baseName\": \"name\",\n \"type\": \"string\"\n },\n {\n \"name\": \"namespace\",\n \"baseName\": \"namespace\",\n \"type\": \"string\"\n },\n {\n \"name\": \"path\",\n \"baseName\": \"path\",\n \"type\": \"string\"\n }\n];\nexports.AdmissionregistrationV1beta1ServiceReference = AdmissionregistrationV1beta1ServiceReference;\n/**\n* WebhookClientConfig contains the information to make a TLS connection with the webhook\n*/\nclass AdmissionregistrationV1beta1WebhookClientConfig {\n static getAttributeTypeMap() {\n return AdmissionregistrationV1beta1WebhookClientConfig.attributeTypeMap;\n }\n}\nAdmissionregistrationV1beta1WebhookClientConfig.discriminator = undefined;\nAdmissionregistrationV1beta1WebhookClientConfig.attributeTypeMap = [\n {\n \"name\": \"caBundle\",\n \"baseName\": \"caBundle\",\n \"type\": \"string\"\n },\n {\n \"name\": \"service\",\n \"baseName\": \"service\",\n \"type\": \"AdmissionregistrationV1beta1ServiceReference\"\n },\n {\n \"name\": \"url\",\n \"baseName\": \"url\",\n \"type\": \"string\"\n }\n];\nexports.AdmissionregistrationV1beta1WebhookClientConfig = AdmissionregistrationV1beta1WebhookClientConfig;\n/**\n* ServiceReference holds a reference to Service.legacy.k8s.io\n*/\nclass ApiextensionsV1beta1ServiceReference {\n static getAttributeTypeMap() {\n return ApiextensionsV1beta1ServiceReference.attributeTypeMap;\n }\n}\nApiextensionsV1beta1ServiceReference.discriminator = undefined;\nApiextensionsV1beta1ServiceReference.attributeTypeMap = [\n {\n \"name\": \"name\",\n \"baseName\": \"name\",\n \"type\": \"string\"\n },\n {\n \"name\": \"namespace\",\n \"baseName\": \"namespace\",\n \"type\": \"string\"\n },\n {\n \"name\": \"path\",\n \"baseName\": \"path\",\n \"type\": \"string\"\n }\n];\nexports.ApiextensionsV1beta1ServiceReference = ApiextensionsV1beta1ServiceReference;\n/**\n* WebhookClientConfig contains the information to make a TLS connection with the webhook. It has the same field as admissionregistration.v1beta1.WebhookClientConfig.\n*/\nclass ApiextensionsV1beta1WebhookClientConfig {\n static getAttributeTypeMap() {\n return ApiextensionsV1beta1WebhookClientConfig.attributeTypeMap;\n }\n}\nApiextensionsV1beta1WebhookClientConfig.discriminator = undefined;\nApiextensionsV1beta1WebhookClientConfig.attributeTypeMap = [\n {\n \"name\": \"caBundle\",\n \"baseName\": \"caBundle\",\n \"type\": \"string\"\n },\n {\n \"name\": \"service\",\n \"baseName\": \"service\",\n \"type\": \"ApiextensionsV1beta1ServiceReference\"\n },\n {\n \"name\": \"url\",\n \"baseName\": \"url\",\n \"type\": \"string\"\n }\n];\nexports.ApiextensionsV1beta1WebhookClientConfig = ApiextensionsV1beta1WebhookClientConfig;\n/**\n* ServiceReference holds a reference to Service.legacy.k8s.io\n*/\nclass ApiregistrationV1beta1ServiceReference {\n static getAttributeTypeMap() {\n return ApiregistrationV1beta1ServiceReference.attributeTypeMap;\n }\n}\nApiregistrationV1beta1ServiceReference.discriminator = undefined;\nApiregistrationV1beta1ServiceReference.attributeTypeMap = [\n {\n \"name\": \"name\",\n \"baseName\": \"name\",\n \"type\": \"string\"\n },\n {\n \"name\": \"namespace\",\n \"baseName\": \"namespace\",\n \"type\": \"string\"\n }\n];\nexports.ApiregistrationV1beta1ServiceReference = ApiregistrationV1beta1ServiceReference;\n/**\n* 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.\n*/\nclass AppsV1beta1Deployment {\n static getAttributeTypeMap() {\n return AppsV1beta1Deployment.attributeTypeMap;\n }\n}\nAppsV1beta1Deployment.discriminator = undefined;\nAppsV1beta1Deployment.attributeTypeMap = [\n {\n \"name\": \"apiVersion\",\n \"baseName\": \"apiVersion\",\n \"type\": \"string\"\n },\n {\n \"name\": \"kind\",\n \"baseName\": \"kind\",\n \"type\": \"string\"\n },\n {\n \"name\": \"metadata\",\n \"baseName\": \"metadata\",\n \"type\": \"V1ObjectMeta\"\n },\n {\n \"name\": \"spec\",\n \"baseName\": \"spec\",\n \"type\": \"AppsV1beta1DeploymentSpec\"\n },\n {\n \"name\": \"status\",\n \"baseName\": \"status\",\n \"type\": \"AppsV1beta1DeploymentStatus\"\n }\n];\nexports.AppsV1beta1Deployment = AppsV1beta1Deployment;\n/**\n* DeploymentCondition describes the state of a deployment at a certain point.\n*/\nclass AppsV1beta1DeploymentCondition {\n static getAttributeTypeMap() {\n return AppsV1beta1DeploymentCondition.attributeTypeMap;\n }\n}\nAppsV1beta1DeploymentCondition.discriminator = undefined;\nAppsV1beta1DeploymentCondition.attributeTypeMap = [\n {\n \"name\": \"lastTransitionTime\",\n \"baseName\": \"lastTransitionTime\",\n \"type\": \"Date\"\n },\n {\n \"name\": \"lastUpdateTime\",\n \"baseName\": \"lastUpdateTime\",\n \"type\": \"Date\"\n },\n {\n \"name\": \"message\",\n \"baseName\": \"message\",\n \"type\": \"string\"\n },\n {\n \"name\": \"reason\",\n \"baseName\": \"reason\",\n \"type\": \"string\"\n },\n {\n \"name\": \"status\",\n \"baseName\": \"status\",\n \"type\": \"string\"\n },\n {\n \"name\": \"type\",\n \"baseName\": \"type\",\n \"type\": \"string\"\n }\n];\nexports.AppsV1beta1DeploymentCondition = AppsV1beta1DeploymentCondition;\n/**\n* DeploymentList is a list of Deployments.\n*/\nclass AppsV1beta1DeploymentList {\n static getAttributeTypeMap() {\n return AppsV1beta1DeploymentList.attributeTypeMap;\n }\n}\nAppsV1beta1DeploymentList.discriminator = undefined;\nAppsV1beta1DeploymentList.attributeTypeMap = [\n {\n \"name\": \"apiVersion\",\n \"baseName\": \"apiVersion\",\n \"type\": \"string\"\n },\n {\n \"name\": \"items\",\n \"baseName\": \"items\",\n \"type\": \"Array\"\n },\n {\n \"name\": \"kind\",\n \"baseName\": \"kind\",\n \"type\": \"string\"\n },\n {\n \"name\": \"metadata\",\n \"baseName\": \"metadata\",\n \"type\": \"V1ListMeta\"\n }\n];\nexports.AppsV1beta1DeploymentList = AppsV1beta1DeploymentList;\n/**\n* DEPRECATED. DeploymentRollback stores the information required to rollback a deployment.\n*/\nclass AppsV1beta1DeploymentRollback {\n static getAttributeTypeMap() {\n return AppsV1beta1DeploymentRollback.attributeTypeMap;\n }\n}\nAppsV1beta1DeploymentRollback.discriminator = undefined;\nAppsV1beta1DeploymentRollback.attributeTypeMap = [\n {\n \"name\": \"apiVersion\",\n \"baseName\": \"apiVersion\",\n \"type\": \"string\"\n },\n {\n \"name\": \"kind\",\n \"baseName\": \"kind\",\n \"type\": \"string\"\n },\n {\n \"name\": \"name\",\n \"baseName\": \"name\",\n \"type\": \"string\"\n },\n {\n \"name\": \"rollbackTo\",\n \"baseName\": \"rollbackTo\",\n \"type\": \"AppsV1beta1RollbackConfig\"\n },\n {\n \"name\": \"updatedAnnotations\",\n \"baseName\": \"updatedAnnotations\",\n \"type\": \"{ [key: string]: string; }\"\n }\n];\nexports.AppsV1beta1DeploymentRollback = AppsV1beta1DeploymentRollback;\n/**\n* DeploymentSpec is the specification of the desired behavior of the Deployment.\n*/\nclass AppsV1beta1DeploymentSpec {\n static getAttributeTypeMap() {\n return AppsV1beta1DeploymentSpec.attributeTypeMap;\n }\n}\nAppsV1beta1DeploymentSpec.discriminator = undefined;\nAppsV1beta1DeploymentSpec.attributeTypeMap = [\n {\n \"name\": \"minReadySeconds\",\n \"baseName\": \"minReadySeconds\",\n \"type\": \"number\"\n },\n {\n \"name\": \"paused\",\n \"baseName\": \"paused\",\n \"type\": \"boolean\"\n },\n {\n \"name\": \"progressDeadlineSeconds\",\n \"baseName\": \"progressDeadlineSeconds\",\n \"type\": \"number\"\n },\n {\n \"name\": \"replicas\",\n \"baseName\": \"replicas\",\n \"type\": \"number\"\n },\n {\n \"name\": \"revisionHistoryLimit\",\n \"baseName\": \"revisionHistoryLimit\",\n \"type\": \"number\"\n },\n {\n \"name\": \"rollbackTo\",\n \"baseName\": \"rollbackTo\",\n \"type\": \"AppsV1beta1RollbackConfig\"\n },\n {\n \"name\": \"selector\",\n \"baseName\": \"selector\",\n \"type\": \"V1LabelSelector\"\n },\n {\n \"name\": \"strategy\",\n \"baseName\": \"strategy\",\n \"type\": \"AppsV1beta1DeploymentStrategy\"\n },\n {\n \"name\": \"template\",\n \"baseName\": \"template\",\n \"type\": \"V1PodTemplateSpec\"\n }\n];\nexports.AppsV1beta1DeploymentSpec = AppsV1beta1DeploymentSpec;\n/**\n* DeploymentStatus is the most recently observed status of the Deployment.\n*/\nclass AppsV1beta1DeploymentStatus {\n static getAttributeTypeMap() {\n return AppsV1beta1DeploymentStatus.attributeTypeMap;\n }\n}\nAppsV1beta1DeploymentStatus.discriminator = undefined;\nAppsV1beta1DeploymentStatus.attributeTypeMap = [\n {\n \"name\": \"availableReplicas\",\n \"baseName\": \"availableReplicas\",\n \"type\": \"number\"\n },\n {\n \"name\": \"collisionCount\",\n \"baseName\": \"collisionCount\",\n \"type\": \"number\"\n },\n {\n \"name\": \"conditions\",\n \"baseName\": \"conditions\",\n \"type\": \"Array\"\n },\n {\n \"name\": \"observedGeneration\",\n \"baseName\": \"observedGeneration\",\n \"type\": \"number\"\n },\n {\n \"name\": \"readyReplicas\",\n \"baseName\": \"readyReplicas\",\n \"type\": \"number\"\n },\n {\n \"name\": \"replicas\",\n \"baseName\": \"replicas\",\n \"type\": \"number\"\n },\n {\n \"name\": \"unavailableReplicas\",\n \"baseName\": \"unavailableReplicas\",\n \"type\": \"number\"\n },\n {\n \"name\": \"updatedReplicas\",\n \"baseName\": \"updatedReplicas\",\n \"type\": \"number\"\n }\n];\nexports.AppsV1beta1DeploymentStatus = AppsV1beta1DeploymentStatus;\n/**\n* DeploymentStrategy describes how to replace existing pods with new ones.\n*/\nclass AppsV1beta1DeploymentStrategy {\n static getAttributeTypeMap() {\n return AppsV1beta1DeploymentStrategy.attributeTypeMap;\n }\n}\nAppsV1beta1DeploymentStrategy.discriminator = undefined;\nAppsV1beta1DeploymentStrategy.attributeTypeMap = [\n {\n \"name\": \"rollingUpdate\",\n \"baseName\": \"rollingUpdate\",\n \"type\": \"AppsV1beta1RollingUpdateDeployment\"\n },\n {\n \"name\": \"type\",\n \"baseName\": \"type\",\n \"type\": \"string\"\n }\n];\nexports.AppsV1beta1DeploymentStrategy = AppsV1beta1DeploymentStrategy;\n/**\n* DEPRECATED.\n*/\nclass AppsV1beta1RollbackConfig {\n static getAttributeTypeMap() {\n return AppsV1beta1RollbackConfig.attributeTypeMap;\n }\n}\nAppsV1beta1RollbackConfig.discriminator = undefined;\nAppsV1beta1RollbackConfig.attributeTypeMap = [\n {\n \"name\": \"revision\",\n \"baseName\": \"revision\",\n \"type\": \"number\"\n }\n];\nexports.AppsV1beta1RollbackConfig = AppsV1beta1RollbackConfig;\n/**\n* Spec to control the desired behavior of rolling update.\n*/\nclass AppsV1beta1RollingUpdateDeployment {\n static getAttributeTypeMap() {\n return AppsV1beta1RollingUpdateDeployment.attributeTypeMap;\n }\n}\nAppsV1beta1RollingUpdateDeployment.discriminator = undefined;\nAppsV1beta1RollingUpdateDeployment.attributeTypeMap = [\n {\n \"name\": \"maxSurge\",\n \"baseName\": \"maxSurge\",\n \"type\": \"any\"\n },\n {\n \"name\": \"maxUnavailable\",\n \"baseName\": \"maxUnavailable\",\n \"type\": \"any\"\n }\n];\nexports.AppsV1beta1RollingUpdateDeployment = AppsV1beta1RollingUpdateDeployment;\n/**\n* Scale represents a scaling request for a resource.\n*/\nclass AppsV1beta1Scale {\n static getAttributeTypeMap() {\n return AppsV1beta1Scale.attributeTypeMap;\n }\n}\nAppsV1beta1Scale.discriminator = undefined;\nAppsV1beta1Scale.attributeTypeMap = [\n {\n \"name\": \"apiVersion\",\n \"baseName\": \"apiVersion\",\n \"type\": \"string\"\n },\n {\n \"name\": \"kind\",\n \"baseName\": \"kind\",\n \"type\": \"string\"\n },\n {\n \"name\": \"metadata\",\n \"baseName\": \"metadata\",\n \"type\": \"V1ObjectMeta\"\n },\n {\n \"name\": \"spec\",\n \"baseName\": \"spec\",\n \"type\": \"AppsV1beta1ScaleSpec\"\n },\n {\n \"name\": \"status\",\n \"baseName\": \"status\",\n \"type\": \"AppsV1beta1ScaleStatus\"\n }\n];\nexports.AppsV1beta1Scale = AppsV1beta1Scale;\n/**\n* ScaleSpec describes the attributes of a scale subresource\n*/\nclass AppsV1beta1ScaleSpec {\n static getAttributeTypeMap() {\n return AppsV1beta1ScaleSpec.attributeTypeMap;\n }\n}\nAppsV1beta1ScaleSpec.discriminator = undefined;\nAppsV1beta1ScaleSpec.attributeTypeMap = [\n {\n \"name\": \"replicas\",\n \"baseName\": \"replicas\",\n \"type\": \"number\"\n }\n];\nexports.AppsV1beta1ScaleSpec = AppsV1beta1ScaleSpec;\n/**\n* ScaleStatus represents the current status of a scale subresource.\n*/\nclass AppsV1beta1ScaleStatus {\n static getAttributeTypeMap() {\n return AppsV1beta1ScaleStatus.attributeTypeMap;\n }\n}\nAppsV1beta1ScaleStatus.discriminator = undefined;\nAppsV1beta1ScaleStatus.attributeTypeMap = [\n {\n \"name\": \"replicas\",\n \"baseName\": \"replicas\",\n \"type\": \"number\"\n },\n {\n \"name\": \"selector\",\n \"baseName\": \"selector\",\n \"type\": \"{ [key: string]: string; }\"\n },\n {\n \"name\": \"targetSelector\",\n \"baseName\": \"targetSelector\",\n \"type\": \"string\"\n }\n];\nexports.AppsV1beta1ScaleStatus = AppsV1beta1ScaleStatus;\n/**\n* AllowedFlexVolume represents a single Flexvolume that is allowed to be used. Deprecated: use AllowedFlexVolume from policy API Group instead.\n*/\nclass ExtensionsV1beta1AllowedFlexVolume {\n static getAttributeTypeMap() {\n return ExtensionsV1beta1AllowedFlexVolume.attributeTypeMap;\n }\n}\nExtensionsV1beta1AllowedFlexVolume.discriminator = undefined;\nExtensionsV1beta1AllowedFlexVolume.attributeTypeMap = [\n {\n \"name\": \"driver\",\n \"baseName\": \"driver\",\n \"type\": \"string\"\n }\n];\nexports.ExtensionsV1beta1AllowedFlexVolume = ExtensionsV1beta1AllowedFlexVolume;\n/**\n* AllowedHostPath defines the host volume conditions that will be enabled by a policy for pods to use. It requires the path prefix to be defined. Deprecated: use AllowedHostPath from policy API Group instead.\n*/\nclass ExtensionsV1beta1AllowedHostPath {\n static getAttributeTypeMap() {\n return ExtensionsV1beta1AllowedHostPath.attributeTypeMap;\n }\n}\nExtensionsV1beta1AllowedHostPath.discriminator = undefined;\nExtensionsV1beta1AllowedHostPath.attributeTypeMap = [\n {\n \"name\": \"pathPrefix\",\n \"baseName\": \"pathPrefix\",\n \"type\": \"string\"\n },\n {\n \"name\": \"readOnly\",\n \"baseName\": \"readOnly\",\n \"type\": \"boolean\"\n }\n];\nexports.ExtensionsV1beta1AllowedHostPath = ExtensionsV1beta1AllowedHostPath;\n/**\n* 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.\n*/\nclass ExtensionsV1beta1Deployment {\n static getAttributeTypeMap() {\n return ExtensionsV1beta1Deployment.attributeTypeMap;\n }\n}\nExtensionsV1beta1Deployment.discriminator = undefined;\nExtensionsV1beta1Deployment.attributeTypeMap = [\n {\n \"name\": \"apiVersion\",\n \"baseName\": \"apiVersion\",\n \"type\": \"string\"\n },\n {\n \"name\": \"kind\",\n \"baseName\": \"kind\",\n \"type\": \"string\"\n },\n {\n \"name\": \"metadata\",\n \"baseName\": \"metadata\",\n \"type\": \"V1ObjectMeta\"\n },\n {\n \"name\": \"spec\",\n \"baseName\": \"spec\",\n \"type\": \"ExtensionsV1beta1DeploymentSpec\"\n },\n {\n \"name\": \"status\",\n \"baseName\": \"status\",\n \"type\": \"ExtensionsV1beta1DeploymentStatus\"\n }\n];\nexports.ExtensionsV1beta1Deployment = ExtensionsV1beta1Deployment;\n/**\n* DeploymentCondition describes the state of a deployment at a certain point.\n*/\nclass ExtensionsV1beta1DeploymentCondition {\n static getAttributeTypeMap() {\n return ExtensionsV1beta1DeploymentCondition.attributeTypeMap;\n }\n}\nExtensionsV1beta1DeploymentCondition.discriminator = undefined;\nExtensionsV1beta1DeploymentCondition.attributeTypeMap = [\n {\n \"name\": \"lastTransitionTime\",\n \"baseName\": \"lastTransitionTime\",\n \"type\": \"Date\"\n },\n {\n \"name\": \"lastUpdateTime\",\n \"baseName\": \"lastUpdateTime\",\n \"type\": \"Date\"\n },\n {\n \"name\": \"message\",\n \"baseName\": \"message\",\n \"type\": \"string\"\n },\n {\n \"name\": \"reason\",\n \"baseName\": \"reason\",\n \"type\": \"string\"\n },\n {\n \"name\": \"status\",\n \"baseName\": \"status\",\n \"type\": \"string\"\n },\n {\n \"name\": \"type\",\n \"baseName\": \"type\",\n \"type\": \"string\"\n }\n];\nexports.ExtensionsV1beta1DeploymentCondition = ExtensionsV1beta1DeploymentCondition;\n/**\n* DeploymentList is a list of Deployments.\n*/\nclass ExtensionsV1beta1DeploymentList {\n static getAttributeTypeMap() {\n return ExtensionsV1beta1DeploymentList.attributeTypeMap;\n }\n}\nExtensionsV1beta1DeploymentList.discriminator = undefined;\nExtensionsV1beta1DeploymentList.attributeTypeMap = [\n {\n \"name\": \"apiVersion\",\n \"baseName\": \"apiVersion\",\n \"type\": \"string\"\n },\n {\n \"name\": \"items\",\n \"baseName\": \"items\",\n \"type\": \"Array\"\n },\n {\n \"name\": \"kind\",\n \"baseName\": \"kind\",\n \"type\": \"string\"\n },\n {\n \"name\": \"metadata\",\n \"baseName\": \"metadata\",\n \"type\": \"V1ListMeta\"\n }\n];\nexports.ExtensionsV1beta1DeploymentList = ExtensionsV1beta1DeploymentList;\n/**\n* DEPRECATED. DeploymentRollback stores the information required to rollback a deployment.\n*/\nclass ExtensionsV1beta1DeploymentRollback {\n static getAttributeTypeMap() {\n return ExtensionsV1beta1DeploymentRollback.attributeTypeMap;\n }\n}\nExtensionsV1beta1DeploymentRollback.discriminator = undefined;\nExtensionsV1beta1DeploymentRollback.attributeTypeMap = [\n {\n \"name\": \"apiVersion\",\n \"baseName\": \"apiVersion\",\n \"type\": \"string\"\n },\n {\n \"name\": \"kind\",\n \"baseName\": \"kind\",\n \"type\": \"string\"\n },\n {\n \"name\": \"name\",\n \"baseName\": \"name\",\n \"type\": \"string\"\n },\n {\n \"name\": \"rollbackTo\",\n \"baseName\": \"rollbackTo\",\n \"type\": \"ExtensionsV1beta1RollbackConfig\"\n },\n {\n \"name\": \"updatedAnnotations\",\n \"baseName\": \"updatedAnnotations\",\n \"type\": \"{ [key: string]: string; }\"\n }\n];\nexports.ExtensionsV1beta1DeploymentRollback = ExtensionsV1beta1DeploymentRollback;\n/**\n* DeploymentSpec is the specification of the desired behavior of the Deployment.\n*/\nclass ExtensionsV1beta1DeploymentSpec {\n static getAttributeTypeMap() {\n return ExtensionsV1beta1DeploymentSpec.attributeTypeMap;\n }\n}\nExtensionsV1beta1DeploymentSpec.discriminator = undefined;\nExtensionsV1beta1DeploymentSpec.attributeTypeMap = [\n {\n \"name\": \"minReadySeconds\",\n \"baseName\": \"minReadySeconds\",\n \"type\": \"number\"\n },\n {\n \"name\": \"paused\",\n \"baseName\": \"paused\",\n \"type\": \"boolean\"\n },\n {\n \"name\": \"progressDeadlineSeconds\",\n \"baseName\": \"progressDeadlineSeconds\",\n \"type\": \"number\"\n },\n {\n \"name\": \"replicas\",\n \"baseName\": \"replicas\",\n \"type\": \"number\"\n },\n {\n \"name\": \"revisionHistoryLimit\",\n \"baseName\": \"revisionHistoryLimit\",\n \"type\": \"number\"\n },\n {\n \"name\": \"rollbackTo\",\n \"baseName\": \"rollbackTo\",\n \"type\": \"ExtensionsV1beta1RollbackConfig\"\n },\n {\n \"name\": \"selector\",\n \"baseName\": \"selector\",\n \"type\": \"V1LabelSelector\"\n },\n {\n \"name\": \"strategy\",\n \"baseName\": \"strategy\",\n \"type\": \"ExtensionsV1beta1DeploymentStrategy\"\n },\n {\n \"name\": \"template\",\n \"baseName\": \"template\",\n \"type\": \"V1PodTemplateSpec\"\n }\n];\nexports.ExtensionsV1beta1DeploymentSpec = ExtensionsV1beta1DeploymentSpec;\n/**\n* DeploymentStatus is the most recently observed status of the Deployment.\n*/\nclass ExtensionsV1beta1DeploymentStatus {\n static getAttributeTypeMap() {\n return ExtensionsV1beta1DeploymentStatus.attributeTypeMap;\n }\n}\nExtensionsV1beta1DeploymentStatus.discriminator = undefined;\nExtensionsV1beta1DeploymentStatus.attributeTypeMap = [\n {\n \"name\": \"availableReplicas\",\n \"baseName\": \"availableReplicas\",\n \"type\": \"number\"\n },\n {\n \"name\": \"collisionCount\",\n \"baseName\": \"collisionCount\",\n \"type\": \"number\"\n },\n {\n \"name\": \"conditions\",\n \"baseName\": \"conditions\",\n \"type\": \"Array\"\n },\n {\n \"name\": \"observedGeneration\",\n \"baseName\": \"observedGeneration\",\n \"type\": \"number\"\n },\n {\n \"name\": \"readyReplicas\",\n \"baseName\": \"readyReplicas\",\n \"type\": \"number\"\n },\n {\n \"name\": \"replicas\",\n \"baseName\": \"replicas\",\n \"type\": \"number\"\n },\n {\n \"name\": \"unavailableReplicas\",\n \"baseName\": \"unavailableReplicas\",\n \"type\": \"number\"\n },\n {\n \"name\": \"updatedReplicas\",\n \"baseName\": \"updatedReplicas\",\n \"type\": \"number\"\n }\n];\nexports.ExtensionsV1beta1DeploymentStatus = ExtensionsV1beta1DeploymentStatus;\n/**\n* DeploymentStrategy describes how to replace existing pods with new ones.\n*/\nclass ExtensionsV1beta1DeploymentStrategy {\n static getAttributeTypeMap() {\n return ExtensionsV1beta1DeploymentStrategy.attributeTypeMap;\n }\n}\nExtensionsV1beta1DeploymentStrategy.discriminator = undefined;\nExtensionsV1beta1DeploymentStrategy.attributeTypeMap = [\n {\n \"name\": \"rollingUpdate\",\n \"baseName\": \"rollingUpdate\",\n \"type\": \"ExtensionsV1beta1RollingUpdateDeployment\"\n },\n {\n \"name\": \"type\",\n \"baseName\": \"type\",\n \"type\": \"string\"\n }\n];\nexports.ExtensionsV1beta1DeploymentStrategy = ExtensionsV1beta1DeploymentStrategy;\n/**\n* FSGroupStrategyOptions defines the strategy type and options used to create the strategy. Deprecated: use FSGroupStrategyOptions from policy API Group instead.\n*/\nclass ExtensionsV1beta1FSGroupStrategyOptions {\n static getAttributeTypeMap() {\n return ExtensionsV1beta1FSGroupStrategyOptions.attributeTypeMap;\n }\n}\nExtensionsV1beta1FSGroupStrategyOptions.discriminator = undefined;\nExtensionsV1beta1FSGroupStrategyOptions.attributeTypeMap = [\n {\n \"name\": \"ranges\",\n \"baseName\": \"ranges\",\n \"type\": \"Array\"\n },\n {\n \"name\": \"rule\",\n \"baseName\": \"rule\",\n \"type\": \"string\"\n }\n];\nexports.ExtensionsV1beta1FSGroupStrategyOptions = ExtensionsV1beta1FSGroupStrategyOptions;\n/**\n* HostPortRange defines a range of host ports that will be enabled by a policy for pods to use. It requires both the start and end to be defined. Deprecated: use HostPortRange from policy API Group instead.\n*/\nclass ExtensionsV1beta1HostPortRange {\n static getAttributeTypeMap() {\n return ExtensionsV1beta1HostPortRange.attributeTypeMap;\n }\n}\nExtensionsV1beta1HostPortRange.discriminator = undefined;\nExtensionsV1beta1HostPortRange.attributeTypeMap = [\n {\n \"name\": \"max\",\n \"baseName\": \"max\",\n \"type\": \"number\"\n },\n {\n \"name\": \"min\",\n \"baseName\": \"min\",\n \"type\": \"number\"\n }\n];\nexports.ExtensionsV1beta1HostPortRange = ExtensionsV1beta1HostPortRange;\n/**\n* IDRange provides a min/max of an allowed range of IDs. Deprecated: use IDRange from policy API Group instead.\n*/\nclass ExtensionsV1beta1IDRange {\n static getAttributeTypeMap() {\n return ExtensionsV1beta1IDRange.attributeTypeMap;\n }\n}\nExtensionsV1beta1IDRange.discriminator = undefined;\nExtensionsV1beta1IDRange.attributeTypeMap = [\n {\n \"name\": \"max\",\n \"baseName\": \"max\",\n \"type\": \"number\"\n },\n {\n \"name\": \"min\",\n \"baseName\": \"min\",\n \"type\": \"number\"\n }\n];\nexports.ExtensionsV1beta1IDRange = ExtensionsV1beta1IDRange;\n/**\n* 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.\n*/\nclass ExtensionsV1beta1PodSecurityPolicy {\n static getAttributeTypeMap() {\n return ExtensionsV1beta1PodSecurityPolicy.attributeTypeMap;\n }\n}\nExtensionsV1beta1PodSecurityPolicy.discriminator = undefined;\nExtensionsV1beta1PodSecurityPolicy.attributeTypeMap = [\n {\n \"name\": \"apiVersion\",\n \"baseName\": \"apiVersion\",\n \"type\": \"string\"\n },\n {\n \"name\": \"kind\",\n \"baseName\": \"kind\",\n \"type\": \"string\"\n },\n {\n \"name\": \"metadata\",\n \"baseName\": \"metadata\",\n \"type\": \"V1ObjectMeta\"\n },\n {\n \"name\": \"spec\",\n \"baseName\": \"spec\",\n \"type\": \"ExtensionsV1beta1PodSecurityPolicySpec\"\n }\n];\nexports.ExtensionsV1beta1PodSecurityPolicy = ExtensionsV1beta1PodSecurityPolicy;\n/**\n* PodSecurityPolicyList is a list of PodSecurityPolicy objects. Deprecated: use PodSecurityPolicyList from policy API Group instead.\n*/\nclass ExtensionsV1beta1PodSecurityPolicyList {\n static getAttributeTypeMap() {\n return ExtensionsV1beta1PodSecurityPolicyList.attributeTypeMap;\n }\n}\nExtensionsV1beta1PodSecurityPolicyList.discriminator = undefined;\nExtensionsV1beta1PodSecurityPolicyList.attributeTypeMap = [\n {\n \"name\": \"apiVersion\",\n \"baseName\": \"apiVersion\",\n \"type\": \"string\"\n },\n {\n \"name\": \"items\",\n \"baseName\": \"items\",\n \"type\": \"Array\"\n },\n {\n \"name\": \"kind\",\n \"baseName\": \"kind\",\n \"type\": \"string\"\n },\n {\n \"name\": \"metadata\",\n \"baseName\": \"metadata\",\n \"type\": \"V1ListMeta\"\n }\n];\nexports.ExtensionsV1beta1PodSecurityPolicyList = ExtensionsV1beta1PodSecurityPolicyList;\n/**\n* PodSecurityPolicySpec defines the policy enforced. Deprecated: use PodSecurityPolicySpec from policy API Group instead.\n*/\nclass ExtensionsV1beta1PodSecurityPolicySpec {\n static getAttributeTypeMap() {\n return ExtensionsV1beta1PodSecurityPolicySpec.attributeTypeMap;\n }\n}\nExtensionsV1beta1PodSecurityPolicySpec.discriminator = undefined;\nExtensionsV1beta1PodSecurityPolicySpec.attributeTypeMap = [\n {\n \"name\": \"allowPrivilegeEscalation\",\n \"baseName\": \"allowPrivilegeEscalation\",\n \"type\": \"boolean\"\n },\n {\n \"name\": \"allowedCapabilities\",\n \"baseName\": \"allowedCapabilities\",\n \"type\": \"Array\"\n },\n {\n \"name\": \"allowedFlexVolumes\",\n \"baseName\": \"allowedFlexVolumes\",\n \"type\": \"Array\"\n },\n {\n \"name\": \"allowedHostPaths\",\n \"baseName\": \"allowedHostPaths\",\n \"type\": \"Array\"\n },\n {\n \"name\": \"allowedProcMountTypes\",\n \"baseName\": \"allowedProcMountTypes\",\n \"type\": \"Array\"\n },\n {\n \"name\": \"allowedUnsafeSysctls\",\n \"baseName\": \"allowedUnsafeSysctls\",\n \"type\": \"Array\"\n },\n {\n \"name\": \"defaultAddCapabilities\",\n \"baseName\": \"defaultAddCapabilities\",\n \"type\": \"Array\"\n },\n {\n \"name\": \"defaultAllowPrivilegeEscalation\",\n \"baseName\": \"defaultAllowPrivilegeEscalation\",\n \"type\": \"boolean\"\n },\n {\n \"name\": \"forbiddenSysctls\",\n \"baseName\": \"forbiddenSysctls\",\n \"type\": \"Array\"\n },\n {\n \"name\": \"fsGroup\",\n \"baseName\": \"fsGroup\",\n \"type\": \"ExtensionsV1beta1FSGroupStrategyOptions\"\n },\n {\n \"name\": \"hostIPC\",\n \"baseName\": \"hostIPC\",\n \"type\": \"boolean\"\n },\n {\n \"name\": \"hostNetwork\",\n \"baseName\": \"hostNetwork\",\n \"type\": \"boolean\"\n },\n {\n \"name\": \"hostPID\",\n \"baseName\": \"hostPID\",\n \"type\": \"boolean\"\n },\n {\n \"name\": \"hostPorts\",\n \"baseName\": \"hostPorts\",\n \"type\": \"Array\"\n },\n {\n \"name\": \"privileged\",\n \"baseName\": \"privileged\",\n \"type\": \"boolean\"\n },\n {\n \"name\": \"readOnlyRootFilesystem\",\n \"baseName\": \"readOnlyRootFilesystem\",\n \"type\": \"boolean\"\n },\n {\n \"name\": \"requiredDropCapabilities\",\n \"baseName\": \"requiredDropCapabilities\",\n \"type\": \"Array\"\n },\n {\n \"name\": \"runAsGroup\",\n \"baseName\": \"runAsGroup\",\n \"type\": \"ExtensionsV1beta1RunAsGroupStrategyOptions\"\n },\n {\n \"name\": \"runAsUser\",\n \"baseName\": \"runAsUser\",\n \"type\": \"ExtensionsV1beta1RunAsUserStrategyOptions\"\n },\n {\n \"name\": \"seLinux\",\n \"baseName\": \"seLinux\",\n \"type\": \"ExtensionsV1beta1SELinuxStrategyOptions\"\n },\n {\n \"name\": \"supplementalGroups\",\n \"baseName\": \"supplementalGroups\",\n \"type\": \"ExtensionsV1beta1SupplementalGroupsStrategyOptions\"\n },\n {\n \"name\": \"volumes\",\n \"baseName\": \"volumes\",\n \"type\": \"Array\"\n }\n];\nexports.ExtensionsV1beta1PodSecurityPolicySpec = ExtensionsV1beta1PodSecurityPolicySpec;\n/**\n* DEPRECATED.\n*/\nclass ExtensionsV1beta1RollbackConfig {\n static getAttributeTypeMap() {\n return ExtensionsV1beta1RollbackConfig.attributeTypeMap;\n }\n}\nExtensionsV1beta1RollbackConfig.discriminator = undefined;\nExtensionsV1beta1RollbackConfig.attributeTypeMap = [\n {\n \"name\": \"revision\",\n \"baseName\": \"revision\",\n \"type\": \"number\"\n }\n];\nexports.ExtensionsV1beta1RollbackConfig = ExtensionsV1beta1RollbackConfig;\n/**\n* Spec to control the desired behavior of rolling update.\n*/\nclass ExtensionsV1beta1RollingUpdateDeployment {\n static getAttributeTypeMap() {\n return ExtensionsV1beta1RollingUpdateDeployment.attributeTypeMap;\n }\n}\nExtensionsV1beta1RollingUpdateDeployment.discriminator = undefined;\nExtensionsV1beta1RollingUpdateDeployment.attributeTypeMap = [\n {\n \"name\": \"maxSurge\",\n \"baseName\": \"maxSurge\",\n \"type\": \"any\"\n },\n {\n \"name\": \"maxUnavailable\",\n \"baseName\": \"maxUnavailable\",\n \"type\": \"any\"\n }\n];\nexports.ExtensionsV1beta1RollingUpdateDeployment = ExtensionsV1beta1RollingUpdateDeployment;\n/**\n* RunAsGroupStrategyOptions defines the strategy type and any options used to create the strategy. Deprecated: use RunAsGroupStrategyOptions from policy API Group instead.\n*/\nclass ExtensionsV1beta1RunAsGroupStrategyOptions {\n static getAttributeTypeMap() {\n return ExtensionsV1beta1RunAsGroupStrategyOptions.attributeTypeMap;\n }\n}\nExtensionsV1beta1RunAsGroupStrategyOptions.discriminator = undefined;\nExtensionsV1beta1RunAsGroupStrategyOptions.attributeTypeMap = [\n {\n \"name\": \"ranges\",\n \"baseName\": \"ranges\",\n \"type\": \"Array\"\n },\n {\n \"name\": \"rule\",\n \"baseName\": \"rule\",\n \"type\": \"string\"\n }\n];\nexports.ExtensionsV1beta1RunAsGroupStrategyOptions = ExtensionsV1beta1RunAsGroupStrategyOptions;\n/**\n* RunAsUserStrategyOptions defines the strategy type and any options used to create the strategy. Deprecated: use RunAsUserStrategyOptions from policy API Group instead.\n*/\nclass ExtensionsV1beta1RunAsUserStrategyOptions {\n static getAttributeTypeMap() {\n return ExtensionsV1beta1RunAsUserStrategyOptions.attributeTypeMap;\n }\n}\nExtensionsV1beta1RunAsUserStrategyOptions.discriminator = undefined;\nExtensionsV1beta1RunAsUserStrategyOptions.attributeTypeMap = [\n {\n \"name\": \"ranges\",\n \"baseName\": \"ranges\",\n \"type\": \"Array\"\n },\n {\n \"name\": \"rule\",\n \"baseName\": \"rule\",\n \"type\": \"string\"\n }\n];\nexports.ExtensionsV1beta1RunAsUserStrategyOptions = ExtensionsV1beta1RunAsUserStrategyOptions;\n/**\n* SELinuxStrategyOptions defines the strategy type and any options used to create the strategy. Deprecated: use SELinuxStrategyOptions from policy API Group instead.\n*/\nclass ExtensionsV1beta1SELinuxStrategyOptions {\n static getAttributeTypeMap() {\n return ExtensionsV1beta1SELinuxStrategyOptions.attributeTypeMap;\n }\n}\nExtensionsV1beta1SELinuxStrategyOptions.discriminator = undefined;\nExtensionsV1beta1SELinuxStrategyOptions.attributeTypeMap = [\n {\n \"name\": \"rule\",\n \"baseName\": \"rule\",\n \"type\": \"string\"\n },\n {\n \"name\": \"seLinuxOptions\",\n \"baseName\": \"seLinuxOptions\",\n \"type\": \"V1SELinuxOptions\"\n }\n];\nexports.ExtensionsV1beta1SELinuxStrategyOptions = ExtensionsV1beta1SELinuxStrategyOptions;\n/**\n* represents a scaling request for a resource.\n*/\nclass ExtensionsV1beta1Scale {\n static getAttributeTypeMap() {\n return ExtensionsV1beta1Scale.attributeTypeMap;\n }\n}\nExtensionsV1beta1Scale.discriminator = undefined;\nExtensionsV1beta1Scale.attributeTypeMap = [\n {\n \"name\": \"apiVersion\",\n \"baseName\": \"apiVersion\",\n \"type\": \"string\"\n },\n {\n \"name\": \"kind\",\n \"baseName\": \"kind\",\n \"type\": \"string\"\n },\n {\n \"name\": \"metadata\",\n \"baseName\": \"metadata\",\n \"type\": \"V1ObjectMeta\"\n },\n {\n \"name\": \"spec\",\n \"baseName\": \"spec\",\n \"type\": \"ExtensionsV1beta1ScaleSpec\"\n },\n {\n \"name\": \"status\",\n \"baseName\": \"status\",\n \"type\": \"ExtensionsV1beta1ScaleStatus\"\n }\n];\nexports.ExtensionsV1beta1Scale = ExtensionsV1beta1Scale;\n/**\n* describes the attributes of a scale subresource\n*/\nclass ExtensionsV1beta1ScaleSpec {\n static getAttributeTypeMap() {\n return ExtensionsV1beta1ScaleSpec.attributeTypeMap;\n }\n}\nExtensionsV1beta1ScaleSpec.discriminator = undefined;\nExtensionsV1beta1ScaleSpec.attributeTypeMap = [\n {\n \"name\": \"replicas\",\n \"baseName\": \"replicas\",\n \"type\": \"number\"\n }\n];\nexports.ExtensionsV1beta1ScaleSpec = ExtensionsV1beta1ScaleSpec;\n/**\n* represents the current status of a scale subresource.\n*/\nclass ExtensionsV1beta1ScaleStatus {\n static getAttributeTypeMap() {\n return ExtensionsV1beta1ScaleStatus.attributeTypeMap;\n }\n}\nExtensionsV1beta1ScaleStatus.discriminator = undefined;\nExtensionsV1beta1ScaleStatus.attributeTypeMap = [\n {\n \"name\": \"replicas\",\n \"baseName\": \"replicas\",\n \"type\": \"number\"\n },\n {\n \"name\": \"selector\",\n \"baseName\": \"selector\",\n \"type\": \"{ [key: string]: string; }\"\n },\n {\n \"name\": \"targetSelector\",\n \"baseName\": \"targetSelector\",\n \"type\": \"string\"\n }\n];\nexports.ExtensionsV1beta1ScaleStatus = ExtensionsV1beta1ScaleStatus;\n/**\n* SupplementalGroupsStrategyOptions defines the strategy type and options used to create the strategy. Deprecated: use SupplementalGroupsStrategyOptions from policy API Group instead.\n*/\nclass ExtensionsV1beta1SupplementalGroupsStrategyOptions {\n static getAttributeTypeMap() {\n return ExtensionsV1beta1SupplementalGroupsStrategyOptions.attributeTypeMap;\n }\n}\nExtensionsV1beta1SupplementalGroupsStrategyOptions.discriminator = undefined;\nExtensionsV1beta1SupplementalGroupsStrategyOptions.attributeTypeMap = [\n {\n \"name\": \"ranges\",\n \"baseName\": \"ranges\",\n \"type\": \"Array\"\n },\n {\n \"name\": \"rule\",\n \"baseName\": \"rule\",\n \"type\": \"string\"\n }\n];\nexports.ExtensionsV1beta1SupplementalGroupsStrategyOptions = ExtensionsV1beta1SupplementalGroupsStrategyOptions;\n/**\n* AllowedFlexVolume represents a single Flexvolume that is allowed to be used.\n*/\nclass PolicyV1beta1AllowedFlexVolume {\n static getAttributeTypeMap() {\n return PolicyV1beta1AllowedFlexVolume.attributeTypeMap;\n }\n}\nPolicyV1beta1AllowedFlexVolume.discriminator = undefined;\nPolicyV1beta1AllowedFlexVolume.attributeTypeMap = [\n {\n \"name\": \"driver\",\n \"baseName\": \"driver\",\n \"type\": \"string\"\n }\n];\nexports.PolicyV1beta1AllowedFlexVolume = PolicyV1beta1AllowedFlexVolume;\n/**\n* AllowedHostPath defines the host volume conditions that will be enabled by a policy for pods to use. It requires the path prefix to be defined.\n*/\nclass PolicyV1beta1AllowedHostPath {\n static getAttributeTypeMap() {\n return PolicyV1beta1AllowedHostPath.attributeTypeMap;\n }\n}\nPolicyV1beta1AllowedHostPath.discriminator = undefined;\nPolicyV1beta1AllowedHostPath.attributeTypeMap = [\n {\n \"name\": \"pathPrefix\",\n \"baseName\": \"pathPrefix\",\n \"type\": \"string\"\n },\n {\n \"name\": \"readOnly\",\n \"baseName\": \"readOnly\",\n \"type\": \"boolean\"\n }\n];\nexports.PolicyV1beta1AllowedHostPath = PolicyV1beta1AllowedHostPath;\n/**\n* FSGroupStrategyOptions defines the strategy type and options used to create the strategy.\n*/\nclass PolicyV1beta1FSGroupStrategyOptions {\n static getAttributeTypeMap() {\n return PolicyV1beta1FSGroupStrategyOptions.attributeTypeMap;\n }\n}\nPolicyV1beta1FSGroupStrategyOptions.discriminator = undefined;\nPolicyV1beta1FSGroupStrategyOptions.attributeTypeMap = [\n {\n \"name\": \"ranges\",\n \"baseName\": \"ranges\",\n \"type\": \"Array\"\n },\n {\n \"name\": \"rule\",\n \"baseName\": \"rule\",\n \"type\": \"string\"\n }\n];\nexports.PolicyV1beta1FSGroupStrategyOptions = PolicyV1beta1FSGroupStrategyOptions;\n/**\n* HostPortRange defines a range of host ports that will be enabled by a policy for pods to use. It requires both the start and end to be defined.\n*/\nclass PolicyV1beta1HostPortRange {\n static getAttributeTypeMap() {\n return PolicyV1beta1HostPortRange.attributeTypeMap;\n }\n}\nPolicyV1beta1HostPortRange.discriminator = undefined;\nPolicyV1beta1HostPortRange.attributeTypeMap = [\n {\n \"name\": \"max\",\n \"baseName\": \"max\",\n \"type\": \"number\"\n },\n {\n \"name\": \"min\",\n \"baseName\": \"min\",\n \"type\": \"number\"\n }\n];\nexports.PolicyV1beta1HostPortRange = PolicyV1beta1HostPortRange;\n/**\n* IDRange provides a min/max of an allowed range of IDs.\n*/\nclass PolicyV1beta1IDRange {\n static getAttributeTypeMap() {\n return PolicyV1beta1IDRange.attributeTypeMap;\n }\n}\nPolicyV1beta1IDRange.discriminator = undefined;\nPolicyV1beta1IDRange.attributeTypeMap = [\n {\n \"name\": \"max\",\n \"baseName\": \"max\",\n \"type\": \"number\"\n },\n {\n \"name\": \"min\",\n \"baseName\": \"min\",\n \"type\": \"number\"\n }\n];\nexports.PolicyV1beta1IDRange = PolicyV1beta1IDRange;\n/**\n* PodSecurityPolicy governs the ability to make requests that affect the Security Context that will be applied to a pod and container.\n*/\nclass PolicyV1beta1PodSecurityPolicy {\n static getAttributeTypeMap() {\n return PolicyV1beta1PodSecurityPolicy.attributeTypeMap;\n }\n}\nPolicyV1beta1PodSecurityPolicy.discriminator = undefined;\nPolicyV1beta1PodSecurityPolicy.attributeTypeMap = [\n {\n \"name\": \"apiVersion\",\n \"baseName\": \"apiVersion\",\n \"type\": \"string\"\n },\n {\n \"name\": \"kind\",\n \"baseName\": \"kind\",\n \"type\": \"string\"\n },\n {\n \"name\": \"metadata\",\n \"baseName\": \"metadata\",\n \"type\": \"V1ObjectMeta\"\n },\n {\n \"name\": \"spec\",\n \"baseName\": \"spec\",\n \"type\": \"PolicyV1beta1PodSecurityPolicySpec\"\n }\n];\nexports.PolicyV1beta1PodSecurityPolicy = PolicyV1beta1PodSecurityPolicy;\n/**\n* PodSecurityPolicyList is a list of PodSecurityPolicy objects.\n*/\nclass PolicyV1beta1PodSecurityPolicyList {\n static getAttributeTypeMap() {\n return PolicyV1beta1PodSecurityPolicyList.attributeTypeMap;\n }\n}\nPolicyV1beta1PodSecurityPolicyList.discriminator = undefined;\nPolicyV1beta1PodSecurityPolicyList.attributeTypeMap = [\n {\n \"name\": \"apiVersion\",\n \"baseName\": \"apiVersion\",\n \"type\": \"string\"\n },\n {\n \"name\": \"items\",\n \"baseName\": \"items\",\n \"type\": \"Array\"\n },\n {\n \"name\": \"kind\",\n \"baseName\": \"kind\",\n \"type\": \"string\"\n },\n {\n \"name\": \"metadata\",\n \"baseName\": \"metadata\",\n \"type\": \"V1ListMeta\"\n }\n];\nexports.PolicyV1beta1PodSecurityPolicyList = PolicyV1beta1PodSecurityPolicyList;\n/**\n* PodSecurityPolicySpec defines the policy enforced.\n*/\nclass PolicyV1beta1PodSecurityPolicySpec {\n static getAttributeTypeMap() {\n return PolicyV1beta1PodSecurityPolicySpec.attributeTypeMap;\n }\n}\nPolicyV1beta1PodSecurityPolicySpec.discriminator = undefined;\nPolicyV1beta1PodSecurityPolicySpec.attributeTypeMap = [\n {\n \"name\": \"allowPrivilegeEscalation\",\n \"baseName\": \"allowPrivilegeEscalation\",\n \"type\": \"boolean\"\n },\n {\n \"name\": \"allowedCapabilities\",\n \"baseName\": \"allowedCapabilities\",\n \"type\": \"Array\"\n },\n {\n \"name\": \"allowedFlexVolumes\",\n \"baseName\": \"allowedFlexVolumes\",\n \"type\": \"Array\"\n },\n {\n \"name\": \"allowedHostPaths\",\n \"baseName\": \"allowedHostPaths\",\n \"type\": \"Array\"\n },\n {\n \"name\": \"allowedProcMountTypes\",\n \"baseName\": \"allowedProcMountTypes\",\n \"type\": \"Array\"\n },\n {\n \"name\": \"allowedUnsafeSysctls\",\n \"baseName\": \"allowedUnsafeSysctls\",\n \"type\": \"Array\"\n },\n {\n \"name\": \"defaultAddCapabilities\",\n \"baseName\": \"defaultAddCapabilities\",\n \"type\": \"Array\"\n },\n {\n \"name\": \"defaultAllowPrivilegeEscalation\",\n \"baseName\": \"defaultAllowPrivilegeEscalation\",\n \"type\": \"boolean\"\n },\n {\n \"name\": \"forbiddenSysctls\",\n \"baseName\": \"forbiddenSysctls\",\n \"type\": \"Array\"\n },\n {\n \"name\": \"fsGroup\",\n \"baseName\": \"fsGroup\",\n \"type\": \"PolicyV1beta1FSGroupStrategyOptions\"\n },\n {\n \"name\": \"hostIPC\",\n \"baseName\": \"hostIPC\",\n \"type\": \"boolean\"\n },\n {\n \"name\": \"hostNetwork\",\n \"baseName\": \"hostNetwork\",\n \"type\": \"boolean\"\n },\n {\n \"name\": \"hostPID\",\n \"baseName\": \"hostPID\",\n \"type\": \"boolean\"\n },\n {\n \"name\": \"hostPorts\",\n \"baseName\": \"hostPorts\",\n \"type\": \"Array\"\n },\n {\n \"name\": \"privileged\",\n \"baseName\": \"privileged\",\n \"type\": \"boolean\"\n },\n {\n \"name\": \"readOnlyRootFilesystem\",\n \"baseName\": \"readOnlyRootFilesystem\",\n \"type\": \"boolean\"\n },\n {\n \"name\": \"requiredDropCapabilities\",\n \"baseName\": \"requiredDropCapabilities\",\n \"type\": \"Array\"\n },\n {\n \"name\": \"runAsGroup\",\n \"baseName\": \"runAsGroup\",\n \"type\": \"PolicyV1beta1RunAsGroupStrategyOptions\"\n },\n {\n \"name\": \"runAsUser\",\n \"baseName\": \"runAsUser\",\n \"type\": \"PolicyV1beta1RunAsUserStrategyOptions\"\n },\n {\n \"name\": \"seLinux\",\n \"baseName\": \"seLinux\",\n \"type\": \"PolicyV1beta1SELinuxStrategyOptions\"\n },\n {\n \"name\": \"supplementalGroups\",\n \"baseName\": \"supplementalGroups\",\n \"type\": \"PolicyV1beta1SupplementalGroupsStrategyOptions\"\n },\n {\n \"name\": \"volumes\",\n \"baseName\": \"volumes\",\n \"type\": \"Array\"\n }\n];\nexports.PolicyV1beta1PodSecurityPolicySpec = PolicyV1beta1PodSecurityPolicySpec;\n/**\n* RunAsGroupStrategyOptions defines the strategy type and any options used to create the strategy.\n*/\nclass PolicyV1beta1RunAsGroupStrategyOptions {\n static getAttributeTypeMap() {\n return PolicyV1beta1RunAsGroupStrategyOptions.attributeTypeMap;\n }\n}\nPolicyV1beta1RunAsGroupStrategyOptions.discriminator = undefined;\nPolicyV1beta1RunAsGroupStrategyOptions.attributeTypeMap = [\n {\n \"name\": \"ranges\",\n \"baseName\": \"ranges\",\n \"type\": \"Array\"\n },\n {\n \"name\": \"rule\",\n \"baseName\": \"rule\",\n \"type\": \"string\"\n }\n];\nexports.PolicyV1beta1RunAsGroupStrategyOptions = PolicyV1beta1RunAsGroupStrategyOptions;\n/**\n* RunAsUserStrategyOptions defines the strategy type and any options used to create the strategy.\n*/\nclass PolicyV1beta1RunAsUserStrategyOptions {\n static getAttributeTypeMap() {\n return PolicyV1beta1RunAsUserStrategyOptions.attributeTypeMap;\n }\n}\nPolicyV1beta1RunAsUserStrategyOptions.discriminator = undefined;\nPolicyV1beta1RunAsUserStrategyOptions.attributeTypeMap = [\n {\n \"name\": \"ranges\",\n \"baseName\": \"ranges\",\n \"type\": \"Array\"\n },\n {\n \"name\": \"rule\",\n \"baseName\": \"rule\",\n \"type\": \"string\"\n }\n];\nexports.PolicyV1beta1RunAsUserStrategyOptions = PolicyV1beta1RunAsUserStrategyOptions;\n/**\n* SELinuxStrategyOptions defines the strategy type and any options used to create the strategy.\n*/\nclass PolicyV1beta1SELinuxStrategyOptions {\n static getAttributeTypeMap() {\n return PolicyV1beta1SELinuxStrategyOptions.attributeTypeMap;\n }\n}\nPolicyV1beta1SELinuxStrategyOptions.discriminator = undefined;\nPolicyV1beta1SELinuxStrategyOptions.attributeTypeMap = [\n {\n \"name\": \"rule\",\n \"baseName\": \"rule\",\n \"type\": \"string\"\n },\n {\n \"name\": \"seLinuxOptions\",\n \"baseName\": \"seLinuxOptions\",\n \"type\": \"V1SELinuxOptions\"\n }\n];\nexports.PolicyV1beta1SELinuxStrategyOptions = PolicyV1beta1SELinuxStrategyOptions;\n/**\n* SupplementalGroupsStrategyOptions defines the strategy type and options used to create the strategy.\n*/\nclass PolicyV1beta1SupplementalGroupsStrategyOptions {\n static getAttributeTypeMap() {\n return PolicyV1beta1SupplementalGroupsStrategyOptions.attributeTypeMap;\n }\n}\nPolicyV1beta1SupplementalGroupsStrategyOptions.discriminator = undefined;\nPolicyV1beta1SupplementalGroupsStrategyOptions.attributeTypeMap = [\n {\n \"name\": \"ranges\",\n \"baseName\": \"ranges\",\n \"type\": \"Array\"\n },\n {\n \"name\": \"rule\",\n \"baseName\": \"rule\",\n \"type\": \"string\"\n }\n];\nexports.PolicyV1beta1SupplementalGroupsStrategyOptions = PolicyV1beta1SupplementalGroupsStrategyOptions;\n/**\n* 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.)\n*/\nclass RuntimeRawExtension {\n static getAttributeTypeMap() {\n return RuntimeRawExtension.attributeTypeMap;\n }\n}\nRuntimeRawExtension.discriminator = undefined;\nRuntimeRawExtension.attributeTypeMap = [\n {\n \"name\": \"raw\",\n \"baseName\": \"Raw\",\n \"type\": \"string\"\n }\n];\nexports.RuntimeRawExtension = RuntimeRawExtension;\n/**\n* APIGroup contains the name, the supported versions, and the preferred version of a group.\n*/\nclass V1APIGroup {\n static getAttributeTypeMap() {\n return V1APIGroup.attributeTypeMap;\n }\n}\nV1APIGroup.discriminator = undefined;\nV1APIGroup.attributeTypeMap = [\n {\n \"name\": \"apiVersion\",\n \"baseName\": \"apiVersion\",\n \"type\": \"string\"\n },\n {\n \"name\": \"kind\",\n \"baseName\": \"kind\",\n \"type\": \"string\"\n },\n {\n \"name\": \"name\",\n \"baseName\": \"name\",\n \"type\": \"string\"\n },\n {\n \"name\": \"preferredVersion\",\n \"baseName\": \"preferredVersion\",\n \"type\": \"V1GroupVersionForDiscovery\"\n },\n {\n \"name\": \"serverAddressByClientCIDRs\",\n \"baseName\": \"serverAddressByClientCIDRs\",\n \"type\": \"Array\"\n },\n {\n \"name\": \"versions\",\n \"baseName\": \"versions\",\n \"type\": \"Array\"\n }\n];\nexports.V1APIGroup = V1APIGroup;\n/**\n* APIGroupList is a list of APIGroup, to allow clients to discover the API at /apis.\n*/\nclass V1APIGroupList {\n static getAttributeTypeMap() {\n return V1APIGroupList.attributeTypeMap;\n }\n}\nV1APIGroupList.discriminator = undefined;\nV1APIGroupList.attributeTypeMap = [\n {\n \"name\": \"apiVersion\",\n \"baseName\": \"apiVersion\",\n \"type\": \"string\"\n },\n {\n \"name\": \"groups\",\n \"baseName\": \"groups\",\n \"type\": \"Array\"\n },\n {\n \"name\": \"kind\",\n \"baseName\": \"kind\",\n \"type\": \"string\"\n }\n];\nexports.V1APIGroupList = V1APIGroupList;\n/**\n* APIResource specifies the name of a resource and whether it is namespaced.\n*/\nclass V1APIResource {\n static getAttributeTypeMap() {\n return V1APIResource.attributeTypeMap;\n }\n}\nV1APIResource.discriminator = undefined;\nV1APIResource.attributeTypeMap = [\n {\n \"name\": \"categories\",\n \"baseName\": \"categories\",\n \"type\": \"Array\"\n },\n {\n \"name\": \"group\",\n \"baseName\": \"group\",\n \"type\": \"string\"\n },\n {\n \"name\": \"kind\",\n \"baseName\": \"kind\",\n \"type\": \"string\"\n },\n {\n \"name\": \"name\",\n \"baseName\": \"name\",\n \"type\": \"string\"\n },\n {\n \"name\": \"namespaced\",\n \"baseName\": \"namespaced\",\n \"type\": \"boolean\"\n },\n {\n \"name\": \"shortNames\",\n \"baseName\": \"shortNames\",\n \"type\": \"Array\"\n },\n {\n \"name\": \"singularName\",\n \"baseName\": \"singularName\",\n \"type\": \"string\"\n },\n {\n \"name\": \"verbs\",\n \"baseName\": \"verbs\",\n \"type\": \"Array\"\n },\n {\n \"name\": \"version\",\n \"baseName\": \"version\",\n \"type\": \"string\"\n }\n];\nexports.V1APIResource = V1APIResource;\n/**\n* APIResourceList is a list of APIResource, it is used to expose the name of the resources supported in a specific group and version, and if the resource is namespaced.\n*/\nclass V1APIResourceList {\n static getAttributeTypeMap() {\n return V1APIResourceList.attributeTypeMap;\n }\n}\nV1APIResourceList.discriminator = undefined;\nV1APIResourceList.attributeTypeMap = [\n {\n \"name\": \"apiVersion\",\n \"baseName\": \"apiVersion\",\n \"type\": \"string\"\n },\n {\n \"name\": \"groupVersion\",\n \"baseName\": \"groupVersion\",\n \"type\": \"string\"\n },\n {\n \"name\": \"kind\",\n \"baseName\": \"kind\",\n \"type\": \"string\"\n },\n {\n \"name\": \"resources\",\n \"baseName\": \"resources\",\n \"type\": \"Array\"\n }\n];\nexports.V1APIResourceList = V1APIResourceList;\n/**\n* APIService represents a server for a particular GroupVersion. Name must be \\\"version.group\\\".\n*/\nclass V1APIService {\n static getAttributeTypeMap() {\n return V1APIService.attributeTypeMap;\n }\n}\nV1APIService.discriminator = undefined;\nV1APIService.attributeTypeMap = [\n {\n \"name\": \"apiVersion\",\n \"baseName\": \"apiVersion\",\n \"type\": \"string\"\n },\n {\n \"name\": \"kind\",\n \"baseName\": \"kind\",\n \"type\": \"string\"\n },\n {\n \"name\": \"metadata\",\n \"baseName\": \"metadata\",\n \"type\": \"V1ObjectMeta\"\n },\n {\n \"name\": \"spec\",\n \"baseName\": \"spec\",\n \"type\": \"V1APIServiceSpec\"\n },\n {\n \"name\": \"status\",\n \"baseName\": \"status\",\n \"type\": \"V1APIServiceStatus\"\n }\n];\nexports.V1APIService = V1APIService;\nclass V1APIServiceCondition {\n static getAttributeTypeMap() {\n return V1APIServiceCondition.attributeTypeMap;\n }\n}\nV1APIServiceCondition.discriminator = undefined;\nV1APIServiceCondition.attributeTypeMap = [\n {\n \"name\": \"lastTransitionTime\",\n \"baseName\": \"lastTransitionTime\",\n \"type\": \"Date\"\n },\n {\n \"name\": \"message\",\n \"baseName\": \"message\",\n \"type\": \"string\"\n },\n {\n \"name\": \"reason\",\n \"baseName\": \"reason\",\n \"type\": \"string\"\n },\n {\n \"name\": \"status\",\n \"baseName\": \"status\",\n \"type\": \"string\"\n },\n {\n \"name\": \"type\",\n \"baseName\": \"type\",\n \"type\": \"string\"\n }\n];\nexports.V1APIServiceCondition = V1APIServiceCondition;\n/**\n* APIServiceList is a list of APIService objects.\n*/\nclass V1APIServiceList {\n static getAttributeTypeMap() {\n return V1APIServiceList.attributeTypeMap;\n }\n}\nV1APIServiceList.discriminator = undefined;\nV1APIServiceList.attributeTypeMap = [\n {\n \"name\": \"apiVersion\",\n \"baseName\": \"apiVersion\",\n \"type\": \"string\"\n },\n {\n \"name\": \"items\",\n \"baseName\": \"items\",\n \"type\": \"Array\"\n },\n {\n \"name\": \"kind\",\n \"baseName\": \"kind\",\n \"type\": \"string\"\n },\n {\n \"name\": \"metadata\",\n \"baseName\": \"metadata\",\n \"type\": \"V1ListMeta\"\n }\n];\nexports.V1APIServiceList = V1APIServiceList;\n/**\n* APIServiceSpec contains information for locating and communicating with a server. Only https is supported, though you are able to disable certificate verification.\n*/\nclass V1APIServiceSpec {\n static getAttributeTypeMap() {\n return V1APIServiceSpec.attributeTypeMap;\n }\n}\nV1APIServiceSpec.discriminator = undefined;\nV1APIServiceSpec.attributeTypeMap = [\n {\n \"name\": \"caBundle\",\n \"baseName\": \"caBundle\",\n \"type\": \"string\"\n },\n {\n \"name\": \"group\",\n \"baseName\": \"group\",\n \"type\": \"string\"\n },\n {\n \"name\": \"groupPriorityMinimum\",\n \"baseName\": \"groupPriorityMinimum\",\n \"type\": \"number\"\n },\n {\n \"name\": \"insecureSkipTLSVerify\",\n \"baseName\": \"insecureSkipTLSVerify\",\n \"type\": \"boolean\"\n },\n {\n \"name\": \"service\",\n \"baseName\": \"service\",\n \"type\": \"V1ServiceReference\"\n },\n {\n \"name\": \"version\",\n \"baseName\": \"version\",\n \"type\": \"string\"\n },\n {\n \"name\": \"versionPriority\",\n \"baseName\": \"versionPriority\",\n \"type\": \"number\"\n }\n];\nexports.V1APIServiceSpec = V1APIServiceSpec;\n/**\n* APIServiceStatus contains derived information about an API server\n*/\nclass V1APIServiceStatus {\n static getAttributeTypeMap() {\n return V1APIServiceStatus.attributeTypeMap;\n }\n}\nV1APIServiceStatus.discriminator = undefined;\nV1APIServiceStatus.attributeTypeMap = [\n {\n \"name\": \"conditions\",\n \"baseName\": \"conditions\",\n \"type\": \"Array\"\n }\n];\nexports.V1APIServiceStatus = V1APIServiceStatus;\n/**\n* APIVersions lists the versions that are available, to allow clients to discover the API at /api, which is the root path of the legacy v1 API.\n*/\nclass V1APIVersions {\n static getAttributeTypeMap() {\n return V1APIVersions.attributeTypeMap;\n }\n}\nV1APIVersions.discriminator = undefined;\nV1APIVersions.attributeTypeMap = [\n {\n \"name\": \"apiVersion\",\n \"baseName\": \"apiVersion\",\n \"type\": \"string\"\n },\n {\n \"name\": \"kind\",\n \"baseName\": \"kind\",\n \"type\": \"string\"\n },\n {\n \"name\": \"serverAddressByClientCIDRs\",\n \"baseName\": \"serverAddressByClientCIDRs\",\n \"type\": \"Array\"\n },\n {\n \"name\": \"versions\",\n \"baseName\": \"versions\",\n \"type\": \"Array\"\n }\n];\nexports.V1APIVersions = V1APIVersions;\n/**\n* Represents a Persistent Disk resource in AWS. An AWS EBS disk must exist before mounting to a container. The disk must also be in the same AWS zone as the kubelet. An AWS EBS disk can only be mounted as read/write once. AWS EBS volumes support ownership management and SELinux relabeling.\n*/\nclass V1AWSElasticBlockStoreVolumeSource {\n static getAttributeTypeMap() {\n return V1AWSElasticBlockStoreVolumeSource.attributeTypeMap;\n }\n}\nV1AWSElasticBlockStoreVolumeSource.discriminator = undefined;\nV1AWSElasticBlockStoreVolumeSource.attributeTypeMap = [\n {\n \"name\": \"fsType\",\n \"baseName\": \"fsType\",\n \"type\": \"string\"\n },\n {\n \"name\": \"partition\",\n \"baseName\": \"partition\",\n \"type\": \"number\"\n },\n {\n \"name\": \"readOnly\",\n \"baseName\": \"readOnly\",\n \"type\": \"boolean\"\n },\n {\n \"name\": \"volumeID\",\n \"baseName\": \"volumeID\",\n \"type\": \"string\"\n }\n];\nexports.V1AWSElasticBlockStoreVolumeSource = V1AWSElasticBlockStoreVolumeSource;\n/**\n* Affinity is a group of affinity scheduling rules.\n*/\nclass V1Affinity {\n static getAttributeTypeMap() {\n return V1Affinity.attributeTypeMap;\n }\n}\nV1Affinity.discriminator = undefined;\nV1Affinity.attributeTypeMap = [\n {\n \"name\": \"nodeAffinity\",\n \"baseName\": \"nodeAffinity\",\n \"type\": \"V1NodeAffinity\"\n },\n {\n \"name\": \"podAffinity\",\n \"baseName\": \"podAffinity\",\n \"type\": \"V1PodAffinity\"\n },\n {\n \"name\": \"podAntiAffinity\",\n \"baseName\": \"podAntiAffinity\",\n \"type\": \"V1PodAntiAffinity\"\n }\n];\nexports.V1Affinity = V1Affinity;\n/**\n* AggregationRule describes how to locate ClusterRoles to aggregate into the ClusterRole\n*/\nclass V1AggregationRule {\n static getAttributeTypeMap() {\n return V1AggregationRule.attributeTypeMap;\n }\n}\nV1AggregationRule.discriminator = undefined;\nV1AggregationRule.attributeTypeMap = [\n {\n \"name\": \"clusterRoleSelectors\",\n \"baseName\": \"clusterRoleSelectors\",\n \"type\": \"Array\"\n }\n];\nexports.V1AggregationRule = V1AggregationRule;\n/**\n* AttachedVolume describes a volume attached to a node\n*/\nclass V1AttachedVolume {\n static getAttributeTypeMap() {\n return V1AttachedVolume.attributeTypeMap;\n }\n}\nV1AttachedVolume.discriminator = undefined;\nV1AttachedVolume.attributeTypeMap = [\n {\n \"name\": \"devicePath\",\n \"baseName\": \"devicePath\",\n \"type\": \"string\"\n },\n {\n \"name\": \"name\",\n \"baseName\": \"name\",\n \"type\": \"string\"\n }\n];\nexports.V1AttachedVolume = V1AttachedVolume;\n/**\n* AzureDisk represents an Azure Data Disk mount on the host and bind mount to the pod.\n*/\nclass V1AzureDiskVolumeSource {\n static getAttributeTypeMap() {\n return V1AzureDiskVolumeSource.attributeTypeMap;\n }\n}\nV1AzureDiskVolumeSource.discriminator = undefined;\nV1AzureDiskVolumeSource.attributeTypeMap = [\n {\n \"name\": \"cachingMode\",\n \"baseName\": \"cachingMode\",\n \"type\": \"string\"\n },\n {\n \"name\": \"diskName\",\n \"baseName\": \"diskName\",\n \"type\": \"string\"\n },\n {\n \"name\": \"diskURI\",\n \"baseName\": \"diskURI\",\n \"type\": \"string\"\n },\n {\n \"name\": \"fsType\",\n \"baseName\": \"fsType\",\n \"type\": \"string\"\n },\n {\n \"name\": \"kind\",\n \"baseName\": \"kind\",\n \"type\": \"string\"\n },\n {\n \"name\": \"readOnly\",\n \"baseName\": \"readOnly\",\n \"type\": \"boolean\"\n }\n];\nexports.V1AzureDiskVolumeSource = V1AzureDiskVolumeSource;\n/**\n* AzureFile represents an Azure File Service mount on the host and bind mount to the pod.\n*/\nclass V1AzureFilePersistentVolumeSource {\n static getAttributeTypeMap() {\n return V1AzureFilePersistentVolumeSource.attributeTypeMap;\n }\n}\nV1AzureFilePersistentVolumeSource.discriminator = undefined;\nV1AzureFilePersistentVolumeSource.attributeTypeMap = [\n {\n \"name\": \"readOnly\",\n \"baseName\": \"readOnly\",\n \"type\": \"boolean\"\n },\n {\n \"name\": \"secretName\",\n \"baseName\": \"secretName\",\n \"type\": \"string\"\n },\n {\n \"name\": \"secretNamespace\",\n \"baseName\": \"secretNamespace\",\n \"type\": \"string\"\n },\n {\n \"name\": \"shareName\",\n \"baseName\": \"shareName\",\n \"type\": \"string\"\n }\n];\nexports.V1AzureFilePersistentVolumeSource = V1AzureFilePersistentVolumeSource;\n/**\n* AzureFile represents an Azure File Service mount on the host and bind mount to the pod.\n*/\nclass V1AzureFileVolumeSource {\n static getAttributeTypeMap() {\n return V1AzureFileVolumeSource.attributeTypeMap;\n }\n}\nV1AzureFileVolumeSource.discriminator = undefined;\nV1AzureFileVolumeSource.attributeTypeMap = [\n {\n \"name\": \"readOnly\",\n \"baseName\": \"readOnly\",\n \"type\": \"boolean\"\n },\n {\n \"name\": \"secretName\",\n \"baseName\": \"secretName\",\n \"type\": \"string\"\n },\n {\n \"name\": \"shareName\",\n \"baseName\": \"shareName\",\n \"type\": \"string\"\n }\n];\nexports.V1AzureFileVolumeSource = V1AzureFileVolumeSource;\n/**\n* Binding ties one object to another; for example, a pod is bound to a node by a scheduler. Deprecated in 1.7, please use the bindings subresource of pods instead.\n*/\nclass V1Binding {\n static getAttributeTypeMap() {\n return V1Binding.attributeTypeMap;\n }\n}\nV1Binding.discriminator = undefined;\nV1Binding.attributeTypeMap = [\n {\n \"name\": \"apiVersion\",\n \"baseName\": \"apiVersion\",\n \"type\": \"string\"\n },\n {\n \"name\": \"kind\",\n \"baseName\": \"kind\",\n \"type\": \"string\"\n },\n {\n \"name\": \"metadata\",\n \"baseName\": \"metadata\",\n \"type\": \"V1ObjectMeta\"\n },\n {\n \"name\": \"target\",\n \"baseName\": \"target\",\n \"type\": \"V1ObjectReference\"\n }\n];\nexports.V1Binding = V1Binding;\n/**\n* Represents storage that is managed by an external CSI volume driver (Beta feature)\n*/\nclass V1CSIPersistentVolumeSource {\n static getAttributeTypeMap() {\n return V1CSIPersistentVolumeSource.attributeTypeMap;\n }\n}\nV1CSIPersistentVolumeSource.discriminator = undefined;\nV1CSIPersistentVolumeSource.attributeTypeMap = [\n {\n \"name\": \"controllerPublishSecretRef\",\n \"baseName\": \"controllerPublishSecretRef\",\n \"type\": \"V1SecretReference\"\n },\n {\n \"name\": \"driver\",\n \"baseName\": \"driver\",\n \"type\": \"string\"\n },\n {\n \"name\": \"fsType\",\n \"baseName\": \"fsType\",\n \"type\": \"string\"\n },\n {\n \"name\": \"nodePublishSecretRef\",\n \"baseName\": \"nodePublishSecretRef\",\n \"type\": \"V1SecretReference\"\n },\n {\n \"name\": \"nodeStageSecretRef\",\n \"baseName\": \"nodeStageSecretRef\",\n \"type\": \"V1SecretReference\"\n },\n {\n \"name\": \"readOnly\",\n \"baseName\": \"readOnly\",\n \"type\": \"boolean\"\n },\n {\n \"name\": \"volumeAttributes\",\n \"baseName\": \"volumeAttributes\",\n \"type\": \"{ [key: string]: string; }\"\n },\n {\n \"name\": \"volumeHandle\",\n \"baseName\": \"volumeHandle\",\n \"type\": \"string\"\n }\n];\nexports.V1CSIPersistentVolumeSource = V1CSIPersistentVolumeSource;\n/**\n* Adds and removes POSIX capabilities from running containers.\n*/\nclass V1Capabilities {\n static getAttributeTypeMap() {\n return V1Capabilities.attributeTypeMap;\n }\n}\nV1Capabilities.discriminator = undefined;\nV1Capabilities.attributeTypeMap = [\n {\n \"name\": \"add\",\n \"baseName\": \"add\",\n \"type\": \"Array\"\n },\n {\n \"name\": \"drop\",\n \"baseName\": \"drop\",\n \"type\": \"Array\"\n }\n];\nexports.V1Capabilities = V1Capabilities;\n/**\n* Represents a Ceph Filesystem mount that lasts the lifetime of a pod Cephfs volumes do not support ownership management or SELinux relabeling.\n*/\nclass V1CephFSPersistentVolumeSource {\n static getAttributeTypeMap() {\n return V1CephFSPersistentVolumeSource.attributeTypeMap;\n }\n}\nV1CephFSPersistentVolumeSource.discriminator = undefined;\nV1CephFSPersistentVolumeSource.attributeTypeMap = [\n {\n \"name\": \"monitors\",\n \"baseName\": \"monitors\",\n \"type\": \"Array\"\n },\n {\n \"name\": \"path\",\n \"baseName\": \"path\",\n \"type\": \"string\"\n },\n {\n \"name\": \"readOnly\",\n \"baseName\": \"readOnly\",\n \"type\": \"boolean\"\n },\n {\n \"name\": \"secretFile\",\n \"baseName\": \"secretFile\",\n \"type\": \"string\"\n },\n {\n \"name\": \"secretRef\",\n \"baseName\": \"secretRef\",\n \"type\": \"V1SecretReference\"\n },\n {\n \"name\": \"user\",\n \"baseName\": \"user\",\n \"type\": \"string\"\n }\n];\nexports.V1CephFSPersistentVolumeSource = V1CephFSPersistentVolumeSource;\n/**\n* Represents a Ceph Filesystem mount that lasts the lifetime of a pod Cephfs volumes do not support ownership management or SELinux relabeling.\n*/\nclass V1CephFSVolumeSource {\n static getAttributeTypeMap() {\n return V1CephFSVolumeSource.attributeTypeMap;\n }\n}\nV1CephFSVolumeSource.discriminator = undefined;\nV1CephFSVolumeSource.attributeTypeMap = [\n {\n \"name\": \"monitors\",\n \"baseName\": \"monitors\",\n \"type\": \"Array\"\n },\n {\n \"name\": \"path\",\n \"baseName\": \"path\",\n \"type\": \"string\"\n },\n {\n \"name\": \"readOnly\",\n \"baseName\": \"readOnly\",\n \"type\": \"boolean\"\n },\n {\n \"name\": \"secretFile\",\n \"baseName\": \"secretFile\",\n \"type\": \"string\"\n },\n {\n \"name\": \"secretRef\",\n \"baseName\": \"secretRef\",\n \"type\": \"V1LocalObjectReference\"\n },\n {\n \"name\": \"user\",\n \"baseName\": \"user\",\n \"type\": \"string\"\n }\n];\nexports.V1CephFSVolumeSource = V1CephFSVolumeSource;\n/**\n* Represents a cinder volume resource in Openstack. A Cinder volume must exist before mounting to a container. The volume must also be in the same region as the kubelet. Cinder volumes support ownership management and SELinux relabeling.\n*/\nclass V1CinderPersistentVolumeSource {\n static getAttributeTypeMap() {\n return V1CinderPersistentVolumeSource.attributeTypeMap;\n }\n}\nV1CinderPersistentVolumeSource.discriminator = undefined;\nV1CinderPersistentVolumeSource.attributeTypeMap = [\n {\n \"name\": \"fsType\",\n \"baseName\": \"fsType\",\n \"type\": \"string\"\n },\n {\n \"name\": \"readOnly\",\n \"baseName\": \"readOnly\",\n \"type\": \"boolean\"\n },\n {\n \"name\": \"secretRef\",\n \"baseName\": \"secretRef\",\n \"type\": \"V1SecretReference\"\n },\n {\n \"name\": \"volumeID\",\n \"baseName\": \"volumeID\",\n \"type\": \"string\"\n }\n];\nexports.V1CinderPersistentVolumeSource = V1CinderPersistentVolumeSource;\n/**\n* Represents a cinder volume resource in Openstack. A Cinder volume must exist before mounting to a container. The volume must also be in the same region as the kubelet. Cinder volumes support ownership management and SELinux relabeling.\n*/\nclass V1CinderVolumeSource {\n static getAttributeTypeMap() {\n return V1CinderVolumeSource.attributeTypeMap;\n }\n}\nV1CinderVolumeSource.discriminator = undefined;\nV1CinderVolumeSource.attributeTypeMap = [\n {\n \"name\": \"fsType\",\n \"baseName\": \"fsType\",\n \"type\": \"string\"\n },\n {\n \"name\": \"readOnly\",\n \"baseName\": \"readOnly\",\n \"type\": \"boolean\"\n },\n {\n \"name\": \"secretRef\",\n \"baseName\": \"secretRef\",\n \"type\": \"V1LocalObjectReference\"\n },\n {\n \"name\": \"volumeID\",\n \"baseName\": \"volumeID\",\n \"type\": \"string\"\n }\n];\nexports.V1CinderVolumeSource = V1CinderVolumeSource;\n/**\n* ClientIPConfig represents the configurations of Client IP based session affinity.\n*/\nclass V1ClientIPConfig {\n static getAttributeTypeMap() {\n return V1ClientIPConfig.attributeTypeMap;\n }\n}\nV1ClientIPConfig.discriminator = undefined;\nV1ClientIPConfig.attributeTypeMap = [\n {\n \"name\": \"timeoutSeconds\",\n \"baseName\": \"timeoutSeconds\",\n \"type\": \"number\"\n }\n];\nexports.V1ClientIPConfig = V1ClientIPConfig;\n/**\n* ClusterRole is a cluster level, logical grouping of PolicyRules that can be referenced as a unit by a RoleBinding or ClusterRoleBinding.\n*/\nclass V1ClusterRole {\n static getAttributeTypeMap() {\n return V1ClusterRole.attributeTypeMap;\n }\n}\nV1ClusterRole.discriminator = undefined;\nV1ClusterRole.attributeTypeMap = [\n {\n \"name\": \"aggregationRule\",\n \"baseName\": \"aggregationRule\",\n \"type\": \"V1AggregationRule\"\n },\n {\n \"name\": \"apiVersion\",\n \"baseName\": \"apiVersion\",\n \"type\": \"string\"\n },\n {\n \"name\": \"kind\",\n \"baseName\": \"kind\",\n \"type\": \"string\"\n },\n {\n \"name\": \"metadata\",\n \"baseName\": \"metadata\",\n \"type\": \"V1ObjectMeta\"\n },\n {\n \"name\": \"rules\",\n \"baseName\": \"rules\",\n \"type\": \"Array\"\n }\n];\nexports.V1ClusterRole = V1ClusterRole;\n/**\n* ClusterRoleBinding references a ClusterRole, but not contain it. It can reference a ClusterRole in the global namespace, and adds who information via Subject.\n*/\nclass V1ClusterRoleBinding {\n static getAttributeTypeMap() {\n return V1ClusterRoleBinding.attributeTypeMap;\n }\n}\nV1ClusterRoleBinding.discriminator = undefined;\nV1ClusterRoleBinding.attributeTypeMap = [\n {\n \"name\": \"apiVersion\",\n \"baseName\": \"apiVersion\",\n \"type\": \"string\"\n },\n {\n \"name\": \"kind\",\n \"baseName\": \"kind\",\n \"type\": \"string\"\n },\n {\n \"name\": \"metadata\",\n \"baseName\": \"metadata\",\n \"type\": \"V1ObjectMeta\"\n },\n {\n \"name\": \"roleRef\",\n \"baseName\": \"roleRef\",\n \"type\": \"V1RoleRef\"\n },\n {\n \"name\": \"subjects\",\n \"baseName\": \"subjects\",\n \"type\": \"Array\"\n }\n];\nexports.V1ClusterRoleBinding = V1ClusterRoleBinding;\n/**\n* ClusterRoleBindingList is a collection of ClusterRoleBindings\n*/\nclass V1ClusterRoleBindingList {\n static getAttributeTypeMap() {\n return V1ClusterRoleBindingList.attributeTypeMap;\n }\n}\nV1ClusterRoleBindingList.discriminator = undefined;\nV1ClusterRoleBindingList.attributeTypeMap = [\n {\n \"name\": \"apiVersion\",\n \"baseName\": \"apiVersion\",\n \"type\": \"string\"\n },\n {\n \"name\": \"items\",\n \"baseName\": \"items\",\n \"type\": \"Array\"\n },\n {\n \"name\": \"kind\",\n \"baseName\": \"kind\",\n \"type\": \"string\"\n },\n {\n \"name\": \"metadata\",\n \"baseName\": \"metadata\",\n \"type\": \"V1ListMeta\"\n }\n];\nexports.V1ClusterRoleBindingList = V1ClusterRoleBindingList;\n/**\n* ClusterRoleList is a collection of ClusterRoles\n*/\nclass V1ClusterRoleList {\n static getAttributeTypeMap() {\n return V1ClusterRoleList.attributeTypeMap;\n }\n}\nV1ClusterRoleList.discriminator = undefined;\nV1ClusterRoleList.attributeTypeMap = [\n {\n \"name\": \"apiVersion\",\n \"baseName\": \"apiVersion\",\n \"type\": \"string\"\n },\n {\n \"name\": \"items\",\n \"baseName\": \"items\",\n \"type\": \"Array\"\n },\n {\n \"name\": \"kind\",\n \"baseName\": \"kind\",\n \"type\": \"string\"\n },\n {\n \"name\": \"metadata\",\n \"baseName\": \"metadata\",\n \"type\": \"V1ListMeta\"\n }\n];\nexports.V1ClusterRoleList = V1ClusterRoleList;\n/**\n* Information about the condition of a component.\n*/\nclass V1ComponentCondition {\n static getAttributeTypeMap() {\n return V1ComponentCondition.attributeTypeMap;\n }\n}\nV1ComponentCondition.discriminator = undefined;\nV1ComponentCondition.attributeTypeMap = [\n {\n \"name\": \"error\",\n \"baseName\": \"error\",\n \"type\": \"string\"\n },\n {\n \"name\": \"message\",\n \"baseName\": \"message\",\n \"type\": \"string\"\n },\n {\n \"name\": \"status\",\n \"baseName\": \"status\",\n \"type\": \"string\"\n },\n {\n \"name\": \"type\",\n \"baseName\": \"type\",\n \"type\": \"string\"\n }\n];\nexports.V1ComponentCondition = V1ComponentCondition;\n/**\n* ComponentStatus (and ComponentStatusList) holds the cluster validation info.\n*/\nclass V1ComponentStatus {\n static getAttributeTypeMap() {\n return V1ComponentStatus.attributeTypeMap;\n }\n}\nV1ComponentStatus.discriminator = undefined;\nV1ComponentStatus.attributeTypeMap = [\n {\n \"name\": \"apiVersion\",\n \"baseName\": \"apiVersion\",\n \"type\": \"string\"\n },\n {\n \"name\": \"conditions\",\n \"baseName\": \"conditions\",\n \"type\": \"Array\"\n },\n {\n \"name\": \"kind\",\n \"baseName\": \"kind\",\n \"type\": \"string\"\n },\n {\n \"name\": \"metadata\",\n \"baseName\": \"metadata\",\n \"type\": \"V1ObjectMeta\"\n }\n];\nexports.V1ComponentStatus = V1ComponentStatus;\n/**\n* Status of all the conditions for the component as a list of ComponentStatus objects.\n*/\nclass V1ComponentStatusList {\n static getAttributeTypeMap() {\n return V1ComponentStatusList.attributeTypeMap;\n }\n}\nV1ComponentStatusList.discriminator = undefined;\nV1ComponentStatusList.attributeTypeMap = [\n {\n \"name\": \"apiVersion\",\n \"baseName\": \"apiVersion\",\n \"type\": \"string\"\n },\n {\n \"name\": \"items\",\n \"baseName\": \"items\",\n \"type\": \"Array\"\n },\n {\n \"name\": \"kind\",\n \"baseName\": \"kind\",\n \"type\": \"string\"\n },\n {\n \"name\": \"metadata\",\n \"baseName\": \"metadata\",\n \"type\": \"V1ListMeta\"\n }\n];\nexports.V1ComponentStatusList = V1ComponentStatusList;\n/**\n* ConfigMap holds configuration data for pods to consume.\n*/\nclass V1ConfigMap {\n static getAttributeTypeMap() {\n return V1ConfigMap.attributeTypeMap;\n }\n}\nV1ConfigMap.discriminator = undefined;\nV1ConfigMap.attributeTypeMap = [\n {\n \"name\": \"apiVersion\",\n \"baseName\": \"apiVersion\",\n \"type\": \"string\"\n },\n {\n \"name\": \"binaryData\",\n \"baseName\": \"binaryData\",\n \"type\": \"{ [key: string]: string; }\"\n },\n {\n \"name\": \"data\",\n \"baseName\": \"data\",\n \"type\": \"{ [key: string]: string; }\"\n },\n {\n \"name\": \"kind\",\n \"baseName\": \"kind\",\n \"type\": \"string\"\n },\n {\n \"name\": \"metadata\",\n \"baseName\": \"metadata\",\n \"type\": \"V1ObjectMeta\"\n }\n];\nexports.V1ConfigMap = V1ConfigMap;\n/**\n* ConfigMapEnvSource selects a ConfigMap to populate the environment variables with. The contents of the target ConfigMap's Data field will represent the key-value pairs as environment variables.\n*/\nclass V1ConfigMapEnvSource {\n static getAttributeTypeMap() {\n return V1ConfigMapEnvSource.attributeTypeMap;\n }\n}\nV1ConfigMapEnvSource.discriminator = undefined;\nV1ConfigMapEnvSource.attributeTypeMap = [\n {\n \"name\": \"name\",\n \"baseName\": \"name\",\n \"type\": \"string\"\n },\n {\n \"name\": \"optional\",\n \"baseName\": \"optional\",\n \"type\": \"boolean\"\n }\n];\nexports.V1ConfigMapEnvSource = V1ConfigMapEnvSource;\n/**\n* Selects a key from a ConfigMap.\n*/\nclass V1ConfigMapKeySelector {\n static getAttributeTypeMap() {\n return V1ConfigMapKeySelector.attributeTypeMap;\n }\n}\nV1ConfigMapKeySelector.discriminator = undefined;\nV1ConfigMapKeySelector.attributeTypeMap = [\n {\n \"name\": \"key\",\n \"baseName\": \"key\",\n \"type\": \"string\"\n },\n {\n \"name\": \"name\",\n \"baseName\": \"name\",\n \"type\": \"string\"\n },\n {\n \"name\": \"optional\",\n \"baseName\": \"optional\",\n \"type\": \"boolean\"\n }\n];\nexports.V1ConfigMapKeySelector = V1ConfigMapKeySelector;\n/**\n* ConfigMapList is a resource containing a list of ConfigMap objects.\n*/\nclass V1ConfigMapList {\n static getAttributeTypeMap() {\n return V1ConfigMapList.attributeTypeMap;\n }\n}\nV1ConfigMapList.discriminator = undefined;\nV1ConfigMapList.attributeTypeMap = [\n {\n \"name\": \"apiVersion\",\n \"baseName\": \"apiVersion\",\n \"type\": \"string\"\n },\n {\n \"name\": \"items\",\n \"baseName\": \"items\",\n \"type\": \"Array\"\n },\n {\n \"name\": \"kind\",\n \"baseName\": \"kind\",\n \"type\": \"string\"\n },\n {\n \"name\": \"metadata\",\n \"baseName\": \"metadata\",\n \"type\": \"V1ListMeta\"\n }\n];\nexports.V1ConfigMapList = V1ConfigMapList;\n/**\n* ConfigMapNodeConfigSource contains the information to reference a ConfigMap as a config source for the Node.\n*/\nclass V1ConfigMapNodeConfigSource {\n static getAttributeTypeMap() {\n return V1ConfigMapNodeConfigSource.attributeTypeMap;\n }\n}\nV1ConfigMapNodeConfigSource.discriminator = undefined;\nV1ConfigMapNodeConfigSource.attributeTypeMap = [\n {\n \"name\": \"kubeletConfigKey\",\n \"baseName\": \"kubeletConfigKey\",\n \"type\": \"string\"\n },\n {\n \"name\": \"name\",\n \"baseName\": \"name\",\n \"type\": \"string\"\n },\n {\n \"name\": \"namespace\",\n \"baseName\": \"namespace\",\n \"type\": \"string\"\n },\n {\n \"name\": \"resourceVersion\",\n \"baseName\": \"resourceVersion\",\n \"type\": \"string\"\n },\n {\n \"name\": \"uid\",\n \"baseName\": \"uid\",\n \"type\": \"string\"\n }\n];\nexports.V1ConfigMapNodeConfigSource = V1ConfigMapNodeConfigSource;\n/**\n* Adapts a ConfigMap into a projected volume. The contents of the target ConfigMap's Data field will be presented in a projected volume as files using the keys in the Data field as the file names, unless the items element is populated with specific mappings of keys to paths. Note that this is identical to a configmap volume source without the default mode.\n*/\nclass V1ConfigMapProjection {\n static getAttributeTypeMap() {\n return V1ConfigMapProjection.attributeTypeMap;\n }\n}\nV1ConfigMapProjection.discriminator = undefined;\nV1ConfigMapProjection.attributeTypeMap = [\n {\n \"name\": \"items\",\n \"baseName\": \"items\",\n \"type\": \"Array\"\n },\n {\n \"name\": \"name\",\n \"baseName\": \"name\",\n \"type\": \"string\"\n },\n {\n \"name\": \"optional\",\n \"baseName\": \"optional\",\n \"type\": \"boolean\"\n }\n];\nexports.V1ConfigMapProjection = V1ConfigMapProjection;\n/**\n* Adapts a ConfigMap into a volume. The contents of the target ConfigMap's Data field will be presented in a volume as files using the keys in the Data field as the file names, unless the items element is populated with specific mappings of keys to paths. ConfigMap volumes support ownership management and SELinux relabeling.\n*/\nclass V1ConfigMapVolumeSource {\n static getAttributeTypeMap() {\n return V1ConfigMapVolumeSource.attributeTypeMap;\n }\n}\nV1ConfigMapVolumeSource.discriminator = undefined;\nV1ConfigMapVolumeSource.attributeTypeMap = [\n {\n \"name\": \"defaultMode\",\n \"baseName\": \"defaultMode\",\n \"type\": \"number\"\n },\n {\n \"name\": \"items\",\n \"baseName\": \"items\",\n \"type\": \"Array\"\n },\n {\n \"name\": \"name\",\n \"baseName\": \"name\",\n \"type\": \"string\"\n },\n {\n \"name\": \"optional\",\n \"baseName\": \"optional\",\n \"type\": \"boolean\"\n }\n];\nexports.V1ConfigMapVolumeSource = V1ConfigMapVolumeSource;\n/**\n* A single application container that you want to run within a pod.\n*/\nclass V1Container {\n static getAttributeTypeMap() {\n return V1Container.attributeTypeMap;\n }\n}\nV1Container.discriminator = undefined;\nV1Container.attributeTypeMap = [\n {\n \"name\": \"args\",\n \"baseName\": \"args\",\n \"type\": \"Array\"\n },\n {\n \"name\": \"command\",\n \"baseName\": \"command\",\n \"type\": \"Array\"\n },\n {\n \"name\": \"env\",\n \"baseName\": \"env\",\n \"type\": \"Array\"\n },\n {\n \"name\": \"envFrom\",\n \"baseName\": \"envFrom\",\n \"type\": \"Array\"\n },\n {\n \"name\": \"image\",\n \"baseName\": \"image\",\n \"type\": \"string\"\n },\n {\n \"name\": \"imagePullPolicy\",\n \"baseName\": \"imagePullPolicy\",\n \"type\": \"string\"\n },\n {\n \"name\": \"lifecycle\",\n \"baseName\": \"lifecycle\",\n \"type\": \"V1Lifecycle\"\n },\n {\n \"name\": \"livenessProbe\",\n \"baseName\": \"livenessProbe\",\n \"type\": \"V1Probe\"\n },\n {\n \"name\": \"name\",\n \"baseName\": \"name\",\n \"type\": \"string\"\n },\n {\n \"name\": \"ports\",\n \"baseName\": \"ports\",\n \"type\": \"Array\"\n },\n {\n \"name\": \"readinessProbe\",\n \"baseName\": \"readinessProbe\",\n \"type\": \"V1Probe\"\n },\n {\n \"name\": \"resources\",\n \"baseName\": \"resources\",\n \"type\": \"V1ResourceRequirements\"\n },\n {\n \"name\": \"securityContext\",\n \"baseName\": \"securityContext\",\n \"type\": \"V1SecurityContext\"\n },\n {\n \"name\": \"stdin\",\n \"baseName\": \"stdin\",\n \"type\": \"boolean\"\n },\n {\n \"name\": \"stdinOnce\",\n \"baseName\": \"stdinOnce\",\n \"type\": \"boolean\"\n },\n {\n \"name\": \"terminationMessagePath\",\n \"baseName\": \"terminationMessagePath\",\n \"type\": \"string\"\n },\n {\n \"name\": \"terminationMessagePolicy\",\n \"baseName\": \"terminationMessagePolicy\",\n \"type\": \"string\"\n },\n {\n \"name\": \"tty\",\n \"baseName\": \"tty\",\n \"type\": \"boolean\"\n },\n {\n \"name\": \"volumeDevices\",\n \"baseName\": \"volumeDevices\",\n \"type\": \"Array\"\n },\n {\n \"name\": \"volumeMounts\",\n \"baseName\": \"volumeMounts\",\n \"type\": \"Array\"\n },\n {\n \"name\": \"workingDir\",\n \"baseName\": \"workingDir\",\n \"type\": \"string\"\n }\n];\nexports.V1Container = V1Container;\n/**\n* Describe a container image\n*/\nclass V1ContainerImage {\n static getAttributeTypeMap() {\n return V1ContainerImage.attributeTypeMap;\n }\n}\nV1ContainerImage.discriminator = undefined;\nV1ContainerImage.attributeTypeMap = [\n {\n \"name\": \"names\",\n \"baseName\": \"names\",\n \"type\": \"Array\"\n },\n {\n \"name\": \"sizeBytes\",\n \"baseName\": \"sizeBytes\",\n \"type\": \"number\"\n }\n];\nexports.V1ContainerImage = V1ContainerImage;\n/**\n* ContainerPort represents a network port in a single container.\n*/\nclass V1ContainerPort {\n static getAttributeTypeMap() {\n return V1ContainerPort.attributeTypeMap;\n }\n}\nV1ContainerPort.discriminator = undefined;\nV1ContainerPort.attributeTypeMap = [\n {\n \"name\": \"containerPort\",\n \"baseName\": \"containerPort\",\n \"type\": \"number\"\n },\n {\n \"name\": \"hostIP\",\n \"baseName\": \"hostIP\",\n \"type\": \"string\"\n },\n {\n \"name\": \"hostPort\",\n \"baseName\": \"hostPort\",\n \"type\": \"number\"\n },\n {\n \"name\": \"name\",\n \"baseName\": \"name\",\n \"type\": \"string\"\n },\n {\n \"name\": \"protocol\",\n \"baseName\": \"protocol\",\n \"type\": \"string\"\n }\n];\nexports.V1ContainerPort = V1ContainerPort;\n/**\n* ContainerState holds a possible state of container. Only one of its members may be specified. If none of them is specified, the default one is ContainerStateWaiting.\n*/\nclass V1ContainerState {\n static getAttributeTypeMap() {\n return V1ContainerState.attributeTypeMap;\n }\n}\nV1ContainerState.discriminator = undefined;\nV1ContainerState.attributeTypeMap = [\n {\n \"name\": \"running\",\n \"baseName\": \"running\",\n \"type\": \"V1ContainerStateRunning\"\n },\n {\n \"name\": \"terminated\",\n \"baseName\": \"terminated\",\n \"type\": \"V1ContainerStateTerminated\"\n },\n {\n \"name\": \"waiting\",\n \"baseName\": \"waiting\",\n \"type\": \"V1ContainerStateWaiting\"\n }\n];\nexports.V1ContainerState = V1ContainerState;\n/**\n* ContainerStateRunning is a running state of a container.\n*/\nclass V1ContainerStateRunning {\n static getAttributeTypeMap() {\n return V1ContainerStateRunning.attributeTypeMap;\n }\n}\nV1ContainerStateRunning.discriminator = undefined;\nV1ContainerStateRunning.attributeTypeMap = [\n {\n \"name\": \"startedAt\",\n \"baseName\": \"startedAt\",\n \"type\": \"Date\"\n }\n];\nexports.V1ContainerStateRunning = V1ContainerStateRunning;\n/**\n* ContainerStateTerminated is a terminated state of a container.\n*/\nclass V1ContainerStateTerminated {\n static getAttributeTypeMap() {\n return V1ContainerStateTerminated.attributeTypeMap;\n }\n}\nV1ContainerStateTerminated.discriminator = undefined;\nV1ContainerStateTerminated.attributeTypeMap = [\n {\n \"name\": \"containerID\",\n \"baseName\": \"containerID\",\n \"type\": \"string\"\n },\n {\n \"name\": \"exitCode\",\n \"baseName\": \"exitCode\",\n \"type\": \"number\"\n },\n {\n \"name\": \"finishedAt\",\n \"baseName\": \"finishedAt\",\n \"type\": \"Date\"\n },\n {\n \"name\": \"message\",\n \"baseName\": \"message\",\n \"type\": \"string\"\n },\n {\n \"name\": \"reason\",\n \"baseName\": \"reason\",\n \"type\": \"string\"\n },\n {\n \"name\": \"signal\",\n \"baseName\": \"signal\",\n \"type\": \"number\"\n },\n {\n \"name\": \"startedAt\",\n \"baseName\": \"startedAt\",\n \"type\": \"Date\"\n }\n];\nexports.V1ContainerStateTerminated = V1ContainerStateTerminated;\n/**\n* ContainerStateWaiting is a waiting state of a container.\n*/\nclass V1ContainerStateWaiting {\n static getAttributeTypeMap() {\n return V1ContainerStateWaiting.attributeTypeMap;\n }\n}\nV1ContainerStateWaiting.discriminator = undefined;\nV1ContainerStateWaiting.attributeTypeMap = [\n {\n \"name\": \"message\",\n \"baseName\": \"message\",\n \"type\": \"string\"\n },\n {\n \"name\": \"reason\",\n \"baseName\": \"reason\",\n \"type\": \"string\"\n }\n];\nexports.V1ContainerStateWaiting = V1ContainerStateWaiting;\n/**\n* ContainerStatus contains details for the current status of this container.\n*/\nclass V1ContainerStatus {\n static getAttributeTypeMap() {\n return V1ContainerStatus.attributeTypeMap;\n }\n}\nV1ContainerStatus.discriminator = undefined;\nV1ContainerStatus.attributeTypeMap = [\n {\n \"name\": \"containerID\",\n \"baseName\": \"containerID\",\n \"type\": \"string\"\n },\n {\n \"name\": \"image\",\n \"baseName\": \"image\",\n \"type\": \"string\"\n },\n {\n \"name\": \"imageID\",\n \"baseName\": \"imageID\",\n \"type\": \"string\"\n },\n {\n \"name\": \"lastState\",\n \"baseName\": \"lastState\",\n \"type\": \"V1ContainerState\"\n },\n {\n \"name\": \"name\",\n \"baseName\": \"name\",\n \"type\": \"string\"\n },\n {\n \"name\": \"ready\",\n \"baseName\": \"ready\",\n \"type\": \"boolean\"\n },\n {\n \"name\": \"restartCount\",\n \"baseName\": \"restartCount\",\n \"type\": \"number\"\n },\n {\n \"name\": \"state\",\n \"baseName\": \"state\",\n \"type\": \"V1ContainerState\"\n }\n];\nexports.V1ContainerStatus = V1ContainerStatus;\n/**\n* ControllerRevision implements an immutable snapshot of state data. Clients are responsible for serializing and deserializing the objects that contain their internal state. Once a ControllerRevision has been successfully created, it can not be updated. The API Server will fail validation of all requests that attempt to mutate the Data field. ControllerRevisions may, however, be deleted. Note that, due to its use by both the DaemonSet and StatefulSet controllers for update and rollback, this object is beta. However, it may be subject to name and representation changes in future releases, and clients should not depend on its stability. It is primarily for internal use by controllers.\n*/\nclass V1ControllerRevision {\n static getAttributeTypeMap() {\n return V1ControllerRevision.attributeTypeMap;\n }\n}\nV1ControllerRevision.discriminator = undefined;\nV1ControllerRevision.attributeTypeMap = [\n {\n \"name\": \"apiVersion\",\n \"baseName\": \"apiVersion\",\n \"type\": \"string\"\n },\n {\n \"name\": \"data\",\n \"baseName\": \"data\",\n \"type\": \"RuntimeRawExtension\"\n },\n {\n \"name\": \"kind\",\n \"baseName\": \"kind\",\n \"type\": \"string\"\n },\n {\n \"name\": \"metadata\",\n \"baseName\": \"metadata\",\n \"type\": \"V1ObjectMeta\"\n },\n {\n \"name\": \"revision\",\n \"baseName\": \"revision\",\n \"type\": \"number\"\n }\n];\nexports.V1ControllerRevision = V1ControllerRevision;\n/**\n* ControllerRevisionList is a resource containing a list of ControllerRevision objects.\n*/\nclass V1ControllerRevisionList {\n static getAttributeTypeMap() {\n return V1ControllerRevisionList.attributeTypeMap;\n }\n}\nV1ControllerRevisionList.discriminator = undefined;\nV1ControllerRevisionList.attributeTypeMap = [\n {\n \"name\": \"apiVersion\",\n \"baseName\": \"apiVersion\",\n \"type\": \"string\"\n },\n {\n \"name\": \"items\",\n \"baseName\": \"items\",\n \"type\": \"Array\"\n },\n {\n \"name\": \"kind\",\n \"baseName\": \"kind\",\n \"type\": \"string\"\n },\n {\n \"name\": \"metadata\",\n \"baseName\": \"metadata\",\n \"type\": \"V1ListMeta\"\n }\n];\nexports.V1ControllerRevisionList = V1ControllerRevisionList;\n/**\n* CrossVersionObjectReference contains enough information to let you identify the referred resource.\n*/\nclass V1CrossVersionObjectReference {\n static getAttributeTypeMap() {\n return V1CrossVersionObjectReference.attributeTypeMap;\n }\n}\nV1CrossVersionObjectReference.discriminator = undefined;\nV1CrossVersionObjectReference.attributeTypeMap = [\n {\n \"name\": \"apiVersion\",\n \"baseName\": \"apiVersion\",\n \"type\": \"string\"\n },\n {\n \"name\": \"kind\",\n \"baseName\": \"kind\",\n \"type\": \"string\"\n },\n {\n \"name\": \"name\",\n \"baseName\": \"name\",\n \"type\": \"string\"\n }\n];\nexports.V1CrossVersionObjectReference = V1CrossVersionObjectReference;\n/**\n* DaemonEndpoint contains information about a single Daemon endpoint.\n*/\nclass V1DaemonEndpoint {\n static getAttributeTypeMap() {\n return V1DaemonEndpoint.attributeTypeMap;\n }\n}\nV1DaemonEndpoint.discriminator = undefined;\nV1DaemonEndpoint.attributeTypeMap = [\n {\n \"name\": \"port\",\n \"baseName\": \"Port\",\n \"type\": \"number\"\n }\n];\nexports.V1DaemonEndpoint = V1DaemonEndpoint;\n/**\n* DaemonSet represents the configuration of a daemon set.\n*/\nclass V1DaemonSet {\n static getAttributeTypeMap() {\n return V1DaemonSet.attributeTypeMap;\n }\n}\nV1DaemonSet.discriminator = undefined;\nV1DaemonSet.attributeTypeMap = [\n {\n \"name\": \"apiVersion\",\n \"baseName\": \"apiVersion\",\n \"type\": \"string\"\n },\n {\n \"name\": \"kind\",\n \"baseName\": \"kind\",\n \"type\": \"string\"\n },\n {\n \"name\": \"metadata\",\n \"baseName\": \"metadata\",\n \"type\": \"V1ObjectMeta\"\n },\n {\n \"name\": \"spec\",\n \"baseName\": \"spec\",\n \"type\": \"V1DaemonSetSpec\"\n },\n {\n \"name\": \"status\",\n \"baseName\": \"status\",\n \"type\": \"V1DaemonSetStatus\"\n }\n];\nexports.V1DaemonSet = V1DaemonSet;\n/**\n* DaemonSetCondition describes the state of a DaemonSet at a certain point.\n*/\nclass V1DaemonSetCondition {\n static getAttributeTypeMap() {\n return V1DaemonSetCondition.attributeTypeMap;\n }\n}\nV1DaemonSetCondition.discriminator = undefined;\nV1DaemonSetCondition.attributeTypeMap = [\n {\n \"name\": \"lastTransitionTime\",\n \"baseName\": \"lastTransitionTime\",\n \"type\": \"Date\"\n },\n {\n \"name\": \"message\",\n \"baseName\": \"message\",\n \"type\": \"string\"\n },\n {\n \"name\": \"reason\",\n \"baseName\": \"reason\",\n \"type\": \"string\"\n },\n {\n \"name\": \"status\",\n \"baseName\": \"status\",\n \"type\": \"string\"\n },\n {\n \"name\": \"type\",\n \"baseName\": \"type\",\n \"type\": \"string\"\n }\n];\nexports.V1DaemonSetCondition = V1DaemonSetCondition;\n/**\n* DaemonSetList is a collection of daemon sets.\n*/\nclass V1DaemonSetList {\n static getAttributeTypeMap() {\n return V1DaemonSetList.attributeTypeMap;\n }\n}\nV1DaemonSetList.discriminator = undefined;\nV1DaemonSetList.attributeTypeMap = [\n {\n \"name\": \"apiVersion\",\n \"baseName\": \"apiVersion\",\n \"type\": \"string\"\n },\n {\n \"name\": \"items\",\n \"baseName\": \"items\",\n \"type\": \"Array\"\n },\n {\n \"name\": \"kind\",\n \"baseName\": \"kind\",\n \"type\": \"string\"\n },\n {\n \"name\": \"metadata\",\n \"baseName\": \"metadata\",\n \"type\": \"V1ListMeta\"\n }\n];\nexports.V1DaemonSetList = V1DaemonSetList;\n/**\n* DaemonSetSpec is the specification of a daemon set.\n*/\nclass V1DaemonSetSpec {\n static getAttributeTypeMap() {\n return V1DaemonSetSpec.attributeTypeMap;\n }\n}\nV1DaemonSetSpec.discriminator = undefined;\nV1DaemonSetSpec.attributeTypeMap = [\n {\n \"name\": \"minReadySeconds\",\n \"baseName\": \"minReadySeconds\",\n \"type\": \"number\"\n },\n {\n \"name\": \"revisionHistoryLimit\",\n \"baseName\": \"revisionHistoryLimit\",\n \"type\": \"number\"\n },\n {\n \"name\": \"selector\",\n \"baseName\": \"selector\",\n \"type\": \"V1LabelSelector\"\n },\n {\n \"name\": \"template\",\n \"baseName\": \"template\",\n \"type\": \"V1PodTemplateSpec\"\n },\n {\n \"name\": \"updateStrategy\",\n \"baseName\": \"updateStrategy\",\n \"type\": \"V1DaemonSetUpdateStrategy\"\n }\n];\nexports.V1DaemonSetSpec = V1DaemonSetSpec;\n/**\n* DaemonSetStatus represents the current status of a daemon set.\n*/\nclass V1DaemonSetStatus {\n static getAttributeTypeMap() {\n return V1DaemonSetStatus.attributeTypeMap;\n }\n}\nV1DaemonSetStatus.discriminator = undefined;\nV1DaemonSetStatus.attributeTypeMap = [\n {\n \"name\": \"collisionCount\",\n \"baseName\": \"collisionCount\",\n \"type\": \"number\"\n },\n {\n \"name\": \"conditions\",\n \"baseName\": \"conditions\",\n \"type\": \"Array\"\n },\n {\n \"name\": \"currentNumberScheduled\",\n \"baseName\": \"currentNumberScheduled\",\n \"type\": \"number\"\n },\n {\n \"name\": \"desiredNumberScheduled\",\n \"baseName\": \"desiredNumberScheduled\",\n \"type\": \"number\"\n },\n {\n \"name\": \"numberAvailable\",\n \"baseName\": \"numberAvailable\",\n \"type\": \"number\"\n },\n {\n \"name\": \"numberMisscheduled\",\n \"baseName\": \"numberMisscheduled\",\n \"type\": \"number\"\n },\n {\n \"name\": \"numberReady\",\n \"baseName\": \"numberReady\",\n \"type\": \"number\"\n },\n {\n \"name\": \"numberUnavailable\",\n \"baseName\": \"numberUnavailable\",\n \"type\": \"number\"\n },\n {\n \"name\": \"observedGeneration\",\n \"baseName\": \"observedGeneration\",\n \"type\": \"number\"\n },\n {\n \"name\": \"updatedNumberScheduled\",\n \"baseName\": \"updatedNumberScheduled\",\n \"type\": \"number\"\n }\n];\nexports.V1DaemonSetStatus = V1DaemonSetStatus;\n/**\n* DaemonSetUpdateStrategy is a struct used to control the update strategy for a DaemonSet.\n*/\nclass V1DaemonSetUpdateStrategy {\n static getAttributeTypeMap() {\n return V1DaemonSetUpdateStrategy.attributeTypeMap;\n }\n}\nV1DaemonSetUpdateStrategy.discriminator = undefined;\nV1DaemonSetUpdateStrategy.attributeTypeMap = [\n {\n \"name\": \"rollingUpdate\",\n \"baseName\": \"rollingUpdate\",\n \"type\": \"V1RollingUpdateDaemonSet\"\n },\n {\n \"name\": \"type\",\n \"baseName\": \"type\",\n \"type\": \"string\"\n }\n];\nexports.V1DaemonSetUpdateStrategy = V1DaemonSetUpdateStrategy;\n/**\n* DeleteOptions may be provided when deleting an API object.\n*/\nclass V1DeleteOptions {\n static getAttributeTypeMap() {\n return V1DeleteOptions.attributeTypeMap;\n }\n}\nV1DeleteOptions.discriminator = undefined;\nV1DeleteOptions.attributeTypeMap = [\n {\n \"name\": \"apiVersion\",\n \"baseName\": \"apiVersion\",\n \"type\": \"string\"\n },\n {\n \"name\": \"dryRun\",\n \"baseName\": \"dryRun\",\n \"type\": \"Array\"\n },\n {\n \"name\": \"gracePeriodSeconds\",\n \"baseName\": \"gracePeriodSeconds\",\n \"type\": \"number\"\n },\n {\n \"name\": \"kind\",\n \"baseName\": \"kind\",\n \"type\": \"string\"\n },\n {\n \"name\": \"orphanDependents\",\n \"baseName\": \"orphanDependents\",\n \"type\": \"boolean\"\n },\n {\n \"name\": \"preconditions\",\n \"baseName\": \"preconditions\",\n \"type\": \"V1Preconditions\"\n },\n {\n \"name\": \"propagationPolicy\",\n \"baseName\": \"propagationPolicy\",\n \"type\": \"string\"\n }\n];\nexports.V1DeleteOptions = V1DeleteOptions;\n/**\n* Deployment enables declarative updates for Pods and ReplicaSets.\n*/\nclass V1Deployment {\n static getAttributeTypeMap() {\n return V1Deployment.attributeTypeMap;\n }\n}\nV1Deployment.discriminator = undefined;\nV1Deployment.attributeTypeMap = [\n {\n \"name\": \"apiVersion\",\n \"baseName\": \"apiVersion\",\n \"type\": \"string\"\n },\n {\n \"name\": \"kind\",\n \"baseName\": \"kind\",\n \"type\": \"string\"\n },\n {\n \"name\": \"metadata\",\n \"baseName\": \"metadata\",\n \"type\": \"V1ObjectMeta\"\n },\n {\n \"name\": \"spec\",\n \"baseName\": \"spec\",\n \"type\": \"V1DeploymentSpec\"\n },\n {\n \"name\": \"status\",\n \"baseName\": \"status\",\n \"type\": \"V1DeploymentStatus\"\n }\n];\nexports.V1Deployment = V1Deployment;\n/**\n* DeploymentCondition describes the state of a deployment at a certain point.\n*/\nclass V1DeploymentCondition {\n static getAttributeTypeMap() {\n return V1DeploymentCondition.attributeTypeMap;\n }\n}\nV1DeploymentCondition.discriminator = undefined;\nV1DeploymentCondition.attributeTypeMap = [\n {\n \"name\": \"lastTransitionTime\",\n \"baseName\": \"lastTransitionTime\",\n \"type\": \"Date\"\n },\n {\n \"name\": \"lastUpdateTime\",\n \"baseName\": \"lastUpdateTime\",\n \"type\": \"Date\"\n },\n {\n \"name\": \"message\",\n \"baseName\": \"message\",\n \"type\": \"string\"\n },\n {\n \"name\": \"reason\",\n \"baseName\": \"reason\",\n \"type\": \"string\"\n },\n {\n \"name\": \"status\",\n \"baseName\": \"status\",\n \"type\": \"string\"\n },\n {\n \"name\": \"type\",\n \"baseName\": \"type\",\n \"type\": \"string\"\n }\n];\nexports.V1DeploymentCondition = V1DeploymentCondition;\n/**\n* DeploymentList is a list of Deployments.\n*/\nclass V1DeploymentList {\n static getAttributeTypeMap() {\n return V1DeploymentList.attributeTypeMap;\n }\n}\nV1DeploymentList.discriminator = undefined;\nV1DeploymentList.attributeTypeMap = [\n {\n \"name\": \"apiVersion\",\n \"baseName\": \"apiVersion\",\n \"type\": \"string\"\n },\n {\n \"name\": \"items\",\n \"baseName\": \"items\",\n \"type\": \"Array\"\n },\n {\n \"name\": \"kind\",\n \"baseName\": \"kind\",\n \"type\": \"string\"\n },\n {\n \"name\": \"metadata\",\n \"baseName\": \"metadata\",\n \"type\": \"V1ListMeta\"\n }\n];\nexports.V1DeploymentList = V1DeploymentList;\n/**\n* DeploymentSpec is the specification of the desired behavior of the Deployment.\n*/\nclass V1DeploymentSpec {\n static getAttributeTypeMap() {\n return V1DeploymentSpec.attributeTypeMap;\n }\n}\nV1DeploymentSpec.discriminator = undefined;\nV1DeploymentSpec.attributeTypeMap = [\n {\n \"name\": \"minReadySeconds\",\n \"baseName\": \"minReadySeconds\",\n \"type\": \"number\"\n },\n {\n \"name\": \"paused\",\n \"baseName\": \"paused\",\n \"type\": \"boolean\"\n },\n {\n \"name\": \"progressDeadlineSeconds\",\n \"baseName\": \"progressDeadlineSeconds\",\n \"type\": \"number\"\n },\n {\n \"name\": \"replicas\",\n \"baseName\": \"replicas\",\n \"type\": \"number\"\n },\n {\n \"name\": \"revisionHistoryLimit\",\n \"baseName\": \"revisionHistoryLimit\",\n \"type\": \"number\"\n },\n {\n \"name\": \"selector\",\n \"baseName\": \"selector\",\n \"type\": \"V1LabelSelector\"\n },\n {\n \"name\": \"strategy\",\n \"baseName\": \"strategy\",\n \"type\": \"V1DeploymentStrategy\"\n },\n {\n \"name\": \"template\",\n \"baseName\": \"template\",\n \"type\": \"V1PodTemplateSpec\"\n }\n];\nexports.V1DeploymentSpec = V1DeploymentSpec;\n/**\n* DeploymentStatus is the most recently observed status of the Deployment.\n*/\nclass V1DeploymentStatus {\n static getAttributeTypeMap() {\n return V1DeploymentStatus.attributeTypeMap;\n }\n}\nV1DeploymentStatus.discriminator = undefined;\nV1DeploymentStatus.attributeTypeMap = [\n {\n \"name\": \"availableReplicas\",\n \"baseName\": \"availableReplicas\",\n \"type\": \"number\"\n },\n {\n \"name\": \"collisionCount\",\n \"baseName\": \"collisionCount\",\n \"type\": \"number\"\n },\n {\n \"name\": \"conditions\",\n \"baseName\": \"conditions\",\n \"type\": \"Array\"\n },\n {\n \"name\": \"observedGeneration\",\n \"baseName\": \"observedGeneration\",\n \"type\": \"number\"\n },\n {\n \"name\": \"readyReplicas\",\n \"baseName\": \"readyReplicas\",\n \"type\": \"number\"\n },\n {\n \"name\": \"replicas\",\n \"baseName\": \"replicas\",\n \"type\": \"number\"\n },\n {\n \"name\": \"unavailableReplicas\",\n \"baseName\": \"unavailableReplicas\",\n \"type\": \"number\"\n },\n {\n \"name\": \"updatedReplicas\",\n \"baseName\": \"updatedReplicas\",\n \"type\": \"number\"\n }\n];\nexports.V1DeploymentStatus = V1DeploymentStatus;\n/**\n* DeploymentStrategy describes how to replace existing pods with new ones.\n*/\nclass V1DeploymentStrategy {\n static getAttributeTypeMap() {\n return V1DeploymentStrategy.attributeTypeMap;\n }\n}\nV1DeploymentStrategy.discriminator = undefined;\nV1DeploymentStrategy.attributeTypeMap = [\n {\n \"name\": \"rollingUpdate\",\n \"baseName\": \"rollingUpdate\",\n \"type\": \"V1RollingUpdateDeployment\"\n },\n {\n \"name\": \"type\",\n \"baseName\": \"type\",\n \"type\": \"string\"\n }\n];\nexports.V1DeploymentStrategy = V1DeploymentStrategy;\n/**\n* Represents downward API info for projecting into a projected volume. Note that this is identical to a downwardAPI volume source without the default mode.\n*/\nclass V1DownwardAPIProjection {\n static getAttributeTypeMap() {\n return V1DownwardAPIProjection.attributeTypeMap;\n }\n}\nV1DownwardAPIProjection.discriminator = undefined;\nV1DownwardAPIProjection.attributeTypeMap = [\n {\n \"name\": \"items\",\n \"baseName\": \"items\",\n \"type\": \"Array\"\n }\n];\nexports.V1DownwardAPIProjection = V1DownwardAPIProjection;\n/**\n* DownwardAPIVolumeFile represents information to create the file containing the pod field\n*/\nclass V1DownwardAPIVolumeFile {\n static getAttributeTypeMap() {\n return V1DownwardAPIVolumeFile.attributeTypeMap;\n }\n}\nV1DownwardAPIVolumeFile.discriminator = undefined;\nV1DownwardAPIVolumeFile.attributeTypeMap = [\n {\n \"name\": \"fieldRef\",\n \"baseName\": \"fieldRef\",\n \"type\": \"V1ObjectFieldSelector\"\n },\n {\n \"name\": \"mode\",\n \"baseName\": \"mode\",\n \"type\": \"number\"\n },\n {\n \"name\": \"path\",\n \"baseName\": \"path\",\n \"type\": \"string\"\n },\n {\n \"name\": \"resourceFieldRef\",\n \"baseName\": \"resourceFieldRef\",\n \"type\": \"V1ResourceFieldSelector\"\n }\n];\nexports.V1DownwardAPIVolumeFile = V1DownwardAPIVolumeFile;\n/**\n* DownwardAPIVolumeSource represents a volume containing downward API info. Downward API volumes support ownership management and SELinux relabeling.\n*/\nclass V1DownwardAPIVolumeSource {\n static getAttributeTypeMap() {\n return V1DownwardAPIVolumeSource.attributeTypeMap;\n }\n}\nV1DownwardAPIVolumeSource.discriminator = undefined;\nV1DownwardAPIVolumeSource.attributeTypeMap = [\n {\n \"name\": \"defaultMode\",\n \"baseName\": \"defaultMode\",\n \"type\": \"number\"\n },\n {\n \"name\": \"items\",\n \"baseName\": \"items\",\n \"type\": \"Array\"\n }\n];\nexports.V1DownwardAPIVolumeSource = V1DownwardAPIVolumeSource;\n/**\n* Represents an empty directory for a pod. Empty directory volumes support ownership management and SELinux relabeling.\n*/\nclass V1EmptyDirVolumeSource {\n static getAttributeTypeMap() {\n return V1EmptyDirVolumeSource.attributeTypeMap;\n }\n}\nV1EmptyDirVolumeSource.discriminator = undefined;\nV1EmptyDirVolumeSource.attributeTypeMap = [\n {\n \"name\": \"medium\",\n \"baseName\": \"medium\",\n \"type\": \"string\"\n },\n {\n \"name\": \"sizeLimit\",\n \"baseName\": \"sizeLimit\",\n \"type\": \"string\"\n }\n];\nexports.V1EmptyDirVolumeSource = V1EmptyDirVolumeSource;\n/**\n* EndpointAddress is a tuple that describes single IP address.\n*/\nclass V1EndpointAddress {\n static getAttributeTypeMap() {\n return V1EndpointAddress.attributeTypeMap;\n }\n}\nV1EndpointAddress.discriminator = undefined;\nV1EndpointAddress.attributeTypeMap = [\n {\n \"name\": \"hostname\",\n \"baseName\": \"hostname\",\n \"type\": \"string\"\n },\n {\n \"name\": \"ip\",\n \"baseName\": \"ip\",\n \"type\": \"string\"\n },\n {\n \"name\": \"nodeName\",\n \"baseName\": \"nodeName\",\n \"type\": \"string\"\n },\n {\n \"name\": \"targetRef\",\n \"baseName\": \"targetRef\",\n \"type\": \"V1ObjectReference\"\n }\n];\nexports.V1EndpointAddress = V1EndpointAddress;\n/**\n* EndpointPort is a tuple that describes a single port.\n*/\nclass V1EndpointPort {\n static getAttributeTypeMap() {\n return V1EndpointPort.attributeTypeMap;\n }\n}\nV1EndpointPort.discriminator = undefined;\nV1EndpointPort.attributeTypeMap = [\n {\n \"name\": \"name\",\n \"baseName\": \"name\",\n \"type\": \"string\"\n },\n {\n \"name\": \"port\",\n \"baseName\": \"port\",\n \"type\": \"number\"\n },\n {\n \"name\": \"protocol\",\n \"baseName\": \"protocol\",\n \"type\": \"string\"\n }\n];\nexports.V1EndpointPort = V1EndpointPort;\n/**\n* EndpointSubset is a group of addresses with a common set of ports. The expanded set of endpoints is the Cartesian product of Addresses x Ports. For example, given: { Addresses: [{\\\"ip\\\": \\\"10.10.1.1\\\"}, {\\\"ip\\\": \\\"10.10.2.2\\\"}], Ports: [{\\\"name\\\": \\\"a\\\", \\\"port\\\": 8675}, {\\\"name\\\": \\\"b\\\", \\\"port\\\": 309}] } The resulting set of endpoints can be viewed as: a: [ 10.10.1.1:8675, 10.10.2.2:8675 ], b: [ 10.10.1.1:309, 10.10.2.2:309 ]\n*/\nclass V1EndpointSubset {\n static getAttributeTypeMap() {\n return V1EndpointSubset.attributeTypeMap;\n }\n}\nV1EndpointSubset.discriminator = undefined;\nV1EndpointSubset.attributeTypeMap = [\n {\n \"name\": \"addresses\",\n \"baseName\": \"addresses\",\n \"type\": \"Array\"\n },\n {\n \"name\": \"notReadyAddresses\",\n \"baseName\": \"notReadyAddresses\",\n \"type\": \"Array\"\n },\n {\n \"name\": \"ports\",\n \"baseName\": \"ports\",\n \"type\": \"Array\"\n }\n];\nexports.V1EndpointSubset = V1EndpointSubset;\n/**\n* Endpoints is a collection of endpoints that implement the actual service. Example: Name: \\\"mysvc\\\", Subsets: [ { Addresses: [{\\\"ip\\\": \\\"10.10.1.1\\\"}, {\\\"ip\\\": \\\"10.10.2.2\\\"}], Ports: [{\\\"name\\\": \\\"a\\\", \\\"port\\\": 8675}, {\\\"name\\\": \\\"b\\\", \\\"port\\\": 309}] }, { Addresses: [{\\\"ip\\\": \\\"10.10.3.3\\\"}], Ports: [{\\\"name\\\": \\\"a\\\", \\\"port\\\": 93}, {\\\"name\\\": \\\"b\\\", \\\"port\\\": 76}] }, ]\n*/\nclass V1Endpoints {\n static getAttributeTypeMap() {\n return V1Endpoints.attributeTypeMap;\n }\n}\nV1Endpoints.discriminator = undefined;\nV1Endpoints.attributeTypeMap = [\n {\n \"name\": \"apiVersion\",\n \"baseName\": \"apiVersion\",\n \"type\": \"string\"\n },\n {\n \"name\": \"kind\",\n \"baseName\": \"kind\",\n \"type\": \"string\"\n },\n {\n \"name\": \"metadata\",\n \"baseName\": \"metadata\",\n \"type\": \"V1ObjectMeta\"\n },\n {\n \"name\": \"subsets\",\n \"baseName\": \"subsets\",\n \"type\": \"Array\"\n }\n];\nexports.V1Endpoints = V1Endpoints;\n/**\n* EndpointsList is a list of endpoints.\n*/\nclass V1EndpointsList {\n static getAttributeTypeMap() {\n return V1EndpointsList.attributeTypeMap;\n }\n}\nV1EndpointsList.discriminator = undefined;\nV1EndpointsList.attributeTypeMap = [\n {\n \"name\": \"apiVersion\",\n \"baseName\": \"apiVersion\",\n \"type\": \"string\"\n },\n {\n \"name\": \"items\",\n \"baseName\": \"items\",\n \"type\": \"Array\"\n },\n {\n \"name\": \"kind\",\n \"baseName\": \"kind\",\n \"type\": \"string\"\n },\n {\n \"name\": \"metadata\",\n \"baseName\": \"metadata\",\n \"type\": \"V1ListMeta\"\n }\n];\nexports.V1EndpointsList = V1EndpointsList;\n/**\n* EnvFromSource represents the source of a set of ConfigMaps\n*/\nclass V1EnvFromSource {\n static getAttributeTypeMap() {\n return V1EnvFromSource.attributeTypeMap;\n }\n}\nV1EnvFromSource.discriminator = undefined;\nV1EnvFromSource.attributeTypeMap = [\n {\n \"name\": \"configMapRef\",\n \"baseName\": \"configMapRef\",\n \"type\": \"V1ConfigMapEnvSource\"\n },\n {\n \"name\": \"prefix\",\n \"baseName\": \"prefix\",\n \"type\": \"string\"\n },\n {\n \"name\": \"secretRef\",\n \"baseName\": \"secretRef\",\n \"type\": \"V1SecretEnvSource\"\n }\n];\nexports.V1EnvFromSource = V1EnvFromSource;\n/**\n* EnvVar represents an environment variable present in a Container.\n*/\nclass V1EnvVar {\n static getAttributeTypeMap() {\n return V1EnvVar.attributeTypeMap;\n }\n}\nV1EnvVar.discriminator = undefined;\nV1EnvVar.attributeTypeMap = [\n {\n \"name\": \"name\",\n \"baseName\": \"name\",\n \"type\": \"string\"\n },\n {\n \"name\": \"value\",\n \"baseName\": \"value\",\n \"type\": \"string\"\n },\n {\n \"name\": \"valueFrom\",\n \"baseName\": \"valueFrom\",\n \"type\": \"V1EnvVarSource\"\n }\n];\nexports.V1EnvVar = V1EnvVar;\n/**\n* EnvVarSource represents a source for the value of an EnvVar.\n*/\nclass V1EnvVarSource {\n static getAttributeTypeMap() {\n return V1EnvVarSource.attributeTypeMap;\n }\n}\nV1EnvVarSource.discriminator = undefined;\nV1EnvVarSource.attributeTypeMap = [\n {\n \"name\": \"configMapKeyRef\",\n \"baseName\": \"configMapKeyRef\",\n \"type\": \"V1ConfigMapKeySelector\"\n },\n {\n \"name\": \"fieldRef\",\n \"baseName\": \"fieldRef\",\n \"type\": \"V1ObjectFieldSelector\"\n },\n {\n \"name\": \"resourceFieldRef\",\n \"baseName\": \"resourceFieldRef\",\n \"type\": \"V1ResourceFieldSelector\"\n },\n {\n \"name\": \"secretKeyRef\",\n \"baseName\": \"secretKeyRef\",\n \"type\": \"V1SecretKeySelector\"\n }\n];\nexports.V1EnvVarSource = V1EnvVarSource;\n/**\n* Event is a report of an event somewhere in the cluster.\n*/\nclass V1Event {\n static getAttributeTypeMap() {\n return V1Event.attributeTypeMap;\n }\n}\nV1Event.discriminator = undefined;\nV1Event.attributeTypeMap = [\n {\n \"name\": \"action\",\n \"baseName\": \"action\",\n \"type\": \"string\"\n },\n {\n \"name\": \"apiVersion\",\n \"baseName\": \"apiVersion\",\n \"type\": \"string\"\n },\n {\n \"name\": \"count\",\n \"baseName\": \"count\",\n \"type\": \"number\"\n },\n {\n \"name\": \"eventTime\",\n \"baseName\": \"eventTime\",\n \"type\": \"Date\"\n },\n {\n \"name\": \"firstTimestamp\",\n \"baseName\": \"firstTimestamp\",\n \"type\": \"Date\"\n },\n {\n \"name\": \"involvedObject\",\n \"baseName\": \"involvedObject\",\n \"type\": \"V1ObjectReference\"\n },\n {\n \"name\": \"kind\",\n \"baseName\": \"kind\",\n \"type\": \"string\"\n },\n {\n \"name\": \"lastTimestamp\",\n \"baseName\": \"lastTimestamp\",\n \"type\": \"Date\"\n },\n {\n \"name\": \"message\",\n \"baseName\": \"message\",\n \"type\": \"string\"\n },\n {\n \"name\": \"metadata\",\n \"baseName\": \"metadata\",\n \"type\": \"V1ObjectMeta\"\n },\n {\n \"name\": \"reason\",\n \"baseName\": \"reason\",\n \"type\": \"string\"\n },\n {\n \"name\": \"related\",\n \"baseName\": \"related\",\n \"type\": \"V1ObjectReference\"\n },\n {\n \"name\": \"reportingComponent\",\n \"baseName\": \"reportingComponent\",\n \"type\": \"string\"\n },\n {\n \"name\": \"reportingInstance\",\n \"baseName\": \"reportingInstance\",\n \"type\": \"string\"\n },\n {\n \"name\": \"series\",\n \"baseName\": \"series\",\n \"type\": \"V1EventSeries\"\n },\n {\n \"name\": \"source\",\n \"baseName\": \"source\",\n \"type\": \"V1EventSource\"\n },\n {\n \"name\": \"type\",\n \"baseName\": \"type\",\n \"type\": \"string\"\n }\n];\nexports.V1Event = V1Event;\n/**\n* EventList is a list of events.\n*/\nclass V1EventList {\n static getAttributeTypeMap() {\n return V1EventList.attributeTypeMap;\n }\n}\nV1EventList.discriminator = undefined;\nV1EventList.attributeTypeMap = [\n {\n \"name\": \"apiVersion\",\n \"baseName\": \"apiVersion\",\n \"type\": \"string\"\n },\n {\n \"name\": \"items\",\n \"baseName\": \"items\",\n \"type\": \"Array\"\n },\n {\n \"name\": \"kind\",\n \"baseName\": \"kind\",\n \"type\": \"string\"\n },\n {\n \"name\": \"metadata\",\n \"baseName\": \"metadata\",\n \"type\": \"V1ListMeta\"\n }\n];\nexports.V1EventList = V1EventList;\n/**\n* EventSeries contain information on series of events, i.e. thing that was/is happening continuously for some time.\n*/\nclass V1EventSeries {\n static getAttributeTypeMap() {\n return V1EventSeries.attributeTypeMap;\n }\n}\nV1EventSeries.discriminator = undefined;\nV1EventSeries.attributeTypeMap = [\n {\n \"name\": \"count\",\n \"baseName\": \"count\",\n \"type\": \"number\"\n },\n {\n \"name\": \"lastObservedTime\",\n \"baseName\": \"lastObservedTime\",\n \"type\": \"Date\"\n },\n {\n \"name\": \"state\",\n \"baseName\": \"state\",\n \"type\": \"string\"\n }\n];\nexports.V1EventSeries = V1EventSeries;\n/**\n* EventSource contains information for an event.\n*/\nclass V1EventSource {\n static getAttributeTypeMap() {\n return V1EventSource.attributeTypeMap;\n }\n}\nV1EventSource.discriminator = undefined;\nV1EventSource.attributeTypeMap = [\n {\n \"name\": \"component\",\n \"baseName\": \"component\",\n \"type\": \"string\"\n },\n {\n \"name\": \"host\",\n \"baseName\": \"host\",\n \"type\": \"string\"\n }\n];\nexports.V1EventSource = V1EventSource;\n/**\n* ExecAction describes a \\\"run in container\\\" action.\n*/\nclass V1ExecAction {\n static getAttributeTypeMap() {\n return V1ExecAction.attributeTypeMap;\n }\n}\nV1ExecAction.discriminator = undefined;\nV1ExecAction.attributeTypeMap = [\n {\n \"name\": \"command\",\n \"baseName\": \"command\",\n \"type\": \"Array\"\n }\n];\nexports.V1ExecAction = V1ExecAction;\n/**\n* Represents a Fibre Channel volume. Fibre Channel volumes can only be mounted as read/write once. Fibre Channel volumes support ownership management and SELinux relabeling.\n*/\nclass V1FCVolumeSource {\n static getAttributeTypeMap() {\n return V1FCVolumeSource.attributeTypeMap;\n }\n}\nV1FCVolumeSource.discriminator = undefined;\nV1FCVolumeSource.attributeTypeMap = [\n {\n \"name\": \"fsType\",\n \"baseName\": \"fsType\",\n \"type\": \"string\"\n },\n {\n \"name\": \"lun\",\n \"baseName\": \"lun\",\n \"type\": \"number\"\n },\n {\n \"name\": \"readOnly\",\n \"baseName\": \"readOnly\",\n \"type\": \"boolean\"\n },\n {\n \"name\": \"targetWWNs\",\n \"baseName\": \"targetWWNs\",\n \"type\": \"Array\"\n },\n {\n \"name\": \"wwids\",\n \"baseName\": \"wwids\",\n \"type\": \"Array\"\n }\n];\nexports.V1FCVolumeSource = V1FCVolumeSource;\n/**\n* FlexPersistentVolumeSource represents a generic persistent volume resource that is provisioned/attached using an exec based plugin.\n*/\nclass V1FlexPersistentVolumeSource {\n static getAttributeTypeMap() {\n return V1FlexPersistentVolumeSource.attributeTypeMap;\n }\n}\nV1FlexPersistentVolumeSource.discriminator = undefined;\nV1FlexPersistentVolumeSource.attributeTypeMap = [\n {\n \"name\": \"driver\",\n \"baseName\": \"driver\",\n \"type\": \"string\"\n },\n {\n \"name\": \"fsType\",\n \"baseName\": \"fsType\",\n \"type\": \"string\"\n },\n {\n \"name\": \"options\",\n \"baseName\": \"options\",\n \"type\": \"{ [key: string]: string; }\"\n },\n {\n \"name\": \"readOnly\",\n \"baseName\": \"readOnly\",\n \"type\": \"boolean\"\n },\n {\n \"name\": \"secretRef\",\n \"baseName\": \"secretRef\",\n \"type\": \"V1SecretReference\"\n }\n];\nexports.V1FlexPersistentVolumeSource = V1FlexPersistentVolumeSource;\n/**\n* FlexVolume represents a generic volume resource that is provisioned/attached using an exec based plugin.\n*/\nclass V1FlexVolumeSource {\n static getAttributeTypeMap() {\n return V1FlexVolumeSource.attributeTypeMap;\n }\n}\nV1FlexVolumeSource.discriminator = undefined;\nV1FlexVolumeSource.attributeTypeMap = [\n {\n \"name\": \"driver\",\n \"baseName\": \"driver\",\n \"type\": \"string\"\n },\n {\n \"name\": \"fsType\",\n \"baseName\": \"fsType\",\n \"type\": \"string\"\n },\n {\n \"name\": \"options\",\n \"baseName\": \"options\",\n \"type\": \"{ [key: string]: string; }\"\n },\n {\n \"name\": \"readOnly\",\n \"baseName\": \"readOnly\",\n \"type\": \"boolean\"\n },\n {\n \"name\": \"secretRef\",\n \"baseName\": \"secretRef\",\n \"type\": \"V1LocalObjectReference\"\n }\n];\nexports.V1FlexVolumeSource = V1FlexVolumeSource;\n/**\n* Represents a Flocker volume mounted by the Flocker agent. One and only one of datasetName and datasetUUID should be set. Flocker volumes do not support ownership management or SELinux relabeling.\n*/\nclass V1FlockerVolumeSource {\n static getAttributeTypeMap() {\n return V1FlockerVolumeSource.attributeTypeMap;\n }\n}\nV1FlockerVolumeSource.discriminator = undefined;\nV1FlockerVolumeSource.attributeTypeMap = [\n {\n \"name\": \"datasetName\",\n \"baseName\": \"datasetName\",\n \"type\": \"string\"\n },\n {\n \"name\": \"datasetUUID\",\n \"baseName\": \"datasetUUID\",\n \"type\": \"string\"\n }\n];\nexports.V1FlockerVolumeSource = V1FlockerVolumeSource;\n/**\n* Represents a Persistent Disk resource in Google Compute Engine. A GCE PD must exist before mounting to a container. The disk must also be in the same GCE project and zone as the kubelet. A GCE PD can only be mounted as read/write once or read-only many times. GCE PDs support ownership management and SELinux relabeling.\n*/\nclass V1GCEPersistentDiskVolumeSource {\n static getAttributeTypeMap() {\n return V1GCEPersistentDiskVolumeSource.attributeTypeMap;\n }\n}\nV1GCEPersistentDiskVolumeSource.discriminator = undefined;\nV1GCEPersistentDiskVolumeSource.attributeTypeMap = [\n {\n \"name\": \"fsType\",\n \"baseName\": \"fsType\",\n \"type\": \"string\"\n },\n {\n \"name\": \"partition\",\n \"baseName\": \"partition\",\n \"type\": \"number\"\n },\n {\n \"name\": \"pdName\",\n \"baseName\": \"pdName\",\n \"type\": \"string\"\n },\n {\n \"name\": \"readOnly\",\n \"baseName\": \"readOnly\",\n \"type\": \"boolean\"\n }\n];\nexports.V1GCEPersistentDiskVolumeSource = V1GCEPersistentDiskVolumeSource;\n/**\n* Represents a volume that is populated with the contents of a git repository. Git repo volumes do not support ownership management. Git repo volumes support SELinux relabeling. DEPRECATED: GitRepo is deprecated. To provision a container with a git repo, mount an EmptyDir into an InitContainer that clones the repo using git, then mount the EmptyDir into the Pod's container.\n*/\nclass V1GitRepoVolumeSource {\n static getAttributeTypeMap() {\n return V1GitRepoVolumeSource.attributeTypeMap;\n }\n}\nV1GitRepoVolumeSource.discriminator = undefined;\nV1GitRepoVolumeSource.attributeTypeMap = [\n {\n \"name\": \"directory\",\n \"baseName\": \"directory\",\n \"type\": \"string\"\n },\n {\n \"name\": \"repository\",\n \"baseName\": \"repository\",\n \"type\": \"string\"\n },\n {\n \"name\": \"revision\",\n \"baseName\": \"revision\",\n \"type\": \"string\"\n }\n];\nexports.V1GitRepoVolumeSource = V1GitRepoVolumeSource;\n/**\n* Represents a Glusterfs mount that lasts the lifetime of a pod. Glusterfs volumes do not support ownership management or SELinux relabeling.\n*/\nclass V1GlusterfsPersistentVolumeSource {\n static getAttributeTypeMap() {\n return V1GlusterfsPersistentVolumeSource.attributeTypeMap;\n }\n}\nV1GlusterfsPersistentVolumeSource.discriminator = undefined;\nV1GlusterfsPersistentVolumeSource.attributeTypeMap = [\n {\n \"name\": \"endpoints\",\n \"baseName\": \"endpoints\",\n \"type\": \"string\"\n },\n {\n \"name\": \"endpointsNamespace\",\n \"baseName\": \"endpointsNamespace\",\n \"type\": \"string\"\n },\n {\n \"name\": \"path\",\n \"baseName\": \"path\",\n \"type\": \"string\"\n },\n {\n \"name\": \"readOnly\",\n \"baseName\": \"readOnly\",\n \"type\": \"boolean\"\n }\n];\nexports.V1GlusterfsPersistentVolumeSource = V1GlusterfsPersistentVolumeSource;\n/**\n* Represents a Glusterfs mount that lasts the lifetime of a pod. Glusterfs volumes do not support ownership management or SELinux relabeling.\n*/\nclass V1GlusterfsVolumeSource {\n static getAttributeTypeMap() {\n return V1GlusterfsVolumeSource.attributeTypeMap;\n }\n}\nV1GlusterfsVolumeSource.discriminator = undefined;\nV1GlusterfsVolumeSource.attributeTypeMap = [\n {\n \"name\": \"endpoints\",\n \"baseName\": \"endpoints\",\n \"type\": \"string\"\n },\n {\n \"name\": \"path\",\n \"baseName\": \"path\",\n \"type\": \"string\"\n },\n {\n \"name\": \"readOnly\",\n \"baseName\": \"readOnly\",\n \"type\": \"boolean\"\n }\n];\nexports.V1GlusterfsVolumeSource = V1GlusterfsVolumeSource;\n/**\n* GroupVersion contains the \\\"group/version\\\" and \\\"version\\\" string of a version. It is made a struct to keep extensibility.\n*/\nclass V1GroupVersionForDiscovery {\n static getAttributeTypeMap() {\n return V1GroupVersionForDiscovery.attributeTypeMap;\n }\n}\nV1GroupVersionForDiscovery.discriminator = undefined;\nV1GroupVersionForDiscovery.attributeTypeMap = [\n {\n \"name\": \"groupVersion\",\n \"baseName\": \"groupVersion\",\n \"type\": \"string\"\n },\n {\n \"name\": \"version\",\n \"baseName\": \"version\",\n \"type\": \"string\"\n }\n];\nexports.V1GroupVersionForDiscovery = V1GroupVersionForDiscovery;\n/**\n* HTTPGetAction describes an action based on HTTP Get requests.\n*/\nclass V1HTTPGetAction {\n static getAttributeTypeMap() {\n return V1HTTPGetAction.attributeTypeMap;\n }\n}\nV1HTTPGetAction.discriminator = undefined;\nV1HTTPGetAction.attributeTypeMap = [\n {\n \"name\": \"host\",\n \"baseName\": \"host\",\n \"type\": \"string\"\n },\n {\n \"name\": \"httpHeaders\",\n \"baseName\": \"httpHeaders\",\n \"type\": \"Array\"\n },\n {\n \"name\": \"path\",\n \"baseName\": \"path\",\n \"type\": \"string\"\n },\n {\n \"name\": \"port\",\n \"baseName\": \"port\",\n \"type\": \"any\"\n },\n {\n \"name\": \"scheme\",\n \"baseName\": \"scheme\",\n \"type\": \"string\"\n }\n];\nexports.V1HTTPGetAction = V1HTTPGetAction;\n/**\n* HTTPHeader describes a custom header to be used in HTTP probes\n*/\nclass V1HTTPHeader {\n static getAttributeTypeMap() {\n return V1HTTPHeader.attributeTypeMap;\n }\n}\nV1HTTPHeader.discriminator = undefined;\nV1HTTPHeader.attributeTypeMap = [\n {\n \"name\": \"name\",\n \"baseName\": \"name\",\n \"type\": \"string\"\n },\n {\n \"name\": \"value\",\n \"baseName\": \"value\",\n \"type\": \"string\"\n }\n];\nexports.V1HTTPHeader = V1HTTPHeader;\n/**\n* Handler defines a specific action that should be taken\n*/\nclass V1Handler {\n static getAttributeTypeMap() {\n return V1Handler.attributeTypeMap;\n }\n}\nV1Handler.discriminator = undefined;\nV1Handler.attributeTypeMap = [\n {\n \"name\": \"exec\",\n \"baseName\": \"exec\",\n \"type\": \"V1ExecAction\"\n },\n {\n \"name\": \"httpGet\",\n \"baseName\": \"httpGet\",\n \"type\": \"V1HTTPGetAction\"\n },\n {\n \"name\": \"tcpSocket\",\n \"baseName\": \"tcpSocket\",\n \"type\": \"V1TCPSocketAction\"\n }\n];\nexports.V1Handler = V1Handler;\n/**\n* configuration of a horizontal pod autoscaler.\n*/\nclass V1HorizontalPodAutoscaler {\n static getAttributeTypeMap() {\n return V1HorizontalPodAutoscaler.attributeTypeMap;\n }\n}\nV1HorizontalPodAutoscaler.discriminator = undefined;\nV1HorizontalPodAutoscaler.attributeTypeMap = [\n {\n \"name\": \"apiVersion\",\n \"baseName\": \"apiVersion\",\n \"type\": \"string\"\n },\n {\n \"name\": \"kind\",\n \"baseName\": \"kind\",\n \"type\": \"string\"\n },\n {\n \"name\": \"metadata\",\n \"baseName\": \"metadata\",\n \"type\": \"V1ObjectMeta\"\n },\n {\n \"name\": \"spec\",\n \"baseName\": \"spec\",\n \"type\": \"V1HorizontalPodAutoscalerSpec\"\n },\n {\n \"name\": \"status\",\n \"baseName\": \"status\",\n \"type\": \"V1HorizontalPodAutoscalerStatus\"\n }\n];\nexports.V1HorizontalPodAutoscaler = V1HorizontalPodAutoscaler;\n/**\n* list of horizontal pod autoscaler objects.\n*/\nclass V1HorizontalPodAutoscalerList {\n static getAttributeTypeMap() {\n return V1HorizontalPodAutoscalerList.attributeTypeMap;\n }\n}\nV1HorizontalPodAutoscalerList.discriminator = undefined;\nV1HorizontalPodAutoscalerList.attributeTypeMap = [\n {\n \"name\": \"apiVersion\",\n \"baseName\": \"apiVersion\",\n \"type\": \"string\"\n },\n {\n \"name\": \"items\",\n \"baseName\": \"items\",\n \"type\": \"Array\"\n },\n {\n \"name\": \"kind\",\n \"baseName\": \"kind\",\n \"type\": \"string\"\n },\n {\n \"name\": \"metadata\",\n \"baseName\": \"metadata\",\n \"type\": \"V1ListMeta\"\n }\n];\nexports.V1HorizontalPodAutoscalerList = V1HorizontalPodAutoscalerList;\n/**\n* specification of a horizontal pod autoscaler.\n*/\nclass V1HorizontalPodAutoscalerSpec {\n static getAttributeTypeMap() {\n return V1HorizontalPodAutoscalerSpec.attributeTypeMap;\n }\n}\nV1HorizontalPodAutoscalerSpec.discriminator = undefined;\nV1HorizontalPodAutoscalerSpec.attributeTypeMap = [\n {\n \"name\": \"maxReplicas\",\n \"baseName\": \"maxReplicas\",\n \"type\": \"number\"\n },\n {\n \"name\": \"minReplicas\",\n \"baseName\": \"minReplicas\",\n \"type\": \"number\"\n },\n {\n \"name\": \"scaleTargetRef\",\n \"baseName\": \"scaleTargetRef\",\n \"type\": \"V1CrossVersionObjectReference\"\n },\n {\n \"name\": \"targetCPUUtilizationPercentage\",\n \"baseName\": \"targetCPUUtilizationPercentage\",\n \"type\": \"number\"\n }\n];\nexports.V1HorizontalPodAutoscalerSpec = V1HorizontalPodAutoscalerSpec;\n/**\n* current status of a horizontal pod autoscaler\n*/\nclass V1HorizontalPodAutoscalerStatus {\n static getAttributeTypeMap() {\n return V1HorizontalPodAutoscalerStatus.attributeTypeMap;\n }\n}\nV1HorizontalPodAutoscalerStatus.discriminator = undefined;\nV1HorizontalPodAutoscalerStatus.attributeTypeMap = [\n {\n \"name\": \"currentCPUUtilizationPercentage\",\n \"baseName\": \"currentCPUUtilizationPercentage\",\n \"type\": \"number\"\n },\n {\n \"name\": \"currentReplicas\",\n \"baseName\": \"currentReplicas\",\n \"type\": \"number\"\n },\n {\n \"name\": \"desiredReplicas\",\n \"baseName\": \"desiredReplicas\",\n \"type\": \"number\"\n },\n {\n \"name\": \"lastScaleTime\",\n \"baseName\": \"lastScaleTime\",\n \"type\": \"Date\"\n },\n {\n \"name\": \"observedGeneration\",\n \"baseName\": \"observedGeneration\",\n \"type\": \"number\"\n }\n];\nexports.V1HorizontalPodAutoscalerStatus = V1HorizontalPodAutoscalerStatus;\n/**\n* HostAlias holds the mapping between IP and hostnames that will be injected as an entry in the pod's hosts file.\n*/\nclass V1HostAlias {\n static getAttributeTypeMap() {\n return V1HostAlias.attributeTypeMap;\n }\n}\nV1HostAlias.discriminator = undefined;\nV1HostAlias.attributeTypeMap = [\n {\n \"name\": \"hostnames\",\n \"baseName\": \"hostnames\",\n \"type\": \"Array\"\n },\n {\n \"name\": \"ip\",\n \"baseName\": \"ip\",\n \"type\": \"string\"\n }\n];\nexports.V1HostAlias = V1HostAlias;\n/**\n* Represents a host path mapped into a pod. Host path volumes do not support ownership management or SELinux relabeling.\n*/\nclass V1HostPathVolumeSource {\n static getAttributeTypeMap() {\n return V1HostPathVolumeSource.attributeTypeMap;\n }\n}\nV1HostPathVolumeSource.discriminator = undefined;\nV1HostPathVolumeSource.attributeTypeMap = [\n {\n \"name\": \"path\",\n \"baseName\": \"path\",\n \"type\": \"string\"\n },\n {\n \"name\": \"type\",\n \"baseName\": \"type\",\n \"type\": \"string\"\n }\n];\nexports.V1HostPathVolumeSource = V1HostPathVolumeSource;\n/**\n* 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.\n*/\nclass V1IPBlock {\n static getAttributeTypeMap() {\n return V1IPBlock.attributeTypeMap;\n }\n}\nV1IPBlock.discriminator = undefined;\nV1IPBlock.attributeTypeMap = [\n {\n \"name\": \"cidr\",\n \"baseName\": \"cidr\",\n \"type\": \"string\"\n },\n {\n \"name\": \"except\",\n \"baseName\": \"except\",\n \"type\": \"Array\"\n }\n];\nexports.V1IPBlock = V1IPBlock;\n/**\n* ISCSIPersistentVolumeSource represents an ISCSI disk. ISCSI volumes can only be mounted as read/write once. ISCSI volumes support ownership management and SELinux relabeling.\n*/\nclass V1ISCSIPersistentVolumeSource {\n static getAttributeTypeMap() {\n return V1ISCSIPersistentVolumeSource.attributeTypeMap;\n }\n}\nV1ISCSIPersistentVolumeSource.discriminator = undefined;\nV1ISCSIPersistentVolumeSource.attributeTypeMap = [\n {\n \"name\": \"chapAuthDiscovery\",\n \"baseName\": \"chapAuthDiscovery\",\n \"type\": \"boolean\"\n },\n {\n \"name\": \"chapAuthSession\",\n \"baseName\": \"chapAuthSession\",\n \"type\": \"boolean\"\n },\n {\n \"name\": \"fsType\",\n \"baseName\": \"fsType\",\n \"type\": \"string\"\n },\n {\n \"name\": \"initiatorName\",\n \"baseName\": \"initiatorName\",\n \"type\": \"string\"\n },\n {\n \"name\": \"iqn\",\n \"baseName\": \"iqn\",\n \"type\": \"string\"\n },\n {\n \"name\": \"iscsiInterface\",\n \"baseName\": \"iscsiInterface\",\n \"type\": \"string\"\n },\n {\n \"name\": \"lun\",\n \"baseName\": \"lun\",\n \"type\": \"number\"\n },\n {\n \"name\": \"portals\",\n \"baseName\": \"portals\",\n \"type\": \"Array\"\n },\n {\n \"name\": \"readOnly\",\n \"baseName\": \"readOnly\",\n \"type\": \"boolean\"\n },\n {\n \"name\": \"secretRef\",\n \"baseName\": \"secretRef\",\n \"type\": \"V1SecretReference\"\n },\n {\n \"name\": \"targetPortal\",\n \"baseName\": \"targetPortal\",\n \"type\": \"string\"\n }\n];\nexports.V1ISCSIPersistentVolumeSource = V1ISCSIPersistentVolumeSource;\n/**\n* Represents an ISCSI disk. ISCSI volumes can only be mounted as read/write once. ISCSI volumes support ownership management and SELinux relabeling.\n*/\nclass V1ISCSIVolumeSource {\n static getAttributeTypeMap() {\n return V1ISCSIVolumeSource.attributeTypeMap;\n }\n}\nV1ISCSIVolumeSource.discriminator = undefined;\nV1ISCSIVolumeSource.attributeTypeMap = [\n {\n \"name\": \"chapAuthDiscovery\",\n \"baseName\": \"chapAuthDiscovery\",\n \"type\": \"boolean\"\n },\n {\n \"name\": \"chapAuthSession\",\n \"baseName\": \"chapAuthSession\",\n \"type\": \"boolean\"\n },\n {\n \"name\": \"fsType\",\n \"baseName\": \"fsType\",\n \"type\": \"string\"\n },\n {\n \"name\": \"initiatorName\",\n \"baseName\": \"initiatorName\",\n \"type\": \"string\"\n },\n {\n \"name\": \"iqn\",\n \"baseName\": \"iqn\",\n \"type\": \"string\"\n },\n {\n \"name\": \"iscsiInterface\",\n \"baseName\": \"iscsiInterface\",\n \"type\": \"string\"\n },\n {\n \"name\": \"lun\",\n \"baseName\": \"lun\",\n \"type\": \"number\"\n },\n {\n \"name\": \"portals\",\n \"baseName\": \"portals\",\n \"type\": \"Array\"\n },\n {\n \"name\": \"readOnly\",\n \"baseName\": \"readOnly\",\n \"type\": \"boolean\"\n },\n {\n \"name\": \"secretRef\",\n \"baseName\": \"secretRef\",\n \"type\": \"V1LocalObjectReference\"\n },\n {\n \"name\": \"targetPortal\",\n \"baseName\": \"targetPortal\",\n \"type\": \"string\"\n }\n];\nexports.V1ISCSIVolumeSource = V1ISCSIVolumeSource;\n/**\n* Initializer is information about an initializer that has not yet completed.\n*/\nclass V1Initializer {\n static getAttributeTypeMap() {\n return V1Initializer.attributeTypeMap;\n }\n}\nV1Initializer.discriminator = undefined;\nV1Initializer.attributeTypeMap = [\n {\n \"name\": \"name\",\n \"baseName\": \"name\",\n \"type\": \"string\"\n }\n];\nexports.V1Initializer = V1Initializer;\n/**\n* Initializers tracks the progress of initialization.\n*/\nclass V1Initializers {\n static getAttributeTypeMap() {\n return V1Initializers.attributeTypeMap;\n }\n}\nV1Initializers.discriminator = undefined;\nV1Initializers.attributeTypeMap = [\n {\n \"name\": \"pending\",\n \"baseName\": \"pending\",\n \"type\": \"Array\"\n },\n {\n \"name\": \"result\",\n \"baseName\": \"result\",\n \"type\": \"V1Status\"\n }\n];\nexports.V1Initializers = V1Initializers;\n/**\n* Job represents the configuration of a single job.\n*/\nclass V1Job {\n static getAttributeTypeMap() {\n return V1Job.attributeTypeMap;\n }\n}\nV1Job.discriminator = undefined;\nV1Job.attributeTypeMap = [\n {\n \"name\": \"apiVersion\",\n \"baseName\": \"apiVersion\",\n \"type\": \"string\"\n },\n {\n \"name\": \"kind\",\n \"baseName\": \"kind\",\n \"type\": \"string\"\n },\n {\n \"name\": \"metadata\",\n \"baseName\": \"metadata\",\n \"type\": \"V1ObjectMeta\"\n },\n {\n \"name\": \"spec\",\n \"baseName\": \"spec\",\n \"type\": \"V1JobSpec\"\n },\n {\n \"name\": \"status\",\n \"baseName\": \"status\",\n \"type\": \"V1JobStatus\"\n }\n];\nexports.V1Job = V1Job;\n/**\n* JobCondition describes current state of a job.\n*/\nclass V1JobCondition {\n static getAttributeTypeMap() {\n return V1JobCondition.attributeTypeMap;\n }\n}\nV1JobCondition.discriminator = undefined;\nV1JobCondition.attributeTypeMap = [\n {\n \"name\": \"lastProbeTime\",\n \"baseName\": \"lastProbeTime\",\n \"type\": \"Date\"\n },\n {\n \"name\": \"lastTransitionTime\",\n \"baseName\": \"lastTransitionTime\",\n \"type\": \"Date\"\n },\n {\n \"name\": \"message\",\n \"baseName\": \"message\",\n \"type\": \"string\"\n },\n {\n \"name\": \"reason\",\n \"baseName\": \"reason\",\n \"type\": \"string\"\n },\n {\n \"name\": \"status\",\n \"baseName\": \"status\",\n \"type\": \"string\"\n },\n {\n \"name\": \"type\",\n \"baseName\": \"type\",\n \"type\": \"string\"\n }\n];\nexports.V1JobCondition = V1JobCondition;\n/**\n* JobList is a collection of jobs.\n*/\nclass V1JobList {\n static getAttributeTypeMap() {\n return V1JobList.attributeTypeMap;\n }\n}\nV1JobList.discriminator = undefined;\nV1JobList.attributeTypeMap = [\n {\n \"name\": \"apiVersion\",\n \"baseName\": \"apiVersion\",\n \"type\": \"string\"\n },\n {\n \"name\": \"items\",\n \"baseName\": \"items\",\n \"type\": \"Array\"\n },\n {\n \"name\": \"kind\",\n \"baseName\": \"kind\",\n \"type\": \"string\"\n },\n {\n \"name\": \"metadata\",\n \"baseName\": \"metadata\",\n \"type\": \"V1ListMeta\"\n }\n];\nexports.V1JobList = V1JobList;\n/**\n* JobSpec describes how the job execution will look like.\n*/\nclass V1JobSpec {\n static getAttributeTypeMap() {\n return V1JobSpec.attributeTypeMap;\n }\n}\nV1JobSpec.discriminator = undefined;\nV1JobSpec.attributeTypeMap = [\n {\n \"name\": \"activeDeadlineSeconds\",\n \"baseName\": \"activeDeadlineSeconds\",\n \"type\": \"number\"\n },\n {\n \"name\": \"backoffLimit\",\n \"baseName\": \"backoffLimit\",\n \"type\": \"number\"\n },\n {\n \"name\": \"completions\",\n \"baseName\": \"completions\",\n \"type\": \"number\"\n },\n {\n \"name\": \"manualSelector\",\n \"baseName\": \"manualSelector\",\n \"type\": \"boolean\"\n },\n {\n \"name\": \"parallelism\",\n \"baseName\": \"parallelism\",\n \"type\": \"number\"\n },\n {\n \"name\": \"selector\",\n \"baseName\": \"selector\",\n \"type\": \"V1LabelSelector\"\n },\n {\n \"name\": \"template\",\n \"baseName\": \"template\",\n \"type\": \"V1PodTemplateSpec\"\n },\n {\n \"name\": \"ttlSecondsAfterFinished\",\n \"baseName\": \"ttlSecondsAfterFinished\",\n \"type\": \"number\"\n }\n];\nexports.V1JobSpec = V1JobSpec;\n/**\n* JobStatus represents the current state of a Job.\n*/\nclass V1JobStatus {\n static getAttributeTypeMap() {\n return V1JobStatus.attributeTypeMap;\n }\n}\nV1JobStatus.discriminator = undefined;\nV1JobStatus.attributeTypeMap = [\n {\n \"name\": \"active\",\n \"baseName\": \"active\",\n \"type\": \"number\"\n },\n {\n \"name\": \"completionTime\",\n \"baseName\": \"completionTime\",\n \"type\": \"Date\"\n },\n {\n \"name\": \"conditions\",\n \"baseName\": \"conditions\",\n \"type\": \"Array\"\n },\n {\n \"name\": \"failed\",\n \"baseName\": \"failed\",\n \"type\": \"number\"\n },\n {\n \"name\": \"startTime\",\n \"baseName\": \"startTime\",\n \"type\": \"Date\"\n },\n {\n \"name\": \"succeeded\",\n \"baseName\": \"succeeded\",\n \"type\": \"number\"\n }\n];\nexports.V1JobStatus = V1JobStatus;\n/**\n* Maps a string key to a path within a volume.\n*/\nclass V1KeyToPath {\n static getAttributeTypeMap() {\n return V1KeyToPath.attributeTypeMap;\n }\n}\nV1KeyToPath.discriminator = undefined;\nV1KeyToPath.attributeTypeMap = [\n {\n \"name\": \"key\",\n \"baseName\": \"key\",\n \"type\": \"string\"\n },\n {\n \"name\": \"mode\",\n \"baseName\": \"mode\",\n \"type\": \"number\"\n },\n {\n \"name\": \"path\",\n \"baseName\": \"path\",\n \"type\": \"string\"\n }\n];\nexports.V1KeyToPath = V1KeyToPath;\n/**\n* A label selector is a label query over a set of resources. The result of matchLabels and matchExpressions are ANDed. An empty label selector matches all objects. A null label selector matches no objects.\n*/\nclass V1LabelSelector {\n static getAttributeTypeMap() {\n return V1LabelSelector.attributeTypeMap;\n }\n}\nV1LabelSelector.discriminator = undefined;\nV1LabelSelector.attributeTypeMap = [\n {\n \"name\": \"matchExpressions\",\n \"baseName\": \"matchExpressions\",\n \"type\": \"Array\"\n },\n {\n \"name\": \"matchLabels\",\n \"baseName\": \"matchLabels\",\n \"type\": \"{ [key: string]: string; }\"\n }\n];\nexports.V1LabelSelector = V1LabelSelector;\n/**\n* A label selector requirement is a selector that contains values, a key, and an operator that relates the key and values.\n*/\nclass V1LabelSelectorRequirement {\n static getAttributeTypeMap() {\n return V1LabelSelectorRequirement.attributeTypeMap;\n }\n}\nV1LabelSelectorRequirement.discriminator = undefined;\nV1LabelSelectorRequirement.attributeTypeMap = [\n {\n \"name\": \"key\",\n \"baseName\": \"key\",\n \"type\": \"string\"\n },\n {\n \"name\": \"operator\",\n \"baseName\": \"operator\",\n \"type\": \"string\"\n },\n {\n \"name\": \"values\",\n \"baseName\": \"values\",\n \"type\": \"Array\"\n }\n];\nexports.V1LabelSelectorRequirement = V1LabelSelectorRequirement;\n/**\n* Lifecycle describes actions that the management system should take in response to container lifecycle events. For the PostStart and PreStop lifecycle handlers, management of the container blocks until the action is complete, unless the container process fails, in which case the handler is aborted.\n*/\nclass V1Lifecycle {\n static getAttributeTypeMap() {\n return V1Lifecycle.attributeTypeMap;\n }\n}\nV1Lifecycle.discriminator = undefined;\nV1Lifecycle.attributeTypeMap = [\n {\n \"name\": \"postStart\",\n \"baseName\": \"postStart\",\n \"type\": \"V1Handler\"\n },\n {\n \"name\": \"preStop\",\n \"baseName\": \"preStop\",\n \"type\": \"V1Handler\"\n }\n];\nexports.V1Lifecycle = V1Lifecycle;\n/**\n* LimitRange sets resource usage limits for each kind of resource in a Namespace.\n*/\nclass V1LimitRange {\n static getAttributeTypeMap() {\n return V1LimitRange.attributeTypeMap;\n }\n}\nV1LimitRange.discriminator = undefined;\nV1LimitRange.attributeTypeMap = [\n {\n \"name\": \"apiVersion\",\n \"baseName\": \"apiVersion\",\n \"type\": \"string\"\n },\n {\n \"name\": \"kind\",\n \"baseName\": \"kind\",\n \"type\": \"string\"\n },\n {\n \"name\": \"metadata\",\n \"baseName\": \"metadata\",\n \"type\": \"V1ObjectMeta\"\n },\n {\n \"name\": \"spec\",\n \"baseName\": \"spec\",\n \"type\": \"V1LimitRangeSpec\"\n }\n];\nexports.V1LimitRange = V1LimitRange;\n/**\n* LimitRangeItem defines a min/max usage limit for any resource that matches on kind.\n*/\nclass V1LimitRangeItem {\n static getAttributeTypeMap() {\n return V1LimitRangeItem.attributeTypeMap;\n }\n}\nV1LimitRangeItem.discriminator = undefined;\nV1LimitRangeItem.attributeTypeMap = [\n {\n \"name\": \"_default\",\n \"baseName\": \"default\",\n \"type\": \"{ [key: string]: string; }\"\n },\n {\n \"name\": \"defaultRequest\",\n \"baseName\": \"defaultRequest\",\n \"type\": \"{ [key: string]: string; }\"\n },\n {\n \"name\": \"max\",\n \"baseName\": \"max\",\n \"type\": \"{ [key: string]: string; }\"\n },\n {\n \"name\": \"maxLimitRequestRatio\",\n \"baseName\": \"maxLimitRequestRatio\",\n \"type\": \"{ [key: string]: string; }\"\n },\n {\n \"name\": \"min\",\n \"baseName\": \"min\",\n \"type\": \"{ [key: string]: string; }\"\n },\n {\n \"name\": \"type\",\n \"baseName\": \"type\",\n \"type\": \"string\"\n }\n];\nexports.V1LimitRangeItem = V1LimitRangeItem;\n/**\n* LimitRangeList is a list of LimitRange items.\n*/\nclass V1LimitRangeList {\n static getAttributeTypeMap() {\n return V1LimitRangeList.attributeTypeMap;\n }\n}\nV1LimitRangeList.discriminator = undefined;\nV1LimitRangeList.attributeTypeMap = [\n {\n \"name\": \"apiVersion\",\n \"baseName\": \"apiVersion\",\n \"type\": \"string\"\n },\n {\n \"name\": \"items\",\n \"baseName\": \"items\",\n \"type\": \"Array\"\n },\n {\n \"name\": \"kind\",\n \"baseName\": \"kind\",\n \"type\": \"string\"\n },\n {\n \"name\": \"metadata\",\n \"baseName\": \"metadata\",\n \"type\": \"V1ListMeta\"\n }\n];\nexports.V1LimitRangeList = V1LimitRangeList;\n/**\n* LimitRangeSpec defines a min/max usage limit for resources that match on kind.\n*/\nclass V1LimitRangeSpec {\n static getAttributeTypeMap() {\n return V1LimitRangeSpec.attributeTypeMap;\n }\n}\nV1LimitRangeSpec.discriminator = undefined;\nV1LimitRangeSpec.attributeTypeMap = [\n {\n \"name\": \"limits\",\n \"baseName\": \"limits\",\n \"type\": \"Array\"\n }\n];\nexports.V1LimitRangeSpec = V1LimitRangeSpec;\n/**\n* ListMeta describes metadata that synthetic resources must have, including lists and various status objects. A resource may have only one of {ObjectMeta, ListMeta}.\n*/\nclass V1ListMeta {\n static getAttributeTypeMap() {\n return V1ListMeta.attributeTypeMap;\n }\n}\nV1ListMeta.discriminator = undefined;\nV1ListMeta.attributeTypeMap = [\n {\n \"name\": \"_continue\",\n \"baseName\": \"continue\",\n \"type\": \"string\"\n },\n {\n \"name\": \"resourceVersion\",\n \"baseName\": \"resourceVersion\",\n \"type\": \"string\"\n },\n {\n \"name\": \"selfLink\",\n \"baseName\": \"selfLink\",\n \"type\": \"string\"\n }\n];\nexports.V1ListMeta = V1ListMeta;\n/**\n* LoadBalancerIngress represents the status of a load-balancer ingress point: traffic intended for the service should be sent to an ingress point.\n*/\nclass V1LoadBalancerIngress {\n static getAttributeTypeMap() {\n return V1LoadBalancerIngress.attributeTypeMap;\n }\n}\nV1LoadBalancerIngress.discriminator = undefined;\nV1LoadBalancerIngress.attributeTypeMap = [\n {\n \"name\": \"hostname\",\n \"baseName\": \"hostname\",\n \"type\": \"string\"\n },\n {\n \"name\": \"ip\",\n \"baseName\": \"ip\",\n \"type\": \"string\"\n }\n];\nexports.V1LoadBalancerIngress = V1LoadBalancerIngress;\n/**\n* LoadBalancerStatus represents the status of a load-balancer.\n*/\nclass V1LoadBalancerStatus {\n static getAttributeTypeMap() {\n return V1LoadBalancerStatus.attributeTypeMap;\n }\n}\nV1LoadBalancerStatus.discriminator = undefined;\nV1LoadBalancerStatus.attributeTypeMap = [\n {\n \"name\": \"ingress\",\n \"baseName\": \"ingress\",\n \"type\": \"Array\"\n }\n];\nexports.V1LoadBalancerStatus = V1LoadBalancerStatus;\n/**\n* LocalObjectReference contains enough information to let you locate the referenced object inside the same namespace.\n*/\nclass V1LocalObjectReference {\n static getAttributeTypeMap() {\n return V1LocalObjectReference.attributeTypeMap;\n }\n}\nV1LocalObjectReference.discriminator = undefined;\nV1LocalObjectReference.attributeTypeMap = [\n {\n \"name\": \"name\",\n \"baseName\": \"name\",\n \"type\": \"string\"\n }\n];\nexports.V1LocalObjectReference = V1LocalObjectReference;\n/**\n* LocalSubjectAccessReview checks whether or not a user or group can perform an action in a given namespace. Having a namespace scoped resource makes it much easier to grant namespace scoped policy that includes permissions checking.\n*/\nclass V1LocalSubjectAccessReview {\n static getAttributeTypeMap() {\n return V1LocalSubjectAccessReview.attributeTypeMap;\n }\n}\nV1LocalSubjectAccessReview.discriminator = undefined;\nV1LocalSubjectAccessReview.attributeTypeMap = [\n {\n \"name\": \"apiVersion\",\n \"baseName\": \"apiVersion\",\n \"type\": \"string\"\n },\n {\n \"name\": \"kind\",\n \"baseName\": \"kind\",\n \"type\": \"string\"\n },\n {\n \"name\": \"metadata\",\n \"baseName\": \"metadata\",\n \"type\": \"V1ObjectMeta\"\n },\n {\n \"name\": \"spec\",\n \"baseName\": \"spec\",\n \"type\": \"V1SubjectAccessReviewSpec\"\n },\n {\n \"name\": \"status\",\n \"baseName\": \"status\",\n \"type\": \"V1SubjectAccessReviewStatus\"\n }\n];\nexports.V1LocalSubjectAccessReview = V1LocalSubjectAccessReview;\n/**\n* Local represents directly-attached storage with node affinity (Beta feature)\n*/\nclass V1LocalVolumeSource {\n static getAttributeTypeMap() {\n return V1LocalVolumeSource.attributeTypeMap;\n }\n}\nV1LocalVolumeSource.discriminator = undefined;\nV1LocalVolumeSource.attributeTypeMap = [\n {\n \"name\": \"fsType\",\n \"baseName\": \"fsType\",\n \"type\": \"string\"\n },\n {\n \"name\": \"path\",\n \"baseName\": \"path\",\n \"type\": \"string\"\n }\n];\nexports.V1LocalVolumeSource = V1LocalVolumeSource;\n/**\n* Represents an NFS mount that lasts the lifetime of a pod. NFS volumes do not support ownership management or SELinux relabeling.\n*/\nclass V1NFSVolumeSource {\n static getAttributeTypeMap() {\n return V1NFSVolumeSource.attributeTypeMap;\n }\n}\nV1NFSVolumeSource.discriminator = undefined;\nV1NFSVolumeSource.attributeTypeMap = [\n {\n \"name\": \"path\",\n \"baseName\": \"path\",\n \"type\": \"string\"\n },\n {\n \"name\": \"readOnly\",\n \"baseName\": \"readOnly\",\n \"type\": \"boolean\"\n },\n {\n \"name\": \"server\",\n \"baseName\": \"server\",\n \"type\": \"string\"\n }\n];\nexports.V1NFSVolumeSource = V1NFSVolumeSource;\n/**\n* Namespace provides a scope for Names. Use of multiple namespaces is optional.\n*/\nclass V1Namespace {\n static getAttributeTypeMap() {\n return V1Namespace.attributeTypeMap;\n }\n}\nV1Namespace.discriminator = undefined;\nV1Namespace.attributeTypeMap = [\n {\n \"name\": \"apiVersion\",\n \"baseName\": \"apiVersion\",\n \"type\": \"string\"\n },\n {\n \"name\": \"kind\",\n \"baseName\": \"kind\",\n \"type\": \"string\"\n },\n {\n \"name\": \"metadata\",\n \"baseName\": \"metadata\",\n \"type\": \"V1ObjectMeta\"\n },\n {\n \"name\": \"spec\",\n \"baseName\": \"spec\",\n \"type\": \"V1NamespaceSpec\"\n },\n {\n \"name\": \"status\",\n \"baseName\": \"status\",\n \"type\": \"V1NamespaceStatus\"\n }\n];\nexports.V1Namespace = V1Namespace;\n/**\n* NamespaceList is a list of Namespaces.\n*/\nclass V1NamespaceList {\n static getAttributeTypeMap() {\n return V1NamespaceList.attributeTypeMap;\n }\n}\nV1NamespaceList.discriminator = undefined;\nV1NamespaceList.attributeTypeMap = [\n {\n \"name\": \"apiVersion\",\n \"baseName\": \"apiVersion\",\n \"type\": \"string\"\n },\n {\n \"name\": \"items\",\n \"baseName\": \"items\",\n \"type\": \"Array\"\n },\n {\n \"name\": \"kind\",\n \"baseName\": \"kind\",\n \"type\": \"string\"\n },\n {\n \"name\": \"metadata\",\n \"baseName\": \"metadata\",\n \"type\": \"V1ListMeta\"\n }\n];\nexports.V1NamespaceList = V1NamespaceList;\n/**\n* NamespaceSpec describes the attributes on a Namespace.\n*/\nclass V1NamespaceSpec {\n static getAttributeTypeMap() {\n return V1NamespaceSpec.attributeTypeMap;\n }\n}\nV1NamespaceSpec.discriminator = undefined;\nV1NamespaceSpec.attributeTypeMap = [\n {\n \"name\": \"finalizers\",\n \"baseName\": \"finalizers\",\n \"type\": \"Array\"\n }\n];\nexports.V1NamespaceSpec = V1NamespaceSpec;\n/**\n* NamespaceStatus is information about the current status of a Namespace.\n*/\nclass V1NamespaceStatus {\n static getAttributeTypeMap() {\n return V1NamespaceStatus.attributeTypeMap;\n }\n}\nV1NamespaceStatus.discriminator = undefined;\nV1NamespaceStatus.attributeTypeMap = [\n {\n \"name\": \"phase\",\n \"baseName\": \"phase\",\n \"type\": \"string\"\n }\n];\nexports.V1NamespaceStatus = V1NamespaceStatus;\n/**\n* NetworkPolicy describes what network traffic is allowed for a set of Pods\n*/\nclass V1NetworkPolicy {\n static getAttributeTypeMap() {\n return V1NetworkPolicy.attributeTypeMap;\n }\n}\nV1NetworkPolicy.discriminator = undefined;\nV1NetworkPolicy.attributeTypeMap = [\n {\n \"name\": \"apiVersion\",\n \"baseName\": \"apiVersion\",\n \"type\": \"string\"\n },\n {\n \"name\": \"kind\",\n \"baseName\": \"kind\",\n \"type\": \"string\"\n },\n {\n \"name\": \"metadata\",\n \"baseName\": \"metadata\",\n \"type\": \"V1ObjectMeta\"\n },\n {\n \"name\": \"spec\",\n \"baseName\": \"spec\",\n \"type\": \"V1NetworkPolicySpec\"\n }\n];\nexports.V1NetworkPolicy = V1NetworkPolicy;\n/**\n* NetworkPolicyEgressRule describes a particular set of traffic that is allowed out of pods matched by a NetworkPolicySpec's podSelector. The traffic must match both ports and to. This type is beta-level in 1.8\n*/\nclass V1NetworkPolicyEgressRule {\n static getAttributeTypeMap() {\n return V1NetworkPolicyEgressRule.attributeTypeMap;\n }\n}\nV1NetworkPolicyEgressRule.discriminator = undefined;\nV1NetworkPolicyEgressRule.attributeTypeMap = [\n {\n \"name\": \"ports\",\n \"baseName\": \"ports\",\n \"type\": \"Array\"\n },\n {\n \"name\": \"to\",\n \"baseName\": \"to\",\n \"type\": \"Array\"\n }\n];\nexports.V1NetworkPolicyEgressRule = V1NetworkPolicyEgressRule;\n/**\n* NetworkPolicyIngressRule describes a particular set of traffic that is allowed to the pods matched by a NetworkPolicySpec's podSelector. The traffic must match both ports and from.\n*/\nclass V1NetworkPolicyIngressRule {\n static getAttributeTypeMap() {\n return V1NetworkPolicyIngressRule.attributeTypeMap;\n }\n}\nV1NetworkPolicyIngressRule.discriminator = undefined;\nV1NetworkPolicyIngressRule.attributeTypeMap = [\n {\n \"name\": \"from\",\n \"baseName\": \"from\",\n \"type\": \"Array\"\n },\n {\n \"name\": \"ports\",\n \"baseName\": \"ports\",\n \"type\": \"Array\"\n }\n];\nexports.V1NetworkPolicyIngressRule = V1NetworkPolicyIngressRule;\n/**\n* NetworkPolicyList is a list of NetworkPolicy objects.\n*/\nclass V1NetworkPolicyList {\n static getAttributeTypeMap() {\n return V1NetworkPolicyList.attributeTypeMap;\n }\n}\nV1NetworkPolicyList.discriminator = undefined;\nV1NetworkPolicyList.attributeTypeMap = [\n {\n \"name\": \"apiVersion\",\n \"baseName\": \"apiVersion\",\n \"type\": \"string\"\n },\n {\n \"name\": \"items\",\n \"baseName\": \"items\",\n \"type\": \"Array\"\n },\n {\n \"name\": \"kind\",\n \"baseName\": \"kind\",\n \"type\": \"string\"\n },\n {\n \"name\": \"metadata\",\n \"baseName\": \"metadata\",\n \"type\": \"V1ListMeta\"\n }\n];\nexports.V1NetworkPolicyList = V1NetworkPolicyList;\n/**\n* NetworkPolicyPeer describes a peer to allow traffic from. Only certain combinations of fields are allowed\n*/\nclass V1NetworkPolicyPeer {\n static getAttributeTypeMap() {\n return V1NetworkPolicyPeer.attributeTypeMap;\n }\n}\nV1NetworkPolicyPeer.discriminator = undefined;\nV1NetworkPolicyPeer.attributeTypeMap = [\n {\n \"name\": \"ipBlock\",\n \"baseName\": \"ipBlock\",\n \"type\": \"V1IPBlock\"\n },\n {\n \"name\": \"namespaceSelector\",\n \"baseName\": \"namespaceSelector\",\n \"type\": \"V1LabelSelector\"\n },\n {\n \"name\": \"podSelector\",\n \"baseName\": \"podSelector\",\n \"type\": \"V1LabelSelector\"\n }\n];\nexports.V1NetworkPolicyPeer = V1NetworkPolicyPeer;\n/**\n* NetworkPolicyPort describes a port to allow traffic on\n*/\nclass V1NetworkPolicyPort {\n static getAttributeTypeMap() {\n return V1NetworkPolicyPort.attributeTypeMap;\n }\n}\nV1NetworkPolicyPort.discriminator = undefined;\nV1NetworkPolicyPort.attributeTypeMap = [\n {\n \"name\": \"port\",\n \"baseName\": \"port\",\n \"type\": \"any\"\n },\n {\n \"name\": \"protocol\",\n \"baseName\": \"protocol\",\n \"type\": \"string\"\n }\n];\nexports.V1NetworkPolicyPort = V1NetworkPolicyPort;\n/**\n* NetworkPolicySpec provides the specification of a NetworkPolicy\n*/\nclass V1NetworkPolicySpec {\n static getAttributeTypeMap() {\n return V1NetworkPolicySpec.attributeTypeMap;\n }\n}\nV1NetworkPolicySpec.discriminator = undefined;\nV1NetworkPolicySpec.attributeTypeMap = [\n {\n \"name\": \"egress\",\n \"baseName\": \"egress\",\n \"type\": \"Array\"\n },\n {\n \"name\": \"ingress\",\n \"baseName\": \"ingress\",\n \"type\": \"Array\"\n },\n {\n \"name\": \"podSelector\",\n \"baseName\": \"podSelector\",\n \"type\": \"V1LabelSelector\"\n },\n {\n \"name\": \"policyTypes\",\n \"baseName\": \"policyTypes\",\n \"type\": \"Array\"\n }\n];\nexports.V1NetworkPolicySpec = V1NetworkPolicySpec;\n/**\n* Node is a worker node in Kubernetes. Each node will have a unique identifier in the cache (i.e. in etcd).\n*/\nclass V1Node {\n static getAttributeTypeMap() {\n return V1Node.attributeTypeMap;\n }\n}\nV1Node.discriminator = undefined;\nV1Node.attributeTypeMap = [\n {\n \"name\": \"apiVersion\",\n \"baseName\": \"apiVersion\",\n \"type\": \"string\"\n },\n {\n \"name\": \"kind\",\n \"baseName\": \"kind\",\n \"type\": \"string\"\n },\n {\n \"name\": \"metadata\",\n \"baseName\": \"metadata\",\n \"type\": \"V1ObjectMeta\"\n },\n {\n \"name\": \"spec\",\n \"baseName\": \"spec\",\n \"type\": \"V1NodeSpec\"\n },\n {\n \"name\": \"status\",\n \"baseName\": \"status\",\n \"type\": \"V1NodeStatus\"\n }\n];\nexports.V1Node = V1Node;\n/**\n* NodeAddress contains information for the node's address.\n*/\nclass V1NodeAddress {\n static getAttributeTypeMap() {\n return V1NodeAddress.attributeTypeMap;\n }\n}\nV1NodeAddress.discriminator = undefined;\nV1NodeAddress.attributeTypeMap = [\n {\n \"name\": \"address\",\n \"baseName\": \"address\",\n \"type\": \"string\"\n },\n {\n \"name\": \"type\",\n \"baseName\": \"type\",\n \"type\": \"string\"\n }\n];\nexports.V1NodeAddress = V1NodeAddress;\n/**\n* Node affinity is a group of node affinity scheduling rules.\n*/\nclass V1NodeAffinity {\n static getAttributeTypeMap() {\n return V1NodeAffinity.attributeTypeMap;\n }\n}\nV1NodeAffinity.discriminator = undefined;\nV1NodeAffinity.attributeTypeMap = [\n {\n \"name\": \"preferredDuringSchedulingIgnoredDuringExecution\",\n \"baseName\": \"preferredDuringSchedulingIgnoredDuringExecution\",\n \"type\": \"Array\"\n },\n {\n \"name\": \"requiredDuringSchedulingIgnoredDuringExecution\",\n \"baseName\": \"requiredDuringSchedulingIgnoredDuringExecution\",\n \"type\": \"V1NodeSelector\"\n }\n];\nexports.V1NodeAffinity = V1NodeAffinity;\n/**\n* NodeCondition contains condition information for a node.\n*/\nclass V1NodeCondition {\n static getAttributeTypeMap() {\n return V1NodeCondition.attributeTypeMap;\n }\n}\nV1NodeCondition.discriminator = undefined;\nV1NodeCondition.attributeTypeMap = [\n {\n \"name\": \"lastHeartbeatTime\",\n \"baseName\": \"lastHeartbeatTime\",\n \"type\": \"Date\"\n },\n {\n \"name\": \"lastTransitionTime\",\n \"baseName\": \"lastTransitionTime\",\n \"type\": \"Date\"\n },\n {\n \"name\": \"message\",\n \"baseName\": \"message\",\n \"type\": \"string\"\n },\n {\n \"name\": \"reason\",\n \"baseName\": \"reason\",\n \"type\": \"string\"\n },\n {\n \"name\": \"status\",\n \"baseName\": \"status\",\n \"type\": \"string\"\n },\n {\n \"name\": \"type\",\n \"baseName\": \"type\",\n \"type\": \"string\"\n }\n];\nexports.V1NodeCondition = V1NodeCondition;\n/**\n* NodeConfigSource specifies a source of node configuration. Exactly one subfield (excluding metadata) must be non-nil.\n*/\nclass V1NodeConfigSource {\n static getAttributeTypeMap() {\n return V1NodeConfigSource.attributeTypeMap;\n }\n}\nV1NodeConfigSource.discriminator = undefined;\nV1NodeConfigSource.attributeTypeMap = [\n {\n \"name\": \"configMap\",\n \"baseName\": \"configMap\",\n \"type\": \"V1ConfigMapNodeConfigSource\"\n }\n];\nexports.V1NodeConfigSource = V1NodeConfigSource;\n/**\n* NodeConfigStatus describes the status of the config assigned by Node.Spec.ConfigSource.\n*/\nclass V1NodeConfigStatus {\n static getAttributeTypeMap() {\n return V1NodeConfigStatus.attributeTypeMap;\n }\n}\nV1NodeConfigStatus.discriminator = undefined;\nV1NodeConfigStatus.attributeTypeMap = [\n {\n \"name\": \"active\",\n \"baseName\": \"active\",\n \"type\": \"V1NodeConfigSource\"\n },\n {\n \"name\": \"assigned\",\n \"baseName\": \"assigned\",\n \"type\": \"V1NodeConfigSource\"\n },\n {\n \"name\": \"error\",\n \"baseName\": \"error\",\n \"type\": \"string\"\n },\n {\n \"name\": \"lastKnownGood\",\n \"baseName\": \"lastKnownGood\",\n \"type\": \"V1NodeConfigSource\"\n }\n];\nexports.V1NodeConfigStatus = V1NodeConfigStatus;\n/**\n* NodeDaemonEndpoints lists ports opened by daemons running on the Node.\n*/\nclass V1NodeDaemonEndpoints {\n static getAttributeTypeMap() {\n return V1NodeDaemonEndpoints.attributeTypeMap;\n }\n}\nV1NodeDaemonEndpoints.discriminator = undefined;\nV1NodeDaemonEndpoints.attributeTypeMap = [\n {\n \"name\": \"kubeletEndpoint\",\n \"baseName\": \"kubeletEndpoint\",\n \"type\": \"V1DaemonEndpoint\"\n }\n];\nexports.V1NodeDaemonEndpoints = V1NodeDaemonEndpoints;\n/**\n* NodeList is the whole list of all Nodes which have been registered with master.\n*/\nclass V1NodeList {\n static getAttributeTypeMap() {\n return V1NodeList.attributeTypeMap;\n }\n}\nV1NodeList.discriminator = undefined;\nV1NodeList.attributeTypeMap = [\n {\n \"name\": \"apiVersion\",\n \"baseName\": \"apiVersion\",\n \"type\": \"string\"\n },\n {\n \"name\": \"items\",\n \"baseName\": \"items\",\n \"type\": \"Array\"\n },\n {\n \"name\": \"kind\",\n \"baseName\": \"kind\",\n \"type\": \"string\"\n },\n {\n \"name\": \"metadata\",\n \"baseName\": \"metadata\",\n \"type\": \"V1ListMeta\"\n }\n];\nexports.V1NodeList = V1NodeList;\n/**\n* A node selector represents the union of the results of one or more label queries over a set of nodes; that is, it represents the OR of the selectors represented by the node selector terms.\n*/\nclass V1NodeSelector {\n static getAttributeTypeMap() {\n return V1NodeSelector.attributeTypeMap;\n }\n}\nV1NodeSelector.discriminator = undefined;\nV1NodeSelector.attributeTypeMap = [\n {\n \"name\": \"nodeSelectorTerms\",\n \"baseName\": \"nodeSelectorTerms\",\n \"type\": \"Array\"\n }\n];\nexports.V1NodeSelector = V1NodeSelector;\n/**\n* A node selector requirement is a selector that contains values, a key, and an operator that relates the key and values.\n*/\nclass V1NodeSelectorRequirement {\n static getAttributeTypeMap() {\n return V1NodeSelectorRequirement.attributeTypeMap;\n }\n}\nV1NodeSelectorRequirement.discriminator = undefined;\nV1NodeSelectorRequirement.attributeTypeMap = [\n {\n \"name\": \"key\",\n \"baseName\": \"key\",\n \"type\": \"string\"\n },\n {\n \"name\": \"operator\",\n \"baseName\": \"operator\",\n \"type\": \"string\"\n },\n {\n \"name\": \"values\",\n \"baseName\": \"values\",\n \"type\": \"Array\"\n }\n];\nexports.V1NodeSelectorRequirement = V1NodeSelectorRequirement;\n/**\n* A null or empty node selector term matches no objects. The requirements of them are ANDed. The TopologySelectorTerm type implements a subset of the NodeSelectorTerm.\n*/\nclass V1NodeSelectorTerm {\n static getAttributeTypeMap() {\n return V1NodeSelectorTerm.attributeTypeMap;\n }\n}\nV1NodeSelectorTerm.discriminator = undefined;\nV1NodeSelectorTerm.attributeTypeMap = [\n {\n \"name\": \"matchExpressions\",\n \"baseName\": \"matchExpressions\",\n \"type\": \"Array\"\n },\n {\n \"name\": \"matchFields\",\n \"baseName\": \"matchFields\",\n \"type\": \"Array\"\n }\n];\nexports.V1NodeSelectorTerm = V1NodeSelectorTerm;\n/**\n* NodeSpec describes the attributes that a node is created with.\n*/\nclass V1NodeSpec {\n static getAttributeTypeMap() {\n return V1NodeSpec.attributeTypeMap;\n }\n}\nV1NodeSpec.discriminator = undefined;\nV1NodeSpec.attributeTypeMap = [\n {\n \"name\": \"configSource\",\n \"baseName\": \"configSource\",\n \"type\": \"V1NodeConfigSource\"\n },\n {\n \"name\": \"externalID\",\n \"baseName\": \"externalID\",\n \"type\": \"string\"\n },\n {\n \"name\": \"podCIDR\",\n \"baseName\": \"podCIDR\",\n \"type\": \"string\"\n },\n {\n \"name\": \"providerID\",\n \"baseName\": \"providerID\",\n \"type\": \"string\"\n },\n {\n \"name\": \"taints\",\n \"baseName\": \"taints\",\n \"type\": \"Array\"\n },\n {\n \"name\": \"unschedulable\",\n \"baseName\": \"unschedulable\",\n \"type\": \"boolean\"\n }\n];\nexports.V1NodeSpec = V1NodeSpec;\n/**\n* NodeStatus is information about the current status of a node.\n*/\nclass V1NodeStatus {\n static getAttributeTypeMap() {\n return V1NodeStatus.attributeTypeMap;\n }\n}\nV1NodeStatus.discriminator = undefined;\nV1NodeStatus.attributeTypeMap = [\n {\n \"name\": \"addresses\",\n \"baseName\": \"addresses\",\n \"type\": \"Array\"\n },\n {\n \"name\": \"allocatable\",\n \"baseName\": \"allocatable\",\n \"type\": \"{ [key: string]: string; }\"\n },\n {\n \"name\": \"capacity\",\n \"baseName\": \"capacity\",\n \"type\": \"{ [key: string]: string; }\"\n },\n {\n \"name\": \"conditions\",\n \"baseName\": \"conditions\",\n \"type\": \"Array\"\n },\n {\n \"name\": \"config\",\n \"baseName\": \"config\",\n \"type\": \"V1NodeConfigStatus\"\n },\n {\n \"name\": \"daemonEndpoints\",\n \"baseName\": \"daemonEndpoints\",\n \"type\": \"V1NodeDaemonEndpoints\"\n },\n {\n \"name\": \"images\",\n \"baseName\": \"images\",\n \"type\": \"Array\"\n },\n {\n \"name\": \"nodeInfo\",\n \"baseName\": \"nodeInfo\",\n \"type\": \"V1NodeSystemInfo\"\n },\n {\n \"name\": \"phase\",\n \"baseName\": \"phase\",\n \"type\": \"string\"\n },\n {\n \"name\": \"volumesAttached\",\n \"baseName\": \"volumesAttached\",\n \"type\": \"Array\"\n },\n {\n \"name\": \"volumesInUse\",\n \"baseName\": \"volumesInUse\",\n \"type\": \"Array\"\n }\n];\nexports.V1NodeStatus = V1NodeStatus;\n/**\n* NodeSystemInfo is a set of ids/uuids to uniquely identify the node.\n*/\nclass V1NodeSystemInfo {\n static getAttributeTypeMap() {\n return V1NodeSystemInfo.attributeTypeMap;\n }\n}\nV1NodeSystemInfo.discriminator = undefined;\nV1NodeSystemInfo.attributeTypeMap = [\n {\n \"name\": \"architecture\",\n \"baseName\": \"architecture\",\n \"type\": \"string\"\n },\n {\n \"name\": \"bootID\",\n \"baseName\": \"bootID\",\n \"type\": \"string\"\n },\n {\n \"name\": \"containerRuntimeVersion\",\n \"baseName\": \"containerRuntimeVersion\",\n \"type\": \"string\"\n },\n {\n \"name\": \"kernelVersion\",\n \"baseName\": \"kernelVersion\",\n \"type\": \"string\"\n },\n {\n \"name\": \"kubeProxyVersion\",\n \"baseName\": \"kubeProxyVersion\",\n \"type\": \"string\"\n },\n {\n \"name\": \"kubeletVersion\",\n \"baseName\": \"kubeletVersion\",\n \"type\": \"string\"\n },\n {\n \"name\": \"machineID\",\n \"baseName\": \"machineID\",\n \"type\": \"string\"\n },\n {\n \"name\": \"operatingSystem\",\n \"baseName\": \"operatingSystem\",\n \"type\": \"string\"\n },\n {\n \"name\": \"osImage\",\n \"baseName\": \"osImage\",\n \"type\": \"string\"\n },\n {\n \"name\": \"systemUUID\",\n \"baseName\": \"systemUUID\",\n \"type\": \"string\"\n }\n];\nexports.V1NodeSystemInfo = V1NodeSystemInfo;\n/**\n* NonResourceAttributes includes the authorization attributes available for non-resource requests to the Authorizer interface\n*/\nclass V1NonResourceAttributes {\n static getAttributeTypeMap() {\n return V1NonResourceAttributes.attributeTypeMap;\n }\n}\nV1NonResourceAttributes.discriminator = undefined;\nV1NonResourceAttributes.attributeTypeMap = [\n {\n \"name\": \"path\",\n \"baseName\": \"path\",\n \"type\": \"string\"\n },\n {\n \"name\": \"verb\",\n \"baseName\": \"verb\",\n \"type\": \"string\"\n }\n];\nexports.V1NonResourceAttributes = V1NonResourceAttributes;\n/**\n* NonResourceRule holds information that describes a rule for the non-resource\n*/\nclass V1NonResourceRule {\n static getAttributeTypeMap() {\n return V1NonResourceRule.attributeTypeMap;\n }\n}\nV1NonResourceRule.discriminator = undefined;\nV1NonResourceRule.attributeTypeMap = [\n {\n \"name\": \"nonResourceURLs\",\n \"baseName\": \"nonResourceURLs\",\n \"type\": \"Array\"\n },\n {\n \"name\": \"verbs\",\n \"baseName\": \"verbs\",\n \"type\": \"Array\"\n }\n];\nexports.V1NonResourceRule = V1NonResourceRule;\n/**\n* ObjectFieldSelector selects an APIVersioned field of an object.\n*/\nclass V1ObjectFieldSelector {\n static getAttributeTypeMap() {\n return V1ObjectFieldSelector.attributeTypeMap;\n }\n}\nV1ObjectFieldSelector.discriminator = undefined;\nV1ObjectFieldSelector.attributeTypeMap = [\n {\n \"name\": \"apiVersion\",\n \"baseName\": \"apiVersion\",\n \"type\": \"string\"\n },\n {\n \"name\": \"fieldPath\",\n \"baseName\": \"fieldPath\",\n \"type\": \"string\"\n }\n];\nexports.V1ObjectFieldSelector = V1ObjectFieldSelector;\n/**\n* ObjectMeta is metadata that all persisted resources must have, which includes all objects users must create.\n*/\nclass V1ObjectMeta {\n static getAttributeTypeMap() {\n return V1ObjectMeta.attributeTypeMap;\n }\n}\nV1ObjectMeta.discriminator = undefined;\nV1ObjectMeta.attributeTypeMap = [\n {\n \"name\": \"annotations\",\n \"baseName\": \"annotations\",\n \"type\": \"{ [key: string]: string; }\"\n },\n {\n \"name\": \"clusterName\",\n \"baseName\": \"clusterName\",\n \"type\": \"string\"\n },\n {\n \"name\": \"creationTimestamp\",\n \"baseName\": \"creationTimestamp\",\n \"type\": \"Date\"\n },\n {\n \"name\": \"deletionGracePeriodSeconds\",\n \"baseName\": \"deletionGracePeriodSeconds\",\n \"type\": \"number\"\n },\n {\n \"name\": \"deletionTimestamp\",\n \"baseName\": \"deletionTimestamp\",\n \"type\": \"Date\"\n },\n {\n \"name\": \"finalizers\",\n \"baseName\": \"finalizers\",\n \"type\": \"Array\"\n },\n {\n \"name\": \"generateName\",\n \"baseName\": \"generateName\",\n \"type\": \"string\"\n },\n {\n \"name\": \"generation\",\n \"baseName\": \"generation\",\n \"type\": \"number\"\n },\n {\n \"name\": \"initializers\",\n \"baseName\": \"initializers\",\n \"type\": \"V1Initializers\"\n },\n {\n \"name\": \"labels\",\n \"baseName\": \"labels\",\n \"type\": \"{ [key: string]: string; }\"\n },\n {\n \"name\": \"name\",\n \"baseName\": \"name\",\n \"type\": \"string\"\n },\n {\n \"name\": \"namespace\",\n \"baseName\": \"namespace\",\n \"type\": \"string\"\n },\n {\n \"name\": \"ownerReferences\",\n \"baseName\": \"ownerReferences\",\n \"type\": \"Array\"\n },\n {\n \"name\": \"resourceVersion\",\n \"baseName\": \"resourceVersion\",\n \"type\": \"string\"\n },\n {\n \"name\": \"selfLink\",\n \"baseName\": \"selfLink\",\n \"type\": \"string\"\n },\n {\n \"name\": \"uid\",\n \"baseName\": \"uid\",\n \"type\": \"string\"\n }\n];\nexports.V1ObjectMeta = V1ObjectMeta;\n/**\n* ObjectReference contains enough information to let you inspect or modify the referred object.\n*/\nclass V1ObjectReference {\n static getAttributeTypeMap() {\n return V1ObjectReference.attributeTypeMap;\n }\n}\nV1ObjectReference.discriminator = undefined;\nV1ObjectReference.attributeTypeMap = [\n {\n \"name\": \"apiVersion\",\n \"baseName\": \"apiVersion\",\n \"type\": \"string\"\n },\n {\n \"name\": \"fieldPath\",\n \"baseName\": \"fieldPath\",\n \"type\": \"string\"\n },\n {\n \"name\": \"kind\",\n \"baseName\": \"kind\",\n \"type\": \"string\"\n },\n {\n \"name\": \"name\",\n \"baseName\": \"name\",\n \"type\": \"string\"\n },\n {\n \"name\": \"namespace\",\n \"baseName\": \"namespace\",\n \"type\": \"string\"\n },\n {\n \"name\": \"resourceVersion\",\n \"baseName\": \"resourceVersion\",\n \"type\": \"string\"\n },\n {\n \"name\": \"uid\",\n \"baseName\": \"uid\",\n \"type\": \"string\"\n }\n];\nexports.V1ObjectReference = V1ObjectReference;\n/**\n* OwnerReference contains enough information to let you identify an owning object. An owning object must be in the same namespace as the dependent, or be cluster-scoped, so there is no namespace field.\n*/\nclass V1OwnerReference {\n static getAttributeTypeMap() {\n return V1OwnerReference.attributeTypeMap;\n }\n}\nV1OwnerReference.discriminator = undefined;\nV1OwnerReference.attributeTypeMap = [\n {\n \"name\": \"apiVersion\",\n \"baseName\": \"apiVersion\",\n \"type\": \"string\"\n },\n {\n \"name\": \"blockOwnerDeletion\",\n \"baseName\": \"blockOwnerDeletion\",\n \"type\": \"boolean\"\n },\n {\n \"name\": \"controller\",\n \"baseName\": \"controller\",\n \"type\": \"boolean\"\n },\n {\n \"name\": \"kind\",\n \"baseName\": \"kind\",\n \"type\": \"string\"\n },\n {\n \"name\": \"name\",\n \"baseName\": \"name\",\n \"type\": \"string\"\n },\n {\n \"name\": \"uid\",\n \"baseName\": \"uid\",\n \"type\": \"string\"\n }\n];\nexports.V1OwnerReference = V1OwnerReference;\n/**\n* PersistentVolume (PV) is a storage resource provisioned by an administrator. It is analogous to a node. More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes\n*/\nclass V1PersistentVolume {\n static getAttributeTypeMap() {\n return V1PersistentVolume.attributeTypeMap;\n }\n}\nV1PersistentVolume.discriminator = undefined;\nV1PersistentVolume.attributeTypeMap = [\n {\n \"name\": \"apiVersion\",\n \"baseName\": \"apiVersion\",\n \"type\": \"string\"\n },\n {\n \"name\": \"kind\",\n \"baseName\": \"kind\",\n \"type\": \"string\"\n },\n {\n \"name\": \"metadata\",\n \"baseName\": \"metadata\",\n \"type\": \"V1ObjectMeta\"\n },\n {\n \"name\": \"spec\",\n \"baseName\": \"spec\",\n \"type\": \"V1PersistentVolumeSpec\"\n },\n {\n \"name\": \"status\",\n \"baseName\": \"status\",\n \"type\": \"V1PersistentVolumeStatus\"\n }\n];\nexports.V1PersistentVolume = V1PersistentVolume;\n/**\n* PersistentVolumeClaim is a user's request for and claim to a persistent volume\n*/\nclass V1PersistentVolumeClaim {\n static getAttributeTypeMap() {\n return V1PersistentVolumeClaim.attributeTypeMap;\n }\n}\nV1PersistentVolumeClaim.discriminator = undefined;\nV1PersistentVolumeClaim.attributeTypeMap = [\n {\n \"name\": \"apiVersion\",\n \"baseName\": \"apiVersion\",\n \"type\": \"string\"\n },\n {\n \"name\": \"kind\",\n \"baseName\": \"kind\",\n \"type\": \"string\"\n },\n {\n \"name\": \"metadata\",\n \"baseName\": \"metadata\",\n \"type\": \"V1ObjectMeta\"\n },\n {\n \"name\": \"spec\",\n \"baseName\": \"spec\",\n \"type\": \"V1PersistentVolumeClaimSpec\"\n },\n {\n \"name\": \"status\",\n \"baseName\": \"status\",\n \"type\": \"V1PersistentVolumeClaimStatus\"\n }\n];\nexports.V1PersistentVolumeClaim = V1PersistentVolumeClaim;\n/**\n* PersistentVolumeClaimCondition contails details about state of pvc\n*/\nclass V1PersistentVolumeClaimCondition {\n static getAttributeTypeMap() {\n return V1PersistentVolumeClaimCondition.attributeTypeMap;\n }\n}\nV1PersistentVolumeClaimCondition.discriminator = undefined;\nV1PersistentVolumeClaimCondition.attributeTypeMap = [\n {\n \"name\": \"lastProbeTime\",\n \"baseName\": \"lastProbeTime\",\n \"type\": \"Date\"\n },\n {\n \"name\": \"lastTransitionTime\",\n \"baseName\": \"lastTransitionTime\",\n \"type\": \"Date\"\n },\n {\n \"name\": \"message\",\n \"baseName\": \"message\",\n \"type\": \"string\"\n },\n {\n \"name\": \"reason\",\n \"baseName\": \"reason\",\n \"type\": \"string\"\n },\n {\n \"name\": \"status\",\n \"baseName\": \"status\",\n \"type\": \"string\"\n },\n {\n \"name\": \"type\",\n \"baseName\": \"type\",\n \"type\": \"string\"\n }\n];\nexports.V1PersistentVolumeClaimCondition = V1PersistentVolumeClaimCondition;\n/**\n* PersistentVolumeClaimList is a list of PersistentVolumeClaim items.\n*/\nclass V1PersistentVolumeClaimList {\n static getAttributeTypeMap() {\n return V1PersistentVolumeClaimList.attributeTypeMap;\n }\n}\nV1PersistentVolumeClaimList.discriminator = undefined;\nV1PersistentVolumeClaimList.attributeTypeMap = [\n {\n \"name\": \"apiVersion\",\n \"baseName\": \"apiVersion\",\n \"type\": \"string\"\n },\n {\n \"name\": \"items\",\n \"baseName\": \"items\",\n \"type\": \"Array\"\n },\n {\n \"name\": \"kind\",\n \"baseName\": \"kind\",\n \"type\": \"string\"\n },\n {\n \"name\": \"metadata\",\n \"baseName\": \"metadata\",\n \"type\": \"V1ListMeta\"\n }\n];\nexports.V1PersistentVolumeClaimList = V1PersistentVolumeClaimList;\n/**\n* PersistentVolumeClaimSpec describes the common attributes of storage devices and allows a Source for provider-specific attributes\n*/\nclass V1PersistentVolumeClaimSpec {\n static getAttributeTypeMap() {\n return V1PersistentVolumeClaimSpec.attributeTypeMap;\n }\n}\nV1PersistentVolumeClaimSpec.discriminator = undefined;\nV1PersistentVolumeClaimSpec.attributeTypeMap = [\n {\n \"name\": \"accessModes\",\n \"baseName\": \"accessModes\",\n \"type\": \"Array\"\n },\n {\n \"name\": \"dataSource\",\n \"baseName\": \"dataSource\",\n \"type\": \"V1TypedLocalObjectReference\"\n },\n {\n \"name\": \"resources\",\n \"baseName\": \"resources\",\n \"type\": \"V1ResourceRequirements\"\n },\n {\n \"name\": \"selector\",\n \"baseName\": \"selector\",\n \"type\": \"V1LabelSelector\"\n },\n {\n \"name\": \"storageClassName\",\n \"baseName\": \"storageClassName\",\n \"type\": \"string\"\n },\n {\n \"name\": \"volumeMode\",\n \"baseName\": \"volumeMode\",\n \"type\": \"string\"\n },\n {\n \"name\": \"volumeName\",\n \"baseName\": \"volumeName\",\n \"type\": \"string\"\n }\n];\nexports.V1PersistentVolumeClaimSpec = V1PersistentVolumeClaimSpec;\n/**\n* PersistentVolumeClaimStatus is the current status of a persistent volume claim.\n*/\nclass V1PersistentVolumeClaimStatus {\n static getAttributeTypeMap() {\n return V1PersistentVolumeClaimStatus.attributeTypeMap;\n }\n}\nV1PersistentVolumeClaimStatus.discriminator = undefined;\nV1PersistentVolumeClaimStatus.attributeTypeMap = [\n {\n \"name\": \"accessModes\",\n \"baseName\": \"accessModes\",\n \"type\": \"Array\"\n },\n {\n \"name\": \"capacity\",\n \"baseName\": \"capacity\",\n \"type\": \"{ [key: string]: string; }\"\n },\n {\n \"name\": \"conditions\",\n \"baseName\": \"conditions\",\n \"type\": \"Array\"\n },\n {\n \"name\": \"phase\",\n \"baseName\": \"phase\",\n \"type\": \"string\"\n }\n];\nexports.V1PersistentVolumeClaimStatus = V1PersistentVolumeClaimStatus;\n/**\n* PersistentVolumeClaimVolumeSource references the user's PVC in the same namespace. This volume finds the bound PV and mounts that volume for the pod. A PersistentVolumeClaimVolumeSource is, essentially, a wrapper around another type of volume that is owned by someone else (the system).\n*/\nclass V1PersistentVolumeClaimVolumeSource {\n static getAttributeTypeMap() {\n return V1PersistentVolumeClaimVolumeSource.attributeTypeMap;\n }\n}\nV1PersistentVolumeClaimVolumeSource.discriminator = undefined;\nV1PersistentVolumeClaimVolumeSource.attributeTypeMap = [\n {\n \"name\": \"claimName\",\n \"baseName\": \"claimName\",\n \"type\": \"string\"\n },\n {\n \"name\": \"readOnly\",\n \"baseName\": \"readOnly\",\n \"type\": \"boolean\"\n }\n];\nexports.V1PersistentVolumeClaimVolumeSource = V1PersistentVolumeClaimVolumeSource;\n/**\n* PersistentVolumeList is a list of PersistentVolume items.\n*/\nclass V1PersistentVolumeList {\n static getAttributeTypeMap() {\n return V1PersistentVolumeList.attributeTypeMap;\n }\n}\nV1PersistentVolumeList.discriminator = undefined;\nV1PersistentVolumeList.attributeTypeMap = [\n {\n \"name\": \"apiVersion\",\n \"baseName\": \"apiVersion\",\n \"type\": \"string\"\n },\n {\n \"name\": \"items\",\n \"baseName\": \"items\",\n \"type\": \"Array\"\n },\n {\n \"name\": \"kind\",\n \"baseName\": \"kind\",\n \"type\": \"string\"\n },\n {\n \"name\": \"metadata\",\n \"baseName\": \"metadata\",\n \"type\": \"V1ListMeta\"\n }\n];\nexports.V1PersistentVolumeList = V1PersistentVolumeList;\n/**\n* PersistentVolumeSpec is the specification of a persistent volume.\n*/\nclass V1PersistentVolumeSpec {\n static getAttributeTypeMap() {\n return V1PersistentVolumeSpec.attributeTypeMap;\n }\n}\nV1PersistentVolumeSpec.discriminator = undefined;\nV1PersistentVolumeSpec.attributeTypeMap = [\n {\n \"name\": \"accessModes\",\n \"baseName\": \"accessModes\",\n \"type\": \"Array\"\n },\n {\n \"name\": \"awsElasticBlockStore\",\n \"baseName\": \"awsElasticBlockStore\",\n \"type\": \"V1AWSElasticBlockStoreVolumeSource\"\n },\n {\n \"name\": \"azureDisk\",\n \"baseName\": \"azureDisk\",\n \"type\": \"V1AzureDiskVolumeSource\"\n },\n {\n \"name\": \"azureFile\",\n \"baseName\": \"azureFile\",\n \"type\": \"V1AzureFilePersistentVolumeSource\"\n },\n {\n \"name\": \"capacity\",\n \"baseName\": \"capacity\",\n \"type\": \"{ [key: string]: string; }\"\n },\n {\n \"name\": \"cephfs\",\n \"baseName\": \"cephfs\",\n \"type\": \"V1CephFSPersistentVolumeSource\"\n },\n {\n \"name\": \"cinder\",\n \"baseName\": \"cinder\",\n \"type\": \"V1CinderPersistentVolumeSource\"\n },\n {\n \"name\": \"claimRef\",\n \"baseName\": \"claimRef\",\n \"type\": \"V1ObjectReference\"\n },\n {\n \"name\": \"csi\",\n \"baseName\": \"csi\",\n \"type\": \"V1CSIPersistentVolumeSource\"\n },\n {\n \"name\": \"fc\",\n \"baseName\": \"fc\",\n \"type\": \"V1FCVolumeSource\"\n },\n {\n \"name\": \"flexVolume\",\n \"baseName\": \"flexVolume\",\n \"type\": \"V1FlexPersistentVolumeSource\"\n },\n {\n \"name\": \"flocker\",\n \"baseName\": \"flocker\",\n \"type\": \"V1FlockerVolumeSource\"\n },\n {\n \"name\": \"gcePersistentDisk\",\n \"baseName\": \"gcePersistentDisk\",\n \"type\": \"V1GCEPersistentDiskVolumeSource\"\n },\n {\n \"name\": \"glusterfs\",\n \"baseName\": \"glusterfs\",\n \"type\": \"V1GlusterfsPersistentVolumeSource\"\n },\n {\n \"name\": \"hostPath\",\n \"baseName\": \"hostPath\",\n \"type\": \"V1HostPathVolumeSource\"\n },\n {\n \"name\": \"iscsi\",\n \"baseName\": \"iscsi\",\n \"type\": \"V1ISCSIPersistentVolumeSource\"\n },\n {\n \"name\": \"local\",\n \"baseName\": \"local\",\n \"type\": \"V1LocalVolumeSource\"\n },\n {\n \"name\": \"mountOptions\",\n \"baseName\": \"mountOptions\",\n \"type\": \"Array\"\n },\n {\n \"name\": \"nfs\",\n \"baseName\": \"nfs\",\n \"type\": \"V1NFSVolumeSource\"\n },\n {\n \"name\": \"nodeAffinity\",\n \"baseName\": \"nodeAffinity\",\n \"type\": \"V1VolumeNodeAffinity\"\n },\n {\n \"name\": \"persistentVolumeReclaimPolicy\",\n \"baseName\": \"persistentVolumeReclaimPolicy\",\n \"type\": \"string\"\n },\n {\n \"name\": \"photonPersistentDisk\",\n \"baseName\": \"photonPersistentDisk\",\n \"type\": \"V1PhotonPersistentDiskVolumeSource\"\n },\n {\n \"name\": \"portworxVolume\",\n \"baseName\": \"portworxVolume\",\n \"type\": \"V1PortworxVolumeSource\"\n },\n {\n \"name\": \"quobyte\",\n \"baseName\": \"quobyte\",\n \"type\": \"V1QuobyteVolumeSource\"\n },\n {\n \"name\": \"rbd\",\n \"baseName\": \"rbd\",\n \"type\": \"V1RBDPersistentVolumeSource\"\n },\n {\n \"name\": \"scaleIO\",\n \"baseName\": \"scaleIO\",\n \"type\": \"V1ScaleIOPersistentVolumeSource\"\n },\n {\n \"name\": \"storageClassName\",\n \"baseName\": \"storageClassName\",\n \"type\": \"string\"\n },\n {\n \"name\": \"storageos\",\n \"baseName\": \"storageos\",\n \"type\": \"V1StorageOSPersistentVolumeSource\"\n },\n {\n \"name\": \"volumeMode\",\n \"baseName\": \"volumeMode\",\n \"type\": \"string\"\n },\n {\n \"name\": \"vsphereVolume\",\n \"baseName\": \"vsphereVolume\",\n \"type\": \"V1VsphereVirtualDiskVolumeSource\"\n }\n];\nexports.V1PersistentVolumeSpec = V1PersistentVolumeSpec;\n/**\n* PersistentVolumeStatus is the current status of a persistent volume.\n*/\nclass V1PersistentVolumeStatus {\n static getAttributeTypeMap() {\n return V1PersistentVolumeStatus.attributeTypeMap;\n }\n}\nV1PersistentVolumeStatus.discriminator = undefined;\nV1PersistentVolumeStatus.attributeTypeMap = [\n {\n \"name\": \"message\",\n \"baseName\": \"message\",\n \"type\": \"string\"\n },\n {\n \"name\": \"phase\",\n \"baseName\": \"phase\",\n \"type\": \"string\"\n },\n {\n \"name\": \"reason\",\n \"baseName\": \"reason\",\n \"type\": \"string\"\n }\n];\nexports.V1PersistentVolumeStatus = V1PersistentVolumeStatus;\n/**\n* Represents a Photon Controller persistent disk resource.\n*/\nclass V1PhotonPersistentDiskVolumeSource {\n static getAttributeTypeMap() {\n return V1PhotonPersistentDiskVolumeSource.attributeTypeMap;\n }\n}\nV1PhotonPersistentDiskVolumeSource.discriminator = undefined;\nV1PhotonPersistentDiskVolumeSource.attributeTypeMap = [\n {\n \"name\": \"fsType\",\n \"baseName\": \"fsType\",\n \"type\": \"string\"\n },\n {\n \"name\": \"pdID\",\n \"baseName\": \"pdID\",\n \"type\": \"string\"\n }\n];\nexports.V1PhotonPersistentDiskVolumeSource = V1PhotonPersistentDiskVolumeSource;\n/**\n* Pod is a collection of containers that can run on a host. This resource is created by clients and scheduled onto hosts.\n*/\nclass V1Pod {\n static getAttributeTypeMap() {\n return V1Pod.attributeTypeMap;\n }\n}\nV1Pod.discriminator = undefined;\nV1Pod.attributeTypeMap = [\n {\n \"name\": \"apiVersion\",\n \"baseName\": \"apiVersion\",\n \"type\": \"string\"\n },\n {\n \"name\": \"kind\",\n \"baseName\": \"kind\",\n \"type\": \"string\"\n },\n {\n \"name\": \"metadata\",\n \"baseName\": \"metadata\",\n \"type\": \"V1ObjectMeta\"\n },\n {\n \"name\": \"spec\",\n \"baseName\": \"spec\",\n \"type\": \"V1PodSpec\"\n },\n {\n \"name\": \"status\",\n \"baseName\": \"status\",\n \"type\": \"V1PodStatus\"\n }\n];\nexports.V1Pod = V1Pod;\n/**\n* Pod affinity is a group of inter pod affinity scheduling rules.\n*/\nclass V1PodAffinity {\n static getAttributeTypeMap() {\n return V1PodAffinity.attributeTypeMap;\n }\n}\nV1PodAffinity.discriminator = undefined;\nV1PodAffinity.attributeTypeMap = [\n {\n \"name\": \"preferredDuringSchedulingIgnoredDuringExecution\",\n \"baseName\": \"preferredDuringSchedulingIgnoredDuringExecution\",\n \"type\": \"Array\"\n },\n {\n \"name\": \"requiredDuringSchedulingIgnoredDuringExecution\",\n \"baseName\": \"requiredDuringSchedulingIgnoredDuringExecution\",\n \"type\": \"Array\"\n }\n];\nexports.V1PodAffinity = V1PodAffinity;\n/**\n* Defines a set of pods (namely those matching the labelSelector relative to the given namespace(s)) that this pod should be co-located (affinity) or not co-located (anti-affinity) with, where co-located is defined as running on a node whose value of the label with key matches that of any node on which a pod of the set of pods is running\n*/\nclass V1PodAffinityTerm {\n static getAttributeTypeMap() {\n return V1PodAffinityTerm.attributeTypeMap;\n }\n}\nV1PodAffinityTerm.discriminator = undefined;\nV1PodAffinityTerm.attributeTypeMap = [\n {\n \"name\": \"labelSelector\",\n \"baseName\": \"labelSelector\",\n \"type\": \"V1LabelSelector\"\n },\n {\n \"name\": \"namespaces\",\n \"baseName\": \"namespaces\",\n \"type\": \"Array\"\n },\n {\n \"name\": \"topologyKey\",\n \"baseName\": \"topologyKey\",\n \"type\": \"string\"\n }\n];\nexports.V1PodAffinityTerm = V1PodAffinityTerm;\n/**\n* Pod anti affinity is a group of inter pod anti affinity scheduling rules.\n*/\nclass V1PodAntiAffinity {\n static getAttributeTypeMap() {\n return V1PodAntiAffinity.attributeTypeMap;\n }\n}\nV1PodAntiAffinity.discriminator = undefined;\nV1PodAntiAffinity.attributeTypeMap = [\n {\n \"name\": \"preferredDuringSchedulingIgnoredDuringExecution\",\n \"baseName\": \"preferredDuringSchedulingIgnoredDuringExecution\",\n \"type\": \"Array\"\n },\n {\n \"name\": \"requiredDuringSchedulingIgnoredDuringExecution\",\n \"baseName\": \"requiredDuringSchedulingIgnoredDuringExecution\",\n \"type\": \"Array\"\n }\n];\nexports.V1PodAntiAffinity = V1PodAntiAffinity;\n/**\n* PodCondition contains details for the current condition of this pod.\n*/\nclass V1PodCondition {\n static getAttributeTypeMap() {\n return V1PodCondition.attributeTypeMap;\n }\n}\nV1PodCondition.discriminator = undefined;\nV1PodCondition.attributeTypeMap = [\n {\n \"name\": \"lastProbeTime\",\n \"baseName\": \"lastProbeTime\",\n \"type\": \"Date\"\n },\n {\n \"name\": \"lastTransitionTime\",\n \"baseName\": \"lastTransitionTime\",\n \"type\": \"Date\"\n },\n {\n \"name\": \"message\",\n \"baseName\": \"message\",\n \"type\": \"string\"\n },\n {\n \"name\": \"reason\",\n \"baseName\": \"reason\",\n \"type\": \"string\"\n },\n {\n \"name\": \"status\",\n \"baseName\": \"status\",\n \"type\": \"string\"\n },\n {\n \"name\": \"type\",\n \"baseName\": \"type\",\n \"type\": \"string\"\n }\n];\nexports.V1PodCondition = V1PodCondition;\n/**\n* PodDNSConfig defines the DNS parameters of a pod in addition to those generated from DNSPolicy.\n*/\nclass V1PodDNSConfig {\n static getAttributeTypeMap() {\n return V1PodDNSConfig.attributeTypeMap;\n }\n}\nV1PodDNSConfig.discriminator = undefined;\nV1PodDNSConfig.attributeTypeMap = [\n {\n \"name\": \"nameservers\",\n \"baseName\": \"nameservers\",\n \"type\": \"Array\"\n },\n {\n \"name\": \"options\",\n \"baseName\": \"options\",\n \"type\": \"Array\"\n },\n {\n \"name\": \"searches\",\n \"baseName\": \"searches\",\n \"type\": \"Array\"\n }\n];\nexports.V1PodDNSConfig = V1PodDNSConfig;\n/**\n* PodDNSConfigOption defines DNS resolver options of a pod.\n*/\nclass V1PodDNSConfigOption {\n static getAttributeTypeMap() {\n return V1PodDNSConfigOption.attributeTypeMap;\n }\n}\nV1PodDNSConfigOption.discriminator = undefined;\nV1PodDNSConfigOption.attributeTypeMap = [\n {\n \"name\": \"name\",\n \"baseName\": \"name\",\n \"type\": \"string\"\n },\n {\n \"name\": \"value\",\n \"baseName\": \"value\",\n \"type\": \"string\"\n }\n];\nexports.V1PodDNSConfigOption = V1PodDNSConfigOption;\n/**\n* PodList is a list of Pods.\n*/\nclass V1PodList {\n static getAttributeTypeMap() {\n return V1PodList.attributeTypeMap;\n }\n}\nV1PodList.discriminator = undefined;\nV1PodList.attributeTypeMap = [\n {\n \"name\": \"apiVersion\",\n \"baseName\": \"apiVersion\",\n \"type\": \"string\"\n },\n {\n \"name\": \"items\",\n \"baseName\": \"items\",\n \"type\": \"Array\"\n },\n {\n \"name\": \"kind\",\n \"baseName\": \"kind\",\n \"type\": \"string\"\n },\n {\n \"name\": \"metadata\",\n \"baseName\": \"metadata\",\n \"type\": \"V1ListMeta\"\n }\n];\nexports.V1PodList = V1PodList;\n/**\n* PodReadinessGate contains the reference to a pod condition\n*/\nclass V1PodReadinessGate {\n static getAttributeTypeMap() {\n return V1PodReadinessGate.attributeTypeMap;\n }\n}\nV1PodReadinessGate.discriminator = undefined;\nV1PodReadinessGate.attributeTypeMap = [\n {\n \"name\": \"conditionType\",\n \"baseName\": \"conditionType\",\n \"type\": \"string\"\n }\n];\nexports.V1PodReadinessGate = V1PodReadinessGate;\n/**\n* PodSecurityContext holds pod-level security attributes and common container settings. Some fields are also present in container.securityContext. Field values of container.securityContext take precedence over field values of PodSecurityContext.\n*/\nclass V1PodSecurityContext {\n static getAttributeTypeMap() {\n return V1PodSecurityContext.attributeTypeMap;\n }\n}\nV1PodSecurityContext.discriminator = undefined;\nV1PodSecurityContext.attributeTypeMap = [\n {\n \"name\": \"fsGroup\",\n \"baseName\": \"fsGroup\",\n \"type\": \"number\"\n },\n {\n \"name\": \"runAsGroup\",\n \"baseName\": \"runAsGroup\",\n \"type\": \"number\"\n },\n {\n \"name\": \"runAsNonRoot\",\n \"baseName\": \"runAsNonRoot\",\n \"type\": \"boolean\"\n },\n {\n \"name\": \"runAsUser\",\n \"baseName\": \"runAsUser\",\n \"type\": \"number\"\n },\n {\n \"name\": \"seLinuxOptions\",\n \"baseName\": \"seLinuxOptions\",\n \"type\": \"V1SELinuxOptions\"\n },\n {\n \"name\": \"supplementalGroups\",\n \"baseName\": \"supplementalGroups\",\n \"type\": \"Array\"\n },\n {\n \"name\": \"sysctls\",\n \"baseName\": \"sysctls\",\n \"type\": \"Array\"\n }\n];\nexports.V1PodSecurityContext = V1PodSecurityContext;\n/**\n* PodSpec is a description of a pod.\n*/\nclass V1PodSpec {\n static getAttributeTypeMap() {\n return V1PodSpec.attributeTypeMap;\n }\n}\nV1PodSpec.discriminator = undefined;\nV1PodSpec.attributeTypeMap = [\n {\n \"name\": \"activeDeadlineSeconds\",\n \"baseName\": \"activeDeadlineSeconds\",\n \"type\": \"number\"\n },\n {\n \"name\": \"affinity\",\n \"baseName\": \"affinity\",\n \"type\": \"V1Affinity\"\n },\n {\n \"name\": \"automountServiceAccountToken\",\n \"baseName\": \"automountServiceAccountToken\",\n \"type\": \"boolean\"\n },\n {\n \"name\": \"containers\",\n \"baseName\": \"containers\",\n \"type\": \"Array\"\n },\n {\n \"name\": \"dnsConfig\",\n \"baseName\": \"dnsConfig\",\n \"type\": \"V1PodDNSConfig\"\n },\n {\n \"name\": \"dnsPolicy\",\n \"baseName\": \"dnsPolicy\",\n \"type\": \"string\"\n },\n {\n \"name\": \"enableServiceLinks\",\n \"baseName\": \"enableServiceLinks\",\n \"type\": \"boolean\"\n },\n {\n \"name\": \"hostAliases\",\n \"baseName\": \"hostAliases\",\n \"type\": \"Array\"\n },\n {\n \"name\": \"hostIPC\",\n \"baseName\": \"hostIPC\",\n \"type\": \"boolean\"\n },\n {\n \"name\": \"hostNetwork\",\n \"baseName\": \"hostNetwork\",\n \"type\": \"boolean\"\n },\n {\n \"name\": \"hostPID\",\n \"baseName\": \"hostPID\",\n \"type\": \"boolean\"\n },\n {\n \"name\": \"hostname\",\n \"baseName\": \"hostname\",\n \"type\": \"string\"\n },\n {\n \"name\": \"imagePullSecrets\",\n \"baseName\": \"imagePullSecrets\",\n \"type\": \"Array\"\n },\n {\n \"name\": \"initContainers\",\n \"baseName\": \"initContainers\",\n \"type\": \"Array\"\n },\n {\n \"name\": \"nodeName\",\n \"baseName\": \"nodeName\",\n \"type\": \"string\"\n },\n {\n \"name\": \"nodeSelector\",\n \"baseName\": \"nodeSelector\",\n \"type\": \"{ [key: string]: string; }\"\n },\n {\n \"name\": \"priority\",\n \"baseName\": \"priority\",\n \"type\": \"number\"\n },\n {\n \"name\": \"priorityClassName\",\n \"baseName\": \"priorityClassName\",\n \"type\": \"string\"\n },\n {\n \"name\": \"readinessGates\",\n \"baseName\": \"readinessGates\",\n \"type\": \"Array\"\n },\n {\n \"name\": \"restartPolicy\",\n \"baseName\": \"restartPolicy\",\n \"type\": \"string\"\n },\n {\n \"name\": \"runtimeClassName\",\n \"baseName\": \"runtimeClassName\",\n \"type\": \"string\"\n },\n {\n \"name\": \"schedulerName\",\n \"baseName\": \"schedulerName\",\n \"type\": \"string\"\n },\n {\n \"name\": \"securityContext\",\n \"baseName\": \"securityContext\",\n \"type\": \"V1PodSecurityContext\"\n },\n {\n \"name\": \"serviceAccount\",\n \"baseName\": \"serviceAccount\",\n \"type\": \"string\"\n },\n {\n \"name\": \"serviceAccountName\",\n \"baseName\": \"serviceAccountName\",\n \"type\": \"string\"\n },\n {\n \"name\": \"shareProcessNamespace\",\n \"baseName\": \"shareProcessNamespace\",\n \"type\": \"boolean\"\n },\n {\n \"name\": \"subdomain\",\n \"baseName\": \"subdomain\",\n \"type\": \"string\"\n },\n {\n \"name\": \"terminationGracePeriodSeconds\",\n \"baseName\": \"terminationGracePeriodSeconds\",\n \"type\": \"number\"\n },\n {\n \"name\": \"tolerations\",\n \"baseName\": \"tolerations\",\n \"type\": \"Array\"\n },\n {\n \"name\": \"volumes\",\n \"baseName\": \"volumes\",\n \"type\": \"Array\"\n }\n];\nexports.V1PodSpec = V1PodSpec;\n/**\n* PodStatus represents information about the status of a pod. Status may trail the actual state of a system, especially if the node that hosts the pod cannot contact the control plane.\n*/\nclass V1PodStatus {\n static getAttributeTypeMap() {\n return V1PodStatus.attributeTypeMap;\n }\n}\nV1PodStatus.discriminator = undefined;\nV1PodStatus.attributeTypeMap = [\n {\n \"name\": \"conditions\",\n \"baseName\": \"conditions\",\n \"type\": \"Array\"\n },\n {\n \"name\": \"containerStatuses\",\n \"baseName\": \"containerStatuses\",\n \"type\": \"Array\"\n },\n {\n \"name\": \"hostIP\",\n \"baseName\": \"hostIP\",\n \"type\": \"string\"\n },\n {\n \"name\": \"initContainerStatuses\",\n \"baseName\": \"initContainerStatuses\",\n \"type\": \"Array\"\n },\n {\n \"name\": \"message\",\n \"baseName\": \"message\",\n \"type\": \"string\"\n },\n {\n \"name\": \"nominatedNodeName\",\n \"baseName\": \"nominatedNodeName\",\n \"type\": \"string\"\n },\n {\n \"name\": \"phase\",\n \"baseName\": \"phase\",\n \"type\": \"string\"\n },\n {\n \"name\": \"podIP\",\n \"baseName\": \"podIP\",\n \"type\": \"string\"\n },\n {\n \"name\": \"qosClass\",\n \"baseName\": \"qosClass\",\n \"type\": \"string\"\n },\n {\n \"name\": \"reason\",\n \"baseName\": \"reason\",\n \"type\": \"string\"\n },\n {\n \"name\": \"startTime\",\n \"baseName\": \"startTime\",\n \"type\": \"Date\"\n }\n];\nexports.V1PodStatus = V1PodStatus;\n/**\n* PodTemplate describes a template for creating copies of a predefined pod.\n*/\nclass V1PodTemplate {\n static getAttributeTypeMap() {\n return V1PodTemplate.attributeTypeMap;\n }\n}\nV1PodTemplate.discriminator = undefined;\nV1PodTemplate.attributeTypeMap = [\n {\n \"name\": \"apiVersion\",\n \"baseName\": \"apiVersion\",\n \"type\": \"string\"\n },\n {\n \"name\": \"kind\",\n \"baseName\": \"kind\",\n \"type\": \"string\"\n },\n {\n \"name\": \"metadata\",\n \"baseName\": \"metadata\",\n \"type\": \"V1ObjectMeta\"\n },\n {\n \"name\": \"template\",\n \"baseName\": \"template\",\n \"type\": \"V1PodTemplateSpec\"\n }\n];\nexports.V1PodTemplate = V1PodTemplate;\n/**\n* PodTemplateList is a list of PodTemplates.\n*/\nclass V1PodTemplateList {\n static getAttributeTypeMap() {\n return V1PodTemplateList.attributeTypeMap;\n }\n}\nV1PodTemplateList.discriminator = undefined;\nV1PodTemplateList.attributeTypeMap = [\n {\n \"name\": \"apiVersion\",\n \"baseName\": \"apiVersion\",\n \"type\": \"string\"\n },\n {\n \"name\": \"items\",\n \"baseName\": \"items\",\n \"type\": \"Array\"\n },\n {\n \"name\": \"kind\",\n \"baseName\": \"kind\",\n \"type\": \"string\"\n },\n {\n \"name\": \"metadata\",\n \"baseName\": \"metadata\",\n \"type\": \"V1ListMeta\"\n }\n];\nexports.V1PodTemplateList = V1PodTemplateList;\n/**\n* PodTemplateSpec describes the data a pod should have when created from a template\n*/\nclass V1PodTemplateSpec {\n static getAttributeTypeMap() {\n return V1PodTemplateSpec.attributeTypeMap;\n }\n}\nV1PodTemplateSpec.discriminator = undefined;\nV1PodTemplateSpec.attributeTypeMap = [\n {\n \"name\": \"metadata\",\n \"baseName\": \"metadata\",\n \"type\": \"V1ObjectMeta\"\n },\n {\n \"name\": \"spec\",\n \"baseName\": \"spec\",\n \"type\": \"V1PodSpec\"\n }\n];\nexports.V1PodTemplateSpec = V1PodTemplateSpec;\n/**\n* PolicyRule holds information that describes a policy rule, but does not contain information about who the rule applies to or which namespace the rule applies to.\n*/\nclass V1PolicyRule {\n static getAttributeTypeMap() {\n return V1PolicyRule.attributeTypeMap;\n }\n}\nV1PolicyRule.discriminator = undefined;\nV1PolicyRule.attributeTypeMap = [\n {\n \"name\": \"apiGroups\",\n \"baseName\": \"apiGroups\",\n \"type\": \"Array\"\n },\n {\n \"name\": \"nonResourceURLs\",\n \"baseName\": \"nonResourceURLs\",\n \"type\": \"Array\"\n },\n {\n \"name\": \"resourceNames\",\n \"baseName\": \"resourceNames\",\n \"type\": \"Array\"\n },\n {\n \"name\": \"resources\",\n \"baseName\": \"resources\",\n \"type\": \"Array\"\n },\n {\n \"name\": \"verbs\",\n \"baseName\": \"verbs\",\n \"type\": \"Array\"\n }\n];\nexports.V1PolicyRule = V1PolicyRule;\n/**\n* PortworxVolumeSource represents a Portworx volume resource.\n*/\nclass V1PortworxVolumeSource {\n static getAttributeTypeMap() {\n return V1PortworxVolumeSource.attributeTypeMap;\n }\n}\nV1PortworxVolumeSource.discriminator = undefined;\nV1PortworxVolumeSource.attributeTypeMap = [\n {\n \"name\": \"fsType\",\n \"baseName\": \"fsType\",\n \"type\": \"string\"\n },\n {\n \"name\": \"readOnly\",\n \"baseName\": \"readOnly\",\n \"type\": \"boolean\"\n },\n {\n \"name\": \"volumeID\",\n \"baseName\": \"volumeID\",\n \"type\": \"string\"\n }\n];\nexports.V1PortworxVolumeSource = V1PortworxVolumeSource;\n/**\n* Preconditions must be fulfilled before an operation (update, delete, etc.) is carried out.\n*/\nclass V1Preconditions {\n static getAttributeTypeMap() {\n return V1Preconditions.attributeTypeMap;\n }\n}\nV1Preconditions.discriminator = undefined;\nV1Preconditions.attributeTypeMap = [\n {\n \"name\": \"uid\",\n \"baseName\": \"uid\",\n \"type\": \"string\"\n }\n];\nexports.V1Preconditions = V1Preconditions;\n/**\n* An empty preferred scheduling term matches all objects with implicit weight 0 (i.e. it's a no-op). A null preferred scheduling term matches no objects (i.e. is also a no-op).\n*/\nclass V1PreferredSchedulingTerm {\n static getAttributeTypeMap() {\n return V1PreferredSchedulingTerm.attributeTypeMap;\n }\n}\nV1PreferredSchedulingTerm.discriminator = undefined;\nV1PreferredSchedulingTerm.attributeTypeMap = [\n {\n \"name\": \"preference\",\n \"baseName\": \"preference\",\n \"type\": \"V1NodeSelectorTerm\"\n },\n {\n \"name\": \"weight\",\n \"baseName\": \"weight\",\n \"type\": \"number\"\n }\n];\nexports.V1PreferredSchedulingTerm = V1PreferredSchedulingTerm;\n/**\n* Probe describes a health check to be performed against a container to determine whether it is alive or ready to receive traffic.\n*/\nclass V1Probe {\n static getAttributeTypeMap() {\n return V1Probe.attributeTypeMap;\n }\n}\nV1Probe.discriminator = undefined;\nV1Probe.attributeTypeMap = [\n {\n \"name\": \"exec\",\n \"baseName\": \"exec\",\n \"type\": \"V1ExecAction\"\n },\n {\n \"name\": \"failureThreshold\",\n \"baseName\": \"failureThreshold\",\n \"type\": \"number\"\n },\n {\n \"name\": \"httpGet\",\n \"baseName\": \"httpGet\",\n \"type\": \"V1HTTPGetAction\"\n },\n {\n \"name\": \"initialDelaySeconds\",\n \"baseName\": \"initialDelaySeconds\",\n \"type\": \"number\"\n },\n {\n \"name\": \"periodSeconds\",\n \"baseName\": \"periodSeconds\",\n \"type\": \"number\"\n },\n {\n \"name\": \"successThreshold\",\n \"baseName\": \"successThreshold\",\n \"type\": \"number\"\n },\n {\n \"name\": \"tcpSocket\",\n \"baseName\": \"tcpSocket\",\n \"type\": \"V1TCPSocketAction\"\n },\n {\n \"name\": \"timeoutSeconds\",\n \"baseName\": \"timeoutSeconds\",\n \"type\": \"number\"\n }\n];\nexports.V1Probe = V1Probe;\n/**\n* Represents a projected volume source\n*/\nclass V1ProjectedVolumeSource {\n static getAttributeTypeMap() {\n return V1ProjectedVolumeSource.attributeTypeMap;\n }\n}\nV1ProjectedVolumeSource.discriminator = undefined;\nV1ProjectedVolumeSource.attributeTypeMap = [\n {\n \"name\": \"defaultMode\",\n \"baseName\": \"defaultMode\",\n \"type\": \"number\"\n },\n {\n \"name\": \"sources\",\n \"baseName\": \"sources\",\n \"type\": \"Array\"\n }\n];\nexports.V1ProjectedVolumeSource = V1ProjectedVolumeSource;\n/**\n* Represents a Quobyte mount that lasts the lifetime of a pod. Quobyte volumes do not support ownership management or SELinux relabeling.\n*/\nclass V1QuobyteVolumeSource {\n static getAttributeTypeMap() {\n return V1QuobyteVolumeSource.attributeTypeMap;\n }\n}\nV1QuobyteVolumeSource.discriminator = undefined;\nV1QuobyteVolumeSource.attributeTypeMap = [\n {\n \"name\": \"group\",\n \"baseName\": \"group\",\n \"type\": \"string\"\n },\n {\n \"name\": \"readOnly\",\n \"baseName\": \"readOnly\",\n \"type\": \"boolean\"\n },\n {\n \"name\": \"registry\",\n \"baseName\": \"registry\",\n \"type\": \"string\"\n },\n {\n \"name\": \"user\",\n \"baseName\": \"user\",\n \"type\": \"string\"\n },\n {\n \"name\": \"volume\",\n \"baseName\": \"volume\",\n \"type\": \"string\"\n }\n];\nexports.V1QuobyteVolumeSource = V1QuobyteVolumeSource;\n/**\n* Represents a Rados Block Device mount that lasts the lifetime of a pod. RBD volumes support ownership management and SELinux relabeling.\n*/\nclass V1RBDPersistentVolumeSource {\n static getAttributeTypeMap() {\n return V1RBDPersistentVolumeSource.attributeTypeMap;\n }\n}\nV1RBDPersistentVolumeSource.discriminator = undefined;\nV1RBDPersistentVolumeSource.attributeTypeMap = [\n {\n \"name\": \"fsType\",\n \"baseName\": \"fsType\",\n \"type\": \"string\"\n },\n {\n \"name\": \"image\",\n \"baseName\": \"image\",\n \"type\": \"string\"\n },\n {\n \"name\": \"keyring\",\n \"baseName\": \"keyring\",\n \"type\": \"string\"\n },\n {\n \"name\": \"monitors\",\n \"baseName\": \"monitors\",\n \"type\": \"Array\"\n },\n {\n \"name\": \"pool\",\n \"baseName\": \"pool\",\n \"type\": \"string\"\n },\n {\n \"name\": \"readOnly\",\n \"baseName\": \"readOnly\",\n \"type\": \"boolean\"\n },\n {\n \"name\": \"secretRef\",\n \"baseName\": \"secretRef\",\n \"type\": \"V1SecretReference\"\n },\n {\n \"name\": \"user\",\n \"baseName\": \"user\",\n \"type\": \"string\"\n }\n];\nexports.V1RBDPersistentVolumeSource = V1RBDPersistentVolumeSource;\n/**\n* Represents a Rados Block Device mount that lasts the lifetime of a pod. RBD volumes support ownership management and SELinux relabeling.\n*/\nclass V1RBDVolumeSource {\n static getAttributeTypeMap() {\n return V1RBDVolumeSource.attributeTypeMap;\n }\n}\nV1RBDVolumeSource.discriminator = undefined;\nV1RBDVolumeSource.attributeTypeMap = [\n {\n \"name\": \"fsType\",\n \"baseName\": \"fsType\",\n \"type\": \"string\"\n },\n {\n \"name\": \"image\",\n \"baseName\": \"image\",\n \"type\": \"string\"\n },\n {\n \"name\": \"keyring\",\n \"baseName\": \"keyring\",\n \"type\": \"string\"\n },\n {\n \"name\": \"monitors\",\n \"baseName\": \"monitors\",\n \"type\": \"Array\"\n },\n {\n \"name\": \"pool\",\n \"baseName\": \"pool\",\n \"type\": \"string\"\n },\n {\n \"name\": \"readOnly\",\n \"baseName\": \"readOnly\",\n \"type\": \"boolean\"\n },\n {\n \"name\": \"secretRef\",\n \"baseName\": \"secretRef\",\n \"type\": \"V1LocalObjectReference\"\n },\n {\n \"name\": \"user\",\n \"baseName\": \"user\",\n \"type\": \"string\"\n }\n];\nexports.V1RBDVolumeSource = V1RBDVolumeSource;\n/**\n* ReplicaSet ensures that a specified number of pod replicas are running at any given time.\n*/\nclass V1ReplicaSet {\n static getAttributeTypeMap() {\n return V1ReplicaSet.attributeTypeMap;\n }\n}\nV1ReplicaSet.discriminator = undefined;\nV1ReplicaSet.attributeTypeMap = [\n {\n \"name\": \"apiVersion\",\n \"baseName\": \"apiVersion\",\n \"type\": \"string\"\n },\n {\n \"name\": \"kind\",\n \"baseName\": \"kind\",\n \"type\": \"string\"\n },\n {\n \"name\": \"metadata\",\n \"baseName\": \"metadata\",\n \"type\": \"V1ObjectMeta\"\n },\n {\n \"name\": \"spec\",\n \"baseName\": \"spec\",\n \"type\": \"V1ReplicaSetSpec\"\n },\n {\n \"name\": \"status\",\n \"baseName\": \"status\",\n \"type\": \"V1ReplicaSetStatus\"\n }\n];\nexports.V1ReplicaSet = V1ReplicaSet;\n/**\n* ReplicaSetCondition describes the state of a replica set at a certain point.\n*/\nclass V1ReplicaSetCondition {\n static getAttributeTypeMap() {\n return V1ReplicaSetCondition.attributeTypeMap;\n }\n}\nV1ReplicaSetCondition.discriminator = undefined;\nV1ReplicaSetCondition.attributeTypeMap = [\n {\n \"name\": \"lastTransitionTime\",\n \"baseName\": \"lastTransitionTime\",\n \"type\": \"Date\"\n },\n {\n \"name\": \"message\",\n \"baseName\": \"message\",\n \"type\": \"string\"\n },\n {\n \"name\": \"reason\",\n \"baseName\": \"reason\",\n \"type\": \"string\"\n },\n {\n \"name\": \"status\",\n \"baseName\": \"status\",\n \"type\": \"string\"\n },\n {\n \"name\": \"type\",\n \"baseName\": \"type\",\n \"type\": \"string\"\n }\n];\nexports.V1ReplicaSetCondition = V1ReplicaSetCondition;\n/**\n* ReplicaSetList is a collection of ReplicaSets.\n*/\nclass V1ReplicaSetList {\n static getAttributeTypeMap() {\n return V1ReplicaSetList.attributeTypeMap;\n }\n}\nV1ReplicaSetList.discriminator = undefined;\nV1ReplicaSetList.attributeTypeMap = [\n {\n \"name\": \"apiVersion\",\n \"baseName\": \"apiVersion\",\n \"type\": \"string\"\n },\n {\n \"name\": \"items\",\n \"baseName\": \"items\",\n \"type\": \"Array\"\n },\n {\n \"name\": \"kind\",\n \"baseName\": \"kind\",\n \"type\": \"string\"\n },\n {\n \"name\": \"metadata\",\n \"baseName\": \"metadata\",\n \"type\": \"V1ListMeta\"\n }\n];\nexports.V1ReplicaSetList = V1ReplicaSetList;\n/**\n* ReplicaSetSpec is the specification of a ReplicaSet.\n*/\nclass V1ReplicaSetSpec {\n static getAttributeTypeMap() {\n return V1ReplicaSetSpec.attributeTypeMap;\n }\n}\nV1ReplicaSetSpec.discriminator = undefined;\nV1ReplicaSetSpec.attributeTypeMap = [\n {\n \"name\": \"minReadySeconds\",\n \"baseName\": \"minReadySeconds\",\n \"type\": \"number\"\n },\n {\n \"name\": \"replicas\",\n \"baseName\": \"replicas\",\n \"type\": \"number\"\n },\n {\n \"name\": \"selector\",\n \"baseName\": \"selector\",\n \"type\": \"V1LabelSelector\"\n },\n {\n \"name\": \"template\",\n \"baseName\": \"template\",\n \"type\": \"V1PodTemplateSpec\"\n }\n];\nexports.V1ReplicaSetSpec = V1ReplicaSetSpec;\n/**\n* ReplicaSetStatus represents the current status of a ReplicaSet.\n*/\nclass V1ReplicaSetStatus {\n static getAttributeTypeMap() {\n return V1ReplicaSetStatus.attributeTypeMap;\n }\n}\nV1ReplicaSetStatus.discriminator = undefined;\nV1ReplicaSetStatus.attributeTypeMap = [\n {\n \"name\": \"availableReplicas\",\n \"baseName\": \"availableReplicas\",\n \"type\": \"number\"\n },\n {\n \"name\": \"conditions\",\n \"baseName\": \"conditions\",\n \"type\": \"Array\"\n },\n {\n \"name\": \"fullyLabeledReplicas\",\n \"baseName\": \"fullyLabeledReplicas\",\n \"type\": \"number\"\n },\n {\n \"name\": \"observedGeneration\",\n \"baseName\": \"observedGeneration\",\n \"type\": \"number\"\n },\n {\n \"name\": \"readyReplicas\",\n \"baseName\": \"readyReplicas\",\n \"type\": \"number\"\n },\n {\n \"name\": \"replicas\",\n \"baseName\": \"replicas\",\n \"type\": \"number\"\n }\n];\nexports.V1ReplicaSetStatus = V1ReplicaSetStatus;\n/**\n* ReplicationController represents the configuration of a replication controller.\n*/\nclass V1ReplicationController {\n static getAttributeTypeMap() {\n return V1ReplicationController.attributeTypeMap;\n }\n}\nV1ReplicationController.discriminator = undefined;\nV1ReplicationController.attributeTypeMap = [\n {\n \"name\": \"apiVersion\",\n \"baseName\": \"apiVersion\",\n \"type\": \"string\"\n },\n {\n \"name\": \"kind\",\n \"baseName\": \"kind\",\n \"type\": \"string\"\n },\n {\n \"name\": \"metadata\",\n \"baseName\": \"metadata\",\n \"type\": \"V1ObjectMeta\"\n },\n {\n \"name\": \"spec\",\n \"baseName\": \"spec\",\n \"type\": \"V1ReplicationControllerSpec\"\n },\n {\n \"name\": \"status\",\n \"baseName\": \"status\",\n \"type\": \"V1ReplicationControllerStatus\"\n }\n];\nexports.V1ReplicationController = V1ReplicationController;\n/**\n* ReplicationControllerCondition describes the state of a replication controller at a certain point.\n*/\nclass V1ReplicationControllerCondition {\n static getAttributeTypeMap() {\n return V1ReplicationControllerCondition.attributeTypeMap;\n }\n}\nV1ReplicationControllerCondition.discriminator = undefined;\nV1ReplicationControllerCondition.attributeTypeMap = [\n {\n \"name\": \"lastTransitionTime\",\n \"baseName\": \"lastTransitionTime\",\n \"type\": \"Date\"\n },\n {\n \"name\": \"message\",\n \"baseName\": \"message\",\n \"type\": \"string\"\n },\n {\n \"name\": \"reason\",\n \"baseName\": \"reason\",\n \"type\": \"string\"\n },\n {\n \"name\": \"status\",\n \"baseName\": \"status\",\n \"type\": \"string\"\n },\n {\n \"name\": \"type\",\n \"baseName\": \"type\",\n \"type\": \"string\"\n }\n];\nexports.V1ReplicationControllerCondition = V1ReplicationControllerCondition;\n/**\n* ReplicationControllerList is a collection of replication controllers.\n*/\nclass V1ReplicationControllerList {\n static getAttributeTypeMap() {\n return V1ReplicationControllerList.attributeTypeMap;\n }\n}\nV1ReplicationControllerList.discriminator = undefined;\nV1ReplicationControllerList.attributeTypeMap = [\n {\n \"name\": \"apiVersion\",\n \"baseName\": \"apiVersion\",\n \"type\": \"string\"\n },\n {\n \"name\": \"items\",\n \"baseName\": \"items\",\n \"type\": \"Array\"\n },\n {\n \"name\": \"kind\",\n \"baseName\": \"kind\",\n \"type\": \"string\"\n },\n {\n \"name\": \"metadata\",\n \"baseName\": \"metadata\",\n \"type\": \"V1ListMeta\"\n }\n];\nexports.V1ReplicationControllerList = V1ReplicationControllerList;\n/**\n* ReplicationControllerSpec is the specification of a replication controller.\n*/\nclass V1ReplicationControllerSpec {\n static getAttributeTypeMap() {\n return V1ReplicationControllerSpec.attributeTypeMap;\n }\n}\nV1ReplicationControllerSpec.discriminator = undefined;\nV1ReplicationControllerSpec.attributeTypeMap = [\n {\n \"name\": \"minReadySeconds\",\n \"baseName\": \"minReadySeconds\",\n \"type\": \"number\"\n },\n {\n \"name\": \"replicas\",\n \"baseName\": \"replicas\",\n \"type\": \"number\"\n },\n {\n \"name\": \"selector\",\n \"baseName\": \"selector\",\n \"type\": \"{ [key: string]: string; }\"\n },\n {\n \"name\": \"template\",\n \"baseName\": \"template\",\n \"type\": \"V1PodTemplateSpec\"\n }\n];\nexports.V1ReplicationControllerSpec = V1ReplicationControllerSpec;\n/**\n* ReplicationControllerStatus represents the current status of a replication controller.\n*/\nclass V1ReplicationControllerStatus {\n static getAttributeTypeMap() {\n return V1ReplicationControllerStatus.attributeTypeMap;\n }\n}\nV1ReplicationControllerStatus.discriminator = undefined;\nV1ReplicationControllerStatus.attributeTypeMap = [\n {\n \"name\": \"availableReplicas\",\n \"baseName\": \"availableReplicas\",\n \"type\": \"number\"\n },\n {\n \"name\": \"conditions\",\n \"baseName\": \"conditions\",\n \"type\": \"Array\"\n },\n {\n \"name\": \"fullyLabeledReplicas\",\n \"baseName\": \"fullyLabeledReplicas\",\n \"type\": \"number\"\n },\n {\n \"name\": \"observedGeneration\",\n \"baseName\": \"observedGeneration\",\n \"type\": \"number\"\n },\n {\n \"name\": \"readyReplicas\",\n \"baseName\": \"readyReplicas\",\n \"type\": \"number\"\n },\n {\n \"name\": \"replicas\",\n \"baseName\": \"replicas\",\n \"type\": \"number\"\n }\n];\nexports.V1ReplicationControllerStatus = V1ReplicationControllerStatus;\n/**\n* ResourceAttributes includes the authorization attributes available for resource requests to the Authorizer interface\n*/\nclass V1ResourceAttributes {\n static getAttributeTypeMap() {\n return V1ResourceAttributes.attributeTypeMap;\n }\n}\nV1ResourceAttributes.discriminator = undefined;\nV1ResourceAttributes.attributeTypeMap = [\n {\n \"name\": \"group\",\n \"baseName\": \"group\",\n \"type\": \"string\"\n },\n {\n \"name\": \"name\",\n \"baseName\": \"name\",\n \"type\": \"string\"\n },\n {\n \"name\": \"namespace\",\n \"baseName\": \"namespace\",\n \"type\": \"string\"\n },\n {\n \"name\": \"resource\",\n \"baseName\": \"resource\",\n \"type\": \"string\"\n },\n {\n \"name\": \"subresource\",\n \"baseName\": \"subresource\",\n \"type\": \"string\"\n },\n {\n \"name\": \"verb\",\n \"baseName\": \"verb\",\n \"type\": \"string\"\n },\n {\n \"name\": \"version\",\n \"baseName\": \"version\",\n \"type\": \"string\"\n }\n];\nexports.V1ResourceAttributes = V1ResourceAttributes;\n/**\n* ResourceFieldSelector represents container resources (cpu, memory) and their output format\n*/\nclass V1ResourceFieldSelector {\n static getAttributeTypeMap() {\n return V1ResourceFieldSelector.attributeTypeMap;\n }\n}\nV1ResourceFieldSelector.discriminator = undefined;\nV1ResourceFieldSelector.attributeTypeMap = [\n {\n \"name\": \"containerName\",\n \"baseName\": \"containerName\",\n \"type\": \"string\"\n },\n {\n \"name\": \"divisor\",\n \"baseName\": \"divisor\",\n \"type\": \"string\"\n },\n {\n \"name\": \"resource\",\n \"baseName\": \"resource\",\n \"type\": \"string\"\n }\n];\nexports.V1ResourceFieldSelector = V1ResourceFieldSelector;\n/**\n* ResourceQuota sets aggregate quota restrictions enforced per namespace\n*/\nclass V1ResourceQuota {\n static getAttributeTypeMap() {\n return V1ResourceQuota.attributeTypeMap;\n }\n}\nV1ResourceQuota.discriminator = undefined;\nV1ResourceQuota.attributeTypeMap = [\n {\n \"name\": \"apiVersion\",\n \"baseName\": \"apiVersion\",\n \"type\": \"string\"\n },\n {\n \"name\": \"kind\",\n \"baseName\": \"kind\",\n \"type\": \"string\"\n },\n {\n \"name\": \"metadata\",\n \"baseName\": \"metadata\",\n \"type\": \"V1ObjectMeta\"\n },\n {\n \"name\": \"spec\",\n \"baseName\": \"spec\",\n \"type\": \"V1ResourceQuotaSpec\"\n },\n {\n \"name\": \"status\",\n \"baseName\": \"status\",\n \"type\": \"V1ResourceQuotaStatus\"\n }\n];\nexports.V1ResourceQuota = V1ResourceQuota;\n/**\n* ResourceQuotaList is a list of ResourceQuota items.\n*/\nclass V1ResourceQuotaList {\n static getAttributeTypeMap() {\n return V1ResourceQuotaList.attributeTypeMap;\n }\n}\nV1ResourceQuotaList.discriminator = undefined;\nV1ResourceQuotaList.attributeTypeMap = [\n {\n \"name\": \"apiVersion\",\n \"baseName\": \"apiVersion\",\n \"type\": \"string\"\n },\n {\n \"name\": \"items\",\n \"baseName\": \"items\",\n \"type\": \"Array\"\n },\n {\n \"name\": \"kind\",\n \"baseName\": \"kind\",\n \"type\": \"string\"\n },\n {\n \"name\": \"metadata\",\n \"baseName\": \"metadata\",\n \"type\": \"V1ListMeta\"\n }\n];\nexports.V1ResourceQuotaList = V1ResourceQuotaList;\n/**\n* ResourceQuotaSpec defines the desired hard limits to enforce for Quota.\n*/\nclass V1ResourceQuotaSpec {\n static getAttributeTypeMap() {\n return V1ResourceQuotaSpec.attributeTypeMap;\n }\n}\nV1ResourceQuotaSpec.discriminator = undefined;\nV1ResourceQuotaSpec.attributeTypeMap = [\n {\n \"name\": \"hard\",\n \"baseName\": \"hard\",\n \"type\": \"{ [key: string]: string; }\"\n },\n {\n \"name\": \"scopeSelector\",\n \"baseName\": \"scopeSelector\",\n \"type\": \"V1ScopeSelector\"\n },\n {\n \"name\": \"scopes\",\n \"baseName\": \"scopes\",\n \"type\": \"Array\"\n }\n];\nexports.V1ResourceQuotaSpec = V1ResourceQuotaSpec;\n/**\n* ResourceQuotaStatus defines the enforced hard limits and observed use.\n*/\nclass V1ResourceQuotaStatus {\n static getAttributeTypeMap() {\n return V1ResourceQuotaStatus.attributeTypeMap;\n }\n}\nV1ResourceQuotaStatus.discriminator = undefined;\nV1ResourceQuotaStatus.attributeTypeMap = [\n {\n \"name\": \"hard\",\n \"baseName\": \"hard\",\n \"type\": \"{ [key: string]: string; }\"\n },\n {\n \"name\": \"used\",\n \"baseName\": \"used\",\n \"type\": \"{ [key: string]: string; }\"\n }\n];\nexports.V1ResourceQuotaStatus = V1ResourceQuotaStatus;\n/**\n* ResourceRequirements describes the compute resource requirements.\n*/\nclass V1ResourceRequirements {\n static getAttributeTypeMap() {\n return V1ResourceRequirements.attributeTypeMap;\n }\n}\nV1ResourceRequirements.discriminator = undefined;\nV1ResourceRequirements.attributeTypeMap = [\n {\n \"name\": \"limits\",\n \"baseName\": \"limits\",\n \"type\": \"{ [key: string]: string; }\"\n },\n {\n \"name\": \"requests\",\n \"baseName\": \"requests\",\n \"type\": \"{ [key: string]: string; }\"\n }\n];\nexports.V1ResourceRequirements = V1ResourceRequirements;\n/**\n* ResourceRule is the list of actions the subject is allowed to perform on resources. The list ordering isn't significant, may contain duplicates, and possibly be incomplete.\n*/\nclass V1ResourceRule {\n static getAttributeTypeMap() {\n return V1ResourceRule.attributeTypeMap;\n }\n}\nV1ResourceRule.discriminator = undefined;\nV1ResourceRule.attributeTypeMap = [\n {\n \"name\": \"apiGroups\",\n \"baseName\": \"apiGroups\",\n \"type\": \"Array\"\n },\n {\n \"name\": \"resourceNames\",\n \"baseName\": \"resourceNames\",\n \"type\": \"Array\"\n },\n {\n \"name\": \"resources\",\n \"baseName\": \"resources\",\n \"type\": \"Array\"\n },\n {\n \"name\": \"verbs\",\n \"baseName\": \"verbs\",\n \"type\": \"Array\"\n }\n];\nexports.V1ResourceRule = V1ResourceRule;\n/**\n* Role is a namespaced, logical grouping of PolicyRules that can be referenced as a unit by a RoleBinding.\n*/\nclass V1Role {\n static getAttributeTypeMap() {\n return V1Role.attributeTypeMap;\n }\n}\nV1Role.discriminator = undefined;\nV1Role.attributeTypeMap = [\n {\n \"name\": \"apiVersion\",\n \"baseName\": \"apiVersion\",\n \"type\": \"string\"\n },\n {\n \"name\": \"kind\",\n \"baseName\": \"kind\",\n \"type\": \"string\"\n },\n {\n \"name\": \"metadata\",\n \"baseName\": \"metadata\",\n \"type\": \"V1ObjectMeta\"\n },\n {\n \"name\": \"rules\",\n \"baseName\": \"rules\",\n \"type\": \"Array\"\n }\n];\nexports.V1Role = V1Role;\n/**\n* RoleBinding references a role, but does not contain it. It can reference a Role in the same namespace or a ClusterRole in the global namespace. It adds who information via Subjects and namespace information by which namespace it exists in. RoleBindings in a given namespace only have effect in that namespace.\n*/\nclass V1RoleBinding {\n static getAttributeTypeMap() {\n return V1RoleBinding.attributeTypeMap;\n }\n}\nV1RoleBinding.discriminator = undefined;\nV1RoleBinding.attributeTypeMap = [\n {\n \"name\": \"apiVersion\",\n \"baseName\": \"apiVersion\",\n \"type\": \"string\"\n },\n {\n \"name\": \"kind\",\n \"baseName\": \"kind\",\n \"type\": \"string\"\n },\n {\n \"name\": \"metadata\",\n \"baseName\": \"metadata\",\n \"type\": \"V1ObjectMeta\"\n },\n {\n \"name\": \"roleRef\",\n \"baseName\": \"roleRef\",\n \"type\": \"V1RoleRef\"\n },\n {\n \"name\": \"subjects\",\n \"baseName\": \"subjects\",\n \"type\": \"Array\"\n }\n];\nexports.V1RoleBinding = V1RoleBinding;\n/**\n* RoleBindingList is a collection of RoleBindings\n*/\nclass V1RoleBindingList {\n static getAttributeTypeMap() {\n return V1RoleBindingList.attributeTypeMap;\n }\n}\nV1RoleBindingList.discriminator = undefined;\nV1RoleBindingList.attributeTypeMap = [\n {\n \"name\": \"apiVersion\",\n \"baseName\": \"apiVersion\",\n \"type\": \"string\"\n },\n {\n \"name\": \"items\",\n \"baseName\": \"items\",\n \"type\": \"Array\"\n },\n {\n \"name\": \"kind\",\n \"baseName\": \"kind\",\n \"type\": \"string\"\n },\n {\n \"name\": \"metadata\",\n \"baseName\": \"metadata\",\n \"type\": \"V1ListMeta\"\n }\n];\nexports.V1RoleBindingList = V1RoleBindingList;\n/**\n* RoleList is a collection of Roles\n*/\nclass V1RoleList {\n static getAttributeTypeMap() {\n return V1RoleList.attributeTypeMap;\n }\n}\nV1RoleList.discriminator = undefined;\nV1RoleList.attributeTypeMap = [\n {\n \"name\": \"apiVersion\",\n \"baseName\": \"apiVersion\",\n \"type\": \"string\"\n },\n {\n \"name\": \"items\",\n \"baseName\": \"items\",\n \"type\": \"Array\"\n },\n {\n \"name\": \"kind\",\n \"baseName\": \"kind\",\n \"type\": \"string\"\n },\n {\n \"name\": \"metadata\",\n \"baseName\": \"metadata\",\n \"type\": \"V1ListMeta\"\n }\n];\nexports.V1RoleList = V1RoleList;\n/**\n* RoleRef contains information that points to the role being used\n*/\nclass V1RoleRef {\n static getAttributeTypeMap() {\n return V1RoleRef.attributeTypeMap;\n }\n}\nV1RoleRef.discriminator = undefined;\nV1RoleRef.attributeTypeMap = [\n {\n \"name\": \"apiGroup\",\n \"baseName\": \"apiGroup\",\n \"type\": \"string\"\n },\n {\n \"name\": \"kind\",\n \"baseName\": \"kind\",\n \"type\": \"string\"\n },\n {\n \"name\": \"name\",\n \"baseName\": \"name\",\n \"type\": \"string\"\n }\n];\nexports.V1RoleRef = V1RoleRef;\n/**\n* Spec to control the desired behavior of daemon set rolling update.\n*/\nclass V1RollingUpdateDaemonSet {\n static getAttributeTypeMap() {\n return V1RollingUpdateDaemonSet.attributeTypeMap;\n }\n}\nV1RollingUpdateDaemonSet.discriminator = undefined;\nV1RollingUpdateDaemonSet.attributeTypeMap = [\n {\n \"name\": \"maxUnavailable\",\n \"baseName\": \"maxUnavailable\",\n \"type\": \"any\"\n }\n];\nexports.V1RollingUpdateDaemonSet = V1RollingUpdateDaemonSet;\n/**\n* Spec to control the desired behavior of rolling update.\n*/\nclass V1RollingUpdateDeployment {\n static getAttributeTypeMap() {\n return V1RollingUpdateDeployment.attributeTypeMap;\n }\n}\nV1RollingUpdateDeployment.discriminator = undefined;\nV1RollingUpdateDeployment.attributeTypeMap = [\n {\n \"name\": \"maxSurge\",\n \"baseName\": \"maxSurge\",\n \"type\": \"any\"\n },\n {\n \"name\": \"maxUnavailable\",\n \"baseName\": \"maxUnavailable\",\n \"type\": \"any\"\n }\n];\nexports.V1RollingUpdateDeployment = V1RollingUpdateDeployment;\n/**\n* RollingUpdateStatefulSetStrategy is used to communicate parameter for RollingUpdateStatefulSetStrategyType.\n*/\nclass V1RollingUpdateStatefulSetStrategy {\n static getAttributeTypeMap() {\n return V1RollingUpdateStatefulSetStrategy.attributeTypeMap;\n }\n}\nV1RollingUpdateStatefulSetStrategy.discriminator = undefined;\nV1RollingUpdateStatefulSetStrategy.attributeTypeMap = [\n {\n \"name\": \"partition\",\n \"baseName\": \"partition\",\n \"type\": \"number\"\n }\n];\nexports.V1RollingUpdateStatefulSetStrategy = V1RollingUpdateStatefulSetStrategy;\n/**\n* SELinuxOptions are the labels to be applied to the container\n*/\nclass V1SELinuxOptions {\n static getAttributeTypeMap() {\n return V1SELinuxOptions.attributeTypeMap;\n }\n}\nV1SELinuxOptions.discriminator = undefined;\nV1SELinuxOptions.attributeTypeMap = [\n {\n \"name\": \"level\",\n \"baseName\": \"level\",\n \"type\": \"string\"\n },\n {\n \"name\": \"role\",\n \"baseName\": \"role\",\n \"type\": \"string\"\n },\n {\n \"name\": \"type\",\n \"baseName\": \"type\",\n \"type\": \"string\"\n },\n {\n \"name\": \"user\",\n \"baseName\": \"user\",\n \"type\": \"string\"\n }\n];\nexports.V1SELinuxOptions = V1SELinuxOptions;\n/**\n* Scale represents a scaling request for a resource.\n*/\nclass V1Scale {\n static getAttributeTypeMap() {\n return V1Scale.attributeTypeMap;\n }\n}\nV1Scale.discriminator = undefined;\nV1Scale.attributeTypeMap = [\n {\n \"name\": \"apiVersion\",\n \"baseName\": \"apiVersion\",\n \"type\": \"string\"\n },\n {\n \"name\": \"kind\",\n \"baseName\": \"kind\",\n \"type\": \"string\"\n },\n {\n \"name\": \"metadata\",\n \"baseName\": \"metadata\",\n \"type\": \"V1ObjectMeta\"\n },\n {\n \"name\": \"spec\",\n \"baseName\": \"spec\",\n \"type\": \"V1ScaleSpec\"\n },\n {\n \"name\": \"status\",\n \"baseName\": \"status\",\n \"type\": \"V1ScaleStatus\"\n }\n];\nexports.V1Scale = V1Scale;\n/**\n* ScaleIOPersistentVolumeSource represents a persistent ScaleIO volume\n*/\nclass V1ScaleIOPersistentVolumeSource {\n static getAttributeTypeMap() {\n return V1ScaleIOPersistentVolumeSource.attributeTypeMap;\n }\n}\nV1ScaleIOPersistentVolumeSource.discriminator = undefined;\nV1ScaleIOPersistentVolumeSource.attributeTypeMap = [\n {\n \"name\": \"fsType\",\n \"baseName\": \"fsType\",\n \"type\": \"string\"\n },\n {\n \"name\": \"gateway\",\n \"baseName\": \"gateway\",\n \"type\": \"string\"\n },\n {\n \"name\": \"protectionDomain\",\n \"baseName\": \"protectionDomain\",\n \"type\": \"string\"\n },\n {\n \"name\": \"readOnly\",\n \"baseName\": \"readOnly\",\n \"type\": \"boolean\"\n },\n {\n \"name\": \"secretRef\",\n \"baseName\": \"secretRef\",\n \"type\": \"V1SecretReference\"\n },\n {\n \"name\": \"sslEnabled\",\n \"baseName\": \"sslEnabled\",\n \"type\": \"boolean\"\n },\n {\n \"name\": \"storageMode\",\n \"baseName\": \"storageMode\",\n \"type\": \"string\"\n },\n {\n \"name\": \"storagePool\",\n \"baseName\": \"storagePool\",\n \"type\": \"string\"\n },\n {\n \"name\": \"system\",\n \"baseName\": \"system\",\n \"type\": \"string\"\n },\n {\n \"name\": \"volumeName\",\n \"baseName\": \"volumeName\",\n \"type\": \"string\"\n }\n];\nexports.V1ScaleIOPersistentVolumeSource = V1ScaleIOPersistentVolumeSource;\n/**\n* ScaleIOVolumeSource represents a persistent ScaleIO volume\n*/\nclass V1ScaleIOVolumeSource {\n static getAttributeTypeMap() {\n return V1ScaleIOVolumeSource.attributeTypeMap;\n }\n}\nV1ScaleIOVolumeSource.discriminator = undefined;\nV1ScaleIOVolumeSource.attributeTypeMap = [\n {\n \"name\": \"fsType\",\n \"baseName\": \"fsType\",\n \"type\": \"string\"\n },\n {\n \"name\": \"gateway\",\n \"baseName\": \"gateway\",\n \"type\": \"string\"\n },\n {\n \"name\": \"protectionDomain\",\n \"baseName\": \"protectionDomain\",\n \"type\": \"string\"\n },\n {\n \"name\": \"readOnly\",\n \"baseName\": \"readOnly\",\n \"type\": \"boolean\"\n },\n {\n \"name\": \"secretRef\",\n \"baseName\": \"secretRef\",\n \"type\": \"V1LocalObjectReference\"\n },\n {\n \"name\": \"sslEnabled\",\n \"baseName\": \"sslEnabled\",\n \"type\": \"boolean\"\n },\n {\n \"name\": \"storageMode\",\n \"baseName\": \"storageMode\",\n \"type\": \"string\"\n },\n {\n \"name\": \"storagePool\",\n \"baseName\": \"storagePool\",\n \"type\": \"string\"\n },\n {\n \"name\": \"system\",\n \"baseName\": \"system\",\n \"type\": \"string\"\n },\n {\n \"name\": \"volumeName\",\n \"baseName\": \"volumeName\",\n \"type\": \"string\"\n }\n];\nexports.V1ScaleIOVolumeSource = V1ScaleIOVolumeSource;\n/**\n* ScaleSpec describes the attributes of a scale subresource.\n*/\nclass V1ScaleSpec {\n static getAttributeTypeMap() {\n return V1ScaleSpec.attributeTypeMap;\n }\n}\nV1ScaleSpec.discriminator = undefined;\nV1ScaleSpec.attributeTypeMap = [\n {\n \"name\": \"replicas\",\n \"baseName\": \"replicas\",\n \"type\": \"number\"\n }\n];\nexports.V1ScaleSpec = V1ScaleSpec;\n/**\n* ScaleStatus represents the current status of a scale subresource.\n*/\nclass V1ScaleStatus {\n static getAttributeTypeMap() {\n return V1ScaleStatus.attributeTypeMap;\n }\n}\nV1ScaleStatus.discriminator = undefined;\nV1ScaleStatus.attributeTypeMap = [\n {\n \"name\": \"replicas\",\n \"baseName\": \"replicas\",\n \"type\": \"number\"\n },\n {\n \"name\": \"selector\",\n \"baseName\": \"selector\",\n \"type\": \"string\"\n }\n];\nexports.V1ScaleStatus = V1ScaleStatus;\n/**\n* A scope selector represents the AND of the selectors represented by the scoped-resource selector requirements.\n*/\nclass V1ScopeSelector {\n static getAttributeTypeMap() {\n return V1ScopeSelector.attributeTypeMap;\n }\n}\nV1ScopeSelector.discriminator = undefined;\nV1ScopeSelector.attributeTypeMap = [\n {\n \"name\": \"matchExpressions\",\n \"baseName\": \"matchExpressions\",\n \"type\": \"Array\"\n }\n];\nexports.V1ScopeSelector = V1ScopeSelector;\n/**\n* A scoped-resource selector requirement is a selector that contains values, a scope name, and an operator that relates the scope name and values.\n*/\nclass V1ScopedResourceSelectorRequirement {\n static getAttributeTypeMap() {\n return V1ScopedResourceSelectorRequirement.attributeTypeMap;\n }\n}\nV1ScopedResourceSelectorRequirement.discriminator = undefined;\nV1ScopedResourceSelectorRequirement.attributeTypeMap = [\n {\n \"name\": \"operator\",\n \"baseName\": \"operator\",\n \"type\": \"string\"\n },\n {\n \"name\": \"scopeName\",\n \"baseName\": \"scopeName\",\n \"type\": \"string\"\n },\n {\n \"name\": \"values\",\n \"baseName\": \"values\",\n \"type\": \"Array\"\n }\n];\nexports.V1ScopedResourceSelectorRequirement = V1ScopedResourceSelectorRequirement;\n/**\n* Secret holds secret data of a certain type. The total bytes of the values in the Data field must be less than MaxSecretSize bytes.\n*/\nclass V1Secret {\n static getAttributeTypeMap() {\n return V1Secret.attributeTypeMap;\n }\n}\nV1Secret.discriminator = undefined;\nV1Secret.attributeTypeMap = [\n {\n \"name\": \"apiVersion\",\n \"baseName\": \"apiVersion\",\n \"type\": \"string\"\n },\n {\n \"name\": \"data\",\n \"baseName\": \"data\",\n \"type\": \"{ [key: string]: string; }\"\n },\n {\n \"name\": \"kind\",\n \"baseName\": \"kind\",\n \"type\": \"string\"\n },\n {\n \"name\": \"metadata\",\n \"baseName\": \"metadata\",\n \"type\": \"V1ObjectMeta\"\n },\n {\n \"name\": \"stringData\",\n \"baseName\": \"stringData\",\n \"type\": \"{ [key: string]: string; }\"\n },\n {\n \"name\": \"type\",\n \"baseName\": \"type\",\n \"type\": \"string\"\n }\n];\nexports.V1Secret = V1Secret;\n/**\n* SecretEnvSource selects a Secret to populate the environment variables with. The contents of the target Secret's Data field will represent the key-value pairs as environment variables.\n*/\nclass V1SecretEnvSource {\n static getAttributeTypeMap() {\n return V1SecretEnvSource.attributeTypeMap;\n }\n}\nV1SecretEnvSource.discriminator = undefined;\nV1SecretEnvSource.attributeTypeMap = [\n {\n \"name\": \"name\",\n \"baseName\": \"name\",\n \"type\": \"string\"\n },\n {\n \"name\": \"optional\",\n \"baseName\": \"optional\",\n \"type\": \"boolean\"\n }\n];\nexports.V1SecretEnvSource = V1SecretEnvSource;\n/**\n* SecretKeySelector selects a key of a Secret.\n*/\nclass V1SecretKeySelector {\n static getAttributeTypeMap() {\n return V1SecretKeySelector.attributeTypeMap;\n }\n}\nV1SecretKeySelector.discriminator = undefined;\nV1SecretKeySelector.attributeTypeMap = [\n {\n \"name\": \"key\",\n \"baseName\": \"key\",\n \"type\": \"string\"\n },\n {\n \"name\": \"name\",\n \"baseName\": \"name\",\n \"type\": \"string\"\n },\n {\n \"name\": \"optional\",\n \"baseName\": \"optional\",\n \"type\": \"boolean\"\n }\n];\nexports.V1SecretKeySelector = V1SecretKeySelector;\n/**\n* SecretList is a list of Secret.\n*/\nclass V1SecretList {\n static getAttributeTypeMap() {\n return V1SecretList.attributeTypeMap;\n }\n}\nV1SecretList.discriminator = undefined;\nV1SecretList.attributeTypeMap = [\n {\n \"name\": \"apiVersion\",\n \"baseName\": \"apiVersion\",\n \"type\": \"string\"\n },\n {\n \"name\": \"items\",\n \"baseName\": \"items\",\n \"type\": \"Array\"\n },\n {\n \"name\": \"kind\",\n \"baseName\": \"kind\",\n \"type\": \"string\"\n },\n {\n \"name\": \"metadata\",\n \"baseName\": \"metadata\",\n \"type\": \"V1ListMeta\"\n }\n];\nexports.V1SecretList = V1SecretList;\n/**\n* Adapts a secret into a projected volume. The contents of the target Secret's Data field will be presented in a projected volume as files using the keys in the Data field as the file names. Note that this is identical to a secret volume source without the default mode.\n*/\nclass V1SecretProjection {\n static getAttributeTypeMap() {\n return V1SecretProjection.attributeTypeMap;\n }\n}\nV1SecretProjection.discriminator = undefined;\nV1SecretProjection.attributeTypeMap = [\n {\n \"name\": \"items\",\n \"baseName\": \"items\",\n \"type\": \"Array\"\n },\n {\n \"name\": \"name\",\n \"baseName\": \"name\",\n \"type\": \"string\"\n },\n {\n \"name\": \"optional\",\n \"baseName\": \"optional\",\n \"type\": \"boolean\"\n }\n];\nexports.V1SecretProjection = V1SecretProjection;\n/**\n* SecretReference represents a Secret Reference. It has enough information to retrieve secret in any namespace\n*/\nclass V1SecretReference {\n static getAttributeTypeMap() {\n return V1SecretReference.attributeTypeMap;\n }\n}\nV1SecretReference.discriminator = undefined;\nV1SecretReference.attributeTypeMap = [\n {\n \"name\": \"name\",\n \"baseName\": \"name\",\n \"type\": \"string\"\n },\n {\n \"name\": \"namespace\",\n \"baseName\": \"namespace\",\n \"type\": \"string\"\n }\n];\nexports.V1SecretReference = V1SecretReference;\n/**\n* Adapts a Secret into a volume. The contents of the target Secret's Data field will be presented in a volume as files using the keys in the Data field as the file names. Secret volumes support ownership management and SELinux relabeling.\n*/\nclass V1SecretVolumeSource {\n static getAttributeTypeMap() {\n return V1SecretVolumeSource.attributeTypeMap;\n }\n}\nV1SecretVolumeSource.discriminator = undefined;\nV1SecretVolumeSource.attributeTypeMap = [\n {\n \"name\": \"defaultMode\",\n \"baseName\": \"defaultMode\",\n \"type\": \"number\"\n },\n {\n \"name\": \"items\",\n \"baseName\": \"items\",\n \"type\": \"Array\"\n },\n {\n \"name\": \"optional\",\n \"baseName\": \"optional\",\n \"type\": \"boolean\"\n },\n {\n \"name\": \"secretName\",\n \"baseName\": \"secretName\",\n \"type\": \"string\"\n }\n];\nexports.V1SecretVolumeSource = V1SecretVolumeSource;\n/**\n* SecurityContext holds security configuration that will be applied to a container. Some fields are present in both SecurityContext and PodSecurityContext. When both are set, the values in SecurityContext take precedence.\n*/\nclass V1SecurityContext {\n static getAttributeTypeMap() {\n return V1SecurityContext.attributeTypeMap;\n }\n}\nV1SecurityContext.discriminator = undefined;\nV1SecurityContext.attributeTypeMap = [\n {\n \"name\": \"allowPrivilegeEscalation\",\n \"baseName\": \"allowPrivilegeEscalation\",\n \"type\": \"boolean\"\n },\n {\n \"name\": \"capabilities\",\n \"baseName\": \"capabilities\",\n \"type\": \"V1Capabilities\"\n },\n {\n \"name\": \"privileged\",\n \"baseName\": \"privileged\",\n \"type\": \"boolean\"\n },\n {\n \"name\": \"procMount\",\n \"baseName\": \"procMount\",\n \"type\": \"string\"\n },\n {\n \"name\": \"readOnlyRootFilesystem\",\n \"baseName\": \"readOnlyRootFilesystem\",\n \"type\": \"boolean\"\n },\n {\n \"name\": \"runAsGroup\",\n \"baseName\": \"runAsGroup\",\n \"type\": \"number\"\n },\n {\n \"name\": \"runAsNonRoot\",\n \"baseName\": \"runAsNonRoot\",\n \"type\": \"boolean\"\n },\n {\n \"name\": \"runAsUser\",\n \"baseName\": \"runAsUser\",\n \"type\": \"number\"\n },\n {\n \"name\": \"seLinuxOptions\",\n \"baseName\": \"seLinuxOptions\",\n \"type\": \"V1SELinuxOptions\"\n }\n];\nexports.V1SecurityContext = V1SecurityContext;\n/**\n* SelfSubjectAccessReview checks whether or the current user can perform an action. Not filling in a spec.namespace means \\\"in all namespaces\\\". Self is a special case, because users should always be able to check whether they can perform an action\n*/\nclass V1SelfSubjectAccessReview {\n static getAttributeTypeMap() {\n return V1SelfSubjectAccessReview.attributeTypeMap;\n }\n}\nV1SelfSubjectAccessReview.discriminator = undefined;\nV1SelfSubjectAccessReview.attributeTypeMap = [\n {\n \"name\": \"apiVersion\",\n \"baseName\": \"apiVersion\",\n \"type\": \"string\"\n },\n {\n \"name\": \"kind\",\n \"baseName\": \"kind\",\n \"type\": \"string\"\n },\n {\n \"name\": \"metadata\",\n \"baseName\": \"metadata\",\n \"type\": \"V1ObjectMeta\"\n },\n {\n \"name\": \"spec\",\n \"baseName\": \"spec\",\n \"type\": \"V1SelfSubjectAccessReviewSpec\"\n },\n {\n \"name\": \"status\",\n \"baseName\": \"status\",\n \"type\": \"V1SubjectAccessReviewStatus\"\n }\n];\nexports.V1SelfSubjectAccessReview = V1SelfSubjectAccessReview;\n/**\n* SelfSubjectAccessReviewSpec is a description of the access request. Exactly one of ResourceAuthorizationAttributes and NonResourceAuthorizationAttributes must be set\n*/\nclass V1SelfSubjectAccessReviewSpec {\n static getAttributeTypeMap() {\n return V1SelfSubjectAccessReviewSpec.attributeTypeMap;\n }\n}\nV1SelfSubjectAccessReviewSpec.discriminator = undefined;\nV1SelfSubjectAccessReviewSpec.attributeTypeMap = [\n {\n \"name\": \"nonResourceAttributes\",\n \"baseName\": \"nonResourceAttributes\",\n \"type\": \"V1NonResourceAttributes\"\n },\n {\n \"name\": \"resourceAttributes\",\n \"baseName\": \"resourceAttributes\",\n \"type\": \"V1ResourceAttributes\"\n }\n];\nexports.V1SelfSubjectAccessReviewSpec = V1SelfSubjectAccessReviewSpec;\n/**\n* SelfSubjectRulesReview enumerates the set of actions the current user can perform within a namespace. The returned list of actions may be incomplete depending on the server's authorization mode, and any errors experienced during the evaluation. SelfSubjectRulesReview should be used by UIs to show/hide actions, or to quickly let an end user reason about their permissions. It should NOT Be used by external systems to drive authorization decisions as this raises confused deputy, cache lifetime/revocation, and correctness concerns. SubjectAccessReview, and LocalAccessReview are the correct way to defer authorization decisions to the API server.\n*/\nclass V1SelfSubjectRulesReview {\n static getAttributeTypeMap() {\n return V1SelfSubjectRulesReview.attributeTypeMap;\n }\n}\nV1SelfSubjectRulesReview.discriminator = undefined;\nV1SelfSubjectRulesReview.attributeTypeMap = [\n {\n \"name\": \"apiVersion\",\n \"baseName\": \"apiVersion\",\n \"type\": \"string\"\n },\n {\n \"name\": \"kind\",\n \"baseName\": \"kind\",\n \"type\": \"string\"\n },\n {\n \"name\": \"metadata\",\n \"baseName\": \"metadata\",\n \"type\": \"V1ObjectMeta\"\n },\n {\n \"name\": \"spec\",\n \"baseName\": \"spec\",\n \"type\": \"V1SelfSubjectRulesReviewSpec\"\n },\n {\n \"name\": \"status\",\n \"baseName\": \"status\",\n \"type\": \"V1SubjectRulesReviewStatus\"\n }\n];\nexports.V1SelfSubjectRulesReview = V1SelfSubjectRulesReview;\nclass V1SelfSubjectRulesReviewSpec {\n static getAttributeTypeMap() {\n return V1SelfSubjectRulesReviewSpec.attributeTypeMap;\n }\n}\nV1SelfSubjectRulesReviewSpec.discriminator = undefined;\nV1SelfSubjectRulesReviewSpec.attributeTypeMap = [\n {\n \"name\": \"namespace\",\n \"baseName\": \"namespace\",\n \"type\": \"string\"\n }\n];\nexports.V1SelfSubjectRulesReviewSpec = V1SelfSubjectRulesReviewSpec;\n/**\n* ServerAddressByClientCIDR helps the client to determine the server address that they should use, depending on the clientCIDR that they match.\n*/\nclass V1ServerAddressByClientCIDR {\n static getAttributeTypeMap() {\n return V1ServerAddressByClientCIDR.attributeTypeMap;\n }\n}\nV1ServerAddressByClientCIDR.discriminator = undefined;\nV1ServerAddressByClientCIDR.attributeTypeMap = [\n {\n \"name\": \"clientCIDR\",\n \"baseName\": \"clientCIDR\",\n \"type\": \"string\"\n },\n {\n \"name\": \"serverAddress\",\n \"baseName\": \"serverAddress\",\n \"type\": \"string\"\n }\n];\nexports.V1ServerAddressByClientCIDR = V1ServerAddressByClientCIDR;\n/**\n* Service is a named abstraction of software service (for example, mysql) consisting of local port (for example 3306) that the proxy listens on, and the selector that determines which pods will answer requests sent through the proxy.\n*/\nclass V1Service {\n static getAttributeTypeMap() {\n return V1Service.attributeTypeMap;\n }\n}\nV1Service.discriminator = undefined;\nV1Service.attributeTypeMap = [\n {\n \"name\": \"apiVersion\",\n \"baseName\": \"apiVersion\",\n \"type\": \"string\"\n },\n {\n \"name\": \"kind\",\n \"baseName\": \"kind\",\n \"type\": \"string\"\n },\n {\n \"name\": \"metadata\",\n \"baseName\": \"metadata\",\n \"type\": \"V1ObjectMeta\"\n },\n {\n \"name\": \"spec\",\n \"baseName\": \"spec\",\n \"type\": \"V1ServiceSpec\"\n },\n {\n \"name\": \"status\",\n \"baseName\": \"status\",\n \"type\": \"V1ServiceStatus\"\n }\n];\nexports.V1Service = V1Service;\n/**\n* ServiceAccount binds together: * a name, understood by users, and perhaps by peripheral systems, for an identity * a principal that can be authenticated and authorized * a set of secrets\n*/\nclass V1ServiceAccount {\n static getAttributeTypeMap() {\n return V1ServiceAccount.attributeTypeMap;\n }\n}\nV1ServiceAccount.discriminator = undefined;\nV1ServiceAccount.attributeTypeMap = [\n {\n \"name\": \"apiVersion\",\n \"baseName\": \"apiVersion\",\n \"type\": \"string\"\n },\n {\n \"name\": \"automountServiceAccountToken\",\n \"baseName\": \"automountServiceAccountToken\",\n \"type\": \"boolean\"\n },\n {\n \"name\": \"imagePullSecrets\",\n \"baseName\": \"imagePullSecrets\",\n \"type\": \"Array\"\n },\n {\n \"name\": \"kind\",\n \"baseName\": \"kind\",\n \"type\": \"string\"\n },\n {\n \"name\": \"metadata\",\n \"baseName\": \"metadata\",\n \"type\": \"V1ObjectMeta\"\n },\n {\n \"name\": \"secrets\",\n \"baseName\": \"secrets\",\n \"type\": \"Array\"\n }\n];\nexports.V1ServiceAccount = V1ServiceAccount;\n/**\n* ServiceAccountList is a list of ServiceAccount objects\n*/\nclass V1ServiceAccountList {\n static getAttributeTypeMap() {\n return V1ServiceAccountList.attributeTypeMap;\n }\n}\nV1ServiceAccountList.discriminator = undefined;\nV1ServiceAccountList.attributeTypeMap = [\n {\n \"name\": \"apiVersion\",\n \"baseName\": \"apiVersion\",\n \"type\": \"string\"\n },\n {\n \"name\": \"items\",\n \"baseName\": \"items\",\n \"type\": \"Array\"\n },\n {\n \"name\": \"kind\",\n \"baseName\": \"kind\",\n \"type\": \"string\"\n },\n {\n \"name\": \"metadata\",\n \"baseName\": \"metadata\",\n \"type\": \"V1ListMeta\"\n }\n];\nexports.V1ServiceAccountList = V1ServiceAccountList;\n/**\n* ServiceAccountTokenProjection represents a projected service account token volume. This projection can be used to insert a service account token into the pods runtime filesystem for use against APIs (Kubernetes API Server or otherwise).\n*/\nclass V1ServiceAccountTokenProjection {\n static getAttributeTypeMap() {\n return V1ServiceAccountTokenProjection.attributeTypeMap;\n }\n}\nV1ServiceAccountTokenProjection.discriminator = undefined;\nV1ServiceAccountTokenProjection.attributeTypeMap = [\n {\n \"name\": \"audience\",\n \"baseName\": \"audience\",\n \"type\": \"string\"\n },\n {\n \"name\": \"expirationSeconds\",\n \"baseName\": \"expirationSeconds\",\n \"type\": \"number\"\n },\n {\n \"name\": \"path\",\n \"baseName\": \"path\",\n \"type\": \"string\"\n }\n];\nexports.V1ServiceAccountTokenProjection = V1ServiceAccountTokenProjection;\n/**\n* ServiceList holds a list of services.\n*/\nclass V1ServiceList {\n static getAttributeTypeMap() {\n return V1ServiceList.attributeTypeMap;\n }\n}\nV1ServiceList.discriminator = undefined;\nV1ServiceList.attributeTypeMap = [\n {\n \"name\": \"apiVersion\",\n \"baseName\": \"apiVersion\",\n \"type\": \"string\"\n },\n {\n \"name\": \"items\",\n \"baseName\": \"items\",\n \"type\": \"Array\"\n },\n {\n \"name\": \"kind\",\n \"baseName\": \"kind\",\n \"type\": \"string\"\n },\n {\n \"name\": \"metadata\",\n \"baseName\": \"metadata\",\n \"type\": \"V1ListMeta\"\n }\n];\nexports.V1ServiceList = V1ServiceList;\n/**\n* ServicePort contains information on service's port.\n*/\nclass V1ServicePort {\n static getAttributeTypeMap() {\n return V1ServicePort.attributeTypeMap;\n }\n}\nV1ServicePort.discriminator = undefined;\nV1ServicePort.attributeTypeMap = [\n {\n \"name\": \"name\",\n \"baseName\": \"name\",\n \"type\": \"string\"\n },\n {\n \"name\": \"nodePort\",\n \"baseName\": \"nodePort\",\n \"type\": \"number\"\n },\n {\n \"name\": \"port\",\n \"baseName\": \"port\",\n \"type\": \"number\"\n },\n {\n \"name\": \"protocol\",\n \"baseName\": \"protocol\",\n \"type\": \"string\"\n },\n {\n \"name\": \"targetPort\",\n \"baseName\": \"targetPort\",\n \"type\": \"any\"\n }\n];\nexports.V1ServicePort = V1ServicePort;\n/**\n* ServiceReference holds a reference to Service.legacy.k8s.io\n*/\nclass V1ServiceReference {\n static getAttributeTypeMap() {\n return V1ServiceReference.attributeTypeMap;\n }\n}\nV1ServiceReference.discriminator = undefined;\nV1ServiceReference.attributeTypeMap = [\n {\n \"name\": \"name\",\n \"baseName\": \"name\",\n \"type\": \"string\"\n },\n {\n \"name\": \"namespace\",\n \"baseName\": \"namespace\",\n \"type\": \"string\"\n }\n];\nexports.V1ServiceReference = V1ServiceReference;\n/**\n* ServiceSpec describes the attributes that a user creates on a service.\n*/\nclass V1ServiceSpec {\n static getAttributeTypeMap() {\n return V1ServiceSpec.attributeTypeMap;\n }\n}\nV1ServiceSpec.discriminator = undefined;\nV1ServiceSpec.attributeTypeMap = [\n {\n \"name\": \"clusterIP\",\n \"baseName\": \"clusterIP\",\n \"type\": \"string\"\n },\n {\n \"name\": \"externalIPs\",\n \"baseName\": \"externalIPs\",\n \"type\": \"Array\"\n },\n {\n \"name\": \"externalName\",\n \"baseName\": \"externalName\",\n \"type\": \"string\"\n },\n {\n \"name\": \"externalTrafficPolicy\",\n \"baseName\": \"externalTrafficPolicy\",\n \"type\": \"string\"\n },\n {\n \"name\": \"healthCheckNodePort\",\n \"baseName\": \"healthCheckNodePort\",\n \"type\": \"number\"\n },\n {\n \"name\": \"loadBalancerIP\",\n \"baseName\": \"loadBalancerIP\",\n \"type\": \"string\"\n },\n {\n \"name\": \"loadBalancerSourceRanges\",\n \"baseName\": \"loadBalancerSourceRanges\",\n \"type\": \"Array\"\n },\n {\n \"name\": \"ports\",\n \"baseName\": \"ports\",\n \"type\": \"Array\"\n },\n {\n \"name\": \"publishNotReadyAddresses\",\n \"baseName\": \"publishNotReadyAddresses\",\n \"type\": \"boolean\"\n },\n {\n \"name\": \"selector\",\n \"baseName\": \"selector\",\n \"type\": \"{ [key: string]: string; }\"\n },\n {\n \"name\": \"sessionAffinity\",\n \"baseName\": \"sessionAffinity\",\n \"type\": \"string\"\n },\n {\n \"name\": \"sessionAffinityConfig\",\n \"baseName\": \"sessionAffinityConfig\",\n \"type\": \"V1SessionAffinityConfig\"\n },\n {\n \"name\": \"type\",\n \"baseName\": \"type\",\n \"type\": \"string\"\n }\n];\nexports.V1ServiceSpec = V1ServiceSpec;\n/**\n* ServiceStatus represents the current status of a service.\n*/\nclass V1ServiceStatus {\n static getAttributeTypeMap() {\n return V1ServiceStatus.attributeTypeMap;\n }\n}\nV1ServiceStatus.discriminator = undefined;\nV1ServiceStatus.attributeTypeMap = [\n {\n \"name\": \"loadBalancer\",\n \"baseName\": \"loadBalancer\",\n \"type\": \"V1LoadBalancerStatus\"\n }\n];\nexports.V1ServiceStatus = V1ServiceStatus;\n/**\n* SessionAffinityConfig represents the configurations of session affinity.\n*/\nclass V1SessionAffinityConfig {\n static getAttributeTypeMap() {\n return V1SessionAffinityConfig.attributeTypeMap;\n }\n}\nV1SessionAffinityConfig.discriminator = undefined;\nV1SessionAffinityConfig.attributeTypeMap = [\n {\n \"name\": \"clientIP\",\n \"baseName\": \"clientIP\",\n \"type\": \"V1ClientIPConfig\"\n }\n];\nexports.V1SessionAffinityConfig = V1SessionAffinityConfig;\n/**\n* StatefulSet represents a set of pods with consistent identities. Identities are defined as: - Network: A single stable DNS and hostname. - Storage: As many VolumeClaims as requested. The StatefulSet guarantees that a given network identity will always map to the same storage identity.\n*/\nclass V1StatefulSet {\n static getAttributeTypeMap() {\n return V1StatefulSet.attributeTypeMap;\n }\n}\nV1StatefulSet.discriminator = undefined;\nV1StatefulSet.attributeTypeMap = [\n {\n \"name\": \"apiVersion\",\n \"baseName\": \"apiVersion\",\n \"type\": \"string\"\n },\n {\n \"name\": \"kind\",\n \"baseName\": \"kind\",\n \"type\": \"string\"\n },\n {\n \"name\": \"metadata\",\n \"baseName\": \"metadata\",\n \"type\": \"V1ObjectMeta\"\n },\n {\n \"name\": \"spec\",\n \"baseName\": \"spec\",\n \"type\": \"V1StatefulSetSpec\"\n },\n {\n \"name\": \"status\",\n \"baseName\": \"status\",\n \"type\": \"V1StatefulSetStatus\"\n }\n];\nexports.V1StatefulSet = V1StatefulSet;\n/**\n* StatefulSetCondition describes the state of a statefulset at a certain point.\n*/\nclass V1StatefulSetCondition {\n static getAttributeTypeMap() {\n return V1StatefulSetCondition.attributeTypeMap;\n }\n}\nV1StatefulSetCondition.discriminator = undefined;\nV1StatefulSetCondition.attributeTypeMap = [\n {\n \"name\": \"lastTransitionTime\",\n \"baseName\": \"lastTransitionTime\",\n \"type\": \"Date\"\n },\n {\n \"name\": \"message\",\n \"baseName\": \"message\",\n \"type\": \"string\"\n },\n {\n \"name\": \"reason\",\n \"baseName\": \"reason\",\n \"type\": \"string\"\n },\n {\n \"name\": \"status\",\n \"baseName\": \"status\",\n \"type\": \"string\"\n },\n {\n \"name\": \"type\",\n \"baseName\": \"type\",\n \"type\": \"string\"\n }\n];\nexports.V1StatefulSetCondition = V1StatefulSetCondition;\n/**\n* StatefulSetList is a collection of StatefulSets.\n*/\nclass V1StatefulSetList {\n static getAttributeTypeMap() {\n return V1StatefulSetList.attributeTypeMap;\n }\n}\nV1StatefulSetList.discriminator = undefined;\nV1StatefulSetList.attributeTypeMap = [\n {\n \"name\": \"apiVersion\",\n \"baseName\": \"apiVersion\",\n \"type\": \"string\"\n },\n {\n \"name\": \"items\",\n \"baseName\": \"items\",\n \"type\": \"Array\"\n },\n {\n \"name\": \"kind\",\n \"baseName\": \"kind\",\n \"type\": \"string\"\n },\n {\n \"name\": \"metadata\",\n \"baseName\": \"metadata\",\n \"type\": \"V1ListMeta\"\n }\n];\nexports.V1StatefulSetList = V1StatefulSetList;\n/**\n* A StatefulSetSpec is the specification of a StatefulSet.\n*/\nclass V1StatefulSetSpec {\n static getAttributeTypeMap() {\n return V1StatefulSetSpec.attributeTypeMap;\n }\n}\nV1StatefulSetSpec.discriminator = undefined;\nV1StatefulSetSpec.attributeTypeMap = [\n {\n \"name\": \"podManagementPolicy\",\n \"baseName\": \"podManagementPolicy\",\n \"type\": \"string\"\n },\n {\n \"name\": \"replicas\",\n \"baseName\": \"replicas\",\n \"type\": \"number\"\n },\n {\n \"name\": \"revisionHistoryLimit\",\n \"baseName\": \"revisionHistoryLimit\",\n \"type\": \"number\"\n },\n {\n \"name\": \"selector\",\n \"baseName\": \"selector\",\n \"type\": \"V1LabelSelector\"\n },\n {\n \"name\": \"serviceName\",\n \"baseName\": \"serviceName\",\n \"type\": \"string\"\n },\n {\n \"name\": \"template\",\n \"baseName\": \"template\",\n \"type\": \"V1PodTemplateSpec\"\n },\n {\n \"name\": \"updateStrategy\",\n \"baseName\": \"updateStrategy\",\n \"type\": \"V1StatefulSetUpdateStrategy\"\n },\n {\n \"name\": \"volumeClaimTemplates\",\n \"baseName\": \"volumeClaimTemplates\",\n \"type\": \"Array\"\n }\n];\nexports.V1StatefulSetSpec = V1StatefulSetSpec;\n/**\n* StatefulSetStatus represents the current state of a StatefulSet.\n*/\nclass V1StatefulSetStatus {\n static getAttributeTypeMap() {\n return V1StatefulSetStatus.attributeTypeMap;\n }\n}\nV1StatefulSetStatus.discriminator = undefined;\nV1StatefulSetStatus.attributeTypeMap = [\n {\n \"name\": \"collisionCount\",\n \"baseName\": \"collisionCount\",\n \"type\": \"number\"\n },\n {\n \"name\": \"conditions\",\n \"baseName\": \"conditions\",\n \"type\": \"Array\"\n },\n {\n \"name\": \"currentReplicas\",\n \"baseName\": \"currentReplicas\",\n \"type\": \"number\"\n },\n {\n \"name\": \"currentRevision\",\n \"baseName\": \"currentRevision\",\n \"type\": \"string\"\n },\n {\n \"name\": \"observedGeneration\",\n \"baseName\": \"observedGeneration\",\n \"type\": \"number\"\n },\n {\n \"name\": \"readyReplicas\",\n \"baseName\": \"readyReplicas\",\n \"type\": \"number\"\n },\n {\n \"name\": \"replicas\",\n \"baseName\": \"replicas\",\n \"type\": \"number\"\n },\n {\n \"name\": \"updateRevision\",\n \"baseName\": \"updateRevision\",\n \"type\": \"string\"\n },\n {\n \"name\": \"updatedReplicas\",\n \"baseName\": \"updatedReplicas\",\n \"type\": \"number\"\n }\n];\nexports.V1StatefulSetStatus = V1StatefulSetStatus;\n/**\n* StatefulSetUpdateStrategy indicates the strategy that the StatefulSet controller will use to perform updates. It includes any additional parameters necessary to perform the update for the indicated strategy.\n*/\nclass V1StatefulSetUpdateStrategy {\n static getAttributeTypeMap() {\n return V1StatefulSetUpdateStrategy.attributeTypeMap;\n }\n}\nV1StatefulSetUpdateStrategy.discriminator = undefined;\nV1StatefulSetUpdateStrategy.attributeTypeMap = [\n {\n \"name\": \"rollingUpdate\",\n \"baseName\": \"rollingUpdate\",\n \"type\": \"V1RollingUpdateStatefulSetStrategy\"\n },\n {\n \"name\": \"type\",\n \"baseName\": \"type\",\n \"type\": \"string\"\n }\n];\nexports.V1StatefulSetUpdateStrategy = V1StatefulSetUpdateStrategy;\n/**\n* Status is a return value for calls that don't return other objects.\n*/\nclass V1Status {\n static getAttributeTypeMap() {\n return V1Status.attributeTypeMap;\n }\n}\nV1Status.discriminator = undefined;\nV1Status.attributeTypeMap = [\n {\n \"name\": \"apiVersion\",\n \"baseName\": \"apiVersion\",\n \"type\": \"string\"\n },\n {\n \"name\": \"code\",\n \"baseName\": \"code\",\n \"type\": \"number\"\n },\n {\n \"name\": \"details\",\n \"baseName\": \"details\",\n \"type\": \"V1StatusDetails\"\n },\n {\n \"name\": \"kind\",\n \"baseName\": \"kind\",\n \"type\": \"string\"\n },\n {\n \"name\": \"message\",\n \"baseName\": \"message\",\n \"type\": \"string\"\n },\n {\n \"name\": \"metadata\",\n \"baseName\": \"metadata\",\n \"type\": \"V1ListMeta\"\n },\n {\n \"name\": \"reason\",\n \"baseName\": \"reason\",\n \"type\": \"string\"\n },\n {\n \"name\": \"status\",\n \"baseName\": \"status\",\n \"type\": \"string\"\n }\n];\nexports.V1Status = V1Status;\n/**\n* StatusCause provides more information about an api.Status failure, including cases when multiple errors are encountered.\n*/\nclass V1StatusCause {\n static getAttributeTypeMap() {\n return V1StatusCause.attributeTypeMap;\n }\n}\nV1StatusCause.discriminator = undefined;\nV1StatusCause.attributeTypeMap = [\n {\n \"name\": \"field\",\n \"baseName\": \"field\",\n \"type\": \"string\"\n },\n {\n \"name\": \"message\",\n \"baseName\": \"message\",\n \"type\": \"string\"\n },\n {\n \"name\": \"reason\",\n \"baseName\": \"reason\",\n \"type\": \"string\"\n }\n];\nexports.V1StatusCause = V1StatusCause;\n/**\n* StatusDetails is a set of additional properties that MAY be set by the server to provide additional information about a response. The Reason field of a Status object defines what attributes will be set. Clients must ignore fields that do not match the defined type of each attribute, and should assume that any attribute may be empty, invalid, or under defined.\n*/\nclass V1StatusDetails {\n static getAttributeTypeMap() {\n return V1StatusDetails.attributeTypeMap;\n }\n}\nV1StatusDetails.discriminator = undefined;\nV1StatusDetails.attributeTypeMap = [\n {\n \"name\": \"causes\",\n \"baseName\": \"causes\",\n \"type\": \"Array\"\n },\n {\n \"name\": \"group\",\n \"baseName\": \"group\",\n \"type\": \"string\"\n },\n {\n \"name\": \"kind\",\n \"baseName\": \"kind\",\n \"type\": \"string\"\n },\n {\n \"name\": \"name\",\n \"baseName\": \"name\",\n \"type\": \"string\"\n },\n {\n \"name\": \"retryAfterSeconds\",\n \"baseName\": \"retryAfterSeconds\",\n \"type\": \"number\"\n },\n {\n \"name\": \"uid\",\n \"baseName\": \"uid\",\n \"type\": \"string\"\n }\n];\nexports.V1StatusDetails = V1StatusDetails;\n/**\n* StorageClass describes the parameters for a class of storage for which PersistentVolumes can be dynamically provisioned. StorageClasses are non-namespaced; the name of the storage class according to etcd is in ObjectMeta.Name.\n*/\nclass V1StorageClass {\n static getAttributeTypeMap() {\n return V1StorageClass.attributeTypeMap;\n }\n}\nV1StorageClass.discriminator = undefined;\nV1StorageClass.attributeTypeMap = [\n {\n \"name\": \"allowVolumeExpansion\",\n \"baseName\": \"allowVolumeExpansion\",\n \"type\": \"boolean\"\n },\n {\n \"name\": \"allowedTopologies\",\n \"baseName\": \"allowedTopologies\",\n \"type\": \"Array\"\n },\n {\n \"name\": \"apiVersion\",\n \"baseName\": \"apiVersion\",\n \"type\": \"string\"\n },\n {\n \"name\": \"kind\",\n \"baseName\": \"kind\",\n \"type\": \"string\"\n },\n {\n \"name\": \"metadata\",\n \"baseName\": \"metadata\",\n \"type\": \"V1ObjectMeta\"\n },\n {\n \"name\": \"mountOptions\",\n \"baseName\": \"mountOptions\",\n \"type\": \"Array\"\n },\n {\n \"name\": \"parameters\",\n \"baseName\": \"parameters\",\n \"type\": \"{ [key: string]: string; }\"\n },\n {\n \"name\": \"provisioner\",\n \"baseName\": \"provisioner\",\n \"type\": \"string\"\n },\n {\n \"name\": \"reclaimPolicy\",\n \"baseName\": \"reclaimPolicy\",\n \"type\": \"string\"\n },\n {\n \"name\": \"volumeBindingMode\",\n \"baseName\": \"volumeBindingMode\",\n \"type\": \"string\"\n }\n];\nexports.V1StorageClass = V1StorageClass;\n/**\n* StorageClassList is a collection of storage classes.\n*/\nclass V1StorageClassList {\n static getAttributeTypeMap() {\n return V1StorageClassList.attributeTypeMap;\n }\n}\nV1StorageClassList.discriminator = undefined;\nV1StorageClassList.attributeTypeMap = [\n {\n \"name\": \"apiVersion\",\n \"baseName\": \"apiVersion\",\n \"type\": \"string\"\n },\n {\n \"name\": \"items\",\n \"baseName\": \"items\",\n \"type\": \"Array\"\n },\n {\n \"name\": \"kind\",\n \"baseName\": \"kind\",\n \"type\": \"string\"\n },\n {\n \"name\": \"metadata\",\n \"baseName\": \"metadata\",\n \"type\": \"V1ListMeta\"\n }\n];\nexports.V1StorageClassList = V1StorageClassList;\n/**\n* Represents a StorageOS persistent volume resource.\n*/\nclass V1StorageOSPersistentVolumeSource {\n static getAttributeTypeMap() {\n return V1StorageOSPersistentVolumeSource.attributeTypeMap;\n }\n}\nV1StorageOSPersistentVolumeSource.discriminator = undefined;\nV1StorageOSPersistentVolumeSource.attributeTypeMap = [\n {\n \"name\": \"fsType\",\n \"baseName\": \"fsType\",\n \"type\": \"string\"\n },\n {\n \"name\": \"readOnly\",\n \"baseName\": \"readOnly\",\n \"type\": \"boolean\"\n },\n {\n \"name\": \"secretRef\",\n \"baseName\": \"secretRef\",\n \"type\": \"V1ObjectReference\"\n },\n {\n \"name\": \"volumeName\",\n \"baseName\": \"volumeName\",\n \"type\": \"string\"\n },\n {\n \"name\": \"volumeNamespace\",\n \"baseName\": \"volumeNamespace\",\n \"type\": \"string\"\n }\n];\nexports.V1StorageOSPersistentVolumeSource = V1StorageOSPersistentVolumeSource;\n/**\n* Represents a StorageOS persistent volume resource.\n*/\nclass V1StorageOSVolumeSource {\n static getAttributeTypeMap() {\n return V1StorageOSVolumeSource.attributeTypeMap;\n }\n}\nV1StorageOSVolumeSource.discriminator = undefined;\nV1StorageOSVolumeSource.attributeTypeMap = [\n {\n \"name\": \"fsType\",\n \"baseName\": \"fsType\",\n \"type\": \"string\"\n },\n {\n \"name\": \"readOnly\",\n \"baseName\": \"readOnly\",\n \"type\": \"boolean\"\n },\n {\n \"name\": \"secretRef\",\n \"baseName\": \"secretRef\",\n \"type\": \"V1LocalObjectReference\"\n },\n {\n \"name\": \"volumeName\",\n \"baseName\": \"volumeName\",\n \"type\": \"string\"\n },\n {\n \"name\": \"volumeNamespace\",\n \"baseName\": \"volumeNamespace\",\n \"type\": \"string\"\n }\n];\nexports.V1StorageOSVolumeSource = V1StorageOSVolumeSource;\n/**\n* Subject contains a reference to the object or user identities a role binding applies to. This can either hold a direct API object reference, or a value for non-objects such as user and group names.\n*/\nclass V1Subject {\n static getAttributeTypeMap() {\n return V1Subject.attributeTypeMap;\n }\n}\nV1Subject.discriminator = undefined;\nV1Subject.attributeTypeMap = [\n {\n \"name\": \"apiGroup\",\n \"baseName\": \"apiGroup\",\n \"type\": \"string\"\n },\n {\n \"name\": \"kind\",\n \"baseName\": \"kind\",\n \"type\": \"string\"\n },\n {\n \"name\": \"name\",\n \"baseName\": \"name\",\n \"type\": \"string\"\n },\n {\n \"name\": \"namespace\",\n \"baseName\": \"namespace\",\n \"type\": \"string\"\n }\n];\nexports.V1Subject = V1Subject;\n/**\n* SubjectAccessReview checks whether or not a user or group can perform an action.\n*/\nclass V1SubjectAccessReview {\n static getAttributeTypeMap() {\n return V1SubjectAccessReview.attributeTypeMap;\n }\n}\nV1SubjectAccessReview.discriminator = undefined;\nV1SubjectAccessReview.attributeTypeMap = [\n {\n \"name\": \"apiVersion\",\n \"baseName\": \"apiVersion\",\n \"type\": \"string\"\n },\n {\n \"name\": \"kind\",\n \"baseName\": \"kind\",\n \"type\": \"string\"\n },\n {\n \"name\": \"metadata\",\n \"baseName\": \"metadata\",\n \"type\": \"V1ObjectMeta\"\n },\n {\n \"name\": \"spec\",\n \"baseName\": \"spec\",\n \"type\": \"V1SubjectAccessReviewSpec\"\n },\n {\n \"name\": \"status\",\n \"baseName\": \"status\",\n \"type\": \"V1SubjectAccessReviewStatus\"\n }\n];\nexports.V1SubjectAccessReview = V1SubjectAccessReview;\n/**\n* SubjectAccessReviewSpec is a description of the access request. Exactly one of ResourceAuthorizationAttributes and NonResourceAuthorizationAttributes must be set\n*/\nclass V1SubjectAccessReviewSpec {\n static getAttributeTypeMap() {\n return V1SubjectAccessReviewSpec.attributeTypeMap;\n }\n}\nV1SubjectAccessReviewSpec.discriminator = undefined;\nV1SubjectAccessReviewSpec.attributeTypeMap = [\n {\n \"name\": \"extra\",\n \"baseName\": \"extra\",\n \"type\": \"{ [key: string]: Array; }\"\n },\n {\n \"name\": \"groups\",\n \"baseName\": \"groups\",\n \"type\": \"Array\"\n },\n {\n \"name\": \"nonResourceAttributes\",\n \"baseName\": \"nonResourceAttributes\",\n \"type\": \"V1NonResourceAttributes\"\n },\n {\n \"name\": \"resourceAttributes\",\n \"baseName\": \"resourceAttributes\",\n \"type\": \"V1ResourceAttributes\"\n },\n {\n \"name\": \"uid\",\n \"baseName\": \"uid\",\n \"type\": \"string\"\n },\n {\n \"name\": \"user\",\n \"baseName\": \"user\",\n \"type\": \"string\"\n }\n];\nexports.V1SubjectAccessReviewSpec = V1SubjectAccessReviewSpec;\n/**\n* SubjectAccessReviewStatus\n*/\nclass V1SubjectAccessReviewStatus {\n static getAttributeTypeMap() {\n return V1SubjectAccessReviewStatus.attributeTypeMap;\n }\n}\nV1SubjectAccessReviewStatus.discriminator = undefined;\nV1SubjectAccessReviewStatus.attributeTypeMap = [\n {\n \"name\": \"allowed\",\n \"baseName\": \"allowed\",\n \"type\": \"boolean\"\n },\n {\n \"name\": \"denied\",\n \"baseName\": \"denied\",\n \"type\": \"boolean\"\n },\n {\n \"name\": \"evaluationError\",\n \"baseName\": \"evaluationError\",\n \"type\": \"string\"\n },\n {\n \"name\": \"reason\",\n \"baseName\": \"reason\",\n \"type\": \"string\"\n }\n];\nexports.V1SubjectAccessReviewStatus = V1SubjectAccessReviewStatus;\n/**\n* SubjectRulesReviewStatus contains the result of a rules check. This check can be incomplete depending on the set of authorizers the server is configured with and any errors experienced during evaluation. Because authorization rules are additive, if a rule appears in a list it's safe to assume the subject has that permission, even if that list is incomplete.\n*/\nclass V1SubjectRulesReviewStatus {\n static getAttributeTypeMap() {\n return V1SubjectRulesReviewStatus.attributeTypeMap;\n }\n}\nV1SubjectRulesReviewStatus.discriminator = undefined;\nV1SubjectRulesReviewStatus.attributeTypeMap = [\n {\n \"name\": \"evaluationError\",\n \"baseName\": \"evaluationError\",\n \"type\": \"string\"\n },\n {\n \"name\": \"incomplete\",\n \"baseName\": \"incomplete\",\n \"type\": \"boolean\"\n },\n {\n \"name\": \"nonResourceRules\",\n \"baseName\": \"nonResourceRules\",\n \"type\": \"Array\"\n },\n {\n \"name\": \"resourceRules\",\n \"baseName\": \"resourceRules\",\n \"type\": \"Array\"\n }\n];\nexports.V1SubjectRulesReviewStatus = V1SubjectRulesReviewStatus;\n/**\n* Sysctl defines a kernel parameter to be set\n*/\nclass V1Sysctl {\n static getAttributeTypeMap() {\n return V1Sysctl.attributeTypeMap;\n }\n}\nV1Sysctl.discriminator = undefined;\nV1Sysctl.attributeTypeMap = [\n {\n \"name\": \"name\",\n \"baseName\": \"name\",\n \"type\": \"string\"\n },\n {\n \"name\": \"value\",\n \"baseName\": \"value\",\n \"type\": \"string\"\n }\n];\nexports.V1Sysctl = V1Sysctl;\n/**\n* TCPSocketAction describes an action based on opening a socket\n*/\nclass V1TCPSocketAction {\n static getAttributeTypeMap() {\n return V1TCPSocketAction.attributeTypeMap;\n }\n}\nV1TCPSocketAction.discriminator = undefined;\nV1TCPSocketAction.attributeTypeMap = [\n {\n \"name\": \"host\",\n \"baseName\": \"host\",\n \"type\": \"string\"\n },\n {\n \"name\": \"port\",\n \"baseName\": \"port\",\n \"type\": \"any\"\n }\n];\nexports.V1TCPSocketAction = V1TCPSocketAction;\n/**\n* The node this Taint is attached to has the \\\"effect\\\" on any pod that does not tolerate the Taint.\n*/\nclass V1Taint {\n static getAttributeTypeMap() {\n return V1Taint.attributeTypeMap;\n }\n}\nV1Taint.discriminator = undefined;\nV1Taint.attributeTypeMap = [\n {\n \"name\": \"effect\",\n \"baseName\": \"effect\",\n \"type\": \"string\"\n },\n {\n \"name\": \"key\",\n \"baseName\": \"key\",\n \"type\": \"string\"\n },\n {\n \"name\": \"timeAdded\",\n \"baseName\": \"timeAdded\",\n \"type\": \"Date\"\n },\n {\n \"name\": \"value\",\n \"baseName\": \"value\",\n \"type\": \"string\"\n }\n];\nexports.V1Taint = V1Taint;\n/**\n* TokenReview attempts to authenticate a token to a known user. Note: TokenReview requests may be cached by the webhook token authenticator plugin in the kube-apiserver.\n*/\nclass V1TokenReview {\n static getAttributeTypeMap() {\n return V1TokenReview.attributeTypeMap;\n }\n}\nV1TokenReview.discriminator = undefined;\nV1TokenReview.attributeTypeMap = [\n {\n \"name\": \"apiVersion\",\n \"baseName\": \"apiVersion\",\n \"type\": \"string\"\n },\n {\n \"name\": \"kind\",\n \"baseName\": \"kind\",\n \"type\": \"string\"\n },\n {\n \"name\": \"metadata\",\n \"baseName\": \"metadata\",\n \"type\": \"V1ObjectMeta\"\n },\n {\n \"name\": \"spec\",\n \"baseName\": \"spec\",\n \"type\": \"V1TokenReviewSpec\"\n },\n {\n \"name\": \"status\",\n \"baseName\": \"status\",\n \"type\": \"V1TokenReviewStatus\"\n }\n];\nexports.V1TokenReview = V1TokenReview;\n/**\n* TokenReviewSpec is a description of the token authentication request.\n*/\nclass V1TokenReviewSpec {\n static getAttributeTypeMap() {\n return V1TokenReviewSpec.attributeTypeMap;\n }\n}\nV1TokenReviewSpec.discriminator = undefined;\nV1TokenReviewSpec.attributeTypeMap = [\n {\n \"name\": \"audiences\",\n \"baseName\": \"audiences\",\n \"type\": \"Array\"\n },\n {\n \"name\": \"token\",\n \"baseName\": \"token\",\n \"type\": \"string\"\n }\n];\nexports.V1TokenReviewSpec = V1TokenReviewSpec;\n/**\n* TokenReviewStatus is the result of the token authentication request.\n*/\nclass V1TokenReviewStatus {\n static getAttributeTypeMap() {\n return V1TokenReviewStatus.attributeTypeMap;\n }\n}\nV1TokenReviewStatus.discriminator = undefined;\nV1TokenReviewStatus.attributeTypeMap = [\n {\n \"name\": \"audiences\",\n \"baseName\": \"audiences\",\n \"type\": \"Array\"\n },\n {\n \"name\": \"authenticated\",\n \"baseName\": \"authenticated\",\n \"type\": \"boolean\"\n },\n {\n \"name\": \"error\",\n \"baseName\": \"error\",\n \"type\": \"string\"\n },\n {\n \"name\": \"user\",\n \"baseName\": \"user\",\n \"type\": \"V1UserInfo\"\n }\n];\nexports.V1TokenReviewStatus = V1TokenReviewStatus;\n/**\n* The pod this Toleration is attached to tolerates any taint that matches the triple using the matching operator .\n*/\nclass V1Toleration {\n static getAttributeTypeMap() {\n return V1Toleration.attributeTypeMap;\n }\n}\nV1Toleration.discriminator = undefined;\nV1Toleration.attributeTypeMap = [\n {\n \"name\": \"effect\",\n \"baseName\": \"effect\",\n \"type\": \"string\"\n },\n {\n \"name\": \"key\",\n \"baseName\": \"key\",\n \"type\": \"string\"\n },\n {\n \"name\": \"operator\",\n \"baseName\": \"operator\",\n \"type\": \"string\"\n },\n {\n \"name\": \"tolerationSeconds\",\n \"baseName\": \"tolerationSeconds\",\n \"type\": \"number\"\n },\n {\n \"name\": \"value\",\n \"baseName\": \"value\",\n \"type\": \"string\"\n }\n];\nexports.V1Toleration = V1Toleration;\n/**\n* A topology selector requirement is a selector that matches given label. This is an alpha feature and may change in the future.\n*/\nclass V1TopologySelectorLabelRequirement {\n static getAttributeTypeMap() {\n return V1TopologySelectorLabelRequirement.attributeTypeMap;\n }\n}\nV1TopologySelectorLabelRequirement.discriminator = undefined;\nV1TopologySelectorLabelRequirement.attributeTypeMap = [\n {\n \"name\": \"key\",\n \"baseName\": \"key\",\n \"type\": \"string\"\n },\n {\n \"name\": \"values\",\n \"baseName\": \"values\",\n \"type\": \"Array\"\n }\n];\nexports.V1TopologySelectorLabelRequirement = V1TopologySelectorLabelRequirement;\n/**\n* A topology selector term represents the result of label queries. A null or empty topology selector term matches no objects. The requirements of them are ANDed. It provides a subset of functionality as NodeSelectorTerm. This is an alpha feature and may change in the future.\n*/\nclass V1TopologySelectorTerm {\n static getAttributeTypeMap() {\n return V1TopologySelectorTerm.attributeTypeMap;\n }\n}\nV1TopologySelectorTerm.discriminator = undefined;\nV1TopologySelectorTerm.attributeTypeMap = [\n {\n \"name\": \"matchLabelExpressions\",\n \"baseName\": \"matchLabelExpressions\",\n \"type\": \"Array\"\n }\n];\nexports.V1TopologySelectorTerm = V1TopologySelectorTerm;\n/**\n* TypedLocalObjectReference contains enough information to let you locate the typed referenced object inside the same namespace.\n*/\nclass V1TypedLocalObjectReference {\n static getAttributeTypeMap() {\n return V1TypedLocalObjectReference.attributeTypeMap;\n }\n}\nV1TypedLocalObjectReference.discriminator = undefined;\nV1TypedLocalObjectReference.attributeTypeMap = [\n {\n \"name\": \"apiGroup\",\n \"baseName\": \"apiGroup\",\n \"type\": \"string\"\n },\n {\n \"name\": \"kind\",\n \"baseName\": \"kind\",\n \"type\": \"string\"\n },\n {\n \"name\": \"name\",\n \"baseName\": \"name\",\n \"type\": \"string\"\n }\n];\nexports.V1TypedLocalObjectReference = V1TypedLocalObjectReference;\n/**\n* UserInfo holds the information about the user needed to implement the user.Info interface.\n*/\nclass V1UserInfo {\n static getAttributeTypeMap() {\n return V1UserInfo.attributeTypeMap;\n }\n}\nV1UserInfo.discriminator = undefined;\nV1UserInfo.attributeTypeMap = [\n {\n \"name\": \"extra\",\n \"baseName\": \"extra\",\n \"type\": \"{ [key: string]: Array; }\"\n },\n {\n \"name\": \"groups\",\n \"baseName\": \"groups\",\n \"type\": \"Array\"\n },\n {\n \"name\": \"uid\",\n \"baseName\": \"uid\",\n \"type\": \"string\"\n },\n {\n \"name\": \"username\",\n \"baseName\": \"username\",\n \"type\": \"string\"\n }\n];\nexports.V1UserInfo = V1UserInfo;\n/**\n* Volume represents a named volume in a pod that may be accessed by any container in the pod.\n*/\nclass V1Volume {\n static getAttributeTypeMap() {\n return V1Volume.attributeTypeMap;\n }\n}\nV1Volume.discriminator = undefined;\nV1Volume.attributeTypeMap = [\n {\n \"name\": \"awsElasticBlockStore\",\n \"baseName\": \"awsElasticBlockStore\",\n \"type\": \"V1AWSElasticBlockStoreVolumeSource\"\n },\n {\n \"name\": \"azureDisk\",\n \"baseName\": \"azureDisk\",\n \"type\": \"V1AzureDiskVolumeSource\"\n },\n {\n \"name\": \"azureFile\",\n \"baseName\": \"azureFile\",\n \"type\": \"V1AzureFileVolumeSource\"\n },\n {\n \"name\": \"cephfs\",\n \"baseName\": \"cephfs\",\n \"type\": \"V1CephFSVolumeSource\"\n },\n {\n \"name\": \"cinder\",\n \"baseName\": \"cinder\",\n \"type\": \"V1CinderVolumeSource\"\n },\n {\n \"name\": \"configMap\",\n \"baseName\": \"configMap\",\n \"type\": \"V1ConfigMapVolumeSource\"\n },\n {\n \"name\": \"downwardAPI\",\n \"baseName\": \"downwardAPI\",\n \"type\": \"V1DownwardAPIVolumeSource\"\n },\n {\n \"name\": \"emptyDir\",\n \"baseName\": \"emptyDir\",\n \"type\": \"V1EmptyDirVolumeSource\"\n },\n {\n \"name\": \"fc\",\n \"baseName\": \"fc\",\n \"type\": \"V1FCVolumeSource\"\n },\n {\n \"name\": \"flexVolume\",\n \"baseName\": \"flexVolume\",\n \"type\": \"V1FlexVolumeSource\"\n },\n {\n \"name\": \"flocker\",\n \"baseName\": \"flocker\",\n \"type\": \"V1FlockerVolumeSource\"\n },\n {\n \"name\": \"gcePersistentDisk\",\n \"baseName\": \"gcePersistentDisk\",\n \"type\": \"V1GCEPersistentDiskVolumeSource\"\n },\n {\n \"name\": \"gitRepo\",\n \"baseName\": \"gitRepo\",\n \"type\": \"V1GitRepoVolumeSource\"\n },\n {\n \"name\": \"glusterfs\",\n \"baseName\": \"glusterfs\",\n \"type\": \"V1GlusterfsVolumeSource\"\n },\n {\n \"name\": \"hostPath\",\n \"baseName\": \"hostPath\",\n \"type\": \"V1HostPathVolumeSource\"\n },\n {\n \"name\": \"iscsi\",\n \"baseName\": \"iscsi\",\n \"type\": \"V1ISCSIVolumeSource\"\n },\n {\n \"name\": \"name\",\n \"baseName\": \"name\",\n \"type\": \"string\"\n },\n {\n \"name\": \"nfs\",\n \"baseName\": \"nfs\",\n \"type\": \"V1NFSVolumeSource\"\n },\n {\n \"name\": \"persistentVolumeClaim\",\n \"baseName\": \"persistentVolumeClaim\",\n \"type\": \"V1PersistentVolumeClaimVolumeSource\"\n },\n {\n \"name\": \"photonPersistentDisk\",\n \"baseName\": \"photonPersistentDisk\",\n \"type\": \"V1PhotonPersistentDiskVolumeSource\"\n },\n {\n \"name\": \"portworxVolume\",\n \"baseName\": \"portworxVolume\",\n \"type\": \"V1PortworxVolumeSource\"\n },\n {\n \"name\": \"projected\",\n \"baseName\": \"projected\",\n \"type\": \"V1ProjectedVolumeSource\"\n },\n {\n \"name\": \"quobyte\",\n \"baseName\": \"quobyte\",\n \"type\": \"V1QuobyteVolumeSource\"\n },\n {\n \"name\": \"rbd\",\n \"baseName\": \"rbd\",\n \"type\": \"V1RBDVolumeSource\"\n },\n {\n \"name\": \"scaleIO\",\n \"baseName\": \"scaleIO\",\n \"type\": \"V1ScaleIOVolumeSource\"\n },\n {\n \"name\": \"secret\",\n \"baseName\": \"secret\",\n \"type\": \"V1SecretVolumeSource\"\n },\n {\n \"name\": \"storageos\",\n \"baseName\": \"storageos\",\n \"type\": \"V1StorageOSVolumeSource\"\n },\n {\n \"name\": \"vsphereVolume\",\n \"baseName\": \"vsphereVolume\",\n \"type\": \"V1VsphereVirtualDiskVolumeSource\"\n }\n];\nexports.V1Volume = V1Volume;\n/**\n* VolumeAttachment captures the intent to attach or detach the specified volume to/from the specified node. VolumeAttachment objects are non-namespaced.\n*/\nclass V1VolumeAttachment {\n static getAttributeTypeMap() {\n return V1VolumeAttachment.attributeTypeMap;\n }\n}\nV1VolumeAttachment.discriminator = undefined;\nV1VolumeAttachment.attributeTypeMap = [\n {\n \"name\": \"apiVersion\",\n \"baseName\": \"apiVersion\",\n \"type\": \"string\"\n },\n {\n \"name\": \"kind\",\n \"baseName\": \"kind\",\n \"type\": \"string\"\n },\n {\n \"name\": \"metadata\",\n \"baseName\": \"metadata\",\n \"type\": \"V1ObjectMeta\"\n },\n {\n \"name\": \"spec\",\n \"baseName\": \"spec\",\n \"type\": \"V1VolumeAttachmentSpec\"\n },\n {\n \"name\": \"status\",\n \"baseName\": \"status\",\n \"type\": \"V1VolumeAttachmentStatus\"\n }\n];\nexports.V1VolumeAttachment = V1VolumeAttachment;\n/**\n* VolumeAttachmentList is a collection of VolumeAttachment objects.\n*/\nclass V1VolumeAttachmentList {\n static getAttributeTypeMap() {\n return V1VolumeAttachmentList.attributeTypeMap;\n }\n}\nV1VolumeAttachmentList.discriminator = undefined;\nV1VolumeAttachmentList.attributeTypeMap = [\n {\n \"name\": \"apiVersion\",\n \"baseName\": \"apiVersion\",\n \"type\": \"string\"\n },\n {\n \"name\": \"items\",\n \"baseName\": \"items\",\n \"type\": \"Array\"\n },\n {\n \"name\": \"kind\",\n \"baseName\": \"kind\",\n \"type\": \"string\"\n },\n {\n \"name\": \"metadata\",\n \"baseName\": \"metadata\",\n \"type\": \"V1ListMeta\"\n }\n];\nexports.V1VolumeAttachmentList = V1VolumeAttachmentList;\n/**\n* VolumeAttachmentSource represents a volume that should be attached. Right now only PersistenVolumes can be attached via external attacher, in future we may allow also inline volumes in pods. Exactly one member can be set.\n*/\nclass V1VolumeAttachmentSource {\n static getAttributeTypeMap() {\n return V1VolumeAttachmentSource.attributeTypeMap;\n }\n}\nV1VolumeAttachmentSource.discriminator = undefined;\nV1VolumeAttachmentSource.attributeTypeMap = [\n {\n \"name\": \"persistentVolumeName\",\n \"baseName\": \"persistentVolumeName\",\n \"type\": \"string\"\n }\n];\nexports.V1VolumeAttachmentSource = V1VolumeAttachmentSource;\n/**\n* VolumeAttachmentSpec is the specification of a VolumeAttachment request.\n*/\nclass V1VolumeAttachmentSpec {\n static getAttributeTypeMap() {\n return V1VolumeAttachmentSpec.attributeTypeMap;\n }\n}\nV1VolumeAttachmentSpec.discriminator = undefined;\nV1VolumeAttachmentSpec.attributeTypeMap = [\n {\n \"name\": \"attacher\",\n \"baseName\": \"attacher\",\n \"type\": \"string\"\n },\n {\n \"name\": \"nodeName\",\n \"baseName\": \"nodeName\",\n \"type\": \"string\"\n },\n {\n \"name\": \"source\",\n \"baseName\": \"source\",\n \"type\": \"V1VolumeAttachmentSource\"\n }\n];\nexports.V1VolumeAttachmentSpec = V1VolumeAttachmentSpec;\n/**\n* VolumeAttachmentStatus is the status of a VolumeAttachment request.\n*/\nclass V1VolumeAttachmentStatus {\n static getAttributeTypeMap() {\n return V1VolumeAttachmentStatus.attributeTypeMap;\n }\n}\nV1VolumeAttachmentStatus.discriminator = undefined;\nV1VolumeAttachmentStatus.attributeTypeMap = [\n {\n \"name\": \"attachError\",\n \"baseName\": \"attachError\",\n \"type\": \"V1VolumeError\"\n },\n {\n \"name\": \"attached\",\n \"baseName\": \"attached\",\n \"type\": \"boolean\"\n },\n {\n \"name\": \"attachmentMetadata\",\n \"baseName\": \"attachmentMetadata\",\n \"type\": \"{ [key: string]: string; }\"\n },\n {\n \"name\": \"detachError\",\n \"baseName\": \"detachError\",\n \"type\": \"V1VolumeError\"\n }\n];\nexports.V1VolumeAttachmentStatus = V1VolumeAttachmentStatus;\n/**\n* volumeDevice describes a mapping of a raw block device within a container.\n*/\nclass V1VolumeDevice {\n static getAttributeTypeMap() {\n return V1VolumeDevice.attributeTypeMap;\n }\n}\nV1VolumeDevice.discriminator = undefined;\nV1VolumeDevice.attributeTypeMap = [\n {\n \"name\": \"devicePath\",\n \"baseName\": \"devicePath\",\n \"type\": \"string\"\n },\n {\n \"name\": \"name\",\n \"baseName\": \"name\",\n \"type\": \"string\"\n }\n];\nexports.V1VolumeDevice = V1VolumeDevice;\n/**\n* VolumeError captures an error encountered during a volume operation.\n*/\nclass V1VolumeError {\n static getAttributeTypeMap() {\n return V1VolumeError.attributeTypeMap;\n }\n}\nV1VolumeError.discriminator = undefined;\nV1VolumeError.attributeTypeMap = [\n {\n \"name\": \"message\",\n \"baseName\": \"message\",\n \"type\": \"string\"\n },\n {\n \"name\": \"time\",\n \"baseName\": \"time\",\n \"type\": \"Date\"\n }\n];\nexports.V1VolumeError = V1VolumeError;\n/**\n* VolumeMount describes a mounting of a Volume within a container.\n*/\nclass V1VolumeMount {\n static getAttributeTypeMap() {\n return V1VolumeMount.attributeTypeMap;\n }\n}\nV1VolumeMount.discriminator = undefined;\nV1VolumeMount.attributeTypeMap = [\n {\n \"name\": \"mountPath\",\n \"baseName\": \"mountPath\",\n \"type\": \"string\"\n },\n {\n \"name\": \"mountPropagation\",\n \"baseName\": \"mountPropagation\",\n \"type\": \"string\"\n },\n {\n \"name\": \"name\",\n \"baseName\": \"name\",\n \"type\": \"string\"\n },\n {\n \"name\": \"readOnly\",\n \"baseName\": \"readOnly\",\n \"type\": \"boolean\"\n },\n {\n \"name\": \"subPath\",\n \"baseName\": \"subPath\",\n \"type\": \"string\"\n }\n];\nexports.V1VolumeMount = V1VolumeMount;\n/**\n* VolumeNodeAffinity defines constraints that limit what nodes this volume can be accessed from.\n*/\nclass V1VolumeNodeAffinity {\n static getAttributeTypeMap() {\n return V1VolumeNodeAffinity.attributeTypeMap;\n }\n}\nV1VolumeNodeAffinity.discriminator = undefined;\nV1VolumeNodeAffinity.attributeTypeMap = [\n {\n \"name\": \"required\",\n \"baseName\": \"required\",\n \"type\": \"V1NodeSelector\"\n }\n];\nexports.V1VolumeNodeAffinity = V1VolumeNodeAffinity;\n/**\n* Projection that may be projected along with other supported volume types\n*/\nclass V1VolumeProjection {\n static getAttributeTypeMap() {\n return V1VolumeProjection.attributeTypeMap;\n }\n}\nV1VolumeProjection.discriminator = undefined;\nV1VolumeProjection.attributeTypeMap = [\n {\n \"name\": \"configMap\",\n \"baseName\": \"configMap\",\n \"type\": \"V1ConfigMapProjection\"\n },\n {\n \"name\": \"downwardAPI\",\n \"baseName\": \"downwardAPI\",\n \"type\": \"V1DownwardAPIProjection\"\n },\n {\n \"name\": \"secret\",\n \"baseName\": \"secret\",\n \"type\": \"V1SecretProjection\"\n },\n {\n \"name\": \"serviceAccountToken\",\n \"baseName\": \"serviceAccountToken\",\n \"type\": \"V1ServiceAccountTokenProjection\"\n }\n];\nexports.V1VolumeProjection = V1VolumeProjection;\n/**\n* Represents a vSphere volume resource.\n*/\nclass V1VsphereVirtualDiskVolumeSource {\n static getAttributeTypeMap() {\n return V1VsphereVirtualDiskVolumeSource.attributeTypeMap;\n }\n}\nV1VsphereVirtualDiskVolumeSource.discriminator = undefined;\nV1VsphereVirtualDiskVolumeSource.attributeTypeMap = [\n {\n \"name\": \"fsType\",\n \"baseName\": \"fsType\",\n \"type\": \"string\"\n },\n {\n \"name\": \"storagePolicyID\",\n \"baseName\": \"storagePolicyID\",\n \"type\": \"string\"\n },\n {\n \"name\": \"storagePolicyName\",\n \"baseName\": \"storagePolicyName\",\n \"type\": \"string\"\n },\n {\n \"name\": \"volumePath\",\n \"baseName\": \"volumePath\",\n \"type\": \"string\"\n }\n];\nexports.V1VsphereVirtualDiskVolumeSource = V1VsphereVirtualDiskVolumeSource;\n/**\n* Event represents a single event to a watched resource.\n*/\nclass V1WatchEvent {\n static getAttributeTypeMap() {\n return V1WatchEvent.attributeTypeMap;\n }\n}\nV1WatchEvent.discriminator = undefined;\nV1WatchEvent.attributeTypeMap = [\n {\n \"name\": \"object\",\n \"baseName\": \"object\",\n \"type\": \"RuntimeRawExtension\"\n },\n {\n \"name\": \"type\",\n \"baseName\": \"type\",\n \"type\": \"string\"\n }\n];\nexports.V1WatchEvent = V1WatchEvent;\n/**\n* The weights of all of the matched WeightedPodAffinityTerm fields are added per-node to find the most preferred node(s)\n*/\nclass V1WeightedPodAffinityTerm {\n static getAttributeTypeMap() {\n return V1WeightedPodAffinityTerm.attributeTypeMap;\n }\n}\nV1WeightedPodAffinityTerm.discriminator = undefined;\nV1WeightedPodAffinityTerm.attributeTypeMap = [\n {\n \"name\": \"podAffinityTerm\",\n \"baseName\": \"podAffinityTerm\",\n \"type\": \"V1PodAffinityTerm\"\n },\n {\n \"name\": \"weight\",\n \"baseName\": \"weight\",\n \"type\": \"number\"\n }\n];\nexports.V1WeightedPodAffinityTerm = V1WeightedPodAffinityTerm;\n/**\n* AggregationRule describes how to locate ClusterRoles to aggregate into the ClusterRole\n*/\nclass V1alpha1AggregationRule {\n static getAttributeTypeMap() {\n return V1alpha1AggregationRule.attributeTypeMap;\n }\n}\nV1alpha1AggregationRule.discriminator = undefined;\nV1alpha1AggregationRule.attributeTypeMap = [\n {\n \"name\": \"clusterRoleSelectors\",\n \"baseName\": \"clusterRoleSelectors\",\n \"type\": \"Array\"\n }\n];\nexports.V1alpha1AggregationRule = V1alpha1AggregationRule;\n/**\n* AuditSink represents a cluster level audit sink\n*/\nclass V1alpha1AuditSink {\n static getAttributeTypeMap() {\n return V1alpha1AuditSink.attributeTypeMap;\n }\n}\nV1alpha1AuditSink.discriminator = undefined;\nV1alpha1AuditSink.attributeTypeMap = [\n {\n \"name\": \"apiVersion\",\n \"baseName\": \"apiVersion\",\n \"type\": \"string\"\n },\n {\n \"name\": \"kind\",\n \"baseName\": \"kind\",\n \"type\": \"string\"\n },\n {\n \"name\": \"metadata\",\n \"baseName\": \"metadata\",\n \"type\": \"V1ObjectMeta\"\n },\n {\n \"name\": \"spec\",\n \"baseName\": \"spec\",\n \"type\": \"V1alpha1AuditSinkSpec\"\n }\n];\nexports.V1alpha1AuditSink = V1alpha1AuditSink;\n/**\n* AuditSinkList is a list of AuditSink items.\n*/\nclass V1alpha1AuditSinkList {\n static getAttributeTypeMap() {\n return V1alpha1AuditSinkList.attributeTypeMap;\n }\n}\nV1alpha1AuditSinkList.discriminator = undefined;\nV1alpha1AuditSinkList.attributeTypeMap = [\n {\n \"name\": \"apiVersion\",\n \"baseName\": \"apiVersion\",\n \"type\": \"string\"\n },\n {\n \"name\": \"items\",\n \"baseName\": \"items\",\n \"type\": \"Array\"\n },\n {\n \"name\": \"kind\",\n \"baseName\": \"kind\",\n \"type\": \"string\"\n },\n {\n \"name\": \"metadata\",\n \"baseName\": \"metadata\",\n \"type\": \"V1ListMeta\"\n }\n];\nexports.V1alpha1AuditSinkList = V1alpha1AuditSinkList;\n/**\n* AuditSinkSpec holds the spec for the audit sink\n*/\nclass V1alpha1AuditSinkSpec {\n static getAttributeTypeMap() {\n return V1alpha1AuditSinkSpec.attributeTypeMap;\n }\n}\nV1alpha1AuditSinkSpec.discriminator = undefined;\nV1alpha1AuditSinkSpec.attributeTypeMap = [\n {\n \"name\": \"policy\",\n \"baseName\": \"policy\",\n \"type\": \"V1alpha1Policy\"\n },\n {\n \"name\": \"webhook\",\n \"baseName\": \"webhook\",\n \"type\": \"V1alpha1Webhook\"\n }\n];\nexports.V1alpha1AuditSinkSpec = V1alpha1AuditSinkSpec;\n/**\n* ClusterRole is a cluster level, logical grouping of PolicyRules that can be referenced as a unit by a RoleBinding or ClusterRoleBinding.\n*/\nclass V1alpha1ClusterRole {\n static getAttributeTypeMap() {\n return V1alpha1ClusterRole.attributeTypeMap;\n }\n}\nV1alpha1ClusterRole.discriminator = undefined;\nV1alpha1ClusterRole.attributeTypeMap = [\n {\n \"name\": \"aggregationRule\",\n \"baseName\": \"aggregationRule\",\n \"type\": \"V1alpha1AggregationRule\"\n },\n {\n \"name\": \"apiVersion\",\n \"baseName\": \"apiVersion\",\n \"type\": \"string\"\n },\n {\n \"name\": \"kind\",\n \"baseName\": \"kind\",\n \"type\": \"string\"\n },\n {\n \"name\": \"metadata\",\n \"baseName\": \"metadata\",\n \"type\": \"V1ObjectMeta\"\n },\n {\n \"name\": \"rules\",\n \"baseName\": \"rules\",\n \"type\": \"Array\"\n }\n];\nexports.V1alpha1ClusterRole = V1alpha1ClusterRole;\n/**\n* ClusterRoleBinding references a ClusterRole, but not contain it. It can reference a ClusterRole in the global namespace, and adds who information via Subject.\n*/\nclass V1alpha1ClusterRoleBinding {\n static getAttributeTypeMap() {\n return V1alpha1ClusterRoleBinding.attributeTypeMap;\n }\n}\nV1alpha1ClusterRoleBinding.discriminator = undefined;\nV1alpha1ClusterRoleBinding.attributeTypeMap = [\n {\n \"name\": \"apiVersion\",\n \"baseName\": \"apiVersion\",\n \"type\": \"string\"\n },\n {\n \"name\": \"kind\",\n \"baseName\": \"kind\",\n \"type\": \"string\"\n },\n {\n \"name\": \"metadata\",\n \"baseName\": \"metadata\",\n \"type\": \"V1ObjectMeta\"\n },\n {\n \"name\": \"roleRef\",\n \"baseName\": \"roleRef\",\n \"type\": \"V1alpha1RoleRef\"\n },\n {\n \"name\": \"subjects\",\n \"baseName\": \"subjects\",\n \"type\": \"Array\"\n }\n];\nexports.V1alpha1ClusterRoleBinding = V1alpha1ClusterRoleBinding;\n/**\n* ClusterRoleBindingList is a collection of ClusterRoleBindings\n*/\nclass V1alpha1ClusterRoleBindingList {\n static getAttributeTypeMap() {\n return V1alpha1ClusterRoleBindingList.attributeTypeMap;\n }\n}\nV1alpha1ClusterRoleBindingList.discriminator = undefined;\nV1alpha1ClusterRoleBindingList.attributeTypeMap = [\n {\n \"name\": \"apiVersion\",\n \"baseName\": \"apiVersion\",\n \"type\": \"string\"\n },\n {\n \"name\": \"items\",\n \"baseName\": \"items\",\n \"type\": \"Array\"\n },\n {\n \"name\": \"kind\",\n \"baseName\": \"kind\",\n \"type\": \"string\"\n },\n {\n \"name\": \"metadata\",\n \"baseName\": \"metadata\",\n \"type\": \"V1ListMeta\"\n }\n];\nexports.V1alpha1ClusterRoleBindingList = V1alpha1ClusterRoleBindingList;\n/**\n* ClusterRoleList is a collection of ClusterRoles\n*/\nclass V1alpha1ClusterRoleList {\n static getAttributeTypeMap() {\n return V1alpha1ClusterRoleList.attributeTypeMap;\n }\n}\nV1alpha1ClusterRoleList.discriminator = undefined;\nV1alpha1ClusterRoleList.attributeTypeMap = [\n {\n \"name\": \"apiVersion\",\n \"baseName\": \"apiVersion\",\n \"type\": \"string\"\n },\n {\n \"name\": \"items\",\n \"baseName\": \"items\",\n \"type\": \"Array\"\n },\n {\n \"name\": \"kind\",\n \"baseName\": \"kind\",\n \"type\": \"string\"\n },\n {\n \"name\": \"metadata\",\n \"baseName\": \"metadata\",\n \"type\": \"V1ListMeta\"\n }\n];\nexports.V1alpha1ClusterRoleList = V1alpha1ClusterRoleList;\n/**\n* Initializer describes the name and the failure policy of an initializer, and what resources it applies to.\n*/\nclass V1alpha1Initializer {\n static getAttributeTypeMap() {\n return V1alpha1Initializer.attributeTypeMap;\n }\n}\nV1alpha1Initializer.discriminator = undefined;\nV1alpha1Initializer.attributeTypeMap = [\n {\n \"name\": \"name\",\n \"baseName\": \"name\",\n \"type\": \"string\"\n },\n {\n \"name\": \"rules\",\n \"baseName\": \"rules\",\n \"type\": \"Array\"\n }\n];\nexports.V1alpha1Initializer = V1alpha1Initializer;\n/**\n* InitializerConfiguration describes the configuration of initializers.\n*/\nclass V1alpha1InitializerConfiguration {\n static getAttributeTypeMap() {\n return V1alpha1InitializerConfiguration.attributeTypeMap;\n }\n}\nV1alpha1InitializerConfiguration.discriminator = undefined;\nV1alpha1InitializerConfiguration.attributeTypeMap = [\n {\n \"name\": \"apiVersion\",\n \"baseName\": \"apiVersion\",\n \"type\": \"string\"\n },\n {\n \"name\": \"initializers\",\n \"baseName\": \"initializers\",\n \"type\": \"Array\"\n },\n {\n \"name\": \"kind\",\n \"baseName\": \"kind\",\n \"type\": \"string\"\n },\n {\n \"name\": \"metadata\",\n \"baseName\": \"metadata\",\n \"type\": \"V1ObjectMeta\"\n }\n];\nexports.V1alpha1InitializerConfiguration = V1alpha1InitializerConfiguration;\n/**\n* InitializerConfigurationList is a list of InitializerConfiguration.\n*/\nclass V1alpha1InitializerConfigurationList {\n static getAttributeTypeMap() {\n return V1alpha1InitializerConfigurationList.attributeTypeMap;\n }\n}\nV1alpha1InitializerConfigurationList.discriminator = undefined;\nV1alpha1InitializerConfigurationList.attributeTypeMap = [\n {\n \"name\": \"apiVersion\",\n \"baseName\": \"apiVersion\",\n \"type\": \"string\"\n },\n {\n \"name\": \"items\",\n \"baseName\": \"items\",\n \"type\": \"Array\"\n },\n {\n \"name\": \"kind\",\n \"baseName\": \"kind\",\n \"type\": \"string\"\n },\n {\n \"name\": \"metadata\",\n \"baseName\": \"metadata\",\n \"type\": \"V1ListMeta\"\n }\n];\nexports.V1alpha1InitializerConfigurationList = V1alpha1InitializerConfigurationList;\n/**\n* PodPreset is a policy resource that defines additional runtime requirements for a Pod.\n*/\nclass V1alpha1PodPreset {\n static getAttributeTypeMap() {\n return V1alpha1PodPreset.attributeTypeMap;\n }\n}\nV1alpha1PodPreset.discriminator = undefined;\nV1alpha1PodPreset.attributeTypeMap = [\n {\n \"name\": \"apiVersion\",\n \"baseName\": \"apiVersion\",\n \"type\": \"string\"\n },\n {\n \"name\": \"kind\",\n \"baseName\": \"kind\",\n \"type\": \"string\"\n },\n {\n \"name\": \"metadata\",\n \"baseName\": \"metadata\",\n \"type\": \"V1ObjectMeta\"\n },\n {\n \"name\": \"spec\",\n \"baseName\": \"spec\",\n \"type\": \"V1alpha1PodPresetSpec\"\n }\n];\nexports.V1alpha1PodPreset = V1alpha1PodPreset;\n/**\n* PodPresetList is a list of PodPreset objects.\n*/\nclass V1alpha1PodPresetList {\n static getAttributeTypeMap() {\n return V1alpha1PodPresetList.attributeTypeMap;\n }\n}\nV1alpha1PodPresetList.discriminator = undefined;\nV1alpha1PodPresetList.attributeTypeMap = [\n {\n \"name\": \"apiVersion\",\n \"baseName\": \"apiVersion\",\n \"type\": \"string\"\n },\n {\n \"name\": \"items\",\n \"baseName\": \"items\",\n \"type\": \"Array\"\n },\n {\n \"name\": \"kind\",\n \"baseName\": \"kind\",\n \"type\": \"string\"\n },\n {\n \"name\": \"metadata\",\n \"baseName\": \"metadata\",\n \"type\": \"V1ListMeta\"\n }\n];\nexports.V1alpha1PodPresetList = V1alpha1PodPresetList;\n/**\n* PodPresetSpec is a description of a pod preset.\n*/\nclass V1alpha1PodPresetSpec {\n static getAttributeTypeMap() {\n return V1alpha1PodPresetSpec.attributeTypeMap;\n }\n}\nV1alpha1PodPresetSpec.discriminator = undefined;\nV1alpha1PodPresetSpec.attributeTypeMap = [\n {\n \"name\": \"env\",\n \"baseName\": \"env\",\n \"type\": \"Array\"\n },\n {\n \"name\": \"envFrom\",\n \"baseName\": \"envFrom\",\n \"type\": \"Array\"\n },\n {\n \"name\": \"selector\",\n \"baseName\": \"selector\",\n \"type\": \"V1LabelSelector\"\n },\n {\n \"name\": \"volumeMounts\",\n \"baseName\": \"volumeMounts\",\n \"type\": \"Array\"\n },\n {\n \"name\": \"volumes\",\n \"baseName\": \"volumes\",\n \"type\": \"Array\"\n }\n];\nexports.V1alpha1PodPresetSpec = V1alpha1PodPresetSpec;\n/**\n* Policy defines the configuration of how audit events are logged\n*/\nclass V1alpha1Policy {\n static getAttributeTypeMap() {\n return V1alpha1Policy.attributeTypeMap;\n }\n}\nV1alpha1Policy.discriminator = undefined;\nV1alpha1Policy.attributeTypeMap = [\n {\n \"name\": \"level\",\n \"baseName\": \"level\",\n \"type\": \"string\"\n },\n {\n \"name\": \"stages\",\n \"baseName\": \"stages\",\n \"type\": \"Array\"\n }\n];\nexports.V1alpha1Policy = V1alpha1Policy;\n/**\n* PolicyRule holds information that describes a policy rule, but does not contain information about who the rule applies to or which namespace the rule applies to.\n*/\nclass V1alpha1PolicyRule {\n static getAttributeTypeMap() {\n return V1alpha1PolicyRule.attributeTypeMap;\n }\n}\nV1alpha1PolicyRule.discriminator = undefined;\nV1alpha1PolicyRule.attributeTypeMap = [\n {\n \"name\": \"apiGroups\",\n \"baseName\": \"apiGroups\",\n \"type\": \"Array\"\n },\n {\n \"name\": \"nonResourceURLs\",\n \"baseName\": \"nonResourceURLs\",\n \"type\": \"Array\"\n },\n {\n \"name\": \"resourceNames\",\n \"baseName\": \"resourceNames\",\n \"type\": \"Array\"\n },\n {\n \"name\": \"resources\",\n \"baseName\": \"resources\",\n \"type\": \"Array\"\n },\n {\n \"name\": \"verbs\",\n \"baseName\": \"verbs\",\n \"type\": \"Array\"\n }\n];\nexports.V1alpha1PolicyRule = V1alpha1PolicyRule;\n/**\n* PriorityClass defines mapping from a priority class name to the priority integer value. The value can be any valid integer.\n*/\nclass V1alpha1PriorityClass {\n static getAttributeTypeMap() {\n return V1alpha1PriorityClass.attributeTypeMap;\n }\n}\nV1alpha1PriorityClass.discriminator = undefined;\nV1alpha1PriorityClass.attributeTypeMap = [\n {\n \"name\": \"apiVersion\",\n \"baseName\": \"apiVersion\",\n \"type\": \"string\"\n },\n {\n \"name\": \"description\",\n \"baseName\": \"description\",\n \"type\": \"string\"\n },\n {\n \"name\": \"globalDefault\",\n \"baseName\": \"globalDefault\",\n \"type\": \"boolean\"\n },\n {\n \"name\": \"kind\",\n \"baseName\": \"kind\",\n \"type\": \"string\"\n },\n {\n \"name\": \"metadata\",\n \"baseName\": \"metadata\",\n \"type\": \"V1ObjectMeta\"\n },\n {\n \"name\": \"value\",\n \"baseName\": \"value\",\n \"type\": \"number\"\n }\n];\nexports.V1alpha1PriorityClass = V1alpha1PriorityClass;\n/**\n* PriorityClassList is a collection of priority classes.\n*/\nclass V1alpha1PriorityClassList {\n static getAttributeTypeMap() {\n return V1alpha1PriorityClassList.attributeTypeMap;\n }\n}\nV1alpha1PriorityClassList.discriminator = undefined;\nV1alpha1PriorityClassList.attributeTypeMap = [\n {\n \"name\": \"apiVersion\",\n \"baseName\": \"apiVersion\",\n \"type\": \"string\"\n },\n {\n \"name\": \"items\",\n \"baseName\": \"items\",\n \"type\": \"Array\"\n },\n {\n \"name\": \"kind\",\n \"baseName\": \"kind\",\n \"type\": \"string\"\n },\n {\n \"name\": \"metadata\",\n \"baseName\": \"metadata\",\n \"type\": \"V1ListMeta\"\n }\n];\nexports.V1alpha1PriorityClassList = V1alpha1PriorityClassList;\n/**\n* Role is a namespaced, logical grouping of PolicyRules that can be referenced as a unit by a RoleBinding.\n*/\nclass V1alpha1Role {\n static getAttributeTypeMap() {\n return V1alpha1Role.attributeTypeMap;\n }\n}\nV1alpha1Role.discriminator = undefined;\nV1alpha1Role.attributeTypeMap = [\n {\n \"name\": \"apiVersion\",\n \"baseName\": \"apiVersion\",\n \"type\": \"string\"\n },\n {\n \"name\": \"kind\",\n \"baseName\": \"kind\",\n \"type\": \"string\"\n },\n {\n \"name\": \"metadata\",\n \"baseName\": \"metadata\",\n \"type\": \"V1ObjectMeta\"\n },\n {\n \"name\": \"rules\",\n \"baseName\": \"rules\",\n \"type\": \"Array\"\n }\n];\nexports.V1alpha1Role = V1alpha1Role;\n/**\n* RoleBinding references a role, but does not contain it. It can reference a Role in the same namespace or a ClusterRole in the global namespace. It adds who information via Subjects and namespace information by which namespace it exists in. RoleBindings in a given namespace only have effect in that namespace.\n*/\nclass V1alpha1RoleBinding {\n static getAttributeTypeMap() {\n return V1alpha1RoleBinding.attributeTypeMap;\n }\n}\nV1alpha1RoleBinding.discriminator = undefined;\nV1alpha1RoleBinding.attributeTypeMap = [\n {\n \"name\": \"apiVersion\",\n \"baseName\": \"apiVersion\",\n \"type\": \"string\"\n },\n {\n \"name\": \"kind\",\n \"baseName\": \"kind\",\n \"type\": \"string\"\n },\n {\n \"name\": \"metadata\",\n \"baseName\": \"metadata\",\n \"type\": \"V1ObjectMeta\"\n },\n {\n \"name\": \"roleRef\",\n \"baseName\": \"roleRef\",\n \"type\": \"V1alpha1RoleRef\"\n },\n {\n \"name\": \"subjects\",\n \"baseName\": \"subjects\",\n \"type\": \"Array\"\n }\n];\nexports.V1alpha1RoleBinding = V1alpha1RoleBinding;\n/**\n* RoleBindingList is a collection of RoleBindings\n*/\nclass V1alpha1RoleBindingList {\n static getAttributeTypeMap() {\n return V1alpha1RoleBindingList.attributeTypeMap;\n }\n}\nV1alpha1RoleBindingList.discriminator = undefined;\nV1alpha1RoleBindingList.attributeTypeMap = [\n {\n \"name\": \"apiVersion\",\n \"baseName\": \"apiVersion\",\n \"type\": \"string\"\n },\n {\n \"name\": \"items\",\n \"baseName\": \"items\",\n \"type\": \"Array\"\n },\n {\n \"name\": \"kind\",\n \"baseName\": \"kind\",\n \"type\": \"string\"\n },\n {\n \"name\": \"metadata\",\n \"baseName\": \"metadata\",\n \"type\": \"V1ListMeta\"\n }\n];\nexports.V1alpha1RoleBindingList = V1alpha1RoleBindingList;\n/**\n* RoleList is a collection of Roles\n*/\nclass V1alpha1RoleList {\n static getAttributeTypeMap() {\n return V1alpha1RoleList.attributeTypeMap;\n }\n}\nV1alpha1RoleList.discriminator = undefined;\nV1alpha1RoleList.attributeTypeMap = [\n {\n \"name\": \"apiVersion\",\n \"baseName\": \"apiVersion\",\n \"type\": \"string\"\n },\n {\n \"name\": \"items\",\n \"baseName\": \"items\",\n \"type\": \"Array\"\n },\n {\n \"name\": \"kind\",\n \"baseName\": \"kind\",\n \"type\": \"string\"\n },\n {\n \"name\": \"metadata\",\n \"baseName\": \"metadata\",\n \"type\": \"V1ListMeta\"\n }\n];\nexports.V1alpha1RoleList = V1alpha1RoleList;\n/**\n* RoleRef contains information that points to the role being used\n*/\nclass V1alpha1RoleRef {\n static getAttributeTypeMap() {\n return V1alpha1RoleRef.attributeTypeMap;\n }\n}\nV1alpha1RoleRef.discriminator = undefined;\nV1alpha1RoleRef.attributeTypeMap = [\n {\n \"name\": \"apiGroup\",\n \"baseName\": \"apiGroup\",\n \"type\": \"string\"\n },\n {\n \"name\": \"kind\",\n \"baseName\": \"kind\",\n \"type\": \"string\"\n },\n {\n \"name\": \"name\",\n \"baseName\": \"name\",\n \"type\": \"string\"\n }\n];\nexports.V1alpha1RoleRef = V1alpha1RoleRef;\n/**\n* Rule is a tuple of APIGroups, APIVersion, and Resources.It is recommended to make sure that all the tuple expansions are valid.\n*/\nclass V1alpha1Rule {\n static getAttributeTypeMap() {\n return V1alpha1Rule.attributeTypeMap;\n }\n}\nV1alpha1Rule.discriminator = undefined;\nV1alpha1Rule.attributeTypeMap = [\n {\n \"name\": \"apiGroups\",\n \"baseName\": \"apiGroups\",\n \"type\": \"Array\"\n },\n {\n \"name\": \"apiVersions\",\n \"baseName\": \"apiVersions\",\n \"type\": \"Array\"\n },\n {\n \"name\": \"resources\",\n \"baseName\": \"resources\",\n \"type\": \"Array\"\n }\n];\nexports.V1alpha1Rule = V1alpha1Rule;\n/**\n* ServiceReference holds a reference to Service.legacy.k8s.io\n*/\nclass V1alpha1ServiceReference {\n static getAttributeTypeMap() {\n return V1alpha1ServiceReference.attributeTypeMap;\n }\n}\nV1alpha1ServiceReference.discriminator = undefined;\nV1alpha1ServiceReference.attributeTypeMap = [\n {\n \"name\": \"name\",\n \"baseName\": \"name\",\n \"type\": \"string\"\n },\n {\n \"name\": \"namespace\",\n \"baseName\": \"namespace\",\n \"type\": \"string\"\n },\n {\n \"name\": \"path\",\n \"baseName\": \"path\",\n \"type\": \"string\"\n }\n];\nexports.V1alpha1ServiceReference = V1alpha1ServiceReference;\n/**\n* Subject contains a reference to the object or user identities a role binding applies to. This can either hold a direct API object reference, or a value for non-objects such as user and group names.\n*/\nclass V1alpha1Subject {\n static getAttributeTypeMap() {\n return V1alpha1Subject.attributeTypeMap;\n }\n}\nV1alpha1Subject.discriminator = undefined;\nV1alpha1Subject.attributeTypeMap = [\n {\n \"name\": \"apiVersion\",\n \"baseName\": \"apiVersion\",\n \"type\": \"string\"\n },\n {\n \"name\": \"kind\",\n \"baseName\": \"kind\",\n \"type\": \"string\"\n },\n {\n \"name\": \"name\",\n \"baseName\": \"name\",\n \"type\": \"string\"\n },\n {\n \"name\": \"namespace\",\n \"baseName\": \"namespace\",\n \"type\": \"string\"\n }\n];\nexports.V1alpha1Subject = V1alpha1Subject;\n/**\n* VolumeAttachment captures the intent to attach or detach the specified volume to/from the specified node. VolumeAttachment objects are non-namespaced.\n*/\nclass V1alpha1VolumeAttachment {\n static getAttributeTypeMap() {\n return V1alpha1VolumeAttachment.attributeTypeMap;\n }\n}\nV1alpha1VolumeAttachment.discriminator = undefined;\nV1alpha1VolumeAttachment.attributeTypeMap = [\n {\n \"name\": \"apiVersion\",\n \"baseName\": \"apiVersion\",\n \"type\": \"string\"\n },\n {\n \"name\": \"kind\",\n \"baseName\": \"kind\",\n \"type\": \"string\"\n },\n {\n \"name\": \"metadata\",\n \"baseName\": \"metadata\",\n \"type\": \"V1ObjectMeta\"\n },\n {\n \"name\": \"spec\",\n \"baseName\": \"spec\",\n \"type\": \"V1alpha1VolumeAttachmentSpec\"\n },\n {\n \"name\": \"status\",\n \"baseName\": \"status\",\n \"type\": \"V1alpha1VolumeAttachmentStatus\"\n }\n];\nexports.V1alpha1VolumeAttachment = V1alpha1VolumeAttachment;\n/**\n* VolumeAttachmentList is a collection of VolumeAttachment objects.\n*/\nclass V1alpha1VolumeAttachmentList {\n static getAttributeTypeMap() {\n return V1alpha1VolumeAttachmentList.attributeTypeMap;\n }\n}\nV1alpha1VolumeAttachmentList.discriminator = undefined;\nV1alpha1VolumeAttachmentList.attributeTypeMap = [\n {\n \"name\": \"apiVersion\",\n \"baseName\": \"apiVersion\",\n \"type\": \"string\"\n },\n {\n \"name\": \"items\",\n \"baseName\": \"items\",\n \"type\": \"Array\"\n },\n {\n \"name\": \"kind\",\n \"baseName\": \"kind\",\n \"type\": \"string\"\n },\n {\n \"name\": \"metadata\",\n \"baseName\": \"metadata\",\n \"type\": \"V1ListMeta\"\n }\n];\nexports.V1alpha1VolumeAttachmentList = V1alpha1VolumeAttachmentList;\n/**\n* VolumeAttachmentSource represents a volume that should be attached. Right now only PersistenVolumes can be attached via external attacher, in future we may allow also inline volumes in pods. Exactly one member can be set.\n*/\nclass V1alpha1VolumeAttachmentSource {\n static getAttributeTypeMap() {\n return V1alpha1VolumeAttachmentSource.attributeTypeMap;\n }\n}\nV1alpha1VolumeAttachmentSource.discriminator = undefined;\nV1alpha1VolumeAttachmentSource.attributeTypeMap = [\n {\n \"name\": \"persistentVolumeName\",\n \"baseName\": \"persistentVolumeName\",\n \"type\": \"string\"\n }\n];\nexports.V1alpha1VolumeAttachmentSource = V1alpha1VolumeAttachmentSource;\n/**\n* VolumeAttachmentSpec is the specification of a VolumeAttachment request.\n*/\nclass V1alpha1VolumeAttachmentSpec {\n static getAttributeTypeMap() {\n return V1alpha1VolumeAttachmentSpec.attributeTypeMap;\n }\n}\nV1alpha1VolumeAttachmentSpec.discriminator = undefined;\nV1alpha1VolumeAttachmentSpec.attributeTypeMap = [\n {\n \"name\": \"attacher\",\n \"baseName\": \"attacher\",\n \"type\": \"string\"\n },\n {\n \"name\": \"nodeName\",\n \"baseName\": \"nodeName\",\n \"type\": \"string\"\n },\n {\n \"name\": \"source\",\n \"baseName\": \"source\",\n \"type\": \"V1alpha1VolumeAttachmentSource\"\n }\n];\nexports.V1alpha1VolumeAttachmentSpec = V1alpha1VolumeAttachmentSpec;\n/**\n* VolumeAttachmentStatus is the status of a VolumeAttachment request.\n*/\nclass V1alpha1VolumeAttachmentStatus {\n static getAttributeTypeMap() {\n return V1alpha1VolumeAttachmentStatus.attributeTypeMap;\n }\n}\nV1alpha1VolumeAttachmentStatus.discriminator = undefined;\nV1alpha1VolumeAttachmentStatus.attributeTypeMap = [\n {\n \"name\": \"attachError\",\n \"baseName\": \"attachError\",\n \"type\": \"V1alpha1VolumeError\"\n },\n {\n \"name\": \"attached\",\n \"baseName\": \"attached\",\n \"type\": \"boolean\"\n },\n {\n \"name\": \"attachmentMetadata\",\n \"baseName\": \"attachmentMetadata\",\n \"type\": \"{ [key: string]: string; }\"\n },\n {\n \"name\": \"detachError\",\n \"baseName\": \"detachError\",\n \"type\": \"V1alpha1VolumeError\"\n }\n];\nexports.V1alpha1VolumeAttachmentStatus = V1alpha1VolumeAttachmentStatus;\n/**\n* VolumeError captures an error encountered during a volume operation.\n*/\nclass V1alpha1VolumeError {\n static getAttributeTypeMap() {\n return V1alpha1VolumeError.attributeTypeMap;\n }\n}\nV1alpha1VolumeError.discriminator = undefined;\nV1alpha1VolumeError.attributeTypeMap = [\n {\n \"name\": \"message\",\n \"baseName\": \"message\",\n \"type\": \"string\"\n },\n {\n \"name\": \"time\",\n \"baseName\": \"time\",\n \"type\": \"Date\"\n }\n];\nexports.V1alpha1VolumeError = V1alpha1VolumeError;\n/**\n* Webhook holds the configuration of the webhook\n*/\nclass V1alpha1Webhook {\n static getAttributeTypeMap() {\n return V1alpha1Webhook.attributeTypeMap;\n }\n}\nV1alpha1Webhook.discriminator = undefined;\nV1alpha1Webhook.attributeTypeMap = [\n {\n \"name\": \"clientConfig\",\n \"baseName\": \"clientConfig\",\n \"type\": \"V1alpha1WebhookClientConfig\"\n },\n {\n \"name\": \"throttle\",\n \"baseName\": \"throttle\",\n \"type\": \"V1alpha1WebhookThrottleConfig\"\n }\n];\nexports.V1alpha1Webhook = V1alpha1Webhook;\n/**\n* WebhookClientConfig contains the information to make a connection with the webhook\n*/\nclass V1alpha1WebhookClientConfig {\n static getAttributeTypeMap() {\n return V1alpha1WebhookClientConfig.attributeTypeMap;\n }\n}\nV1alpha1WebhookClientConfig.discriminator = undefined;\nV1alpha1WebhookClientConfig.attributeTypeMap = [\n {\n \"name\": \"caBundle\",\n \"baseName\": \"caBundle\",\n \"type\": \"string\"\n },\n {\n \"name\": \"service\",\n \"baseName\": \"service\",\n \"type\": \"V1alpha1ServiceReference\"\n },\n {\n \"name\": \"url\",\n \"baseName\": \"url\",\n \"type\": \"string\"\n }\n];\nexports.V1alpha1WebhookClientConfig = V1alpha1WebhookClientConfig;\n/**\n* WebhookThrottleConfig holds the configuration for throttling events\n*/\nclass V1alpha1WebhookThrottleConfig {\n static getAttributeTypeMap() {\n return V1alpha1WebhookThrottleConfig.attributeTypeMap;\n }\n}\nV1alpha1WebhookThrottleConfig.discriminator = undefined;\nV1alpha1WebhookThrottleConfig.attributeTypeMap = [\n {\n \"name\": \"burst\",\n \"baseName\": \"burst\",\n \"type\": \"number\"\n },\n {\n \"name\": \"qps\",\n \"baseName\": \"qps\",\n \"type\": \"number\"\n }\n];\nexports.V1alpha1WebhookThrottleConfig = V1alpha1WebhookThrottleConfig;\n/**\n* APIService represents a server for a particular GroupVersion. Name must be \\\"version.group\\\".\n*/\nclass V1beta1APIService {\n static getAttributeTypeMap() {\n return V1beta1APIService.attributeTypeMap;\n }\n}\nV1beta1APIService.discriminator = undefined;\nV1beta1APIService.attributeTypeMap = [\n {\n \"name\": \"apiVersion\",\n \"baseName\": \"apiVersion\",\n \"type\": \"string\"\n },\n {\n \"name\": \"kind\",\n \"baseName\": \"kind\",\n \"type\": \"string\"\n },\n {\n \"name\": \"metadata\",\n \"baseName\": \"metadata\",\n \"type\": \"V1ObjectMeta\"\n },\n {\n \"name\": \"spec\",\n \"baseName\": \"spec\",\n \"type\": \"V1beta1APIServiceSpec\"\n },\n {\n \"name\": \"status\",\n \"baseName\": \"status\",\n \"type\": \"V1beta1APIServiceStatus\"\n }\n];\nexports.V1beta1APIService = V1beta1APIService;\nclass V1beta1APIServiceCondition {\n static getAttributeTypeMap() {\n return V1beta1APIServiceCondition.attributeTypeMap;\n }\n}\nV1beta1APIServiceCondition.discriminator = undefined;\nV1beta1APIServiceCondition.attributeTypeMap = [\n {\n \"name\": \"lastTransitionTime\",\n \"baseName\": \"lastTransitionTime\",\n \"type\": \"Date\"\n },\n {\n \"name\": \"message\",\n \"baseName\": \"message\",\n \"type\": \"string\"\n },\n {\n \"name\": \"reason\",\n \"baseName\": \"reason\",\n \"type\": \"string\"\n },\n {\n \"name\": \"status\",\n \"baseName\": \"status\",\n \"type\": \"string\"\n },\n {\n \"name\": \"type\",\n \"baseName\": \"type\",\n \"type\": \"string\"\n }\n];\nexports.V1beta1APIServiceCondition = V1beta1APIServiceCondition;\n/**\n* APIServiceList is a list of APIService objects.\n*/\nclass V1beta1APIServiceList {\n static getAttributeTypeMap() {\n return V1beta1APIServiceList.attributeTypeMap;\n }\n}\nV1beta1APIServiceList.discriminator = undefined;\nV1beta1APIServiceList.attributeTypeMap = [\n {\n \"name\": \"apiVersion\",\n \"baseName\": \"apiVersion\",\n \"type\": \"string\"\n },\n {\n \"name\": \"items\",\n \"baseName\": \"items\",\n \"type\": \"Array\"\n },\n {\n \"name\": \"kind\",\n \"baseName\": \"kind\",\n \"type\": \"string\"\n },\n {\n \"name\": \"metadata\",\n \"baseName\": \"metadata\",\n \"type\": \"V1ListMeta\"\n }\n];\nexports.V1beta1APIServiceList = V1beta1APIServiceList;\n/**\n* APIServiceSpec contains information for locating and communicating with a server. Only https is supported, though you are able to disable certificate verification.\n*/\nclass V1beta1APIServiceSpec {\n static getAttributeTypeMap() {\n return V1beta1APIServiceSpec.attributeTypeMap;\n }\n}\nV1beta1APIServiceSpec.discriminator = undefined;\nV1beta1APIServiceSpec.attributeTypeMap = [\n {\n \"name\": \"caBundle\",\n \"baseName\": \"caBundle\",\n \"type\": \"string\"\n },\n {\n \"name\": \"group\",\n \"baseName\": \"group\",\n \"type\": \"string\"\n },\n {\n \"name\": \"groupPriorityMinimum\",\n \"baseName\": \"groupPriorityMinimum\",\n \"type\": \"number\"\n },\n {\n \"name\": \"insecureSkipTLSVerify\",\n \"baseName\": \"insecureSkipTLSVerify\",\n \"type\": \"boolean\"\n },\n {\n \"name\": \"service\",\n \"baseName\": \"service\",\n \"type\": \"ApiregistrationV1beta1ServiceReference\"\n },\n {\n \"name\": \"version\",\n \"baseName\": \"version\",\n \"type\": \"string\"\n },\n {\n \"name\": \"versionPriority\",\n \"baseName\": \"versionPriority\",\n \"type\": \"number\"\n }\n];\nexports.V1beta1APIServiceSpec = V1beta1APIServiceSpec;\n/**\n* APIServiceStatus contains derived information about an API server\n*/\nclass V1beta1APIServiceStatus {\n static getAttributeTypeMap() {\n return V1beta1APIServiceStatus.attributeTypeMap;\n }\n}\nV1beta1APIServiceStatus.discriminator = undefined;\nV1beta1APIServiceStatus.attributeTypeMap = [\n {\n \"name\": \"conditions\",\n \"baseName\": \"conditions\",\n \"type\": \"Array\"\n }\n];\nexports.V1beta1APIServiceStatus = V1beta1APIServiceStatus;\n/**\n* AggregationRule describes how to locate ClusterRoles to aggregate into the ClusterRole\n*/\nclass V1beta1AggregationRule {\n static getAttributeTypeMap() {\n return V1beta1AggregationRule.attributeTypeMap;\n }\n}\nV1beta1AggregationRule.discriminator = undefined;\nV1beta1AggregationRule.attributeTypeMap = [\n {\n \"name\": \"clusterRoleSelectors\",\n \"baseName\": \"clusterRoleSelectors\",\n \"type\": \"Array\"\n }\n];\nexports.V1beta1AggregationRule = V1beta1AggregationRule;\n/**\n* Describes a certificate signing request\n*/\nclass V1beta1CertificateSigningRequest {\n static getAttributeTypeMap() {\n return V1beta1CertificateSigningRequest.attributeTypeMap;\n }\n}\nV1beta1CertificateSigningRequest.discriminator = undefined;\nV1beta1CertificateSigningRequest.attributeTypeMap = [\n {\n \"name\": \"apiVersion\",\n \"baseName\": \"apiVersion\",\n \"type\": \"string\"\n },\n {\n \"name\": \"kind\",\n \"baseName\": \"kind\",\n \"type\": \"string\"\n },\n {\n \"name\": \"metadata\",\n \"baseName\": \"metadata\",\n \"type\": \"V1ObjectMeta\"\n },\n {\n \"name\": \"spec\",\n \"baseName\": \"spec\",\n \"type\": \"V1beta1CertificateSigningRequestSpec\"\n },\n {\n \"name\": \"status\",\n \"baseName\": \"status\",\n \"type\": \"V1beta1CertificateSigningRequestStatus\"\n }\n];\nexports.V1beta1CertificateSigningRequest = V1beta1CertificateSigningRequest;\nclass V1beta1CertificateSigningRequestCondition {\n static getAttributeTypeMap() {\n return V1beta1CertificateSigningRequestCondition.attributeTypeMap;\n }\n}\nV1beta1CertificateSigningRequestCondition.discriminator = undefined;\nV1beta1CertificateSigningRequestCondition.attributeTypeMap = [\n {\n \"name\": \"lastUpdateTime\",\n \"baseName\": \"lastUpdateTime\",\n \"type\": \"Date\"\n },\n {\n \"name\": \"message\",\n \"baseName\": \"message\",\n \"type\": \"string\"\n },\n {\n \"name\": \"reason\",\n \"baseName\": \"reason\",\n \"type\": \"string\"\n },\n {\n \"name\": \"type\",\n \"baseName\": \"type\",\n \"type\": \"string\"\n }\n];\nexports.V1beta1CertificateSigningRequestCondition = V1beta1CertificateSigningRequestCondition;\nclass V1beta1CertificateSigningRequestList {\n static getAttributeTypeMap() {\n return V1beta1CertificateSigningRequestList.attributeTypeMap;\n }\n}\nV1beta1CertificateSigningRequestList.discriminator = undefined;\nV1beta1CertificateSigningRequestList.attributeTypeMap = [\n {\n \"name\": \"apiVersion\",\n \"baseName\": \"apiVersion\",\n \"type\": \"string\"\n },\n {\n \"name\": \"items\",\n \"baseName\": \"items\",\n \"type\": \"Array\"\n },\n {\n \"name\": \"kind\",\n \"baseName\": \"kind\",\n \"type\": \"string\"\n },\n {\n \"name\": \"metadata\",\n \"baseName\": \"metadata\",\n \"type\": \"V1ListMeta\"\n }\n];\nexports.V1beta1CertificateSigningRequestList = V1beta1CertificateSigningRequestList;\n/**\n* 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.\n*/\nclass V1beta1CertificateSigningRequestSpec {\n static getAttributeTypeMap() {\n return V1beta1CertificateSigningRequestSpec.attributeTypeMap;\n }\n}\nV1beta1CertificateSigningRequestSpec.discriminator = undefined;\nV1beta1CertificateSigningRequestSpec.attributeTypeMap = [\n {\n \"name\": \"extra\",\n \"baseName\": \"extra\",\n \"type\": \"{ [key: string]: Array; }\"\n },\n {\n \"name\": \"groups\",\n \"baseName\": \"groups\",\n \"type\": \"Array\"\n },\n {\n \"name\": \"request\",\n \"baseName\": \"request\",\n \"type\": \"string\"\n },\n {\n \"name\": \"uid\",\n \"baseName\": \"uid\",\n \"type\": \"string\"\n },\n {\n \"name\": \"usages\",\n \"baseName\": \"usages\",\n \"type\": \"Array\"\n },\n {\n \"name\": \"username\",\n \"baseName\": \"username\",\n \"type\": \"string\"\n }\n];\nexports.V1beta1CertificateSigningRequestSpec = V1beta1CertificateSigningRequestSpec;\nclass V1beta1CertificateSigningRequestStatus {\n static getAttributeTypeMap() {\n return V1beta1CertificateSigningRequestStatus.attributeTypeMap;\n }\n}\nV1beta1CertificateSigningRequestStatus.discriminator = undefined;\nV1beta1CertificateSigningRequestStatus.attributeTypeMap = [\n {\n \"name\": \"certificate\",\n \"baseName\": \"certificate\",\n \"type\": \"string\"\n },\n {\n \"name\": \"conditions\",\n \"baseName\": \"conditions\",\n \"type\": \"Array\"\n }\n];\nexports.V1beta1CertificateSigningRequestStatus = V1beta1CertificateSigningRequestStatus;\n/**\n* ClusterRole is a cluster level, logical grouping of PolicyRules that can be referenced as a unit by a RoleBinding or ClusterRoleBinding.\n*/\nclass V1beta1ClusterRole {\n static getAttributeTypeMap() {\n return V1beta1ClusterRole.attributeTypeMap;\n }\n}\nV1beta1ClusterRole.discriminator = undefined;\nV1beta1ClusterRole.attributeTypeMap = [\n {\n \"name\": \"aggregationRule\",\n \"baseName\": \"aggregationRule\",\n \"type\": \"V1beta1AggregationRule\"\n },\n {\n \"name\": \"apiVersion\",\n \"baseName\": \"apiVersion\",\n \"type\": \"string\"\n },\n {\n \"name\": \"kind\",\n \"baseName\": \"kind\",\n \"type\": \"string\"\n },\n {\n \"name\": \"metadata\",\n \"baseName\": \"metadata\",\n \"type\": \"V1ObjectMeta\"\n },\n {\n \"name\": \"rules\",\n \"baseName\": \"rules\",\n \"type\": \"Array\"\n }\n];\nexports.V1beta1ClusterRole = V1beta1ClusterRole;\n/**\n* ClusterRoleBinding references a ClusterRole, but not contain it. It can reference a ClusterRole in the global namespace, and adds who information via Subject.\n*/\nclass V1beta1ClusterRoleBinding {\n static getAttributeTypeMap() {\n return V1beta1ClusterRoleBinding.attributeTypeMap;\n }\n}\nV1beta1ClusterRoleBinding.discriminator = undefined;\nV1beta1ClusterRoleBinding.attributeTypeMap = [\n {\n \"name\": \"apiVersion\",\n \"baseName\": \"apiVersion\",\n \"type\": \"string\"\n },\n {\n \"name\": \"kind\",\n \"baseName\": \"kind\",\n \"type\": \"string\"\n },\n {\n \"name\": \"metadata\",\n \"baseName\": \"metadata\",\n \"type\": \"V1ObjectMeta\"\n },\n {\n \"name\": \"roleRef\",\n \"baseName\": \"roleRef\",\n \"type\": \"V1beta1RoleRef\"\n },\n {\n \"name\": \"subjects\",\n \"baseName\": \"subjects\",\n \"type\": \"Array\"\n }\n];\nexports.V1beta1ClusterRoleBinding = V1beta1ClusterRoleBinding;\n/**\n* ClusterRoleBindingList is a collection of ClusterRoleBindings\n*/\nclass V1beta1ClusterRoleBindingList {\n static getAttributeTypeMap() {\n return V1beta1ClusterRoleBindingList.attributeTypeMap;\n }\n}\nV1beta1ClusterRoleBindingList.discriminator = undefined;\nV1beta1ClusterRoleBindingList.attributeTypeMap = [\n {\n \"name\": \"apiVersion\",\n \"baseName\": \"apiVersion\",\n \"type\": \"string\"\n },\n {\n \"name\": \"items\",\n \"baseName\": \"items\",\n \"type\": \"Array\"\n },\n {\n \"name\": \"kind\",\n \"baseName\": \"kind\",\n \"type\": \"string\"\n },\n {\n \"name\": \"metadata\",\n \"baseName\": \"metadata\",\n \"type\": \"V1ListMeta\"\n }\n];\nexports.V1beta1ClusterRoleBindingList = V1beta1ClusterRoleBindingList;\n/**\n* ClusterRoleList is a collection of ClusterRoles\n*/\nclass V1beta1ClusterRoleList {\n static getAttributeTypeMap() {\n return V1beta1ClusterRoleList.attributeTypeMap;\n }\n}\nV1beta1ClusterRoleList.discriminator = undefined;\nV1beta1ClusterRoleList.attributeTypeMap = [\n {\n \"name\": \"apiVersion\",\n \"baseName\": \"apiVersion\",\n \"type\": \"string\"\n },\n {\n \"name\": \"items\",\n \"baseName\": \"items\",\n \"type\": \"Array\"\n },\n {\n \"name\": \"kind\",\n \"baseName\": \"kind\",\n \"type\": \"string\"\n },\n {\n \"name\": \"metadata\",\n \"baseName\": \"metadata\",\n \"type\": \"V1ListMeta\"\n }\n];\nexports.V1beta1ClusterRoleList = V1beta1ClusterRoleList;\n/**\n* 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.\n*/\nclass V1beta1ControllerRevision {\n static getAttributeTypeMap() {\n return V1beta1ControllerRevision.attributeTypeMap;\n }\n}\nV1beta1ControllerRevision.discriminator = undefined;\nV1beta1ControllerRevision.attributeTypeMap = [\n {\n \"name\": \"apiVersion\",\n \"baseName\": \"apiVersion\",\n \"type\": \"string\"\n },\n {\n \"name\": \"data\",\n \"baseName\": \"data\",\n \"type\": \"RuntimeRawExtension\"\n },\n {\n \"name\": \"kind\",\n \"baseName\": \"kind\",\n \"type\": \"string\"\n },\n {\n \"name\": \"metadata\",\n \"baseName\": \"metadata\",\n \"type\": \"V1ObjectMeta\"\n },\n {\n \"name\": \"revision\",\n \"baseName\": \"revision\",\n \"type\": \"number\"\n }\n];\nexports.V1beta1ControllerRevision = V1beta1ControllerRevision;\n/**\n* ControllerRevisionList is a resource containing a list of ControllerRevision objects.\n*/\nclass V1beta1ControllerRevisionList {\n static getAttributeTypeMap() {\n return V1beta1ControllerRevisionList.attributeTypeMap;\n }\n}\nV1beta1ControllerRevisionList.discriminator = undefined;\nV1beta1ControllerRevisionList.attributeTypeMap = [\n {\n \"name\": \"apiVersion\",\n \"baseName\": \"apiVersion\",\n \"type\": \"string\"\n },\n {\n \"name\": \"items\",\n \"baseName\": \"items\",\n \"type\": \"Array\"\n },\n {\n \"name\": \"kind\",\n \"baseName\": \"kind\",\n \"type\": \"string\"\n },\n {\n \"name\": \"metadata\",\n \"baseName\": \"metadata\",\n \"type\": \"V1ListMeta\"\n }\n];\nexports.V1beta1ControllerRevisionList = V1beta1ControllerRevisionList;\n/**\n* CronJob represents the configuration of a single cron job.\n*/\nclass V1beta1CronJob {\n static getAttributeTypeMap() {\n return V1beta1CronJob.attributeTypeMap;\n }\n}\nV1beta1CronJob.discriminator = undefined;\nV1beta1CronJob.attributeTypeMap = [\n {\n \"name\": \"apiVersion\",\n \"baseName\": \"apiVersion\",\n \"type\": \"string\"\n },\n {\n \"name\": \"kind\",\n \"baseName\": \"kind\",\n \"type\": \"string\"\n },\n {\n \"name\": \"metadata\",\n \"baseName\": \"metadata\",\n \"type\": \"V1ObjectMeta\"\n },\n {\n \"name\": \"spec\",\n \"baseName\": \"spec\",\n \"type\": \"V1beta1CronJobSpec\"\n },\n {\n \"name\": \"status\",\n \"baseName\": \"status\",\n \"type\": \"V1beta1CronJobStatus\"\n }\n];\nexports.V1beta1CronJob = V1beta1CronJob;\n/**\n* CronJobList is a collection of cron jobs.\n*/\nclass V1beta1CronJobList {\n static getAttributeTypeMap() {\n return V1beta1CronJobList.attributeTypeMap;\n }\n}\nV1beta1CronJobList.discriminator = undefined;\nV1beta1CronJobList.attributeTypeMap = [\n {\n \"name\": \"apiVersion\",\n \"baseName\": \"apiVersion\",\n \"type\": \"string\"\n },\n {\n \"name\": \"items\",\n \"baseName\": \"items\",\n \"type\": \"Array\"\n },\n {\n \"name\": \"kind\",\n \"baseName\": \"kind\",\n \"type\": \"string\"\n },\n {\n \"name\": \"metadata\",\n \"baseName\": \"metadata\",\n \"type\": \"V1ListMeta\"\n }\n];\nexports.V1beta1CronJobList = V1beta1CronJobList;\n/**\n* CronJobSpec describes how the job execution will look like and when it will actually run.\n*/\nclass V1beta1CronJobSpec {\n static getAttributeTypeMap() {\n return V1beta1CronJobSpec.attributeTypeMap;\n }\n}\nV1beta1CronJobSpec.discriminator = undefined;\nV1beta1CronJobSpec.attributeTypeMap = [\n {\n \"name\": \"concurrencyPolicy\",\n \"baseName\": \"concurrencyPolicy\",\n \"type\": \"string\"\n },\n {\n \"name\": \"failedJobsHistoryLimit\",\n \"baseName\": \"failedJobsHistoryLimit\",\n \"type\": \"number\"\n },\n {\n \"name\": \"jobTemplate\",\n \"baseName\": \"jobTemplate\",\n \"type\": \"V1beta1JobTemplateSpec\"\n },\n {\n \"name\": \"schedule\",\n \"baseName\": \"schedule\",\n \"type\": \"string\"\n },\n {\n \"name\": \"startingDeadlineSeconds\",\n \"baseName\": \"startingDeadlineSeconds\",\n \"type\": \"number\"\n },\n {\n \"name\": \"successfulJobsHistoryLimit\",\n \"baseName\": \"successfulJobsHistoryLimit\",\n \"type\": \"number\"\n },\n {\n \"name\": \"suspend\",\n \"baseName\": \"suspend\",\n \"type\": \"boolean\"\n }\n];\nexports.V1beta1CronJobSpec = V1beta1CronJobSpec;\n/**\n* CronJobStatus represents the current state of a cron job.\n*/\nclass V1beta1CronJobStatus {\n static getAttributeTypeMap() {\n return V1beta1CronJobStatus.attributeTypeMap;\n }\n}\nV1beta1CronJobStatus.discriminator = undefined;\nV1beta1CronJobStatus.attributeTypeMap = [\n {\n \"name\": \"active\",\n \"baseName\": \"active\",\n \"type\": \"Array\"\n },\n {\n \"name\": \"lastScheduleTime\",\n \"baseName\": \"lastScheduleTime\",\n \"type\": \"Date\"\n }\n];\nexports.V1beta1CronJobStatus = V1beta1CronJobStatus;\n/**\n* CustomResourceColumnDefinition specifies a column for server side printing.\n*/\nclass V1beta1CustomResourceColumnDefinition {\n static getAttributeTypeMap() {\n return V1beta1CustomResourceColumnDefinition.attributeTypeMap;\n }\n}\nV1beta1CustomResourceColumnDefinition.discriminator = undefined;\nV1beta1CustomResourceColumnDefinition.attributeTypeMap = [\n {\n \"name\": \"jSONPath\",\n \"baseName\": \"JSONPath\",\n \"type\": \"string\"\n },\n {\n \"name\": \"description\",\n \"baseName\": \"description\",\n \"type\": \"string\"\n },\n {\n \"name\": \"format\",\n \"baseName\": \"format\",\n \"type\": \"string\"\n },\n {\n \"name\": \"name\",\n \"baseName\": \"name\",\n \"type\": \"string\"\n },\n {\n \"name\": \"priority\",\n \"baseName\": \"priority\",\n \"type\": \"number\"\n },\n {\n \"name\": \"type\",\n \"baseName\": \"type\",\n \"type\": \"string\"\n }\n];\nexports.V1beta1CustomResourceColumnDefinition = V1beta1CustomResourceColumnDefinition;\n/**\n* CustomResourceConversion describes how to convert different versions of a CR.\n*/\nclass V1beta1CustomResourceConversion {\n static getAttributeTypeMap() {\n return V1beta1CustomResourceConversion.attributeTypeMap;\n }\n}\nV1beta1CustomResourceConversion.discriminator = undefined;\nV1beta1CustomResourceConversion.attributeTypeMap = [\n {\n \"name\": \"strategy\",\n \"baseName\": \"strategy\",\n \"type\": \"string\"\n },\n {\n \"name\": \"webhookClientConfig\",\n \"baseName\": \"webhookClientConfig\",\n \"type\": \"ApiextensionsV1beta1WebhookClientConfig\"\n }\n];\nexports.V1beta1CustomResourceConversion = V1beta1CustomResourceConversion;\n/**\n* CustomResourceDefinition represents a resource that should be exposed on the API server. Its name MUST be in the format <.spec.name>.<.spec.group>.\n*/\nclass V1beta1CustomResourceDefinition {\n static getAttributeTypeMap() {\n return V1beta1CustomResourceDefinition.attributeTypeMap;\n }\n}\nV1beta1CustomResourceDefinition.discriminator = undefined;\nV1beta1CustomResourceDefinition.attributeTypeMap = [\n {\n \"name\": \"apiVersion\",\n \"baseName\": \"apiVersion\",\n \"type\": \"string\"\n },\n {\n \"name\": \"kind\",\n \"baseName\": \"kind\",\n \"type\": \"string\"\n },\n {\n \"name\": \"metadata\",\n \"baseName\": \"metadata\",\n \"type\": \"V1ObjectMeta\"\n },\n {\n \"name\": \"spec\",\n \"baseName\": \"spec\",\n \"type\": \"V1beta1CustomResourceDefinitionSpec\"\n },\n {\n \"name\": \"status\",\n \"baseName\": \"status\",\n \"type\": \"V1beta1CustomResourceDefinitionStatus\"\n }\n];\nexports.V1beta1CustomResourceDefinition = V1beta1CustomResourceDefinition;\n/**\n* CustomResourceDefinitionCondition contains details for the current condition of this pod.\n*/\nclass V1beta1CustomResourceDefinitionCondition {\n static getAttributeTypeMap() {\n return V1beta1CustomResourceDefinitionCondition.attributeTypeMap;\n }\n}\nV1beta1CustomResourceDefinitionCondition.discriminator = undefined;\nV1beta1CustomResourceDefinitionCondition.attributeTypeMap = [\n {\n \"name\": \"lastTransitionTime\",\n \"baseName\": \"lastTransitionTime\",\n \"type\": \"Date\"\n },\n {\n \"name\": \"message\",\n \"baseName\": \"message\",\n \"type\": \"string\"\n },\n {\n \"name\": \"reason\",\n \"baseName\": \"reason\",\n \"type\": \"string\"\n },\n {\n \"name\": \"status\",\n \"baseName\": \"status\",\n \"type\": \"string\"\n },\n {\n \"name\": \"type\",\n \"baseName\": \"type\",\n \"type\": \"string\"\n }\n];\nexports.V1beta1CustomResourceDefinitionCondition = V1beta1CustomResourceDefinitionCondition;\n/**\n* CustomResourceDefinitionList is a list of CustomResourceDefinition objects.\n*/\nclass V1beta1CustomResourceDefinitionList {\n static getAttributeTypeMap() {\n return V1beta1CustomResourceDefinitionList.attributeTypeMap;\n }\n}\nV1beta1CustomResourceDefinitionList.discriminator = undefined;\nV1beta1CustomResourceDefinitionList.attributeTypeMap = [\n {\n \"name\": \"apiVersion\",\n \"baseName\": \"apiVersion\",\n \"type\": \"string\"\n },\n {\n \"name\": \"items\",\n \"baseName\": \"items\",\n \"type\": \"Array\"\n },\n {\n \"name\": \"kind\",\n \"baseName\": \"kind\",\n \"type\": \"string\"\n },\n {\n \"name\": \"metadata\",\n \"baseName\": \"metadata\",\n \"type\": \"V1ListMeta\"\n }\n];\nexports.V1beta1CustomResourceDefinitionList = V1beta1CustomResourceDefinitionList;\n/**\n* CustomResourceDefinitionNames indicates the names to serve this CustomResourceDefinition\n*/\nclass V1beta1CustomResourceDefinitionNames {\n static getAttributeTypeMap() {\n return V1beta1CustomResourceDefinitionNames.attributeTypeMap;\n }\n}\nV1beta1CustomResourceDefinitionNames.discriminator = undefined;\nV1beta1CustomResourceDefinitionNames.attributeTypeMap = [\n {\n \"name\": \"categories\",\n \"baseName\": \"categories\",\n \"type\": \"Array\"\n },\n {\n \"name\": \"kind\",\n \"baseName\": \"kind\",\n \"type\": \"string\"\n },\n {\n \"name\": \"listKind\",\n \"baseName\": \"listKind\",\n \"type\": \"string\"\n },\n {\n \"name\": \"plural\",\n \"baseName\": \"plural\",\n \"type\": \"string\"\n },\n {\n \"name\": \"shortNames\",\n \"baseName\": \"shortNames\",\n \"type\": \"Array\"\n },\n {\n \"name\": \"singular\",\n \"baseName\": \"singular\",\n \"type\": \"string\"\n }\n];\nexports.V1beta1CustomResourceDefinitionNames = V1beta1CustomResourceDefinitionNames;\n/**\n* CustomResourceDefinitionSpec describes how a user wants their resource to appear\n*/\nclass V1beta1CustomResourceDefinitionSpec {\n static getAttributeTypeMap() {\n return V1beta1CustomResourceDefinitionSpec.attributeTypeMap;\n }\n}\nV1beta1CustomResourceDefinitionSpec.discriminator = undefined;\nV1beta1CustomResourceDefinitionSpec.attributeTypeMap = [\n {\n \"name\": \"additionalPrinterColumns\",\n \"baseName\": \"additionalPrinterColumns\",\n \"type\": \"Array\"\n },\n {\n \"name\": \"conversion\",\n \"baseName\": \"conversion\",\n \"type\": \"V1beta1CustomResourceConversion\"\n },\n {\n \"name\": \"group\",\n \"baseName\": \"group\",\n \"type\": \"string\"\n },\n {\n \"name\": \"names\",\n \"baseName\": \"names\",\n \"type\": \"V1beta1CustomResourceDefinitionNames\"\n },\n {\n \"name\": \"scope\",\n \"baseName\": \"scope\",\n \"type\": \"string\"\n },\n {\n \"name\": \"subresources\",\n \"baseName\": \"subresources\",\n \"type\": \"V1beta1CustomResourceSubresources\"\n },\n {\n \"name\": \"validation\",\n \"baseName\": \"validation\",\n \"type\": \"V1beta1CustomResourceValidation\"\n },\n {\n \"name\": \"version\",\n \"baseName\": \"version\",\n \"type\": \"string\"\n },\n {\n \"name\": \"versions\",\n \"baseName\": \"versions\",\n \"type\": \"Array\"\n }\n];\nexports.V1beta1CustomResourceDefinitionSpec = V1beta1CustomResourceDefinitionSpec;\n/**\n* CustomResourceDefinitionStatus indicates the state of the CustomResourceDefinition\n*/\nclass V1beta1CustomResourceDefinitionStatus {\n static getAttributeTypeMap() {\n return V1beta1CustomResourceDefinitionStatus.attributeTypeMap;\n }\n}\nV1beta1CustomResourceDefinitionStatus.discriminator = undefined;\nV1beta1CustomResourceDefinitionStatus.attributeTypeMap = [\n {\n \"name\": \"acceptedNames\",\n \"baseName\": \"acceptedNames\",\n \"type\": \"V1beta1CustomResourceDefinitionNames\"\n },\n {\n \"name\": \"conditions\",\n \"baseName\": \"conditions\",\n \"type\": \"Array\"\n },\n {\n \"name\": \"storedVersions\",\n \"baseName\": \"storedVersions\",\n \"type\": \"Array\"\n }\n];\nexports.V1beta1CustomResourceDefinitionStatus = V1beta1CustomResourceDefinitionStatus;\n/**\n* CustomResourceDefinitionVersion describes a version for CRD.\n*/\nclass V1beta1CustomResourceDefinitionVersion {\n static getAttributeTypeMap() {\n return V1beta1CustomResourceDefinitionVersion.attributeTypeMap;\n }\n}\nV1beta1CustomResourceDefinitionVersion.discriminator = undefined;\nV1beta1CustomResourceDefinitionVersion.attributeTypeMap = [\n {\n \"name\": \"additionalPrinterColumns\",\n \"baseName\": \"additionalPrinterColumns\",\n \"type\": \"Array\"\n },\n {\n \"name\": \"name\",\n \"baseName\": \"name\",\n \"type\": \"string\"\n },\n {\n \"name\": \"schema\",\n \"baseName\": \"schema\",\n \"type\": \"V1beta1CustomResourceValidation\"\n },\n {\n \"name\": \"served\",\n \"baseName\": \"served\",\n \"type\": \"boolean\"\n },\n {\n \"name\": \"storage\",\n \"baseName\": \"storage\",\n \"type\": \"boolean\"\n },\n {\n \"name\": \"subresources\",\n \"baseName\": \"subresources\",\n \"type\": \"V1beta1CustomResourceSubresources\"\n }\n];\nexports.V1beta1CustomResourceDefinitionVersion = V1beta1CustomResourceDefinitionVersion;\n/**\n* CustomResourceSubresourceScale defines how to serve the scale subresource for CustomResources.\n*/\nclass V1beta1CustomResourceSubresourceScale {\n static getAttributeTypeMap() {\n return V1beta1CustomResourceSubresourceScale.attributeTypeMap;\n }\n}\nV1beta1CustomResourceSubresourceScale.discriminator = undefined;\nV1beta1CustomResourceSubresourceScale.attributeTypeMap = [\n {\n \"name\": \"labelSelectorPath\",\n \"baseName\": \"labelSelectorPath\",\n \"type\": \"string\"\n },\n {\n \"name\": \"specReplicasPath\",\n \"baseName\": \"specReplicasPath\",\n \"type\": \"string\"\n },\n {\n \"name\": \"statusReplicasPath\",\n \"baseName\": \"statusReplicasPath\",\n \"type\": \"string\"\n }\n];\nexports.V1beta1CustomResourceSubresourceScale = V1beta1CustomResourceSubresourceScale;\n/**\n* CustomResourceSubresources defines the status and scale subresources for CustomResources.\n*/\nclass V1beta1CustomResourceSubresources {\n static getAttributeTypeMap() {\n return V1beta1CustomResourceSubresources.attributeTypeMap;\n }\n}\nV1beta1CustomResourceSubresources.discriminator = undefined;\nV1beta1CustomResourceSubresources.attributeTypeMap = [\n {\n \"name\": \"scale\",\n \"baseName\": \"scale\",\n \"type\": \"V1beta1CustomResourceSubresourceScale\"\n },\n {\n \"name\": \"status\",\n \"baseName\": \"status\",\n \"type\": \"any\"\n }\n];\nexports.V1beta1CustomResourceSubresources = V1beta1CustomResourceSubresources;\n/**\n* CustomResourceValidation is a list of validation methods for CustomResources.\n*/\nclass V1beta1CustomResourceValidation {\n static getAttributeTypeMap() {\n return V1beta1CustomResourceValidation.attributeTypeMap;\n }\n}\nV1beta1CustomResourceValidation.discriminator = undefined;\nV1beta1CustomResourceValidation.attributeTypeMap = [\n {\n \"name\": \"openAPIV3Schema\",\n \"baseName\": \"openAPIV3Schema\",\n \"type\": \"V1beta1JSONSchemaProps\"\n }\n];\nexports.V1beta1CustomResourceValidation = V1beta1CustomResourceValidation;\n/**\n* 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.\n*/\nclass V1beta1DaemonSet {\n static getAttributeTypeMap() {\n return V1beta1DaemonSet.attributeTypeMap;\n }\n}\nV1beta1DaemonSet.discriminator = undefined;\nV1beta1DaemonSet.attributeTypeMap = [\n {\n \"name\": \"apiVersion\",\n \"baseName\": \"apiVersion\",\n \"type\": \"string\"\n },\n {\n \"name\": \"kind\",\n \"baseName\": \"kind\",\n \"type\": \"string\"\n },\n {\n \"name\": \"metadata\",\n \"baseName\": \"metadata\",\n \"type\": \"V1ObjectMeta\"\n },\n {\n \"name\": \"spec\",\n \"baseName\": \"spec\",\n \"type\": \"V1beta1DaemonSetSpec\"\n },\n {\n \"name\": \"status\",\n \"baseName\": \"status\",\n \"type\": \"V1beta1DaemonSetStatus\"\n }\n];\nexports.V1beta1DaemonSet = V1beta1DaemonSet;\n/**\n* DaemonSetCondition describes the state of a DaemonSet at a certain point.\n*/\nclass V1beta1DaemonSetCondition {\n static getAttributeTypeMap() {\n return V1beta1DaemonSetCondition.attributeTypeMap;\n }\n}\nV1beta1DaemonSetCondition.discriminator = undefined;\nV1beta1DaemonSetCondition.attributeTypeMap = [\n {\n \"name\": \"lastTransitionTime\",\n \"baseName\": \"lastTransitionTime\",\n \"type\": \"Date\"\n },\n {\n \"name\": \"message\",\n \"baseName\": \"message\",\n \"type\": \"string\"\n },\n {\n \"name\": \"reason\",\n \"baseName\": \"reason\",\n \"type\": \"string\"\n },\n {\n \"name\": \"status\",\n \"baseName\": \"status\",\n \"type\": \"string\"\n },\n {\n \"name\": \"type\",\n \"baseName\": \"type\",\n \"type\": \"string\"\n }\n];\nexports.V1beta1DaemonSetCondition = V1beta1DaemonSetCondition;\n/**\n* DaemonSetList is a collection of daemon sets.\n*/\nclass V1beta1DaemonSetList {\n static getAttributeTypeMap() {\n return V1beta1DaemonSetList.attributeTypeMap;\n }\n}\nV1beta1DaemonSetList.discriminator = undefined;\nV1beta1DaemonSetList.attributeTypeMap = [\n {\n \"name\": \"apiVersion\",\n \"baseName\": \"apiVersion\",\n \"type\": \"string\"\n },\n {\n \"name\": \"items\",\n \"baseName\": \"items\",\n \"type\": \"Array\"\n },\n {\n \"name\": \"kind\",\n \"baseName\": \"kind\",\n \"type\": \"string\"\n },\n {\n \"name\": \"metadata\",\n \"baseName\": \"metadata\",\n \"type\": \"V1ListMeta\"\n }\n];\nexports.V1beta1DaemonSetList = V1beta1DaemonSetList;\n/**\n* DaemonSetSpec is the specification of a daemon set.\n*/\nclass V1beta1DaemonSetSpec {\n static getAttributeTypeMap() {\n return V1beta1DaemonSetSpec.attributeTypeMap;\n }\n}\nV1beta1DaemonSetSpec.discriminator = undefined;\nV1beta1DaemonSetSpec.attributeTypeMap = [\n {\n \"name\": \"minReadySeconds\",\n \"baseName\": \"minReadySeconds\",\n \"type\": \"number\"\n },\n {\n \"name\": \"revisionHistoryLimit\",\n \"baseName\": \"revisionHistoryLimit\",\n \"type\": \"number\"\n },\n {\n \"name\": \"selector\",\n \"baseName\": \"selector\",\n \"type\": \"V1LabelSelector\"\n },\n {\n \"name\": \"template\",\n \"baseName\": \"template\",\n \"type\": \"V1PodTemplateSpec\"\n },\n {\n \"name\": \"templateGeneration\",\n \"baseName\": \"templateGeneration\",\n \"type\": \"number\"\n },\n {\n \"name\": \"updateStrategy\",\n \"baseName\": \"updateStrategy\",\n \"type\": \"V1beta1DaemonSetUpdateStrategy\"\n }\n];\nexports.V1beta1DaemonSetSpec = V1beta1DaemonSetSpec;\n/**\n* DaemonSetStatus represents the current status of a daemon set.\n*/\nclass V1beta1DaemonSetStatus {\n static getAttributeTypeMap() {\n return V1beta1DaemonSetStatus.attributeTypeMap;\n }\n}\nV1beta1DaemonSetStatus.discriminator = undefined;\nV1beta1DaemonSetStatus.attributeTypeMap = [\n {\n \"name\": \"collisionCount\",\n \"baseName\": \"collisionCount\",\n \"type\": \"number\"\n },\n {\n \"name\": \"conditions\",\n \"baseName\": \"conditions\",\n \"type\": \"Array\"\n },\n {\n \"name\": \"currentNumberScheduled\",\n \"baseName\": \"currentNumberScheduled\",\n \"type\": \"number\"\n },\n {\n \"name\": \"desiredNumberScheduled\",\n \"baseName\": \"desiredNumberScheduled\",\n \"type\": \"number\"\n },\n {\n \"name\": \"numberAvailable\",\n \"baseName\": \"numberAvailable\",\n \"type\": \"number\"\n },\n {\n \"name\": \"numberMisscheduled\",\n \"baseName\": \"numberMisscheduled\",\n \"type\": \"number\"\n },\n {\n \"name\": \"numberReady\",\n \"baseName\": \"numberReady\",\n \"type\": \"number\"\n },\n {\n \"name\": \"numberUnavailable\",\n \"baseName\": \"numberUnavailable\",\n \"type\": \"number\"\n },\n {\n \"name\": \"observedGeneration\",\n \"baseName\": \"observedGeneration\",\n \"type\": \"number\"\n },\n {\n \"name\": \"updatedNumberScheduled\",\n \"baseName\": \"updatedNumberScheduled\",\n \"type\": \"number\"\n }\n];\nexports.V1beta1DaemonSetStatus = V1beta1DaemonSetStatus;\nclass V1beta1DaemonSetUpdateStrategy {\n static getAttributeTypeMap() {\n return V1beta1DaemonSetUpdateStrategy.attributeTypeMap;\n }\n}\nV1beta1DaemonSetUpdateStrategy.discriminator = undefined;\nV1beta1DaemonSetUpdateStrategy.attributeTypeMap = [\n {\n \"name\": \"rollingUpdate\",\n \"baseName\": \"rollingUpdate\",\n \"type\": \"V1beta1RollingUpdateDaemonSet\"\n },\n {\n \"name\": \"type\",\n \"baseName\": \"type\",\n \"type\": \"string\"\n }\n];\nexports.V1beta1DaemonSetUpdateStrategy = V1beta1DaemonSetUpdateStrategy;\n/**\n* Event is a report of an event somewhere in the cluster. It generally denotes some state change in the system.\n*/\nclass V1beta1Event {\n static getAttributeTypeMap() {\n return V1beta1Event.attributeTypeMap;\n }\n}\nV1beta1Event.discriminator = undefined;\nV1beta1Event.attributeTypeMap = [\n {\n \"name\": \"action\",\n \"baseName\": \"action\",\n \"type\": \"string\"\n },\n {\n \"name\": \"apiVersion\",\n \"baseName\": \"apiVersion\",\n \"type\": \"string\"\n },\n {\n \"name\": \"deprecatedCount\",\n \"baseName\": \"deprecatedCount\",\n \"type\": \"number\"\n },\n {\n \"name\": \"deprecatedFirstTimestamp\",\n \"baseName\": \"deprecatedFirstTimestamp\",\n \"type\": \"Date\"\n },\n {\n \"name\": \"deprecatedLastTimestamp\",\n \"baseName\": \"deprecatedLastTimestamp\",\n \"type\": \"Date\"\n },\n {\n \"name\": \"deprecatedSource\",\n \"baseName\": \"deprecatedSource\",\n \"type\": \"V1EventSource\"\n },\n {\n \"name\": \"eventTime\",\n \"baseName\": \"eventTime\",\n \"type\": \"Date\"\n },\n {\n \"name\": \"kind\",\n \"baseName\": \"kind\",\n \"type\": \"string\"\n },\n {\n \"name\": \"metadata\",\n \"baseName\": \"metadata\",\n \"type\": \"V1ObjectMeta\"\n },\n {\n \"name\": \"note\",\n \"baseName\": \"note\",\n \"type\": \"string\"\n },\n {\n \"name\": \"reason\",\n \"baseName\": \"reason\",\n \"type\": \"string\"\n },\n {\n \"name\": \"regarding\",\n \"baseName\": \"regarding\",\n \"type\": \"V1ObjectReference\"\n },\n {\n \"name\": \"related\",\n \"baseName\": \"related\",\n \"type\": \"V1ObjectReference\"\n },\n {\n \"name\": \"reportingController\",\n \"baseName\": \"reportingController\",\n \"type\": \"string\"\n },\n {\n \"name\": \"reportingInstance\",\n \"baseName\": \"reportingInstance\",\n \"type\": \"string\"\n },\n {\n \"name\": \"series\",\n \"baseName\": \"series\",\n \"type\": \"V1beta1EventSeries\"\n },\n {\n \"name\": \"type\",\n \"baseName\": \"type\",\n \"type\": \"string\"\n }\n];\nexports.V1beta1Event = V1beta1Event;\n/**\n* EventList is a list of Event objects.\n*/\nclass V1beta1EventList {\n static getAttributeTypeMap() {\n return V1beta1EventList.attributeTypeMap;\n }\n}\nV1beta1EventList.discriminator = undefined;\nV1beta1EventList.attributeTypeMap = [\n {\n \"name\": \"apiVersion\",\n \"baseName\": \"apiVersion\",\n \"type\": \"string\"\n },\n {\n \"name\": \"items\",\n \"baseName\": \"items\",\n \"type\": \"Array\"\n },\n {\n \"name\": \"kind\",\n \"baseName\": \"kind\",\n \"type\": \"string\"\n },\n {\n \"name\": \"metadata\",\n \"baseName\": \"metadata\",\n \"type\": \"V1ListMeta\"\n }\n];\nexports.V1beta1EventList = V1beta1EventList;\n/**\n* EventSeries contain information on series of events, i.e. thing that was/is happening continuously for some time.\n*/\nclass V1beta1EventSeries {\n static getAttributeTypeMap() {\n return V1beta1EventSeries.attributeTypeMap;\n }\n}\nV1beta1EventSeries.discriminator = undefined;\nV1beta1EventSeries.attributeTypeMap = [\n {\n \"name\": \"count\",\n \"baseName\": \"count\",\n \"type\": \"number\"\n },\n {\n \"name\": \"lastObservedTime\",\n \"baseName\": \"lastObservedTime\",\n \"type\": \"Date\"\n },\n {\n \"name\": \"state\",\n \"baseName\": \"state\",\n \"type\": \"string\"\n }\n];\nexports.V1beta1EventSeries = V1beta1EventSeries;\n/**\n* Eviction evicts a pod from its node subject to certain policies and safety constraints. This is a subresource of Pod. A request to cause such an eviction is created by POSTing to .../pods//evictions.\n*/\nclass V1beta1Eviction {\n static getAttributeTypeMap() {\n return V1beta1Eviction.attributeTypeMap;\n }\n}\nV1beta1Eviction.discriminator = undefined;\nV1beta1Eviction.attributeTypeMap = [\n {\n \"name\": \"apiVersion\",\n \"baseName\": \"apiVersion\",\n \"type\": \"string\"\n },\n {\n \"name\": \"deleteOptions\",\n \"baseName\": \"deleteOptions\",\n \"type\": \"V1DeleteOptions\"\n },\n {\n \"name\": \"kind\",\n \"baseName\": \"kind\",\n \"type\": \"string\"\n },\n {\n \"name\": \"metadata\",\n \"baseName\": \"metadata\",\n \"type\": \"V1ObjectMeta\"\n }\n];\nexports.V1beta1Eviction = V1beta1Eviction;\n/**\n* ExternalDocumentation allows referencing an external resource for extended documentation.\n*/\nclass V1beta1ExternalDocumentation {\n static getAttributeTypeMap() {\n return V1beta1ExternalDocumentation.attributeTypeMap;\n }\n}\nV1beta1ExternalDocumentation.discriminator = undefined;\nV1beta1ExternalDocumentation.attributeTypeMap = [\n {\n \"name\": \"description\",\n \"baseName\": \"description\",\n \"type\": \"string\"\n },\n {\n \"name\": \"url\",\n \"baseName\": \"url\",\n \"type\": \"string\"\n }\n];\nexports.V1beta1ExternalDocumentation = V1beta1ExternalDocumentation;\n/**\n* HTTPIngressPath associates a path regex with a backend. Incoming urls matching the path are forwarded to the backend.\n*/\nclass V1beta1HTTPIngressPath {\n static getAttributeTypeMap() {\n return V1beta1HTTPIngressPath.attributeTypeMap;\n }\n}\nV1beta1HTTPIngressPath.discriminator = undefined;\nV1beta1HTTPIngressPath.attributeTypeMap = [\n {\n \"name\": \"backend\",\n \"baseName\": \"backend\",\n \"type\": \"V1beta1IngressBackend\"\n },\n {\n \"name\": \"path\",\n \"baseName\": \"path\",\n \"type\": \"string\"\n }\n];\nexports.V1beta1HTTPIngressPath = V1beta1HTTPIngressPath;\n/**\n* HTTPIngressRuleValue is a list of http selectors pointing to backends. In the example: http:///? -> backend where where parts of the url correspond to RFC 3986, this resource will be used to match against everything after the last '/' and before the first '?' or '#'.\n*/\nclass V1beta1HTTPIngressRuleValue {\n static getAttributeTypeMap() {\n return V1beta1HTTPIngressRuleValue.attributeTypeMap;\n }\n}\nV1beta1HTTPIngressRuleValue.discriminator = undefined;\nV1beta1HTTPIngressRuleValue.attributeTypeMap = [\n {\n \"name\": \"paths\",\n \"baseName\": \"paths\",\n \"type\": \"Array\"\n }\n];\nexports.V1beta1HTTPIngressRuleValue = V1beta1HTTPIngressRuleValue;\n/**\n* 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.\n*/\nclass V1beta1IPBlock {\n static getAttributeTypeMap() {\n return V1beta1IPBlock.attributeTypeMap;\n }\n}\nV1beta1IPBlock.discriminator = undefined;\nV1beta1IPBlock.attributeTypeMap = [\n {\n \"name\": \"cidr\",\n \"baseName\": \"cidr\",\n \"type\": \"string\"\n },\n {\n \"name\": \"except\",\n \"baseName\": \"except\",\n \"type\": \"Array\"\n }\n];\nexports.V1beta1IPBlock = V1beta1IPBlock;\n/**\n* Ingress is a collection of rules that allow inbound connections to reach the endpoints defined by a backend. An Ingress can be configured to give services externally-reachable urls, load balance traffic, terminate SSL, offer name based virtual hosting etc.\n*/\nclass V1beta1Ingress {\n static getAttributeTypeMap() {\n return V1beta1Ingress.attributeTypeMap;\n }\n}\nV1beta1Ingress.discriminator = undefined;\nV1beta1Ingress.attributeTypeMap = [\n {\n \"name\": \"apiVersion\",\n \"baseName\": \"apiVersion\",\n \"type\": \"string\"\n },\n {\n \"name\": \"kind\",\n \"baseName\": \"kind\",\n \"type\": \"string\"\n },\n {\n \"name\": \"metadata\",\n \"baseName\": \"metadata\",\n \"type\": \"V1ObjectMeta\"\n },\n {\n \"name\": \"spec\",\n \"baseName\": \"spec\",\n \"type\": \"V1beta1IngressSpec\"\n },\n {\n \"name\": \"status\",\n \"baseName\": \"status\",\n \"type\": \"V1beta1IngressStatus\"\n }\n];\nexports.V1beta1Ingress = V1beta1Ingress;\n/**\n* IngressBackend describes all endpoints for a given service and port.\n*/\nclass V1beta1IngressBackend {\n static getAttributeTypeMap() {\n return V1beta1IngressBackend.attributeTypeMap;\n }\n}\nV1beta1IngressBackend.discriminator = undefined;\nV1beta1IngressBackend.attributeTypeMap = [\n {\n \"name\": \"serviceName\",\n \"baseName\": \"serviceName\",\n \"type\": \"string\"\n },\n {\n \"name\": \"servicePort\",\n \"baseName\": \"servicePort\",\n \"type\": \"any\"\n }\n];\nexports.V1beta1IngressBackend = V1beta1IngressBackend;\n/**\n* IngressList is a collection of Ingress.\n*/\nclass V1beta1IngressList {\n static getAttributeTypeMap() {\n return V1beta1IngressList.attributeTypeMap;\n }\n}\nV1beta1IngressList.discriminator = undefined;\nV1beta1IngressList.attributeTypeMap = [\n {\n \"name\": \"apiVersion\",\n \"baseName\": \"apiVersion\",\n \"type\": \"string\"\n },\n {\n \"name\": \"items\",\n \"baseName\": \"items\",\n \"type\": \"Array\"\n },\n {\n \"name\": \"kind\",\n \"baseName\": \"kind\",\n \"type\": \"string\"\n },\n {\n \"name\": \"metadata\",\n \"baseName\": \"metadata\",\n \"type\": \"V1ListMeta\"\n }\n];\nexports.V1beta1IngressList = V1beta1IngressList;\n/**\n* IngressRule represents the rules mapping the paths under a specified host to the related backend services. Incoming requests are first evaluated for a host match, then routed to the backend associated with the matching IngressRuleValue.\n*/\nclass V1beta1IngressRule {\n static getAttributeTypeMap() {\n return V1beta1IngressRule.attributeTypeMap;\n }\n}\nV1beta1IngressRule.discriminator = undefined;\nV1beta1IngressRule.attributeTypeMap = [\n {\n \"name\": \"host\",\n \"baseName\": \"host\",\n \"type\": \"string\"\n },\n {\n \"name\": \"http\",\n \"baseName\": \"http\",\n \"type\": \"V1beta1HTTPIngressRuleValue\"\n }\n];\nexports.V1beta1IngressRule = V1beta1IngressRule;\n/**\n* IngressSpec describes the Ingress the user wishes to exist.\n*/\nclass V1beta1IngressSpec {\n static getAttributeTypeMap() {\n return V1beta1IngressSpec.attributeTypeMap;\n }\n}\nV1beta1IngressSpec.discriminator = undefined;\nV1beta1IngressSpec.attributeTypeMap = [\n {\n \"name\": \"backend\",\n \"baseName\": \"backend\",\n \"type\": \"V1beta1IngressBackend\"\n },\n {\n \"name\": \"rules\",\n \"baseName\": \"rules\",\n \"type\": \"Array\"\n },\n {\n \"name\": \"tls\",\n \"baseName\": \"tls\",\n \"type\": \"Array\"\n }\n];\nexports.V1beta1IngressSpec = V1beta1IngressSpec;\n/**\n* IngressStatus describe the current state of the Ingress.\n*/\nclass V1beta1IngressStatus {\n static getAttributeTypeMap() {\n return V1beta1IngressStatus.attributeTypeMap;\n }\n}\nV1beta1IngressStatus.discriminator = undefined;\nV1beta1IngressStatus.attributeTypeMap = [\n {\n \"name\": \"loadBalancer\",\n \"baseName\": \"loadBalancer\",\n \"type\": \"V1LoadBalancerStatus\"\n }\n];\nexports.V1beta1IngressStatus = V1beta1IngressStatus;\n/**\n* IngressTLS describes the transport layer security associated with an Ingress.\n*/\nclass V1beta1IngressTLS {\n static getAttributeTypeMap() {\n return V1beta1IngressTLS.attributeTypeMap;\n }\n}\nV1beta1IngressTLS.discriminator = undefined;\nV1beta1IngressTLS.attributeTypeMap = [\n {\n \"name\": \"hosts\",\n \"baseName\": \"hosts\",\n \"type\": \"Array\"\n },\n {\n \"name\": \"secretName\",\n \"baseName\": \"secretName\",\n \"type\": \"string\"\n }\n];\nexports.V1beta1IngressTLS = V1beta1IngressTLS;\n/**\n* JSONSchemaProps is a JSON-Schema following Specification Draft 4 (http://json-schema.org/).\n*/\nclass V1beta1JSONSchemaProps {\n static getAttributeTypeMap() {\n return V1beta1JSONSchemaProps.attributeTypeMap;\n }\n}\nV1beta1JSONSchemaProps.discriminator = undefined;\nV1beta1JSONSchemaProps.attributeTypeMap = [\n {\n \"name\": \"ref\",\n \"baseName\": \"$ref\",\n \"type\": \"string\"\n },\n {\n \"name\": \"schema\",\n \"baseName\": \"$schema\",\n \"type\": \"string\"\n },\n {\n \"name\": \"additionalItems\",\n \"baseName\": \"additionalItems\",\n \"type\": \"any\"\n },\n {\n \"name\": \"additionalProperties\",\n \"baseName\": \"additionalProperties\",\n \"type\": \"any\"\n },\n {\n \"name\": \"allOf\",\n \"baseName\": \"allOf\",\n \"type\": \"Array\"\n },\n {\n \"name\": \"anyOf\",\n \"baseName\": \"anyOf\",\n \"type\": \"Array\"\n },\n {\n \"name\": \"_default\",\n \"baseName\": \"default\",\n \"type\": \"any\"\n },\n {\n \"name\": \"definitions\",\n \"baseName\": \"definitions\",\n \"type\": \"{ [key: string]: V1beta1JSONSchemaProps; }\"\n },\n {\n \"name\": \"dependencies\",\n \"baseName\": \"dependencies\",\n \"type\": \"{ [key: string]: any; }\"\n },\n {\n \"name\": \"description\",\n \"baseName\": \"description\",\n \"type\": \"string\"\n },\n {\n \"name\": \"_enum\",\n \"baseName\": \"enum\",\n \"type\": \"Array\"\n },\n {\n \"name\": \"example\",\n \"baseName\": \"example\",\n \"type\": \"any\"\n },\n {\n \"name\": \"exclusiveMaximum\",\n \"baseName\": \"exclusiveMaximum\",\n \"type\": \"boolean\"\n },\n {\n \"name\": \"exclusiveMinimum\",\n \"baseName\": \"exclusiveMinimum\",\n \"type\": \"boolean\"\n },\n {\n \"name\": \"externalDocs\",\n \"baseName\": \"externalDocs\",\n \"type\": \"V1beta1ExternalDocumentation\"\n },\n {\n \"name\": \"format\",\n \"baseName\": \"format\",\n \"type\": \"string\"\n },\n {\n \"name\": \"id\",\n \"baseName\": \"id\",\n \"type\": \"string\"\n },\n {\n \"name\": \"items\",\n \"baseName\": \"items\",\n \"type\": \"any\"\n },\n {\n \"name\": \"maxItems\",\n \"baseName\": \"maxItems\",\n \"type\": \"number\"\n },\n {\n \"name\": \"maxLength\",\n \"baseName\": \"maxLength\",\n \"type\": \"number\"\n },\n {\n \"name\": \"maxProperties\",\n \"baseName\": \"maxProperties\",\n \"type\": \"number\"\n },\n {\n \"name\": \"maximum\",\n \"baseName\": \"maximum\",\n \"type\": \"number\"\n },\n {\n \"name\": \"minItems\",\n \"baseName\": \"minItems\",\n \"type\": \"number\"\n },\n {\n \"name\": \"minLength\",\n \"baseName\": \"minLength\",\n \"type\": \"number\"\n },\n {\n \"name\": \"minProperties\",\n \"baseName\": \"minProperties\",\n \"type\": \"number\"\n },\n {\n \"name\": \"minimum\",\n \"baseName\": \"minimum\",\n \"type\": \"number\"\n },\n {\n \"name\": \"multipleOf\",\n \"baseName\": \"multipleOf\",\n \"type\": \"number\"\n },\n {\n \"name\": \"not\",\n \"baseName\": \"not\",\n \"type\": \"V1beta1JSONSchemaProps\"\n },\n {\n \"name\": \"oneOf\",\n \"baseName\": \"oneOf\",\n \"type\": \"Array\"\n },\n {\n \"name\": \"pattern\",\n \"baseName\": \"pattern\",\n \"type\": \"string\"\n },\n {\n \"name\": \"patternProperties\",\n \"baseName\": \"patternProperties\",\n \"type\": \"{ [key: string]: V1beta1JSONSchemaProps; }\"\n },\n {\n \"name\": \"properties\",\n \"baseName\": \"properties\",\n \"type\": \"{ [key: string]: V1beta1JSONSchemaProps; }\"\n },\n {\n \"name\": \"required\",\n \"baseName\": \"required\",\n \"type\": \"Array\"\n },\n {\n \"name\": \"title\",\n \"baseName\": \"title\",\n \"type\": \"string\"\n },\n {\n \"name\": \"type\",\n \"baseName\": \"type\",\n \"type\": \"string\"\n },\n {\n \"name\": \"uniqueItems\",\n \"baseName\": \"uniqueItems\",\n \"type\": \"boolean\"\n }\n];\nexports.V1beta1JSONSchemaProps = V1beta1JSONSchemaProps;\n/**\n* JobTemplateSpec describes the data a Job should have when created from a template\n*/\nclass V1beta1JobTemplateSpec {\n static getAttributeTypeMap() {\n return V1beta1JobTemplateSpec.attributeTypeMap;\n }\n}\nV1beta1JobTemplateSpec.discriminator = undefined;\nV1beta1JobTemplateSpec.attributeTypeMap = [\n {\n \"name\": \"metadata\",\n \"baseName\": \"metadata\",\n \"type\": \"V1ObjectMeta\"\n },\n {\n \"name\": \"spec\",\n \"baseName\": \"spec\",\n \"type\": \"V1JobSpec\"\n }\n];\nexports.V1beta1JobTemplateSpec = V1beta1JobTemplateSpec;\n/**\n* Lease defines a lease concept.\n*/\nclass V1beta1Lease {\n static getAttributeTypeMap() {\n return V1beta1Lease.attributeTypeMap;\n }\n}\nV1beta1Lease.discriminator = undefined;\nV1beta1Lease.attributeTypeMap = [\n {\n \"name\": \"apiVersion\",\n \"baseName\": \"apiVersion\",\n \"type\": \"string\"\n },\n {\n \"name\": \"kind\",\n \"baseName\": \"kind\",\n \"type\": \"string\"\n },\n {\n \"name\": \"metadata\",\n \"baseName\": \"metadata\",\n \"type\": \"V1ObjectMeta\"\n },\n {\n \"name\": \"spec\",\n \"baseName\": \"spec\",\n \"type\": \"V1beta1LeaseSpec\"\n }\n];\nexports.V1beta1Lease = V1beta1Lease;\n/**\n* LeaseList is a list of Lease objects.\n*/\nclass V1beta1LeaseList {\n static getAttributeTypeMap() {\n return V1beta1LeaseList.attributeTypeMap;\n }\n}\nV1beta1LeaseList.discriminator = undefined;\nV1beta1LeaseList.attributeTypeMap = [\n {\n \"name\": \"apiVersion\",\n \"baseName\": \"apiVersion\",\n \"type\": \"string\"\n },\n {\n \"name\": \"items\",\n \"baseName\": \"items\",\n \"type\": \"Array\"\n },\n {\n \"name\": \"kind\",\n \"baseName\": \"kind\",\n \"type\": \"string\"\n },\n {\n \"name\": \"metadata\",\n \"baseName\": \"metadata\",\n \"type\": \"V1ListMeta\"\n }\n];\nexports.V1beta1LeaseList = V1beta1LeaseList;\n/**\n* LeaseSpec is a specification of a Lease.\n*/\nclass V1beta1LeaseSpec {\n static getAttributeTypeMap() {\n return V1beta1LeaseSpec.attributeTypeMap;\n }\n}\nV1beta1LeaseSpec.discriminator = undefined;\nV1beta1LeaseSpec.attributeTypeMap = [\n {\n \"name\": \"acquireTime\",\n \"baseName\": \"acquireTime\",\n \"type\": \"Date\"\n },\n {\n \"name\": \"holderIdentity\",\n \"baseName\": \"holderIdentity\",\n \"type\": \"string\"\n },\n {\n \"name\": \"leaseDurationSeconds\",\n \"baseName\": \"leaseDurationSeconds\",\n \"type\": \"number\"\n },\n {\n \"name\": \"leaseTransitions\",\n \"baseName\": \"leaseTransitions\",\n \"type\": \"number\"\n },\n {\n \"name\": \"renewTime\",\n \"baseName\": \"renewTime\",\n \"type\": \"Date\"\n }\n];\nexports.V1beta1LeaseSpec = V1beta1LeaseSpec;\n/**\n* LocalSubjectAccessReview checks whether or not a user or group can perform an action in a given namespace. Having a namespace scoped resource makes it much easier to grant namespace scoped policy that includes permissions checking.\n*/\nclass V1beta1LocalSubjectAccessReview {\n static getAttributeTypeMap() {\n return V1beta1LocalSubjectAccessReview.attributeTypeMap;\n }\n}\nV1beta1LocalSubjectAccessReview.discriminator = undefined;\nV1beta1LocalSubjectAccessReview.attributeTypeMap = [\n {\n \"name\": \"apiVersion\",\n \"baseName\": \"apiVersion\",\n \"type\": \"string\"\n },\n {\n \"name\": \"kind\",\n \"baseName\": \"kind\",\n \"type\": \"string\"\n },\n {\n \"name\": \"metadata\",\n \"baseName\": \"metadata\",\n \"type\": \"V1ObjectMeta\"\n },\n {\n \"name\": \"spec\",\n \"baseName\": \"spec\",\n \"type\": \"V1beta1SubjectAccessReviewSpec\"\n },\n {\n \"name\": \"status\",\n \"baseName\": \"status\",\n \"type\": \"V1beta1SubjectAccessReviewStatus\"\n }\n];\nexports.V1beta1LocalSubjectAccessReview = V1beta1LocalSubjectAccessReview;\n/**\n* MutatingWebhookConfiguration describes the configuration of and admission webhook that accept or reject and may change the object.\n*/\nclass V1beta1MutatingWebhookConfiguration {\n static getAttributeTypeMap() {\n return V1beta1MutatingWebhookConfiguration.attributeTypeMap;\n }\n}\nV1beta1MutatingWebhookConfiguration.discriminator = undefined;\nV1beta1MutatingWebhookConfiguration.attributeTypeMap = [\n {\n \"name\": \"apiVersion\",\n \"baseName\": \"apiVersion\",\n \"type\": \"string\"\n },\n {\n \"name\": \"kind\",\n \"baseName\": \"kind\",\n \"type\": \"string\"\n },\n {\n \"name\": \"metadata\",\n \"baseName\": \"metadata\",\n \"type\": \"V1ObjectMeta\"\n },\n {\n \"name\": \"webhooks\",\n \"baseName\": \"webhooks\",\n \"type\": \"Array\"\n }\n];\nexports.V1beta1MutatingWebhookConfiguration = V1beta1MutatingWebhookConfiguration;\n/**\n* MutatingWebhookConfigurationList is a list of MutatingWebhookConfiguration.\n*/\nclass V1beta1MutatingWebhookConfigurationList {\n static getAttributeTypeMap() {\n return V1beta1MutatingWebhookConfigurationList.attributeTypeMap;\n }\n}\nV1beta1MutatingWebhookConfigurationList.discriminator = undefined;\nV1beta1MutatingWebhookConfigurationList.attributeTypeMap = [\n {\n \"name\": \"apiVersion\",\n \"baseName\": \"apiVersion\",\n \"type\": \"string\"\n },\n {\n \"name\": \"items\",\n \"baseName\": \"items\",\n \"type\": \"Array\"\n },\n {\n \"name\": \"kind\",\n \"baseName\": \"kind\",\n \"type\": \"string\"\n },\n {\n \"name\": \"metadata\",\n \"baseName\": \"metadata\",\n \"type\": \"V1ListMeta\"\n }\n];\nexports.V1beta1MutatingWebhookConfigurationList = V1beta1MutatingWebhookConfigurationList;\n/**\n* 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\n*/\nclass V1beta1NetworkPolicy {\n static getAttributeTypeMap() {\n return V1beta1NetworkPolicy.attributeTypeMap;\n }\n}\nV1beta1NetworkPolicy.discriminator = undefined;\nV1beta1NetworkPolicy.attributeTypeMap = [\n {\n \"name\": \"apiVersion\",\n \"baseName\": \"apiVersion\",\n \"type\": \"string\"\n },\n {\n \"name\": \"kind\",\n \"baseName\": \"kind\",\n \"type\": \"string\"\n },\n {\n \"name\": \"metadata\",\n \"baseName\": \"metadata\",\n \"type\": \"V1ObjectMeta\"\n },\n {\n \"name\": \"spec\",\n \"baseName\": \"spec\",\n \"type\": \"V1beta1NetworkPolicySpec\"\n }\n];\nexports.V1beta1NetworkPolicy = V1beta1NetworkPolicy;\n/**\n* 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\n*/\nclass V1beta1NetworkPolicyEgressRule {\n static getAttributeTypeMap() {\n return V1beta1NetworkPolicyEgressRule.attributeTypeMap;\n }\n}\nV1beta1NetworkPolicyEgressRule.discriminator = undefined;\nV1beta1NetworkPolicyEgressRule.attributeTypeMap = [\n {\n \"name\": \"ports\",\n \"baseName\": \"ports\",\n \"type\": \"Array\"\n },\n {\n \"name\": \"to\",\n \"baseName\": \"to\",\n \"type\": \"Array\"\n }\n];\nexports.V1beta1NetworkPolicyEgressRule = V1beta1NetworkPolicyEgressRule;\n/**\n* 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.\n*/\nclass V1beta1NetworkPolicyIngressRule {\n static getAttributeTypeMap() {\n return V1beta1NetworkPolicyIngressRule.attributeTypeMap;\n }\n}\nV1beta1NetworkPolicyIngressRule.discriminator = undefined;\nV1beta1NetworkPolicyIngressRule.attributeTypeMap = [\n {\n \"name\": \"from\",\n \"baseName\": \"from\",\n \"type\": \"Array\"\n },\n {\n \"name\": \"ports\",\n \"baseName\": \"ports\",\n \"type\": \"Array\"\n }\n];\nexports.V1beta1NetworkPolicyIngressRule = V1beta1NetworkPolicyIngressRule;\n/**\n* DEPRECATED 1.9 - This group version of NetworkPolicyList is deprecated by networking/v1/NetworkPolicyList. Network Policy List is a list of NetworkPolicy objects.\n*/\nclass V1beta1NetworkPolicyList {\n static getAttributeTypeMap() {\n return V1beta1NetworkPolicyList.attributeTypeMap;\n }\n}\nV1beta1NetworkPolicyList.discriminator = undefined;\nV1beta1NetworkPolicyList.attributeTypeMap = [\n {\n \"name\": \"apiVersion\",\n \"baseName\": \"apiVersion\",\n \"type\": \"string\"\n },\n {\n \"name\": \"items\",\n \"baseName\": \"items\",\n \"type\": \"Array\"\n },\n {\n \"name\": \"kind\",\n \"baseName\": \"kind\",\n \"type\": \"string\"\n },\n {\n \"name\": \"metadata\",\n \"baseName\": \"metadata\",\n \"type\": \"V1ListMeta\"\n }\n];\nexports.V1beta1NetworkPolicyList = V1beta1NetworkPolicyList;\n/**\n* DEPRECATED 1.9 - This group version of NetworkPolicyPeer is deprecated by networking/v1/NetworkPolicyPeer.\n*/\nclass V1beta1NetworkPolicyPeer {\n static getAttributeTypeMap() {\n return V1beta1NetworkPolicyPeer.attributeTypeMap;\n }\n}\nV1beta1NetworkPolicyPeer.discriminator = undefined;\nV1beta1NetworkPolicyPeer.attributeTypeMap = [\n {\n \"name\": \"ipBlock\",\n \"baseName\": \"ipBlock\",\n \"type\": \"V1beta1IPBlock\"\n },\n {\n \"name\": \"namespaceSelector\",\n \"baseName\": \"namespaceSelector\",\n \"type\": \"V1LabelSelector\"\n },\n {\n \"name\": \"podSelector\",\n \"baseName\": \"podSelector\",\n \"type\": \"V1LabelSelector\"\n }\n];\nexports.V1beta1NetworkPolicyPeer = V1beta1NetworkPolicyPeer;\n/**\n* DEPRECATED 1.9 - This group version of NetworkPolicyPort is deprecated by networking/v1/NetworkPolicyPort.\n*/\nclass V1beta1NetworkPolicyPort {\n static getAttributeTypeMap() {\n return V1beta1NetworkPolicyPort.attributeTypeMap;\n }\n}\nV1beta1NetworkPolicyPort.discriminator = undefined;\nV1beta1NetworkPolicyPort.attributeTypeMap = [\n {\n \"name\": \"port\",\n \"baseName\": \"port\",\n \"type\": \"any\"\n },\n {\n \"name\": \"protocol\",\n \"baseName\": \"protocol\",\n \"type\": \"string\"\n }\n];\nexports.V1beta1NetworkPolicyPort = V1beta1NetworkPolicyPort;\n/**\n* DEPRECATED 1.9 - This group version of NetworkPolicySpec is deprecated by networking/v1/NetworkPolicySpec.\n*/\nclass V1beta1NetworkPolicySpec {\n static getAttributeTypeMap() {\n return V1beta1NetworkPolicySpec.attributeTypeMap;\n }\n}\nV1beta1NetworkPolicySpec.discriminator = undefined;\nV1beta1NetworkPolicySpec.attributeTypeMap = [\n {\n \"name\": \"egress\",\n \"baseName\": \"egress\",\n \"type\": \"Array\"\n },\n {\n \"name\": \"ingress\",\n \"baseName\": \"ingress\",\n \"type\": \"Array\"\n },\n {\n \"name\": \"podSelector\",\n \"baseName\": \"podSelector\",\n \"type\": \"V1LabelSelector\"\n },\n {\n \"name\": \"policyTypes\",\n \"baseName\": \"policyTypes\",\n \"type\": \"Array\"\n }\n];\nexports.V1beta1NetworkPolicySpec = V1beta1NetworkPolicySpec;\n/**\n* NonResourceAttributes includes the authorization attributes available for non-resource requests to the Authorizer interface\n*/\nclass V1beta1NonResourceAttributes {\n static getAttributeTypeMap() {\n return V1beta1NonResourceAttributes.attributeTypeMap;\n }\n}\nV1beta1NonResourceAttributes.discriminator = undefined;\nV1beta1NonResourceAttributes.attributeTypeMap = [\n {\n \"name\": \"path\",\n \"baseName\": \"path\",\n \"type\": \"string\"\n },\n {\n \"name\": \"verb\",\n \"baseName\": \"verb\",\n \"type\": \"string\"\n }\n];\nexports.V1beta1NonResourceAttributes = V1beta1NonResourceAttributes;\n/**\n* NonResourceRule holds information that describes a rule for the non-resource\n*/\nclass V1beta1NonResourceRule {\n static getAttributeTypeMap() {\n return V1beta1NonResourceRule.attributeTypeMap;\n }\n}\nV1beta1NonResourceRule.discriminator = undefined;\nV1beta1NonResourceRule.attributeTypeMap = [\n {\n \"name\": \"nonResourceURLs\",\n \"baseName\": \"nonResourceURLs\",\n \"type\": \"Array\"\n },\n {\n \"name\": \"verbs\",\n \"baseName\": \"verbs\",\n \"type\": \"Array\"\n }\n];\nexports.V1beta1NonResourceRule = V1beta1NonResourceRule;\n/**\n* PodDisruptionBudget is an object to define the max disruption that can be caused to a collection of pods\n*/\nclass V1beta1PodDisruptionBudget {\n static getAttributeTypeMap() {\n return V1beta1PodDisruptionBudget.attributeTypeMap;\n }\n}\nV1beta1PodDisruptionBudget.discriminator = undefined;\nV1beta1PodDisruptionBudget.attributeTypeMap = [\n {\n \"name\": \"apiVersion\",\n \"baseName\": \"apiVersion\",\n \"type\": \"string\"\n },\n {\n \"name\": \"kind\",\n \"baseName\": \"kind\",\n \"type\": \"string\"\n },\n {\n \"name\": \"metadata\",\n \"baseName\": \"metadata\",\n \"type\": \"V1ObjectMeta\"\n },\n {\n \"name\": \"spec\",\n \"baseName\": \"spec\",\n \"type\": \"V1beta1PodDisruptionBudgetSpec\"\n },\n {\n \"name\": \"status\",\n \"baseName\": \"status\",\n \"type\": \"V1beta1PodDisruptionBudgetStatus\"\n }\n];\nexports.V1beta1PodDisruptionBudget = V1beta1PodDisruptionBudget;\n/**\n* PodDisruptionBudgetList is a collection of PodDisruptionBudgets.\n*/\nclass V1beta1PodDisruptionBudgetList {\n static getAttributeTypeMap() {\n return V1beta1PodDisruptionBudgetList.attributeTypeMap;\n }\n}\nV1beta1PodDisruptionBudgetList.discriminator = undefined;\nV1beta1PodDisruptionBudgetList.attributeTypeMap = [\n {\n \"name\": \"apiVersion\",\n \"baseName\": \"apiVersion\",\n \"type\": \"string\"\n },\n {\n \"name\": \"items\",\n \"baseName\": \"items\",\n \"type\": \"Array\"\n },\n {\n \"name\": \"kind\",\n \"baseName\": \"kind\",\n \"type\": \"string\"\n },\n {\n \"name\": \"metadata\",\n \"baseName\": \"metadata\",\n \"type\": \"V1ListMeta\"\n }\n];\nexports.V1beta1PodDisruptionBudgetList = V1beta1PodDisruptionBudgetList;\n/**\n* PodDisruptionBudgetSpec is a description of a PodDisruptionBudget.\n*/\nclass V1beta1PodDisruptionBudgetSpec {\n static getAttributeTypeMap() {\n return V1beta1PodDisruptionBudgetSpec.attributeTypeMap;\n }\n}\nV1beta1PodDisruptionBudgetSpec.discriminator = undefined;\nV1beta1PodDisruptionBudgetSpec.attributeTypeMap = [\n {\n \"name\": \"maxUnavailable\",\n \"baseName\": \"maxUnavailable\",\n \"type\": \"any\"\n },\n {\n \"name\": \"minAvailable\",\n \"baseName\": \"minAvailable\",\n \"type\": \"any\"\n },\n {\n \"name\": \"selector\",\n \"baseName\": \"selector\",\n \"type\": \"V1LabelSelector\"\n }\n];\nexports.V1beta1PodDisruptionBudgetSpec = V1beta1PodDisruptionBudgetSpec;\n/**\n* PodDisruptionBudgetStatus represents information about the status of a PodDisruptionBudget. Status may trail the actual state of a system.\n*/\nclass V1beta1PodDisruptionBudgetStatus {\n static getAttributeTypeMap() {\n return V1beta1PodDisruptionBudgetStatus.attributeTypeMap;\n }\n}\nV1beta1PodDisruptionBudgetStatus.discriminator = undefined;\nV1beta1PodDisruptionBudgetStatus.attributeTypeMap = [\n {\n \"name\": \"currentHealthy\",\n \"baseName\": \"currentHealthy\",\n \"type\": \"number\"\n },\n {\n \"name\": \"desiredHealthy\",\n \"baseName\": \"desiredHealthy\",\n \"type\": \"number\"\n },\n {\n \"name\": \"disruptedPods\",\n \"baseName\": \"disruptedPods\",\n \"type\": \"{ [key: string]: Date; }\"\n },\n {\n \"name\": \"disruptionsAllowed\",\n \"baseName\": \"disruptionsAllowed\",\n \"type\": \"number\"\n },\n {\n \"name\": \"expectedPods\",\n \"baseName\": \"expectedPods\",\n \"type\": \"number\"\n },\n {\n \"name\": \"observedGeneration\",\n \"baseName\": \"observedGeneration\",\n \"type\": \"number\"\n }\n];\nexports.V1beta1PodDisruptionBudgetStatus = V1beta1PodDisruptionBudgetStatus;\n/**\n* PolicyRule holds information that describes a policy rule, but does not contain information about who the rule applies to or which namespace the rule applies to.\n*/\nclass V1beta1PolicyRule {\n static getAttributeTypeMap() {\n return V1beta1PolicyRule.attributeTypeMap;\n }\n}\nV1beta1PolicyRule.discriminator = undefined;\nV1beta1PolicyRule.attributeTypeMap = [\n {\n \"name\": \"apiGroups\",\n \"baseName\": \"apiGroups\",\n \"type\": \"Array\"\n },\n {\n \"name\": \"nonResourceURLs\",\n \"baseName\": \"nonResourceURLs\",\n \"type\": \"Array\"\n },\n {\n \"name\": \"resourceNames\",\n \"baseName\": \"resourceNames\",\n \"type\": \"Array\"\n },\n {\n \"name\": \"resources\",\n \"baseName\": \"resources\",\n \"type\": \"Array\"\n },\n {\n \"name\": \"verbs\",\n \"baseName\": \"verbs\",\n \"type\": \"Array\"\n }\n];\nexports.V1beta1PolicyRule = V1beta1PolicyRule;\n/**\n* PriorityClass defines mapping from a priority class name to the priority integer value. The value can be any valid integer.\n*/\nclass V1beta1PriorityClass {\n static getAttributeTypeMap() {\n return V1beta1PriorityClass.attributeTypeMap;\n }\n}\nV1beta1PriorityClass.discriminator = undefined;\nV1beta1PriorityClass.attributeTypeMap = [\n {\n \"name\": \"apiVersion\",\n \"baseName\": \"apiVersion\",\n \"type\": \"string\"\n },\n {\n \"name\": \"description\",\n \"baseName\": \"description\",\n \"type\": \"string\"\n },\n {\n \"name\": \"globalDefault\",\n \"baseName\": \"globalDefault\",\n \"type\": \"boolean\"\n },\n {\n \"name\": \"kind\",\n \"baseName\": \"kind\",\n \"type\": \"string\"\n },\n {\n \"name\": \"metadata\",\n \"baseName\": \"metadata\",\n \"type\": \"V1ObjectMeta\"\n },\n {\n \"name\": \"value\",\n \"baseName\": \"value\",\n \"type\": \"number\"\n }\n];\nexports.V1beta1PriorityClass = V1beta1PriorityClass;\n/**\n* PriorityClassList is a collection of priority classes.\n*/\nclass V1beta1PriorityClassList {\n static getAttributeTypeMap() {\n return V1beta1PriorityClassList.attributeTypeMap;\n }\n}\nV1beta1PriorityClassList.discriminator = undefined;\nV1beta1PriorityClassList.attributeTypeMap = [\n {\n \"name\": \"apiVersion\",\n \"baseName\": \"apiVersion\",\n \"type\": \"string\"\n },\n {\n \"name\": \"items\",\n \"baseName\": \"items\",\n \"type\": \"Array\"\n },\n {\n \"name\": \"kind\",\n \"baseName\": \"kind\",\n \"type\": \"string\"\n },\n {\n \"name\": \"metadata\",\n \"baseName\": \"metadata\",\n \"type\": \"V1ListMeta\"\n }\n];\nexports.V1beta1PriorityClassList = V1beta1PriorityClassList;\n/**\n* 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.\n*/\nclass V1beta1ReplicaSet {\n static getAttributeTypeMap() {\n return V1beta1ReplicaSet.attributeTypeMap;\n }\n}\nV1beta1ReplicaSet.discriminator = undefined;\nV1beta1ReplicaSet.attributeTypeMap = [\n {\n \"name\": \"apiVersion\",\n \"baseName\": \"apiVersion\",\n \"type\": \"string\"\n },\n {\n \"name\": \"kind\",\n \"baseName\": \"kind\",\n \"type\": \"string\"\n },\n {\n \"name\": \"metadata\",\n \"baseName\": \"metadata\",\n \"type\": \"V1ObjectMeta\"\n },\n {\n \"name\": \"spec\",\n \"baseName\": \"spec\",\n \"type\": \"V1beta1ReplicaSetSpec\"\n },\n {\n \"name\": \"status\",\n \"baseName\": \"status\",\n \"type\": \"V1beta1ReplicaSetStatus\"\n }\n];\nexports.V1beta1ReplicaSet = V1beta1ReplicaSet;\n/**\n* ReplicaSetCondition describes the state of a replica set at a certain point.\n*/\nclass V1beta1ReplicaSetCondition {\n static getAttributeTypeMap() {\n return V1beta1ReplicaSetCondition.attributeTypeMap;\n }\n}\nV1beta1ReplicaSetCondition.discriminator = undefined;\nV1beta1ReplicaSetCondition.attributeTypeMap = [\n {\n \"name\": \"lastTransitionTime\",\n \"baseName\": \"lastTransitionTime\",\n \"type\": \"Date\"\n },\n {\n \"name\": \"message\",\n \"baseName\": \"message\",\n \"type\": \"string\"\n },\n {\n \"name\": \"reason\",\n \"baseName\": \"reason\",\n \"type\": \"string\"\n },\n {\n \"name\": \"status\",\n \"baseName\": \"status\",\n \"type\": \"string\"\n },\n {\n \"name\": \"type\",\n \"baseName\": \"type\",\n \"type\": \"string\"\n }\n];\nexports.V1beta1ReplicaSetCondition = V1beta1ReplicaSetCondition;\n/**\n* ReplicaSetList is a collection of ReplicaSets.\n*/\nclass V1beta1ReplicaSetList {\n static getAttributeTypeMap() {\n return V1beta1ReplicaSetList.attributeTypeMap;\n }\n}\nV1beta1ReplicaSetList.discriminator = undefined;\nV1beta1ReplicaSetList.attributeTypeMap = [\n {\n \"name\": \"apiVersion\",\n \"baseName\": \"apiVersion\",\n \"type\": \"string\"\n },\n {\n \"name\": \"items\",\n \"baseName\": \"items\",\n \"type\": \"Array\"\n },\n {\n \"name\": \"kind\",\n \"baseName\": \"kind\",\n \"type\": \"string\"\n },\n {\n \"name\": \"metadata\",\n \"baseName\": \"metadata\",\n \"type\": \"V1ListMeta\"\n }\n];\nexports.V1beta1ReplicaSetList = V1beta1ReplicaSetList;\n/**\n* ReplicaSetSpec is the specification of a ReplicaSet.\n*/\nclass V1beta1ReplicaSetSpec {\n static getAttributeTypeMap() {\n return V1beta1ReplicaSetSpec.attributeTypeMap;\n }\n}\nV1beta1ReplicaSetSpec.discriminator = undefined;\nV1beta1ReplicaSetSpec.attributeTypeMap = [\n {\n \"name\": \"minReadySeconds\",\n \"baseName\": \"minReadySeconds\",\n \"type\": \"number\"\n },\n {\n \"name\": \"replicas\",\n \"baseName\": \"replicas\",\n \"type\": \"number\"\n },\n {\n \"name\": \"selector\",\n \"baseName\": \"selector\",\n \"type\": \"V1LabelSelector\"\n },\n {\n \"name\": \"template\",\n \"baseName\": \"template\",\n \"type\": \"V1PodTemplateSpec\"\n }\n];\nexports.V1beta1ReplicaSetSpec = V1beta1ReplicaSetSpec;\n/**\n* ReplicaSetStatus represents the current status of a ReplicaSet.\n*/\nclass V1beta1ReplicaSetStatus {\n static getAttributeTypeMap() {\n return V1beta1ReplicaSetStatus.attributeTypeMap;\n }\n}\nV1beta1ReplicaSetStatus.discriminator = undefined;\nV1beta1ReplicaSetStatus.attributeTypeMap = [\n {\n \"name\": \"availableReplicas\",\n \"baseName\": \"availableReplicas\",\n \"type\": \"number\"\n },\n {\n \"name\": \"conditions\",\n \"baseName\": \"conditions\",\n \"type\": \"Array\"\n },\n {\n \"name\": \"fullyLabeledReplicas\",\n \"baseName\": \"fullyLabeledReplicas\",\n \"type\": \"number\"\n },\n {\n \"name\": \"observedGeneration\",\n \"baseName\": \"observedGeneration\",\n \"type\": \"number\"\n },\n {\n \"name\": \"readyReplicas\",\n \"baseName\": \"readyReplicas\",\n \"type\": \"number\"\n },\n {\n \"name\": \"replicas\",\n \"baseName\": \"replicas\",\n \"type\": \"number\"\n }\n];\nexports.V1beta1ReplicaSetStatus = V1beta1ReplicaSetStatus;\n/**\n* ResourceAttributes includes the authorization attributes available for resource requests to the Authorizer interface\n*/\nclass V1beta1ResourceAttributes {\n static getAttributeTypeMap() {\n return V1beta1ResourceAttributes.attributeTypeMap;\n }\n}\nV1beta1ResourceAttributes.discriminator = undefined;\nV1beta1ResourceAttributes.attributeTypeMap = [\n {\n \"name\": \"group\",\n \"baseName\": \"group\",\n \"type\": \"string\"\n },\n {\n \"name\": \"name\",\n \"baseName\": \"name\",\n \"type\": \"string\"\n },\n {\n \"name\": \"namespace\",\n \"baseName\": \"namespace\",\n \"type\": \"string\"\n },\n {\n \"name\": \"resource\",\n \"baseName\": \"resource\",\n \"type\": \"string\"\n },\n {\n \"name\": \"subresource\",\n \"baseName\": \"subresource\",\n \"type\": \"string\"\n },\n {\n \"name\": \"verb\",\n \"baseName\": \"verb\",\n \"type\": \"string\"\n },\n {\n \"name\": \"version\",\n \"baseName\": \"version\",\n \"type\": \"string\"\n }\n];\nexports.V1beta1ResourceAttributes = V1beta1ResourceAttributes;\n/**\n* ResourceRule is the list of actions the subject is allowed to perform on resources. The list ordering isn't significant, may contain duplicates, and possibly be incomplete.\n*/\nclass V1beta1ResourceRule {\n static getAttributeTypeMap() {\n return V1beta1ResourceRule.attributeTypeMap;\n }\n}\nV1beta1ResourceRule.discriminator = undefined;\nV1beta1ResourceRule.attributeTypeMap = [\n {\n \"name\": \"apiGroups\",\n \"baseName\": \"apiGroups\",\n \"type\": \"Array\"\n },\n {\n \"name\": \"resourceNames\",\n \"baseName\": \"resourceNames\",\n \"type\": \"Array\"\n },\n {\n \"name\": \"resources\",\n \"baseName\": \"resources\",\n \"type\": \"Array\"\n },\n {\n \"name\": \"verbs\",\n \"baseName\": \"verbs\",\n \"type\": \"Array\"\n }\n];\nexports.V1beta1ResourceRule = V1beta1ResourceRule;\n/**\n* Role is a namespaced, logical grouping of PolicyRules that can be referenced as a unit by a RoleBinding.\n*/\nclass V1beta1Role {\n static getAttributeTypeMap() {\n return V1beta1Role.attributeTypeMap;\n }\n}\nV1beta1Role.discriminator = undefined;\nV1beta1Role.attributeTypeMap = [\n {\n \"name\": \"apiVersion\",\n \"baseName\": \"apiVersion\",\n \"type\": \"string\"\n },\n {\n \"name\": \"kind\",\n \"baseName\": \"kind\",\n \"type\": \"string\"\n },\n {\n \"name\": \"metadata\",\n \"baseName\": \"metadata\",\n \"type\": \"V1ObjectMeta\"\n },\n {\n \"name\": \"rules\",\n \"baseName\": \"rules\",\n \"type\": \"Array\"\n }\n];\nexports.V1beta1Role = V1beta1Role;\n/**\n* RoleBinding references a role, but does not contain it. It can reference a Role in the same namespace or a ClusterRole in the global namespace. It adds who information via Subjects and namespace information by which namespace it exists in. RoleBindings in a given namespace only have effect in that namespace.\n*/\nclass V1beta1RoleBinding {\n static getAttributeTypeMap() {\n return V1beta1RoleBinding.attributeTypeMap;\n }\n}\nV1beta1RoleBinding.discriminator = undefined;\nV1beta1RoleBinding.attributeTypeMap = [\n {\n \"name\": \"apiVersion\",\n \"baseName\": \"apiVersion\",\n \"type\": \"string\"\n },\n {\n \"name\": \"kind\",\n \"baseName\": \"kind\",\n \"type\": \"string\"\n },\n {\n \"name\": \"metadata\",\n \"baseName\": \"metadata\",\n \"type\": \"V1ObjectMeta\"\n },\n {\n \"name\": \"roleRef\",\n \"baseName\": \"roleRef\",\n \"type\": \"V1beta1RoleRef\"\n },\n {\n \"name\": \"subjects\",\n \"baseName\": \"subjects\",\n \"type\": \"Array\"\n }\n];\nexports.V1beta1RoleBinding = V1beta1RoleBinding;\n/**\n* RoleBindingList is a collection of RoleBindings\n*/\nclass V1beta1RoleBindingList {\n static getAttributeTypeMap() {\n return V1beta1RoleBindingList.attributeTypeMap;\n }\n}\nV1beta1RoleBindingList.discriminator = undefined;\nV1beta1RoleBindingList.attributeTypeMap = [\n {\n \"name\": \"apiVersion\",\n \"baseName\": \"apiVersion\",\n \"type\": \"string\"\n },\n {\n \"name\": \"items\",\n \"baseName\": \"items\",\n \"type\": \"Array\"\n },\n {\n \"name\": \"kind\",\n \"baseName\": \"kind\",\n \"type\": \"string\"\n },\n {\n \"name\": \"metadata\",\n \"baseName\": \"metadata\",\n \"type\": \"V1ListMeta\"\n }\n];\nexports.V1beta1RoleBindingList = V1beta1RoleBindingList;\n/**\n* RoleList is a collection of Roles\n*/\nclass V1beta1RoleList {\n static getAttributeTypeMap() {\n return V1beta1RoleList.attributeTypeMap;\n }\n}\nV1beta1RoleList.discriminator = undefined;\nV1beta1RoleList.attributeTypeMap = [\n {\n \"name\": \"apiVersion\",\n \"baseName\": \"apiVersion\",\n \"type\": \"string\"\n },\n {\n \"name\": \"items\",\n \"baseName\": \"items\",\n \"type\": \"Array\"\n },\n {\n \"name\": \"kind\",\n \"baseName\": \"kind\",\n \"type\": \"string\"\n },\n {\n \"name\": \"metadata\",\n \"baseName\": \"metadata\",\n \"type\": \"V1ListMeta\"\n }\n];\nexports.V1beta1RoleList = V1beta1RoleList;\n/**\n* RoleRef contains information that points to the role being used\n*/\nclass V1beta1RoleRef {\n static getAttributeTypeMap() {\n return V1beta1RoleRef.attributeTypeMap;\n }\n}\nV1beta1RoleRef.discriminator = undefined;\nV1beta1RoleRef.attributeTypeMap = [\n {\n \"name\": \"apiGroup\",\n \"baseName\": \"apiGroup\",\n \"type\": \"string\"\n },\n {\n \"name\": \"kind\",\n \"baseName\": \"kind\",\n \"type\": \"string\"\n },\n {\n \"name\": \"name\",\n \"baseName\": \"name\",\n \"type\": \"string\"\n }\n];\nexports.V1beta1RoleRef = V1beta1RoleRef;\n/**\n* Spec to control the desired behavior of daemon set rolling update.\n*/\nclass V1beta1RollingUpdateDaemonSet {\n static getAttributeTypeMap() {\n return V1beta1RollingUpdateDaemonSet.attributeTypeMap;\n }\n}\nV1beta1RollingUpdateDaemonSet.discriminator = undefined;\nV1beta1RollingUpdateDaemonSet.attributeTypeMap = [\n {\n \"name\": \"maxUnavailable\",\n \"baseName\": \"maxUnavailable\",\n \"type\": \"any\"\n }\n];\nexports.V1beta1RollingUpdateDaemonSet = V1beta1RollingUpdateDaemonSet;\n/**\n* RollingUpdateStatefulSetStrategy is used to communicate parameter for RollingUpdateStatefulSetStrategyType.\n*/\nclass V1beta1RollingUpdateStatefulSetStrategy {\n static getAttributeTypeMap() {\n return V1beta1RollingUpdateStatefulSetStrategy.attributeTypeMap;\n }\n}\nV1beta1RollingUpdateStatefulSetStrategy.discriminator = undefined;\nV1beta1RollingUpdateStatefulSetStrategy.attributeTypeMap = [\n {\n \"name\": \"partition\",\n \"baseName\": \"partition\",\n \"type\": \"number\"\n }\n];\nexports.V1beta1RollingUpdateStatefulSetStrategy = V1beta1RollingUpdateStatefulSetStrategy;\n/**\n* RuleWithOperations is a tuple of Operations and Resources. It is recommended to make sure that all the tuple expansions are valid.\n*/\nclass V1beta1RuleWithOperations {\n static getAttributeTypeMap() {\n return V1beta1RuleWithOperations.attributeTypeMap;\n }\n}\nV1beta1RuleWithOperations.discriminator = undefined;\nV1beta1RuleWithOperations.attributeTypeMap = [\n {\n \"name\": \"apiGroups\",\n \"baseName\": \"apiGroups\",\n \"type\": \"Array\"\n },\n {\n \"name\": \"apiVersions\",\n \"baseName\": \"apiVersions\",\n \"type\": \"Array\"\n },\n {\n \"name\": \"operations\",\n \"baseName\": \"operations\",\n \"type\": \"Array\"\n },\n {\n \"name\": \"resources\",\n \"baseName\": \"resources\",\n \"type\": \"Array\"\n }\n];\nexports.V1beta1RuleWithOperations = V1beta1RuleWithOperations;\n/**\n* SelfSubjectAccessReview checks whether or the current user can perform an action. Not filling in a spec.namespace means \\\"in all namespaces\\\". Self is a special case, because users should always be able to check whether they can perform an action\n*/\nclass V1beta1SelfSubjectAccessReview {\n static getAttributeTypeMap() {\n return V1beta1SelfSubjectAccessReview.attributeTypeMap;\n }\n}\nV1beta1SelfSubjectAccessReview.discriminator = undefined;\nV1beta1SelfSubjectAccessReview.attributeTypeMap = [\n {\n \"name\": \"apiVersion\",\n \"baseName\": \"apiVersion\",\n \"type\": \"string\"\n },\n {\n \"name\": \"kind\",\n \"baseName\": \"kind\",\n \"type\": \"string\"\n },\n {\n \"name\": \"metadata\",\n \"baseName\": \"metadata\",\n \"type\": \"V1ObjectMeta\"\n },\n {\n \"name\": \"spec\",\n \"baseName\": \"spec\",\n \"type\": \"V1beta1SelfSubjectAccessReviewSpec\"\n },\n {\n \"name\": \"status\",\n \"baseName\": \"status\",\n \"type\": \"V1beta1SubjectAccessReviewStatus\"\n }\n];\nexports.V1beta1SelfSubjectAccessReview = V1beta1SelfSubjectAccessReview;\n/**\n* SelfSubjectAccessReviewSpec is a description of the access request. Exactly one of ResourceAuthorizationAttributes and NonResourceAuthorizationAttributes must be set\n*/\nclass V1beta1SelfSubjectAccessReviewSpec {\n static getAttributeTypeMap() {\n return V1beta1SelfSubjectAccessReviewSpec.attributeTypeMap;\n }\n}\nV1beta1SelfSubjectAccessReviewSpec.discriminator = undefined;\nV1beta1SelfSubjectAccessReviewSpec.attributeTypeMap = [\n {\n \"name\": \"nonResourceAttributes\",\n \"baseName\": \"nonResourceAttributes\",\n \"type\": \"V1beta1NonResourceAttributes\"\n },\n {\n \"name\": \"resourceAttributes\",\n \"baseName\": \"resourceAttributes\",\n \"type\": \"V1beta1ResourceAttributes\"\n }\n];\nexports.V1beta1SelfSubjectAccessReviewSpec = V1beta1SelfSubjectAccessReviewSpec;\n/**\n* SelfSubjectRulesReview enumerates the set of actions the current user can perform within a namespace. The returned list of actions may be incomplete depending on the server's authorization mode, and any errors experienced during the evaluation. SelfSubjectRulesReview should be used by UIs to show/hide actions, or to quickly let an end user reason about their permissions. It should NOT Be used by external systems to drive authorization decisions as this raises confused deputy, cache lifetime/revocation, and correctness concerns. SubjectAccessReview, and LocalAccessReview are the correct way to defer authorization decisions to the API server.\n*/\nclass V1beta1SelfSubjectRulesReview {\n static getAttributeTypeMap() {\n return V1beta1SelfSubjectRulesReview.attributeTypeMap;\n }\n}\nV1beta1SelfSubjectRulesReview.discriminator = undefined;\nV1beta1SelfSubjectRulesReview.attributeTypeMap = [\n {\n \"name\": \"apiVersion\",\n \"baseName\": \"apiVersion\",\n \"type\": \"string\"\n },\n {\n \"name\": \"kind\",\n \"baseName\": \"kind\",\n \"type\": \"string\"\n },\n {\n \"name\": \"metadata\",\n \"baseName\": \"metadata\",\n \"type\": \"V1ObjectMeta\"\n },\n {\n \"name\": \"spec\",\n \"baseName\": \"spec\",\n \"type\": \"V1beta1SelfSubjectRulesReviewSpec\"\n },\n {\n \"name\": \"status\",\n \"baseName\": \"status\",\n \"type\": \"V1beta1SubjectRulesReviewStatus\"\n }\n];\nexports.V1beta1SelfSubjectRulesReview = V1beta1SelfSubjectRulesReview;\nclass V1beta1SelfSubjectRulesReviewSpec {\n static getAttributeTypeMap() {\n return V1beta1SelfSubjectRulesReviewSpec.attributeTypeMap;\n }\n}\nV1beta1SelfSubjectRulesReviewSpec.discriminator = undefined;\nV1beta1SelfSubjectRulesReviewSpec.attributeTypeMap = [\n {\n \"name\": \"namespace\",\n \"baseName\": \"namespace\",\n \"type\": \"string\"\n }\n];\nexports.V1beta1SelfSubjectRulesReviewSpec = V1beta1SelfSubjectRulesReviewSpec;\n/**\n* 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.\n*/\nclass V1beta1StatefulSet {\n static getAttributeTypeMap() {\n return V1beta1StatefulSet.attributeTypeMap;\n }\n}\nV1beta1StatefulSet.discriminator = undefined;\nV1beta1StatefulSet.attributeTypeMap = [\n {\n \"name\": \"apiVersion\",\n \"baseName\": \"apiVersion\",\n \"type\": \"string\"\n },\n {\n \"name\": \"kind\",\n \"baseName\": \"kind\",\n \"type\": \"string\"\n },\n {\n \"name\": \"metadata\",\n \"baseName\": \"metadata\",\n \"type\": \"V1ObjectMeta\"\n },\n {\n \"name\": \"spec\",\n \"baseName\": \"spec\",\n \"type\": \"V1beta1StatefulSetSpec\"\n },\n {\n \"name\": \"status\",\n \"baseName\": \"status\",\n \"type\": \"V1beta1StatefulSetStatus\"\n }\n];\nexports.V1beta1StatefulSet = V1beta1StatefulSet;\n/**\n* StatefulSetCondition describes the state of a statefulset at a certain point.\n*/\nclass V1beta1StatefulSetCondition {\n static getAttributeTypeMap() {\n return V1beta1StatefulSetCondition.attributeTypeMap;\n }\n}\nV1beta1StatefulSetCondition.discriminator = undefined;\nV1beta1StatefulSetCondition.attributeTypeMap = [\n {\n \"name\": \"lastTransitionTime\",\n \"baseName\": \"lastTransitionTime\",\n \"type\": \"Date\"\n },\n {\n \"name\": \"message\",\n \"baseName\": \"message\",\n \"type\": \"string\"\n },\n {\n \"name\": \"reason\",\n \"baseName\": \"reason\",\n \"type\": \"string\"\n },\n {\n \"name\": \"status\",\n \"baseName\": \"status\",\n \"type\": \"string\"\n },\n {\n \"name\": \"type\",\n \"baseName\": \"type\",\n \"type\": \"string\"\n }\n];\nexports.V1beta1StatefulSetCondition = V1beta1StatefulSetCondition;\n/**\n* StatefulSetList is a collection of StatefulSets.\n*/\nclass V1beta1StatefulSetList {\n static getAttributeTypeMap() {\n return V1beta1StatefulSetList.attributeTypeMap;\n }\n}\nV1beta1StatefulSetList.discriminator = undefined;\nV1beta1StatefulSetList.attributeTypeMap = [\n {\n \"name\": \"apiVersion\",\n \"baseName\": \"apiVersion\",\n \"type\": \"string\"\n },\n {\n \"name\": \"items\",\n \"baseName\": \"items\",\n \"type\": \"Array\"\n },\n {\n \"name\": \"kind\",\n \"baseName\": \"kind\",\n \"type\": \"string\"\n },\n {\n \"name\": \"metadata\",\n \"baseName\": \"metadata\",\n \"type\": \"V1ListMeta\"\n }\n];\nexports.V1beta1StatefulSetList = V1beta1StatefulSetList;\n/**\n* A StatefulSetSpec is the specification of a StatefulSet.\n*/\nclass V1beta1StatefulSetSpec {\n static getAttributeTypeMap() {\n return V1beta1StatefulSetSpec.attributeTypeMap;\n }\n}\nV1beta1StatefulSetSpec.discriminator = undefined;\nV1beta1StatefulSetSpec.attributeTypeMap = [\n {\n \"name\": \"podManagementPolicy\",\n \"baseName\": \"podManagementPolicy\",\n \"type\": \"string\"\n },\n {\n \"name\": \"replicas\",\n \"baseName\": \"replicas\",\n \"type\": \"number\"\n },\n {\n \"name\": \"revisionHistoryLimit\",\n \"baseName\": \"revisionHistoryLimit\",\n \"type\": \"number\"\n },\n {\n \"name\": \"selector\",\n \"baseName\": \"selector\",\n \"type\": \"V1LabelSelector\"\n },\n {\n \"name\": \"serviceName\",\n \"baseName\": \"serviceName\",\n \"type\": \"string\"\n },\n {\n \"name\": \"template\",\n \"baseName\": \"template\",\n \"type\": \"V1PodTemplateSpec\"\n },\n {\n \"name\": \"updateStrategy\",\n \"baseName\": \"updateStrategy\",\n \"type\": \"V1beta1StatefulSetUpdateStrategy\"\n },\n {\n \"name\": \"volumeClaimTemplates\",\n \"baseName\": \"volumeClaimTemplates\",\n \"type\": \"Array\"\n }\n];\nexports.V1beta1StatefulSetSpec = V1beta1StatefulSetSpec;\n/**\n* StatefulSetStatus represents the current state of a StatefulSet.\n*/\nclass V1beta1StatefulSetStatus {\n static getAttributeTypeMap() {\n return V1beta1StatefulSetStatus.attributeTypeMap;\n }\n}\nV1beta1StatefulSetStatus.discriminator = undefined;\nV1beta1StatefulSetStatus.attributeTypeMap = [\n {\n \"name\": \"collisionCount\",\n \"baseName\": \"collisionCount\",\n \"type\": \"number\"\n },\n {\n \"name\": \"conditions\",\n \"baseName\": \"conditions\",\n \"type\": \"Array\"\n },\n {\n \"name\": \"currentReplicas\",\n \"baseName\": \"currentReplicas\",\n \"type\": \"number\"\n },\n {\n \"name\": \"currentRevision\",\n \"baseName\": \"currentRevision\",\n \"type\": \"string\"\n },\n {\n \"name\": \"observedGeneration\",\n \"baseName\": \"observedGeneration\",\n \"type\": \"number\"\n },\n {\n \"name\": \"readyReplicas\",\n \"baseName\": \"readyReplicas\",\n \"type\": \"number\"\n },\n {\n \"name\": \"replicas\",\n \"baseName\": \"replicas\",\n \"type\": \"number\"\n },\n {\n \"name\": \"updateRevision\",\n \"baseName\": \"updateRevision\",\n \"type\": \"string\"\n },\n {\n \"name\": \"updatedReplicas\",\n \"baseName\": \"updatedReplicas\",\n \"type\": \"number\"\n }\n];\nexports.V1beta1StatefulSetStatus = V1beta1StatefulSetStatus;\n/**\n* StatefulSetUpdateStrategy indicates the strategy that the StatefulSet controller will use to perform updates. It includes any additional parameters necessary to perform the update for the indicated strategy.\n*/\nclass V1beta1StatefulSetUpdateStrategy {\n static getAttributeTypeMap() {\n return V1beta1StatefulSetUpdateStrategy.attributeTypeMap;\n }\n}\nV1beta1StatefulSetUpdateStrategy.discriminator = undefined;\nV1beta1StatefulSetUpdateStrategy.attributeTypeMap = [\n {\n \"name\": \"rollingUpdate\",\n \"baseName\": \"rollingUpdate\",\n \"type\": \"V1beta1RollingUpdateStatefulSetStrategy\"\n },\n {\n \"name\": \"type\",\n \"baseName\": \"type\",\n \"type\": \"string\"\n }\n];\nexports.V1beta1StatefulSetUpdateStrategy = V1beta1StatefulSetUpdateStrategy;\n/**\n* StorageClass describes the parameters for a class of storage for which PersistentVolumes can be dynamically provisioned. StorageClasses are non-namespaced; the name of the storage class according to etcd is in ObjectMeta.Name.\n*/\nclass V1beta1StorageClass {\n static getAttributeTypeMap() {\n return V1beta1StorageClass.attributeTypeMap;\n }\n}\nV1beta1StorageClass.discriminator = undefined;\nV1beta1StorageClass.attributeTypeMap = [\n {\n \"name\": \"allowVolumeExpansion\",\n \"baseName\": \"allowVolumeExpansion\",\n \"type\": \"boolean\"\n },\n {\n \"name\": \"allowedTopologies\",\n \"baseName\": \"allowedTopologies\",\n \"type\": \"Array\"\n },\n {\n \"name\": \"apiVersion\",\n \"baseName\": \"apiVersion\",\n \"type\": \"string\"\n },\n {\n \"name\": \"kind\",\n \"baseName\": \"kind\",\n \"type\": \"string\"\n },\n {\n \"name\": \"metadata\",\n \"baseName\": \"metadata\",\n \"type\": \"V1ObjectMeta\"\n },\n {\n \"name\": \"mountOptions\",\n \"baseName\": \"mountOptions\",\n \"type\": \"Array\"\n },\n {\n \"name\": \"parameters\",\n \"baseName\": \"parameters\",\n \"type\": \"{ [key: string]: string; }\"\n },\n {\n \"name\": \"provisioner\",\n \"baseName\": \"provisioner\",\n \"type\": \"string\"\n },\n {\n \"name\": \"reclaimPolicy\",\n \"baseName\": \"reclaimPolicy\",\n \"type\": \"string\"\n },\n {\n \"name\": \"volumeBindingMode\",\n \"baseName\": \"volumeBindingMode\",\n \"type\": \"string\"\n }\n];\nexports.V1beta1StorageClass = V1beta1StorageClass;\n/**\n* StorageClassList is a collection of storage classes.\n*/\nclass V1beta1StorageClassList {\n static getAttributeTypeMap() {\n return V1beta1StorageClassList.attributeTypeMap;\n }\n}\nV1beta1StorageClassList.discriminator = undefined;\nV1beta1StorageClassList.attributeTypeMap = [\n {\n \"name\": \"apiVersion\",\n \"baseName\": \"apiVersion\",\n \"type\": \"string\"\n },\n {\n \"name\": \"items\",\n \"baseName\": \"items\",\n \"type\": \"Array\"\n },\n {\n \"name\": \"kind\",\n \"baseName\": \"kind\",\n \"type\": \"string\"\n },\n {\n \"name\": \"metadata\",\n \"baseName\": \"metadata\",\n \"type\": \"V1ListMeta\"\n }\n];\nexports.V1beta1StorageClassList = V1beta1StorageClassList;\n/**\n* Subject contains a reference to the object or user identities a role binding applies to. This can either hold a direct API object reference, or a value for non-objects such as user and group names.\n*/\nclass V1beta1Subject {\n static getAttributeTypeMap() {\n return V1beta1Subject.attributeTypeMap;\n }\n}\nV1beta1Subject.discriminator = undefined;\nV1beta1Subject.attributeTypeMap = [\n {\n \"name\": \"apiGroup\",\n \"baseName\": \"apiGroup\",\n \"type\": \"string\"\n },\n {\n \"name\": \"kind\",\n \"baseName\": \"kind\",\n \"type\": \"string\"\n },\n {\n \"name\": \"name\",\n \"baseName\": \"name\",\n \"type\": \"string\"\n },\n {\n \"name\": \"namespace\",\n \"baseName\": \"namespace\",\n \"type\": \"string\"\n }\n];\nexports.V1beta1Subject = V1beta1Subject;\n/**\n* SubjectAccessReview checks whether or not a user or group can perform an action.\n*/\nclass V1beta1SubjectAccessReview {\n static getAttributeTypeMap() {\n return V1beta1SubjectAccessReview.attributeTypeMap;\n }\n}\nV1beta1SubjectAccessReview.discriminator = undefined;\nV1beta1SubjectAccessReview.attributeTypeMap = [\n {\n \"name\": \"apiVersion\",\n \"baseName\": \"apiVersion\",\n \"type\": \"string\"\n },\n {\n \"name\": \"kind\",\n \"baseName\": \"kind\",\n \"type\": \"string\"\n },\n {\n \"name\": \"metadata\",\n \"baseName\": \"metadata\",\n \"type\": \"V1ObjectMeta\"\n },\n {\n \"name\": \"spec\",\n \"baseName\": \"spec\",\n \"type\": \"V1beta1SubjectAccessReviewSpec\"\n },\n {\n \"name\": \"status\",\n \"baseName\": \"status\",\n \"type\": \"V1beta1SubjectAccessReviewStatus\"\n }\n];\nexports.V1beta1SubjectAccessReview = V1beta1SubjectAccessReview;\n/**\n* SubjectAccessReviewSpec is a description of the access request. Exactly one of ResourceAuthorizationAttributes and NonResourceAuthorizationAttributes must be set\n*/\nclass V1beta1SubjectAccessReviewSpec {\n static getAttributeTypeMap() {\n return V1beta1SubjectAccessReviewSpec.attributeTypeMap;\n }\n}\nV1beta1SubjectAccessReviewSpec.discriminator = undefined;\nV1beta1SubjectAccessReviewSpec.attributeTypeMap = [\n {\n \"name\": \"extra\",\n \"baseName\": \"extra\",\n \"type\": \"{ [key: string]: Array; }\"\n },\n {\n \"name\": \"group\",\n \"baseName\": \"group\",\n \"type\": \"Array\"\n },\n {\n \"name\": \"nonResourceAttributes\",\n \"baseName\": \"nonResourceAttributes\",\n \"type\": \"V1beta1NonResourceAttributes\"\n },\n {\n \"name\": \"resourceAttributes\",\n \"baseName\": \"resourceAttributes\",\n \"type\": \"V1beta1ResourceAttributes\"\n },\n {\n \"name\": \"uid\",\n \"baseName\": \"uid\",\n \"type\": \"string\"\n },\n {\n \"name\": \"user\",\n \"baseName\": \"user\",\n \"type\": \"string\"\n }\n];\nexports.V1beta1SubjectAccessReviewSpec = V1beta1SubjectAccessReviewSpec;\n/**\n* SubjectAccessReviewStatus\n*/\nclass V1beta1SubjectAccessReviewStatus {\n static getAttributeTypeMap() {\n return V1beta1SubjectAccessReviewStatus.attributeTypeMap;\n }\n}\nV1beta1SubjectAccessReviewStatus.discriminator = undefined;\nV1beta1SubjectAccessReviewStatus.attributeTypeMap = [\n {\n \"name\": \"allowed\",\n \"baseName\": \"allowed\",\n \"type\": \"boolean\"\n },\n {\n \"name\": \"denied\",\n \"baseName\": \"denied\",\n \"type\": \"boolean\"\n },\n {\n \"name\": \"evaluationError\",\n \"baseName\": \"evaluationError\",\n \"type\": \"string\"\n },\n {\n \"name\": \"reason\",\n \"baseName\": \"reason\",\n \"type\": \"string\"\n }\n];\nexports.V1beta1SubjectAccessReviewStatus = V1beta1SubjectAccessReviewStatus;\n/**\n* SubjectRulesReviewStatus contains the result of a rules check. This check can be incomplete depending on the set of authorizers the server is configured with and any errors experienced during evaluation. Because authorization rules are additive, if a rule appears in a list it's safe to assume the subject has that permission, even if that list is incomplete.\n*/\nclass V1beta1SubjectRulesReviewStatus {\n static getAttributeTypeMap() {\n return V1beta1SubjectRulesReviewStatus.attributeTypeMap;\n }\n}\nV1beta1SubjectRulesReviewStatus.discriminator = undefined;\nV1beta1SubjectRulesReviewStatus.attributeTypeMap = [\n {\n \"name\": \"evaluationError\",\n \"baseName\": \"evaluationError\",\n \"type\": \"string\"\n },\n {\n \"name\": \"incomplete\",\n \"baseName\": \"incomplete\",\n \"type\": \"boolean\"\n },\n {\n \"name\": \"nonResourceRules\",\n \"baseName\": \"nonResourceRules\",\n \"type\": \"Array\"\n },\n {\n \"name\": \"resourceRules\",\n \"baseName\": \"resourceRules\",\n \"type\": \"Array\"\n }\n];\nexports.V1beta1SubjectRulesReviewStatus = V1beta1SubjectRulesReviewStatus;\n/**\n* TokenReview attempts to authenticate a token to a known user. Note: TokenReview requests may be cached by the webhook token authenticator plugin in the kube-apiserver.\n*/\nclass V1beta1TokenReview {\n static getAttributeTypeMap() {\n return V1beta1TokenReview.attributeTypeMap;\n }\n}\nV1beta1TokenReview.discriminator = undefined;\nV1beta1TokenReview.attributeTypeMap = [\n {\n \"name\": \"apiVersion\",\n \"baseName\": \"apiVersion\",\n \"type\": \"string\"\n },\n {\n \"name\": \"kind\",\n \"baseName\": \"kind\",\n \"type\": \"string\"\n },\n {\n \"name\": \"metadata\",\n \"baseName\": \"metadata\",\n \"type\": \"V1ObjectMeta\"\n },\n {\n \"name\": \"spec\",\n \"baseName\": \"spec\",\n \"type\": \"V1beta1TokenReviewSpec\"\n },\n {\n \"name\": \"status\",\n \"baseName\": \"status\",\n \"type\": \"V1beta1TokenReviewStatus\"\n }\n];\nexports.V1beta1TokenReview = V1beta1TokenReview;\n/**\n* TokenReviewSpec is a description of the token authentication request.\n*/\nclass V1beta1TokenReviewSpec {\n static getAttributeTypeMap() {\n return V1beta1TokenReviewSpec.attributeTypeMap;\n }\n}\nV1beta1TokenReviewSpec.discriminator = undefined;\nV1beta1TokenReviewSpec.attributeTypeMap = [\n {\n \"name\": \"audiences\",\n \"baseName\": \"audiences\",\n \"type\": \"Array\"\n },\n {\n \"name\": \"token\",\n \"baseName\": \"token\",\n \"type\": \"string\"\n }\n];\nexports.V1beta1TokenReviewSpec = V1beta1TokenReviewSpec;\n/**\n* TokenReviewStatus is the result of the token authentication request.\n*/\nclass V1beta1TokenReviewStatus {\n static getAttributeTypeMap() {\n return V1beta1TokenReviewStatus.attributeTypeMap;\n }\n}\nV1beta1TokenReviewStatus.discriminator = undefined;\nV1beta1TokenReviewStatus.attributeTypeMap = [\n {\n \"name\": \"audiences\",\n \"baseName\": \"audiences\",\n \"type\": \"Array\"\n },\n {\n \"name\": \"authenticated\",\n \"baseName\": \"authenticated\",\n \"type\": \"boolean\"\n },\n {\n \"name\": \"error\",\n \"baseName\": \"error\",\n \"type\": \"string\"\n },\n {\n \"name\": \"user\",\n \"baseName\": \"user\",\n \"type\": \"V1beta1UserInfo\"\n }\n];\nexports.V1beta1TokenReviewStatus = V1beta1TokenReviewStatus;\n/**\n* UserInfo holds the information about the user needed to implement the user.Info interface.\n*/\nclass V1beta1UserInfo {\n static getAttributeTypeMap() {\n return V1beta1UserInfo.attributeTypeMap;\n }\n}\nV1beta1UserInfo.discriminator = undefined;\nV1beta1UserInfo.attributeTypeMap = [\n {\n \"name\": \"extra\",\n \"baseName\": \"extra\",\n \"type\": \"{ [key: string]: Array; }\"\n },\n {\n \"name\": \"groups\",\n \"baseName\": \"groups\",\n \"type\": \"Array\"\n },\n {\n \"name\": \"uid\",\n \"baseName\": \"uid\",\n \"type\": \"string\"\n },\n {\n \"name\": \"username\",\n \"baseName\": \"username\",\n \"type\": \"string\"\n }\n];\nexports.V1beta1UserInfo = V1beta1UserInfo;\n/**\n* ValidatingWebhookConfiguration describes the configuration of and admission webhook that accept or reject and object without changing it.\n*/\nclass V1beta1ValidatingWebhookConfiguration {\n static getAttributeTypeMap() {\n return V1beta1ValidatingWebhookConfiguration.attributeTypeMap;\n }\n}\nV1beta1ValidatingWebhookConfiguration.discriminator = undefined;\nV1beta1ValidatingWebhookConfiguration.attributeTypeMap = [\n {\n \"name\": \"apiVersion\",\n \"baseName\": \"apiVersion\",\n \"type\": \"string\"\n },\n {\n \"name\": \"kind\",\n \"baseName\": \"kind\",\n \"type\": \"string\"\n },\n {\n \"name\": \"metadata\",\n \"baseName\": \"metadata\",\n \"type\": \"V1ObjectMeta\"\n },\n {\n \"name\": \"webhooks\",\n \"baseName\": \"webhooks\",\n \"type\": \"Array\"\n }\n];\nexports.V1beta1ValidatingWebhookConfiguration = V1beta1ValidatingWebhookConfiguration;\n/**\n* ValidatingWebhookConfigurationList is a list of ValidatingWebhookConfiguration.\n*/\nclass V1beta1ValidatingWebhookConfigurationList {\n static getAttributeTypeMap() {\n return V1beta1ValidatingWebhookConfigurationList.attributeTypeMap;\n }\n}\nV1beta1ValidatingWebhookConfigurationList.discriminator = undefined;\nV1beta1ValidatingWebhookConfigurationList.attributeTypeMap = [\n {\n \"name\": \"apiVersion\",\n \"baseName\": \"apiVersion\",\n \"type\": \"string\"\n },\n {\n \"name\": \"items\",\n \"baseName\": \"items\",\n \"type\": \"Array\"\n },\n {\n \"name\": \"kind\",\n \"baseName\": \"kind\",\n \"type\": \"string\"\n },\n {\n \"name\": \"metadata\",\n \"baseName\": \"metadata\",\n \"type\": \"V1ListMeta\"\n }\n];\nexports.V1beta1ValidatingWebhookConfigurationList = V1beta1ValidatingWebhookConfigurationList;\n/**\n* VolumeAttachment captures the intent to attach or detach the specified volume to/from the specified node. VolumeAttachment objects are non-namespaced.\n*/\nclass V1beta1VolumeAttachment {\n static getAttributeTypeMap() {\n return V1beta1VolumeAttachment.attributeTypeMap;\n }\n}\nV1beta1VolumeAttachment.discriminator = undefined;\nV1beta1VolumeAttachment.attributeTypeMap = [\n {\n \"name\": \"apiVersion\",\n \"baseName\": \"apiVersion\",\n \"type\": \"string\"\n },\n {\n \"name\": \"kind\",\n \"baseName\": \"kind\",\n \"type\": \"string\"\n },\n {\n \"name\": \"metadata\",\n \"baseName\": \"metadata\",\n \"type\": \"V1ObjectMeta\"\n },\n {\n \"name\": \"spec\",\n \"baseName\": \"spec\",\n \"type\": \"V1beta1VolumeAttachmentSpec\"\n },\n {\n \"name\": \"status\",\n \"baseName\": \"status\",\n \"type\": \"V1beta1VolumeAttachmentStatus\"\n }\n];\nexports.V1beta1VolumeAttachment = V1beta1VolumeAttachment;\n/**\n* VolumeAttachmentList is a collection of VolumeAttachment objects.\n*/\nclass V1beta1VolumeAttachmentList {\n static getAttributeTypeMap() {\n return V1beta1VolumeAttachmentList.attributeTypeMap;\n }\n}\nV1beta1VolumeAttachmentList.discriminator = undefined;\nV1beta1VolumeAttachmentList.attributeTypeMap = [\n {\n \"name\": \"apiVersion\",\n \"baseName\": \"apiVersion\",\n \"type\": \"string\"\n },\n {\n \"name\": \"items\",\n \"baseName\": \"items\",\n \"type\": \"Array\"\n },\n {\n \"name\": \"kind\",\n \"baseName\": \"kind\",\n \"type\": \"string\"\n },\n {\n \"name\": \"metadata\",\n \"baseName\": \"metadata\",\n \"type\": \"V1ListMeta\"\n }\n];\nexports.V1beta1VolumeAttachmentList = V1beta1VolumeAttachmentList;\n/**\n* VolumeAttachmentSource represents a volume that should be attached. Right now only PersistenVolumes can be attached via external attacher, in future we may allow also inline volumes in pods. Exactly one member can be set.\n*/\nclass V1beta1VolumeAttachmentSource {\n static getAttributeTypeMap() {\n return V1beta1VolumeAttachmentSource.attributeTypeMap;\n }\n}\nV1beta1VolumeAttachmentSource.discriminator = undefined;\nV1beta1VolumeAttachmentSource.attributeTypeMap = [\n {\n \"name\": \"persistentVolumeName\",\n \"baseName\": \"persistentVolumeName\",\n \"type\": \"string\"\n }\n];\nexports.V1beta1VolumeAttachmentSource = V1beta1VolumeAttachmentSource;\n/**\n* VolumeAttachmentSpec is the specification of a VolumeAttachment request.\n*/\nclass V1beta1VolumeAttachmentSpec {\n static getAttributeTypeMap() {\n return V1beta1VolumeAttachmentSpec.attributeTypeMap;\n }\n}\nV1beta1VolumeAttachmentSpec.discriminator = undefined;\nV1beta1VolumeAttachmentSpec.attributeTypeMap = [\n {\n \"name\": \"attacher\",\n \"baseName\": \"attacher\",\n \"type\": \"string\"\n },\n {\n \"name\": \"nodeName\",\n \"baseName\": \"nodeName\",\n \"type\": \"string\"\n },\n {\n \"name\": \"source\",\n \"baseName\": \"source\",\n \"type\": \"V1beta1VolumeAttachmentSource\"\n }\n];\nexports.V1beta1VolumeAttachmentSpec = V1beta1VolumeAttachmentSpec;\n/**\n* VolumeAttachmentStatus is the status of a VolumeAttachment request.\n*/\nclass V1beta1VolumeAttachmentStatus {\n static getAttributeTypeMap() {\n return V1beta1VolumeAttachmentStatus.attributeTypeMap;\n }\n}\nV1beta1VolumeAttachmentStatus.discriminator = undefined;\nV1beta1VolumeAttachmentStatus.attributeTypeMap = [\n {\n \"name\": \"attachError\",\n \"baseName\": \"attachError\",\n \"type\": \"V1beta1VolumeError\"\n },\n {\n \"name\": \"attached\",\n \"baseName\": \"attached\",\n \"type\": \"boolean\"\n },\n {\n \"name\": \"attachmentMetadata\",\n \"baseName\": \"attachmentMetadata\",\n \"type\": \"{ [key: string]: string; }\"\n },\n {\n \"name\": \"detachError\",\n \"baseName\": \"detachError\",\n \"type\": \"V1beta1VolumeError\"\n }\n];\nexports.V1beta1VolumeAttachmentStatus = V1beta1VolumeAttachmentStatus;\n/**\n* VolumeError captures an error encountered during a volume operation.\n*/\nclass V1beta1VolumeError {\n static getAttributeTypeMap() {\n return V1beta1VolumeError.attributeTypeMap;\n }\n}\nV1beta1VolumeError.discriminator = undefined;\nV1beta1VolumeError.attributeTypeMap = [\n {\n \"name\": \"message\",\n \"baseName\": \"message\",\n \"type\": \"string\"\n },\n {\n \"name\": \"time\",\n \"baseName\": \"time\",\n \"type\": \"Date\"\n }\n];\nexports.V1beta1VolumeError = V1beta1VolumeError;\n/**\n* Webhook describes an admission webhook and the resources and operations it applies to.\n*/\nclass V1beta1Webhook {\n static getAttributeTypeMap() {\n return V1beta1Webhook.attributeTypeMap;\n }\n}\nV1beta1Webhook.discriminator = undefined;\nV1beta1Webhook.attributeTypeMap = [\n {\n \"name\": \"clientConfig\",\n \"baseName\": \"clientConfig\",\n \"type\": \"AdmissionregistrationV1beta1WebhookClientConfig\"\n },\n {\n \"name\": \"failurePolicy\",\n \"baseName\": \"failurePolicy\",\n \"type\": \"string\"\n },\n {\n \"name\": \"name\",\n \"baseName\": \"name\",\n \"type\": \"string\"\n },\n {\n \"name\": \"namespaceSelector\",\n \"baseName\": \"namespaceSelector\",\n \"type\": \"V1LabelSelector\"\n },\n {\n \"name\": \"rules\",\n \"baseName\": \"rules\",\n \"type\": \"Array\"\n },\n {\n \"name\": \"sideEffects\",\n \"baseName\": \"sideEffects\",\n \"type\": \"string\"\n }\n];\nexports.V1beta1Webhook = V1beta1Webhook;\n/**\n* 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.\n*/\nclass V1beta2ControllerRevision {\n static getAttributeTypeMap() {\n return V1beta2ControllerRevision.attributeTypeMap;\n }\n}\nV1beta2ControllerRevision.discriminator = undefined;\nV1beta2ControllerRevision.attributeTypeMap = [\n {\n \"name\": \"apiVersion\",\n \"baseName\": \"apiVersion\",\n \"type\": \"string\"\n },\n {\n \"name\": \"data\",\n \"baseName\": \"data\",\n \"type\": \"RuntimeRawExtension\"\n },\n {\n \"name\": \"kind\",\n \"baseName\": \"kind\",\n \"type\": \"string\"\n },\n {\n \"name\": \"metadata\",\n \"baseName\": \"metadata\",\n \"type\": \"V1ObjectMeta\"\n },\n {\n \"name\": \"revision\",\n \"baseName\": \"revision\",\n \"type\": \"number\"\n }\n];\nexports.V1beta2ControllerRevision = V1beta2ControllerRevision;\n/**\n* ControllerRevisionList is a resource containing a list of ControllerRevision objects.\n*/\nclass V1beta2ControllerRevisionList {\n static getAttributeTypeMap() {\n return V1beta2ControllerRevisionList.attributeTypeMap;\n }\n}\nV1beta2ControllerRevisionList.discriminator = undefined;\nV1beta2ControllerRevisionList.attributeTypeMap = [\n {\n \"name\": \"apiVersion\",\n \"baseName\": \"apiVersion\",\n \"type\": \"string\"\n },\n {\n \"name\": \"items\",\n \"baseName\": \"items\",\n \"type\": \"Array\"\n },\n {\n \"name\": \"kind\",\n \"baseName\": \"kind\",\n \"type\": \"string\"\n },\n {\n \"name\": \"metadata\",\n \"baseName\": \"metadata\",\n \"type\": \"V1ListMeta\"\n }\n];\nexports.V1beta2ControllerRevisionList = V1beta2ControllerRevisionList;\n/**\n* 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.\n*/\nclass V1beta2DaemonSet {\n static getAttributeTypeMap() {\n return V1beta2DaemonSet.attributeTypeMap;\n }\n}\nV1beta2DaemonSet.discriminator = undefined;\nV1beta2DaemonSet.attributeTypeMap = [\n {\n \"name\": \"apiVersion\",\n \"baseName\": \"apiVersion\",\n \"type\": \"string\"\n },\n {\n \"name\": \"kind\",\n \"baseName\": \"kind\",\n \"type\": \"string\"\n },\n {\n \"name\": \"metadata\",\n \"baseName\": \"metadata\",\n \"type\": \"V1ObjectMeta\"\n },\n {\n \"name\": \"spec\",\n \"baseName\": \"spec\",\n \"type\": \"V1beta2DaemonSetSpec\"\n },\n {\n \"name\": \"status\",\n \"baseName\": \"status\",\n \"type\": \"V1beta2DaemonSetStatus\"\n }\n];\nexports.V1beta2DaemonSet = V1beta2DaemonSet;\n/**\n* DaemonSetCondition describes the state of a DaemonSet at a certain point.\n*/\nclass V1beta2DaemonSetCondition {\n static getAttributeTypeMap() {\n return V1beta2DaemonSetCondition.attributeTypeMap;\n }\n}\nV1beta2DaemonSetCondition.discriminator = undefined;\nV1beta2DaemonSetCondition.attributeTypeMap = [\n {\n \"name\": \"lastTransitionTime\",\n \"baseName\": \"lastTransitionTime\",\n \"type\": \"Date\"\n },\n {\n \"name\": \"message\",\n \"baseName\": \"message\",\n \"type\": \"string\"\n },\n {\n \"name\": \"reason\",\n \"baseName\": \"reason\",\n \"type\": \"string\"\n },\n {\n \"name\": \"status\",\n \"baseName\": \"status\",\n \"type\": \"string\"\n },\n {\n \"name\": \"type\",\n \"baseName\": \"type\",\n \"type\": \"string\"\n }\n];\nexports.V1beta2DaemonSetCondition = V1beta2DaemonSetCondition;\n/**\n* DaemonSetList is a collection of daemon sets.\n*/\nclass V1beta2DaemonSetList {\n static getAttributeTypeMap() {\n return V1beta2DaemonSetList.attributeTypeMap;\n }\n}\nV1beta2DaemonSetList.discriminator = undefined;\nV1beta2DaemonSetList.attributeTypeMap = [\n {\n \"name\": \"apiVersion\",\n \"baseName\": \"apiVersion\",\n \"type\": \"string\"\n },\n {\n \"name\": \"items\",\n \"baseName\": \"items\",\n \"type\": \"Array\"\n },\n {\n \"name\": \"kind\",\n \"baseName\": \"kind\",\n \"type\": \"string\"\n },\n {\n \"name\": \"metadata\",\n \"baseName\": \"metadata\",\n \"type\": \"V1ListMeta\"\n }\n];\nexports.V1beta2DaemonSetList = V1beta2DaemonSetList;\n/**\n* DaemonSetSpec is the specification of a daemon set.\n*/\nclass V1beta2DaemonSetSpec {\n static getAttributeTypeMap() {\n return V1beta2DaemonSetSpec.attributeTypeMap;\n }\n}\nV1beta2DaemonSetSpec.discriminator = undefined;\nV1beta2DaemonSetSpec.attributeTypeMap = [\n {\n \"name\": \"minReadySeconds\",\n \"baseName\": \"minReadySeconds\",\n \"type\": \"number\"\n },\n {\n \"name\": \"revisionHistoryLimit\",\n \"baseName\": \"revisionHistoryLimit\",\n \"type\": \"number\"\n },\n {\n \"name\": \"selector\",\n \"baseName\": \"selector\",\n \"type\": \"V1LabelSelector\"\n },\n {\n \"name\": \"template\",\n \"baseName\": \"template\",\n \"type\": \"V1PodTemplateSpec\"\n },\n {\n \"name\": \"updateStrategy\",\n \"baseName\": \"updateStrategy\",\n \"type\": \"V1beta2DaemonSetUpdateStrategy\"\n }\n];\nexports.V1beta2DaemonSetSpec = V1beta2DaemonSetSpec;\n/**\n* DaemonSetStatus represents the current status of a daemon set.\n*/\nclass V1beta2DaemonSetStatus {\n static getAttributeTypeMap() {\n return V1beta2DaemonSetStatus.attributeTypeMap;\n }\n}\nV1beta2DaemonSetStatus.discriminator = undefined;\nV1beta2DaemonSetStatus.attributeTypeMap = [\n {\n \"name\": \"collisionCount\",\n \"baseName\": \"collisionCount\",\n \"type\": \"number\"\n },\n {\n \"name\": \"conditions\",\n \"baseName\": \"conditions\",\n \"type\": \"Array\"\n },\n {\n \"name\": \"currentNumberScheduled\",\n \"baseName\": \"currentNumberScheduled\",\n \"type\": \"number\"\n },\n {\n \"name\": \"desiredNumberScheduled\",\n \"baseName\": \"desiredNumberScheduled\",\n \"type\": \"number\"\n },\n {\n \"name\": \"numberAvailable\",\n \"baseName\": \"numberAvailable\",\n \"type\": \"number\"\n },\n {\n \"name\": \"numberMisscheduled\",\n \"baseName\": \"numberMisscheduled\",\n \"type\": \"number\"\n },\n {\n \"name\": \"numberReady\",\n \"baseName\": \"numberReady\",\n \"type\": \"number\"\n },\n {\n \"name\": \"numberUnavailable\",\n \"baseName\": \"numberUnavailable\",\n \"type\": \"number\"\n },\n {\n \"name\": \"observedGeneration\",\n \"baseName\": \"observedGeneration\",\n \"type\": \"number\"\n },\n {\n \"name\": \"updatedNumberScheduled\",\n \"baseName\": \"updatedNumberScheduled\",\n \"type\": \"number\"\n }\n];\nexports.V1beta2DaemonSetStatus = V1beta2DaemonSetStatus;\n/**\n* DaemonSetUpdateStrategy is a struct used to control the update strategy for a DaemonSet.\n*/\nclass V1beta2DaemonSetUpdateStrategy {\n static getAttributeTypeMap() {\n return V1beta2DaemonSetUpdateStrategy.attributeTypeMap;\n }\n}\nV1beta2DaemonSetUpdateStrategy.discriminator = undefined;\nV1beta2DaemonSetUpdateStrategy.attributeTypeMap = [\n {\n \"name\": \"rollingUpdate\",\n \"baseName\": \"rollingUpdate\",\n \"type\": \"V1beta2RollingUpdateDaemonSet\"\n },\n {\n \"name\": \"type\",\n \"baseName\": \"type\",\n \"type\": \"string\"\n }\n];\nexports.V1beta2DaemonSetUpdateStrategy = V1beta2DaemonSetUpdateStrategy;\n/**\n* 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.\n*/\nclass V1beta2Deployment {\n static getAttributeTypeMap() {\n return V1beta2Deployment.attributeTypeMap;\n }\n}\nV1beta2Deployment.discriminator = undefined;\nV1beta2Deployment.attributeTypeMap = [\n {\n \"name\": \"apiVersion\",\n \"baseName\": \"apiVersion\",\n \"type\": \"string\"\n },\n {\n \"name\": \"kind\",\n \"baseName\": \"kind\",\n \"type\": \"string\"\n },\n {\n \"name\": \"metadata\",\n \"baseName\": \"metadata\",\n \"type\": \"V1ObjectMeta\"\n },\n {\n \"name\": \"spec\",\n \"baseName\": \"spec\",\n \"type\": \"V1beta2DeploymentSpec\"\n },\n {\n \"name\": \"status\",\n \"baseName\": \"status\",\n \"type\": \"V1beta2DeploymentStatus\"\n }\n];\nexports.V1beta2Deployment = V1beta2Deployment;\n/**\n* DeploymentCondition describes the state of a deployment at a certain point.\n*/\nclass V1beta2DeploymentCondition {\n static getAttributeTypeMap() {\n return V1beta2DeploymentCondition.attributeTypeMap;\n }\n}\nV1beta2DeploymentCondition.discriminator = undefined;\nV1beta2DeploymentCondition.attributeTypeMap = [\n {\n \"name\": \"lastTransitionTime\",\n \"baseName\": \"lastTransitionTime\",\n \"type\": \"Date\"\n },\n {\n \"name\": \"lastUpdateTime\",\n \"baseName\": \"lastUpdateTime\",\n \"type\": \"Date\"\n },\n {\n \"name\": \"message\",\n \"baseName\": \"message\",\n \"type\": \"string\"\n },\n {\n \"name\": \"reason\",\n \"baseName\": \"reason\",\n \"type\": \"string\"\n },\n {\n \"name\": \"status\",\n \"baseName\": \"status\",\n \"type\": \"string\"\n },\n {\n \"name\": \"type\",\n \"baseName\": \"type\",\n \"type\": \"string\"\n }\n];\nexports.V1beta2DeploymentCondition = V1beta2DeploymentCondition;\n/**\n* DeploymentList is a list of Deployments.\n*/\nclass V1beta2DeploymentList {\n static getAttributeTypeMap() {\n return V1beta2DeploymentList.attributeTypeMap;\n }\n}\nV1beta2DeploymentList.discriminator = undefined;\nV1beta2DeploymentList.attributeTypeMap = [\n {\n \"name\": \"apiVersion\",\n \"baseName\": \"apiVersion\",\n \"type\": \"string\"\n },\n {\n \"name\": \"items\",\n \"baseName\": \"items\",\n \"type\": \"Array\"\n },\n {\n \"name\": \"kind\",\n \"baseName\": \"kind\",\n \"type\": \"string\"\n },\n {\n \"name\": \"metadata\",\n \"baseName\": \"metadata\",\n \"type\": \"V1ListMeta\"\n }\n];\nexports.V1beta2DeploymentList = V1beta2DeploymentList;\n/**\n* DeploymentSpec is the specification of the desired behavior of the Deployment.\n*/\nclass V1beta2DeploymentSpec {\n static getAttributeTypeMap() {\n return V1beta2DeploymentSpec.attributeTypeMap;\n }\n}\nV1beta2DeploymentSpec.discriminator = undefined;\nV1beta2DeploymentSpec.attributeTypeMap = [\n {\n \"name\": \"minReadySeconds\",\n \"baseName\": \"minReadySeconds\",\n \"type\": \"number\"\n },\n {\n \"name\": \"paused\",\n \"baseName\": \"paused\",\n \"type\": \"boolean\"\n },\n {\n \"name\": \"progressDeadlineSeconds\",\n \"baseName\": \"progressDeadlineSeconds\",\n \"type\": \"number\"\n },\n {\n \"name\": \"replicas\",\n \"baseName\": \"replicas\",\n \"type\": \"number\"\n },\n {\n \"name\": \"revisionHistoryLimit\",\n \"baseName\": \"revisionHistoryLimit\",\n \"type\": \"number\"\n },\n {\n \"name\": \"selector\",\n \"baseName\": \"selector\",\n \"type\": \"V1LabelSelector\"\n },\n {\n \"name\": \"strategy\",\n \"baseName\": \"strategy\",\n \"type\": \"V1beta2DeploymentStrategy\"\n },\n {\n \"name\": \"template\",\n \"baseName\": \"template\",\n \"type\": \"V1PodTemplateSpec\"\n }\n];\nexports.V1beta2DeploymentSpec = V1beta2DeploymentSpec;\n/**\n* DeploymentStatus is the most recently observed status of the Deployment.\n*/\nclass V1beta2DeploymentStatus {\n static getAttributeTypeMap() {\n return V1beta2DeploymentStatus.attributeTypeMap;\n }\n}\nV1beta2DeploymentStatus.discriminator = undefined;\nV1beta2DeploymentStatus.attributeTypeMap = [\n {\n \"name\": \"availableReplicas\",\n \"baseName\": \"availableReplicas\",\n \"type\": \"number\"\n },\n {\n \"name\": \"collisionCount\",\n \"baseName\": \"collisionCount\",\n \"type\": \"number\"\n },\n {\n \"name\": \"conditions\",\n \"baseName\": \"conditions\",\n \"type\": \"Array\"\n },\n {\n \"name\": \"observedGeneration\",\n \"baseName\": \"observedGeneration\",\n \"type\": \"number\"\n },\n {\n \"name\": \"readyReplicas\",\n \"baseName\": \"readyReplicas\",\n \"type\": \"number\"\n },\n {\n \"name\": \"replicas\",\n \"baseName\": \"replicas\",\n \"type\": \"number\"\n },\n {\n \"name\": \"unavailableReplicas\",\n \"baseName\": \"unavailableReplicas\",\n \"type\": \"number\"\n },\n {\n \"name\": \"updatedReplicas\",\n \"baseName\": \"updatedReplicas\",\n \"type\": \"number\"\n }\n];\nexports.V1beta2DeploymentStatus = V1beta2DeploymentStatus;\n/**\n* DeploymentStrategy describes how to replace existing pods with new ones.\n*/\nclass V1beta2DeploymentStrategy {\n static getAttributeTypeMap() {\n return V1beta2DeploymentStrategy.attributeTypeMap;\n }\n}\nV1beta2DeploymentStrategy.discriminator = undefined;\nV1beta2DeploymentStrategy.attributeTypeMap = [\n {\n \"name\": \"rollingUpdate\",\n \"baseName\": \"rollingUpdate\",\n \"type\": \"V1beta2RollingUpdateDeployment\"\n },\n {\n \"name\": \"type\",\n \"baseName\": \"type\",\n \"type\": \"string\"\n }\n];\nexports.V1beta2DeploymentStrategy = V1beta2DeploymentStrategy;\n/**\n* 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.\n*/\nclass V1beta2ReplicaSet {\n static getAttributeTypeMap() {\n return V1beta2ReplicaSet.attributeTypeMap;\n }\n}\nV1beta2ReplicaSet.discriminator = undefined;\nV1beta2ReplicaSet.attributeTypeMap = [\n {\n \"name\": \"apiVersion\",\n \"baseName\": \"apiVersion\",\n \"type\": \"string\"\n },\n {\n \"name\": \"kind\",\n \"baseName\": \"kind\",\n \"type\": \"string\"\n },\n {\n \"name\": \"metadata\",\n \"baseName\": \"metadata\",\n \"type\": \"V1ObjectMeta\"\n },\n {\n \"name\": \"spec\",\n \"baseName\": \"spec\",\n \"type\": \"V1beta2ReplicaSetSpec\"\n },\n {\n \"name\": \"status\",\n \"baseName\": \"status\",\n \"type\": \"V1beta2ReplicaSetStatus\"\n }\n];\nexports.V1beta2ReplicaSet = V1beta2ReplicaSet;\n/**\n* ReplicaSetCondition describes the state of a replica set at a certain point.\n*/\nclass V1beta2ReplicaSetCondition {\n static getAttributeTypeMap() {\n return V1beta2ReplicaSetCondition.attributeTypeMap;\n }\n}\nV1beta2ReplicaSetCondition.discriminator = undefined;\nV1beta2ReplicaSetCondition.attributeTypeMap = [\n {\n \"name\": \"lastTransitionTime\",\n \"baseName\": \"lastTransitionTime\",\n \"type\": \"Date\"\n },\n {\n \"name\": \"message\",\n \"baseName\": \"message\",\n \"type\": \"string\"\n },\n {\n \"name\": \"reason\",\n \"baseName\": \"reason\",\n \"type\": \"string\"\n },\n {\n \"name\": \"status\",\n \"baseName\": \"status\",\n \"type\": \"string\"\n },\n {\n \"name\": \"type\",\n \"baseName\": \"type\",\n \"type\": \"string\"\n }\n];\nexports.V1beta2ReplicaSetCondition = V1beta2ReplicaSetCondition;\n/**\n* ReplicaSetList is a collection of ReplicaSets.\n*/\nclass V1beta2ReplicaSetList {\n static getAttributeTypeMap() {\n return V1beta2ReplicaSetList.attributeTypeMap;\n }\n}\nV1beta2ReplicaSetList.discriminator = undefined;\nV1beta2ReplicaSetList.attributeTypeMap = [\n {\n \"name\": \"apiVersion\",\n \"baseName\": \"apiVersion\",\n \"type\": \"string\"\n },\n {\n \"name\": \"items\",\n \"baseName\": \"items\",\n \"type\": \"Array\"\n },\n {\n \"name\": \"kind\",\n \"baseName\": \"kind\",\n \"type\": \"string\"\n },\n {\n \"name\": \"metadata\",\n \"baseName\": \"metadata\",\n \"type\": \"V1ListMeta\"\n }\n];\nexports.V1beta2ReplicaSetList = V1beta2ReplicaSetList;\n/**\n* ReplicaSetSpec is the specification of a ReplicaSet.\n*/\nclass V1beta2ReplicaSetSpec {\n static getAttributeTypeMap() {\n return V1beta2ReplicaSetSpec.attributeTypeMap;\n }\n}\nV1beta2ReplicaSetSpec.discriminator = undefined;\nV1beta2ReplicaSetSpec.attributeTypeMap = [\n {\n \"name\": \"minReadySeconds\",\n \"baseName\": \"minReadySeconds\",\n \"type\": \"number\"\n },\n {\n \"name\": \"replicas\",\n \"baseName\": \"replicas\",\n \"type\": \"number\"\n },\n {\n \"name\": \"selector\",\n \"baseName\": \"selector\",\n \"type\": \"V1LabelSelector\"\n },\n {\n \"name\": \"template\",\n \"baseName\": \"template\",\n \"type\": \"V1PodTemplateSpec\"\n }\n];\nexports.V1beta2ReplicaSetSpec = V1beta2ReplicaSetSpec;\n/**\n* ReplicaSetStatus represents the current status of a ReplicaSet.\n*/\nclass V1beta2ReplicaSetStatus {\n static getAttributeTypeMap() {\n return V1beta2ReplicaSetStatus.attributeTypeMap;\n }\n}\nV1beta2ReplicaSetStatus.discriminator = undefined;\nV1beta2ReplicaSetStatus.attributeTypeMap = [\n {\n \"name\": \"availableReplicas\",\n \"baseName\": \"availableReplicas\",\n \"type\": \"number\"\n },\n {\n \"name\": \"conditions\",\n \"baseName\": \"conditions\",\n \"type\": \"Array\"\n },\n {\n \"name\": \"fullyLabeledReplicas\",\n \"baseName\": \"fullyLabeledReplicas\",\n \"type\": \"number\"\n },\n {\n \"name\": \"observedGeneration\",\n \"baseName\": \"observedGeneration\",\n \"type\": \"number\"\n },\n {\n \"name\": \"readyReplicas\",\n \"baseName\": \"readyReplicas\",\n \"type\": \"number\"\n },\n {\n \"name\": \"replicas\",\n \"baseName\": \"replicas\",\n \"type\": \"number\"\n }\n];\nexports.V1beta2ReplicaSetStatus = V1beta2ReplicaSetStatus;\n/**\n* Spec to control the desired behavior of daemon set rolling update.\n*/\nclass V1beta2RollingUpdateDaemonSet {\n static getAttributeTypeMap() {\n return V1beta2RollingUpdateDaemonSet.attributeTypeMap;\n }\n}\nV1beta2RollingUpdateDaemonSet.discriminator = undefined;\nV1beta2RollingUpdateDaemonSet.attributeTypeMap = [\n {\n \"name\": \"maxUnavailable\",\n \"baseName\": \"maxUnavailable\",\n \"type\": \"any\"\n }\n];\nexports.V1beta2RollingUpdateDaemonSet = V1beta2RollingUpdateDaemonSet;\n/**\n* Spec to control the desired behavior of rolling update.\n*/\nclass V1beta2RollingUpdateDeployment {\n static getAttributeTypeMap() {\n return V1beta2RollingUpdateDeployment.attributeTypeMap;\n }\n}\nV1beta2RollingUpdateDeployment.discriminator = undefined;\nV1beta2RollingUpdateDeployment.attributeTypeMap = [\n {\n \"name\": \"maxSurge\",\n \"baseName\": \"maxSurge\",\n \"type\": \"any\"\n },\n {\n \"name\": \"maxUnavailable\",\n \"baseName\": \"maxUnavailable\",\n \"type\": \"any\"\n }\n];\nexports.V1beta2RollingUpdateDeployment = V1beta2RollingUpdateDeployment;\n/**\n* RollingUpdateStatefulSetStrategy is used to communicate parameter for RollingUpdateStatefulSetStrategyType.\n*/\nclass V1beta2RollingUpdateStatefulSetStrategy {\n static getAttributeTypeMap() {\n return V1beta2RollingUpdateStatefulSetStrategy.attributeTypeMap;\n }\n}\nV1beta2RollingUpdateStatefulSetStrategy.discriminator = undefined;\nV1beta2RollingUpdateStatefulSetStrategy.attributeTypeMap = [\n {\n \"name\": \"partition\",\n \"baseName\": \"partition\",\n \"type\": \"number\"\n }\n];\nexports.V1beta2RollingUpdateStatefulSetStrategy = V1beta2RollingUpdateStatefulSetStrategy;\n/**\n* Scale represents a scaling request for a resource.\n*/\nclass V1beta2Scale {\n static getAttributeTypeMap() {\n return V1beta2Scale.attributeTypeMap;\n }\n}\nV1beta2Scale.discriminator = undefined;\nV1beta2Scale.attributeTypeMap = [\n {\n \"name\": \"apiVersion\",\n \"baseName\": \"apiVersion\",\n \"type\": \"string\"\n },\n {\n \"name\": \"kind\",\n \"baseName\": \"kind\",\n \"type\": \"string\"\n },\n {\n \"name\": \"metadata\",\n \"baseName\": \"metadata\",\n \"type\": \"V1ObjectMeta\"\n },\n {\n \"name\": \"spec\",\n \"baseName\": \"spec\",\n \"type\": \"V1beta2ScaleSpec\"\n },\n {\n \"name\": \"status\",\n \"baseName\": \"status\",\n \"type\": \"V1beta2ScaleStatus\"\n }\n];\nexports.V1beta2Scale = V1beta2Scale;\n/**\n* ScaleSpec describes the attributes of a scale subresource\n*/\nclass V1beta2ScaleSpec {\n static getAttributeTypeMap() {\n return V1beta2ScaleSpec.attributeTypeMap;\n }\n}\nV1beta2ScaleSpec.discriminator = undefined;\nV1beta2ScaleSpec.attributeTypeMap = [\n {\n \"name\": \"replicas\",\n \"baseName\": \"replicas\",\n \"type\": \"number\"\n }\n];\nexports.V1beta2ScaleSpec = V1beta2ScaleSpec;\n/**\n* ScaleStatus represents the current status of a scale subresource.\n*/\nclass V1beta2ScaleStatus {\n static getAttributeTypeMap() {\n return V1beta2ScaleStatus.attributeTypeMap;\n }\n}\nV1beta2ScaleStatus.discriminator = undefined;\nV1beta2ScaleStatus.attributeTypeMap = [\n {\n \"name\": \"replicas\",\n \"baseName\": \"replicas\",\n \"type\": \"number\"\n },\n {\n \"name\": \"selector\",\n \"baseName\": \"selector\",\n \"type\": \"{ [key: string]: string; }\"\n },\n {\n \"name\": \"targetSelector\",\n \"baseName\": \"targetSelector\",\n \"type\": \"string\"\n }\n];\nexports.V1beta2ScaleStatus = V1beta2ScaleStatus;\n/**\n* 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.\n*/\nclass V1beta2StatefulSet {\n static getAttributeTypeMap() {\n return V1beta2StatefulSet.attributeTypeMap;\n }\n}\nV1beta2StatefulSet.discriminator = undefined;\nV1beta2StatefulSet.attributeTypeMap = [\n {\n \"name\": \"apiVersion\",\n \"baseName\": \"apiVersion\",\n \"type\": \"string\"\n },\n {\n \"name\": \"kind\",\n \"baseName\": \"kind\",\n \"type\": \"string\"\n },\n {\n \"name\": \"metadata\",\n \"baseName\": \"metadata\",\n \"type\": \"V1ObjectMeta\"\n },\n {\n \"name\": \"spec\",\n \"baseName\": \"spec\",\n \"type\": \"V1beta2StatefulSetSpec\"\n },\n {\n \"name\": \"status\",\n \"baseName\": \"status\",\n \"type\": \"V1beta2StatefulSetStatus\"\n }\n];\nexports.V1beta2StatefulSet = V1beta2StatefulSet;\n/**\n* StatefulSetCondition describes the state of a statefulset at a certain point.\n*/\nclass V1beta2StatefulSetCondition {\n static getAttributeTypeMap() {\n return V1beta2StatefulSetCondition.attributeTypeMap;\n }\n}\nV1beta2StatefulSetCondition.discriminator = undefined;\nV1beta2StatefulSetCondition.attributeTypeMap = [\n {\n \"name\": \"lastTransitionTime\",\n \"baseName\": \"lastTransitionTime\",\n \"type\": \"Date\"\n },\n {\n \"name\": \"message\",\n \"baseName\": \"message\",\n \"type\": \"string\"\n },\n {\n \"name\": \"reason\",\n \"baseName\": \"reason\",\n \"type\": \"string\"\n },\n {\n \"name\": \"status\",\n \"baseName\": \"status\",\n \"type\": \"string\"\n },\n {\n \"name\": \"type\",\n \"baseName\": \"type\",\n \"type\": \"string\"\n }\n];\nexports.V1beta2StatefulSetCondition = V1beta2StatefulSetCondition;\n/**\n* StatefulSetList is a collection of StatefulSets.\n*/\nclass V1beta2StatefulSetList {\n static getAttributeTypeMap() {\n return V1beta2StatefulSetList.attributeTypeMap;\n }\n}\nV1beta2StatefulSetList.discriminator = undefined;\nV1beta2StatefulSetList.attributeTypeMap = [\n {\n \"name\": \"apiVersion\",\n \"baseName\": \"apiVersion\",\n \"type\": \"string\"\n },\n {\n \"name\": \"items\",\n \"baseName\": \"items\",\n \"type\": \"Array\"\n },\n {\n \"name\": \"kind\",\n \"baseName\": \"kind\",\n \"type\": \"string\"\n },\n {\n \"name\": \"metadata\",\n \"baseName\": \"metadata\",\n \"type\": \"V1ListMeta\"\n }\n];\nexports.V1beta2StatefulSetList = V1beta2StatefulSetList;\n/**\n* A StatefulSetSpec is the specification of a StatefulSet.\n*/\nclass V1beta2StatefulSetSpec {\n static getAttributeTypeMap() {\n return V1beta2StatefulSetSpec.attributeTypeMap;\n }\n}\nV1beta2StatefulSetSpec.discriminator = undefined;\nV1beta2StatefulSetSpec.attributeTypeMap = [\n {\n \"name\": \"podManagementPolicy\",\n \"baseName\": \"podManagementPolicy\",\n \"type\": \"string\"\n },\n {\n \"name\": \"replicas\",\n \"baseName\": \"replicas\",\n \"type\": \"number\"\n },\n {\n \"name\": \"revisionHistoryLimit\",\n \"baseName\": \"revisionHistoryLimit\",\n \"type\": \"number\"\n },\n {\n \"name\": \"selector\",\n \"baseName\": \"selector\",\n \"type\": \"V1LabelSelector\"\n },\n {\n \"name\": \"serviceName\",\n \"baseName\": \"serviceName\",\n \"type\": \"string\"\n },\n {\n \"name\": \"template\",\n \"baseName\": \"template\",\n \"type\": \"V1PodTemplateSpec\"\n },\n {\n \"name\": \"updateStrategy\",\n \"baseName\": \"updateStrategy\",\n \"type\": \"V1beta2StatefulSetUpdateStrategy\"\n },\n {\n \"name\": \"volumeClaimTemplates\",\n \"baseName\": \"volumeClaimTemplates\",\n \"type\": \"Array\"\n }\n];\nexports.V1beta2StatefulSetSpec = V1beta2StatefulSetSpec;\n/**\n* StatefulSetStatus represents the current state of a StatefulSet.\n*/\nclass V1beta2StatefulSetStatus {\n static getAttributeTypeMap() {\n return V1beta2StatefulSetStatus.attributeTypeMap;\n }\n}\nV1beta2StatefulSetStatus.discriminator = undefined;\nV1beta2StatefulSetStatus.attributeTypeMap = [\n {\n \"name\": \"collisionCount\",\n \"baseName\": \"collisionCount\",\n \"type\": \"number\"\n },\n {\n \"name\": \"conditions\",\n \"baseName\": \"conditions\",\n \"type\": \"Array\"\n },\n {\n \"name\": \"currentReplicas\",\n \"baseName\": \"currentReplicas\",\n \"type\": \"number\"\n },\n {\n \"name\": \"currentRevision\",\n \"baseName\": \"currentRevision\",\n \"type\": \"string\"\n },\n {\n \"name\": \"observedGeneration\",\n \"baseName\": \"observedGeneration\",\n \"type\": \"number\"\n },\n {\n \"name\": \"readyReplicas\",\n \"baseName\": \"readyReplicas\",\n \"type\": \"number\"\n },\n {\n \"name\": \"replicas\",\n \"baseName\": \"replicas\",\n \"type\": \"number\"\n },\n {\n \"name\": \"updateRevision\",\n \"baseName\": \"updateRevision\",\n \"type\": \"string\"\n },\n {\n \"name\": \"updatedReplicas\",\n \"baseName\": \"updatedReplicas\",\n \"type\": \"number\"\n }\n];\nexports.V1beta2StatefulSetStatus = V1beta2StatefulSetStatus;\n/**\n* StatefulSetUpdateStrategy indicates the strategy that the StatefulSet controller will use to perform updates. It includes any additional parameters necessary to perform the update for the indicated strategy.\n*/\nclass V1beta2StatefulSetUpdateStrategy {\n static getAttributeTypeMap() {\n return V1beta2StatefulSetUpdateStrategy.attributeTypeMap;\n }\n}\nV1beta2StatefulSetUpdateStrategy.discriminator = undefined;\nV1beta2StatefulSetUpdateStrategy.attributeTypeMap = [\n {\n \"name\": \"rollingUpdate\",\n \"baseName\": \"rollingUpdate\",\n \"type\": \"V1beta2RollingUpdateStatefulSetStrategy\"\n },\n {\n \"name\": \"type\",\n \"baseName\": \"type\",\n \"type\": \"string\"\n }\n];\nexports.V1beta2StatefulSetUpdateStrategy = V1beta2StatefulSetUpdateStrategy;\n/**\n* CronJob represents the configuration of a single cron job.\n*/\nclass V2alpha1CronJob {\n static getAttributeTypeMap() {\n return V2alpha1CronJob.attributeTypeMap;\n }\n}\nV2alpha1CronJob.discriminator = undefined;\nV2alpha1CronJob.attributeTypeMap = [\n {\n \"name\": \"apiVersion\",\n \"baseName\": \"apiVersion\",\n \"type\": \"string\"\n },\n {\n \"name\": \"kind\",\n \"baseName\": \"kind\",\n \"type\": \"string\"\n },\n {\n \"name\": \"metadata\",\n \"baseName\": \"metadata\",\n \"type\": \"V1ObjectMeta\"\n },\n {\n \"name\": \"spec\",\n \"baseName\": \"spec\",\n \"type\": \"V2alpha1CronJobSpec\"\n },\n {\n \"name\": \"status\",\n \"baseName\": \"status\",\n \"type\": \"V2alpha1CronJobStatus\"\n }\n];\nexports.V2alpha1CronJob = V2alpha1CronJob;\n/**\n* CronJobList is a collection of cron jobs.\n*/\nclass V2alpha1CronJobList {\n static getAttributeTypeMap() {\n return V2alpha1CronJobList.attributeTypeMap;\n }\n}\nV2alpha1CronJobList.discriminator = undefined;\nV2alpha1CronJobList.attributeTypeMap = [\n {\n \"name\": \"apiVersion\",\n \"baseName\": \"apiVersion\",\n \"type\": \"string\"\n },\n {\n \"name\": \"items\",\n \"baseName\": \"items\",\n \"type\": \"Array\"\n },\n {\n \"name\": \"kind\",\n \"baseName\": \"kind\",\n \"type\": \"string\"\n },\n {\n \"name\": \"metadata\",\n \"baseName\": \"metadata\",\n \"type\": \"V1ListMeta\"\n }\n];\nexports.V2alpha1CronJobList = V2alpha1CronJobList;\n/**\n* CronJobSpec describes how the job execution will look like and when it will actually run.\n*/\nclass V2alpha1CronJobSpec {\n static getAttributeTypeMap() {\n return V2alpha1CronJobSpec.attributeTypeMap;\n }\n}\nV2alpha1CronJobSpec.discriminator = undefined;\nV2alpha1CronJobSpec.attributeTypeMap = [\n {\n \"name\": \"concurrencyPolicy\",\n \"baseName\": \"concurrencyPolicy\",\n \"type\": \"string\"\n },\n {\n \"name\": \"failedJobsHistoryLimit\",\n \"baseName\": \"failedJobsHistoryLimit\",\n \"type\": \"number\"\n },\n {\n \"name\": \"jobTemplate\",\n \"baseName\": \"jobTemplate\",\n \"type\": \"V2alpha1JobTemplateSpec\"\n },\n {\n \"name\": \"schedule\",\n \"baseName\": \"schedule\",\n \"type\": \"string\"\n },\n {\n \"name\": \"startingDeadlineSeconds\",\n \"baseName\": \"startingDeadlineSeconds\",\n \"type\": \"number\"\n },\n {\n \"name\": \"successfulJobsHistoryLimit\",\n \"baseName\": \"successfulJobsHistoryLimit\",\n \"type\": \"number\"\n },\n {\n \"name\": \"suspend\",\n \"baseName\": \"suspend\",\n \"type\": \"boolean\"\n }\n];\nexports.V2alpha1CronJobSpec = V2alpha1CronJobSpec;\n/**\n* CronJobStatus represents the current state of a cron job.\n*/\nclass V2alpha1CronJobStatus {\n static getAttributeTypeMap() {\n return V2alpha1CronJobStatus.attributeTypeMap;\n }\n}\nV2alpha1CronJobStatus.discriminator = undefined;\nV2alpha1CronJobStatus.attributeTypeMap = [\n {\n \"name\": \"active\",\n \"baseName\": \"active\",\n \"type\": \"Array\"\n },\n {\n \"name\": \"lastScheduleTime\",\n \"baseName\": \"lastScheduleTime\",\n \"type\": \"Date\"\n }\n];\nexports.V2alpha1CronJobStatus = V2alpha1CronJobStatus;\n/**\n* JobTemplateSpec describes the data a Job should have when created from a template\n*/\nclass V2alpha1JobTemplateSpec {\n static getAttributeTypeMap() {\n return V2alpha1JobTemplateSpec.attributeTypeMap;\n }\n}\nV2alpha1JobTemplateSpec.discriminator = undefined;\nV2alpha1JobTemplateSpec.attributeTypeMap = [\n {\n \"name\": \"metadata\",\n \"baseName\": \"metadata\",\n \"type\": \"V1ObjectMeta\"\n },\n {\n \"name\": \"spec\",\n \"baseName\": \"spec\",\n \"type\": \"V1JobSpec\"\n }\n];\nexports.V2alpha1JobTemplateSpec = V2alpha1JobTemplateSpec;\n/**\n* CrossVersionObjectReference contains enough information to let you identify the referred resource.\n*/\nclass V2beta1CrossVersionObjectReference {\n static getAttributeTypeMap() {\n return V2beta1CrossVersionObjectReference.attributeTypeMap;\n }\n}\nV2beta1CrossVersionObjectReference.discriminator = undefined;\nV2beta1CrossVersionObjectReference.attributeTypeMap = [\n {\n \"name\": \"apiVersion\",\n \"baseName\": \"apiVersion\",\n \"type\": \"string\"\n },\n {\n \"name\": \"kind\",\n \"baseName\": \"kind\",\n \"type\": \"string\"\n },\n {\n \"name\": \"name\",\n \"baseName\": \"name\",\n \"type\": \"string\"\n }\n];\nexports.V2beta1CrossVersionObjectReference = V2beta1CrossVersionObjectReference;\n/**\n* ExternalMetricSource indicates how to scale on a metric not associated with any Kubernetes object (for example length of queue in cloud messaging service, or QPS from loadbalancer running outside of cluster). Exactly one \\\"target\\\" type should be set.\n*/\nclass V2beta1ExternalMetricSource {\n static getAttributeTypeMap() {\n return V2beta1ExternalMetricSource.attributeTypeMap;\n }\n}\nV2beta1ExternalMetricSource.discriminator = undefined;\nV2beta1ExternalMetricSource.attributeTypeMap = [\n {\n \"name\": \"metricName\",\n \"baseName\": \"metricName\",\n \"type\": \"string\"\n },\n {\n \"name\": \"metricSelector\",\n \"baseName\": \"metricSelector\",\n \"type\": \"V1LabelSelector\"\n },\n {\n \"name\": \"targetAverageValue\",\n \"baseName\": \"targetAverageValue\",\n \"type\": \"string\"\n },\n {\n \"name\": \"targetValue\",\n \"baseName\": \"targetValue\",\n \"type\": \"string\"\n }\n];\nexports.V2beta1ExternalMetricSource = V2beta1ExternalMetricSource;\n/**\n* ExternalMetricStatus indicates the current value of a global metric not associated with any Kubernetes object.\n*/\nclass V2beta1ExternalMetricStatus {\n static getAttributeTypeMap() {\n return V2beta1ExternalMetricStatus.attributeTypeMap;\n }\n}\nV2beta1ExternalMetricStatus.discriminator = undefined;\nV2beta1ExternalMetricStatus.attributeTypeMap = [\n {\n \"name\": \"currentAverageValue\",\n \"baseName\": \"currentAverageValue\",\n \"type\": \"string\"\n },\n {\n \"name\": \"currentValue\",\n \"baseName\": \"currentValue\",\n \"type\": \"string\"\n },\n {\n \"name\": \"metricName\",\n \"baseName\": \"metricName\",\n \"type\": \"string\"\n },\n {\n \"name\": \"metricSelector\",\n \"baseName\": \"metricSelector\",\n \"type\": \"V1LabelSelector\"\n }\n];\nexports.V2beta1ExternalMetricStatus = V2beta1ExternalMetricStatus;\n/**\n* HorizontalPodAutoscaler is the configuration for a horizontal pod autoscaler, which automatically manages the replica count of any resource implementing the scale subresource based on the metrics specified.\n*/\nclass V2beta1HorizontalPodAutoscaler {\n static getAttributeTypeMap() {\n return V2beta1HorizontalPodAutoscaler.attributeTypeMap;\n }\n}\nV2beta1HorizontalPodAutoscaler.discriminator = undefined;\nV2beta1HorizontalPodAutoscaler.attributeTypeMap = [\n {\n \"name\": \"apiVersion\",\n \"baseName\": \"apiVersion\",\n \"type\": \"string\"\n },\n {\n \"name\": \"kind\",\n \"baseName\": \"kind\",\n \"type\": \"string\"\n },\n {\n \"name\": \"metadata\",\n \"baseName\": \"metadata\",\n \"type\": \"V1ObjectMeta\"\n },\n {\n \"name\": \"spec\",\n \"baseName\": \"spec\",\n \"type\": \"V2beta1HorizontalPodAutoscalerSpec\"\n },\n {\n \"name\": \"status\",\n \"baseName\": \"status\",\n \"type\": \"V2beta1HorizontalPodAutoscalerStatus\"\n }\n];\nexports.V2beta1HorizontalPodAutoscaler = V2beta1HorizontalPodAutoscaler;\n/**\n* HorizontalPodAutoscalerCondition describes the state of a HorizontalPodAutoscaler at a certain point.\n*/\nclass V2beta1HorizontalPodAutoscalerCondition {\n static getAttributeTypeMap() {\n return V2beta1HorizontalPodAutoscalerCondition.attributeTypeMap;\n }\n}\nV2beta1HorizontalPodAutoscalerCondition.discriminator = undefined;\nV2beta1HorizontalPodAutoscalerCondition.attributeTypeMap = [\n {\n \"name\": \"lastTransitionTime\",\n \"baseName\": \"lastTransitionTime\",\n \"type\": \"Date\"\n },\n {\n \"name\": \"message\",\n \"baseName\": \"message\",\n \"type\": \"string\"\n },\n {\n \"name\": \"reason\",\n \"baseName\": \"reason\",\n \"type\": \"string\"\n },\n {\n \"name\": \"status\",\n \"baseName\": \"status\",\n \"type\": \"string\"\n },\n {\n \"name\": \"type\",\n \"baseName\": \"type\",\n \"type\": \"string\"\n }\n];\nexports.V2beta1HorizontalPodAutoscalerCondition = V2beta1HorizontalPodAutoscalerCondition;\n/**\n* HorizontalPodAutoscaler is a list of horizontal pod autoscaler objects.\n*/\nclass V2beta1HorizontalPodAutoscalerList {\n static getAttributeTypeMap() {\n return V2beta1HorizontalPodAutoscalerList.attributeTypeMap;\n }\n}\nV2beta1HorizontalPodAutoscalerList.discriminator = undefined;\nV2beta1HorizontalPodAutoscalerList.attributeTypeMap = [\n {\n \"name\": \"apiVersion\",\n \"baseName\": \"apiVersion\",\n \"type\": \"string\"\n },\n {\n \"name\": \"items\",\n \"baseName\": \"items\",\n \"type\": \"Array\"\n },\n {\n \"name\": \"kind\",\n \"baseName\": \"kind\",\n \"type\": \"string\"\n },\n {\n \"name\": \"metadata\",\n \"baseName\": \"metadata\",\n \"type\": \"V1ListMeta\"\n }\n];\nexports.V2beta1HorizontalPodAutoscalerList = V2beta1HorizontalPodAutoscalerList;\n/**\n* HorizontalPodAutoscalerSpec describes the desired functionality of the HorizontalPodAutoscaler.\n*/\nclass V2beta1HorizontalPodAutoscalerSpec {\n static getAttributeTypeMap() {\n return V2beta1HorizontalPodAutoscalerSpec.attributeTypeMap;\n }\n}\nV2beta1HorizontalPodAutoscalerSpec.discriminator = undefined;\nV2beta1HorizontalPodAutoscalerSpec.attributeTypeMap = [\n {\n \"name\": \"maxReplicas\",\n \"baseName\": \"maxReplicas\",\n \"type\": \"number\"\n },\n {\n \"name\": \"metrics\",\n \"baseName\": \"metrics\",\n \"type\": \"Array\"\n },\n {\n \"name\": \"minReplicas\",\n \"baseName\": \"minReplicas\",\n \"type\": \"number\"\n },\n {\n \"name\": \"scaleTargetRef\",\n \"baseName\": \"scaleTargetRef\",\n \"type\": \"V2beta1CrossVersionObjectReference\"\n }\n];\nexports.V2beta1HorizontalPodAutoscalerSpec = V2beta1HorizontalPodAutoscalerSpec;\n/**\n* HorizontalPodAutoscalerStatus describes the current status of a horizontal pod autoscaler.\n*/\nclass V2beta1HorizontalPodAutoscalerStatus {\n static getAttributeTypeMap() {\n return V2beta1HorizontalPodAutoscalerStatus.attributeTypeMap;\n }\n}\nV2beta1HorizontalPodAutoscalerStatus.discriminator = undefined;\nV2beta1HorizontalPodAutoscalerStatus.attributeTypeMap = [\n {\n \"name\": \"conditions\",\n \"baseName\": \"conditions\",\n \"type\": \"Array\"\n },\n {\n \"name\": \"currentMetrics\",\n \"baseName\": \"currentMetrics\",\n \"type\": \"Array\"\n },\n {\n \"name\": \"currentReplicas\",\n \"baseName\": \"currentReplicas\",\n \"type\": \"number\"\n },\n {\n \"name\": \"desiredReplicas\",\n \"baseName\": \"desiredReplicas\",\n \"type\": \"number\"\n },\n {\n \"name\": \"lastScaleTime\",\n \"baseName\": \"lastScaleTime\",\n \"type\": \"Date\"\n },\n {\n \"name\": \"observedGeneration\",\n \"baseName\": \"observedGeneration\",\n \"type\": \"number\"\n }\n];\nexports.V2beta1HorizontalPodAutoscalerStatus = V2beta1HorizontalPodAutoscalerStatus;\n/**\n* MetricSpec specifies how to scale based on a single metric (only `type` and one other matching field should be set at once).\n*/\nclass V2beta1MetricSpec {\n static getAttributeTypeMap() {\n return V2beta1MetricSpec.attributeTypeMap;\n }\n}\nV2beta1MetricSpec.discriminator = undefined;\nV2beta1MetricSpec.attributeTypeMap = [\n {\n \"name\": \"external\",\n \"baseName\": \"external\",\n \"type\": \"V2beta1ExternalMetricSource\"\n },\n {\n \"name\": \"object\",\n \"baseName\": \"object\",\n \"type\": \"V2beta1ObjectMetricSource\"\n },\n {\n \"name\": \"pods\",\n \"baseName\": \"pods\",\n \"type\": \"V2beta1PodsMetricSource\"\n },\n {\n \"name\": \"resource\",\n \"baseName\": \"resource\",\n \"type\": \"V2beta1ResourceMetricSource\"\n },\n {\n \"name\": \"type\",\n \"baseName\": \"type\",\n \"type\": \"string\"\n }\n];\nexports.V2beta1MetricSpec = V2beta1MetricSpec;\n/**\n* MetricStatus describes the last-read state of a single metric.\n*/\nclass V2beta1MetricStatus {\n static getAttributeTypeMap() {\n return V2beta1MetricStatus.attributeTypeMap;\n }\n}\nV2beta1MetricStatus.discriminator = undefined;\nV2beta1MetricStatus.attributeTypeMap = [\n {\n \"name\": \"external\",\n \"baseName\": \"external\",\n \"type\": \"V2beta1ExternalMetricStatus\"\n },\n {\n \"name\": \"object\",\n \"baseName\": \"object\",\n \"type\": \"V2beta1ObjectMetricStatus\"\n },\n {\n \"name\": \"pods\",\n \"baseName\": \"pods\",\n \"type\": \"V2beta1PodsMetricStatus\"\n },\n {\n \"name\": \"resource\",\n \"baseName\": \"resource\",\n \"type\": \"V2beta1ResourceMetricStatus\"\n },\n {\n \"name\": \"type\",\n \"baseName\": \"type\",\n \"type\": \"string\"\n }\n];\nexports.V2beta1MetricStatus = V2beta1MetricStatus;\n/**\n* ObjectMetricSource indicates how to scale on a metric describing a kubernetes object (for example, hits-per-second on an Ingress object).\n*/\nclass V2beta1ObjectMetricSource {\n static getAttributeTypeMap() {\n return V2beta1ObjectMetricSource.attributeTypeMap;\n }\n}\nV2beta1ObjectMetricSource.discriminator = undefined;\nV2beta1ObjectMetricSource.attributeTypeMap = [\n {\n \"name\": \"averageValue\",\n \"baseName\": \"averageValue\",\n \"type\": \"string\"\n },\n {\n \"name\": \"metricName\",\n \"baseName\": \"metricName\",\n \"type\": \"string\"\n },\n {\n \"name\": \"selector\",\n \"baseName\": \"selector\",\n \"type\": \"V1LabelSelector\"\n },\n {\n \"name\": \"target\",\n \"baseName\": \"target\",\n \"type\": \"V2beta1CrossVersionObjectReference\"\n },\n {\n \"name\": \"targetValue\",\n \"baseName\": \"targetValue\",\n \"type\": \"string\"\n }\n];\nexports.V2beta1ObjectMetricSource = V2beta1ObjectMetricSource;\n/**\n* ObjectMetricStatus indicates the current value of a metric describing a kubernetes object (for example, hits-per-second on an Ingress object).\n*/\nclass V2beta1ObjectMetricStatus {\n static getAttributeTypeMap() {\n return V2beta1ObjectMetricStatus.attributeTypeMap;\n }\n}\nV2beta1ObjectMetricStatus.discriminator = undefined;\nV2beta1ObjectMetricStatus.attributeTypeMap = [\n {\n \"name\": \"averageValue\",\n \"baseName\": \"averageValue\",\n \"type\": \"string\"\n },\n {\n \"name\": \"currentValue\",\n \"baseName\": \"currentValue\",\n \"type\": \"string\"\n },\n {\n \"name\": \"metricName\",\n \"baseName\": \"metricName\",\n \"type\": \"string\"\n },\n {\n \"name\": \"selector\",\n \"baseName\": \"selector\",\n \"type\": \"V1LabelSelector\"\n },\n {\n \"name\": \"target\",\n \"baseName\": \"target\",\n \"type\": \"V2beta1CrossVersionObjectReference\"\n }\n];\nexports.V2beta1ObjectMetricStatus = V2beta1ObjectMetricStatus;\n/**\n* PodsMetricSource indicates how to scale on a metric describing each pod in the current scale target (for example, transactions-processed-per-second). The values will be averaged together before being compared to the target value.\n*/\nclass V2beta1PodsMetricSource {\n static getAttributeTypeMap() {\n return V2beta1PodsMetricSource.attributeTypeMap;\n }\n}\nV2beta1PodsMetricSource.discriminator = undefined;\nV2beta1PodsMetricSource.attributeTypeMap = [\n {\n \"name\": \"metricName\",\n \"baseName\": \"metricName\",\n \"type\": \"string\"\n },\n {\n \"name\": \"selector\",\n \"baseName\": \"selector\",\n \"type\": \"V1LabelSelector\"\n },\n {\n \"name\": \"targetAverageValue\",\n \"baseName\": \"targetAverageValue\",\n \"type\": \"string\"\n }\n];\nexports.V2beta1PodsMetricSource = V2beta1PodsMetricSource;\n/**\n* PodsMetricStatus indicates the current value of a metric describing each pod in the current scale target (for example, transactions-processed-per-second).\n*/\nclass V2beta1PodsMetricStatus {\n static getAttributeTypeMap() {\n return V2beta1PodsMetricStatus.attributeTypeMap;\n }\n}\nV2beta1PodsMetricStatus.discriminator = undefined;\nV2beta1PodsMetricStatus.attributeTypeMap = [\n {\n \"name\": \"currentAverageValue\",\n \"baseName\": \"currentAverageValue\",\n \"type\": \"string\"\n },\n {\n \"name\": \"metricName\",\n \"baseName\": \"metricName\",\n \"type\": \"string\"\n },\n {\n \"name\": \"selector\",\n \"baseName\": \"selector\",\n \"type\": \"V1LabelSelector\"\n }\n];\nexports.V2beta1PodsMetricStatus = V2beta1PodsMetricStatus;\n/**\n* ResourceMetricSource indicates how to scale on a resource metric known to Kubernetes, as specified in requests and limits, describing each pod in the current scale target (e.g. CPU or memory). The values will be averaged together before being compared to the target. Such metrics are built in to Kubernetes, and have special scaling options on top of those available to normal per-pod metrics using the \\\"pods\\\" source. Only one \\\"target\\\" type should be set.\n*/\nclass V2beta1ResourceMetricSource {\n static getAttributeTypeMap() {\n return V2beta1ResourceMetricSource.attributeTypeMap;\n }\n}\nV2beta1ResourceMetricSource.discriminator = undefined;\nV2beta1ResourceMetricSource.attributeTypeMap = [\n {\n \"name\": \"name\",\n \"baseName\": \"name\",\n \"type\": \"string\"\n },\n {\n \"name\": \"targetAverageUtilization\",\n \"baseName\": \"targetAverageUtilization\",\n \"type\": \"number\"\n },\n {\n \"name\": \"targetAverageValue\",\n \"baseName\": \"targetAverageValue\",\n \"type\": \"string\"\n }\n];\nexports.V2beta1ResourceMetricSource = V2beta1ResourceMetricSource;\n/**\n* ResourceMetricStatus indicates the current value of a resource metric known to Kubernetes, as specified in requests and limits, describing each pod in the current scale target (e.g. CPU or memory). Such metrics are built in to Kubernetes, and have special scaling options on top of those available to normal per-pod metrics using the \\\"pods\\\" source.\n*/\nclass V2beta1ResourceMetricStatus {\n static getAttributeTypeMap() {\n return V2beta1ResourceMetricStatus.attributeTypeMap;\n }\n}\nV2beta1ResourceMetricStatus.discriminator = undefined;\nV2beta1ResourceMetricStatus.attributeTypeMap = [\n {\n \"name\": \"currentAverageUtilization\",\n \"baseName\": \"currentAverageUtilization\",\n \"type\": \"number\"\n },\n {\n \"name\": \"currentAverageValue\",\n \"baseName\": \"currentAverageValue\",\n \"type\": \"string\"\n },\n {\n \"name\": \"name\",\n \"baseName\": \"name\",\n \"type\": \"string\"\n }\n];\nexports.V2beta1ResourceMetricStatus = V2beta1ResourceMetricStatus;\n/**\n* CrossVersionObjectReference contains enough information to let you identify the referred resource.\n*/\nclass V2beta2CrossVersionObjectReference {\n static getAttributeTypeMap() {\n return V2beta2CrossVersionObjectReference.attributeTypeMap;\n }\n}\nV2beta2CrossVersionObjectReference.discriminator = undefined;\nV2beta2CrossVersionObjectReference.attributeTypeMap = [\n {\n \"name\": \"apiVersion\",\n \"baseName\": \"apiVersion\",\n \"type\": \"string\"\n },\n {\n \"name\": \"kind\",\n \"baseName\": \"kind\",\n \"type\": \"string\"\n },\n {\n \"name\": \"name\",\n \"baseName\": \"name\",\n \"type\": \"string\"\n }\n];\nexports.V2beta2CrossVersionObjectReference = V2beta2CrossVersionObjectReference;\n/**\n* ExternalMetricSource indicates how to scale on a metric not associated with any Kubernetes object (for example length of queue in cloud messaging service, or QPS from loadbalancer running outside of cluster).\n*/\nclass V2beta2ExternalMetricSource {\n static getAttributeTypeMap() {\n return V2beta2ExternalMetricSource.attributeTypeMap;\n }\n}\nV2beta2ExternalMetricSource.discriminator = undefined;\nV2beta2ExternalMetricSource.attributeTypeMap = [\n {\n \"name\": \"metric\",\n \"baseName\": \"metric\",\n \"type\": \"V2beta2MetricIdentifier\"\n },\n {\n \"name\": \"target\",\n \"baseName\": \"target\",\n \"type\": \"V2beta2MetricTarget\"\n }\n];\nexports.V2beta2ExternalMetricSource = V2beta2ExternalMetricSource;\n/**\n* ExternalMetricStatus indicates the current value of a global metric not associated with any Kubernetes object.\n*/\nclass V2beta2ExternalMetricStatus {\n static getAttributeTypeMap() {\n return V2beta2ExternalMetricStatus.attributeTypeMap;\n }\n}\nV2beta2ExternalMetricStatus.discriminator = undefined;\nV2beta2ExternalMetricStatus.attributeTypeMap = [\n {\n \"name\": \"current\",\n \"baseName\": \"current\",\n \"type\": \"V2beta2MetricValueStatus\"\n },\n {\n \"name\": \"metric\",\n \"baseName\": \"metric\",\n \"type\": \"V2beta2MetricIdentifier\"\n }\n];\nexports.V2beta2ExternalMetricStatus = V2beta2ExternalMetricStatus;\n/**\n* HorizontalPodAutoscaler is the configuration for a horizontal pod autoscaler, which automatically manages the replica count of any resource implementing the scale subresource based on the metrics specified.\n*/\nclass V2beta2HorizontalPodAutoscaler {\n static getAttributeTypeMap() {\n return V2beta2HorizontalPodAutoscaler.attributeTypeMap;\n }\n}\nV2beta2HorizontalPodAutoscaler.discriminator = undefined;\nV2beta2HorizontalPodAutoscaler.attributeTypeMap = [\n {\n \"name\": \"apiVersion\",\n \"baseName\": \"apiVersion\",\n \"type\": \"string\"\n },\n {\n \"name\": \"kind\",\n \"baseName\": \"kind\",\n \"type\": \"string\"\n },\n {\n \"name\": \"metadata\",\n \"baseName\": \"metadata\",\n \"type\": \"V1ObjectMeta\"\n },\n {\n \"name\": \"spec\",\n \"baseName\": \"spec\",\n \"type\": \"V2beta2HorizontalPodAutoscalerSpec\"\n },\n {\n \"name\": \"status\",\n \"baseName\": \"status\",\n \"type\": \"V2beta2HorizontalPodAutoscalerStatus\"\n }\n];\nexports.V2beta2HorizontalPodAutoscaler = V2beta2HorizontalPodAutoscaler;\n/**\n* HorizontalPodAutoscalerCondition describes the state of a HorizontalPodAutoscaler at a certain point.\n*/\nclass V2beta2HorizontalPodAutoscalerCondition {\n static getAttributeTypeMap() {\n return V2beta2HorizontalPodAutoscalerCondition.attributeTypeMap;\n }\n}\nV2beta2HorizontalPodAutoscalerCondition.discriminator = undefined;\nV2beta2HorizontalPodAutoscalerCondition.attributeTypeMap = [\n {\n \"name\": \"lastTransitionTime\",\n \"baseName\": \"lastTransitionTime\",\n \"type\": \"Date\"\n },\n {\n \"name\": \"message\",\n \"baseName\": \"message\",\n \"type\": \"string\"\n },\n {\n \"name\": \"reason\",\n \"baseName\": \"reason\",\n \"type\": \"string\"\n },\n {\n \"name\": \"status\",\n \"baseName\": \"status\",\n \"type\": \"string\"\n },\n {\n \"name\": \"type\",\n \"baseName\": \"type\",\n \"type\": \"string\"\n }\n];\nexports.V2beta2HorizontalPodAutoscalerCondition = V2beta2HorizontalPodAutoscalerCondition;\n/**\n* HorizontalPodAutoscalerList is a list of horizontal pod autoscaler objects.\n*/\nclass V2beta2HorizontalPodAutoscalerList {\n static getAttributeTypeMap() {\n return V2beta2HorizontalPodAutoscalerList.attributeTypeMap;\n }\n}\nV2beta2HorizontalPodAutoscalerList.discriminator = undefined;\nV2beta2HorizontalPodAutoscalerList.attributeTypeMap = [\n {\n \"name\": \"apiVersion\",\n \"baseName\": \"apiVersion\",\n \"type\": \"string\"\n },\n {\n \"name\": \"items\",\n \"baseName\": \"items\",\n \"type\": \"Array\"\n },\n {\n \"name\": \"kind\",\n \"baseName\": \"kind\",\n \"type\": \"string\"\n },\n {\n \"name\": \"metadata\",\n \"baseName\": \"metadata\",\n \"type\": \"V1ListMeta\"\n }\n];\nexports.V2beta2HorizontalPodAutoscalerList = V2beta2HorizontalPodAutoscalerList;\n/**\n* HorizontalPodAutoscalerSpec describes the desired functionality of the HorizontalPodAutoscaler.\n*/\nclass V2beta2HorizontalPodAutoscalerSpec {\n static getAttributeTypeMap() {\n return V2beta2HorizontalPodAutoscalerSpec.attributeTypeMap;\n }\n}\nV2beta2HorizontalPodAutoscalerSpec.discriminator = undefined;\nV2beta2HorizontalPodAutoscalerSpec.attributeTypeMap = [\n {\n \"name\": \"maxReplicas\",\n \"baseName\": \"maxReplicas\",\n \"type\": \"number\"\n },\n {\n \"name\": \"metrics\",\n \"baseName\": \"metrics\",\n \"type\": \"Array\"\n },\n {\n \"name\": \"minReplicas\",\n \"baseName\": \"minReplicas\",\n \"type\": \"number\"\n },\n {\n \"name\": \"scaleTargetRef\",\n \"baseName\": \"scaleTargetRef\",\n \"type\": \"V2beta2CrossVersionObjectReference\"\n }\n];\nexports.V2beta2HorizontalPodAutoscalerSpec = V2beta2HorizontalPodAutoscalerSpec;\n/**\n* HorizontalPodAutoscalerStatus describes the current status of a horizontal pod autoscaler.\n*/\nclass V2beta2HorizontalPodAutoscalerStatus {\n static getAttributeTypeMap() {\n return V2beta2HorizontalPodAutoscalerStatus.attributeTypeMap;\n }\n}\nV2beta2HorizontalPodAutoscalerStatus.discriminator = undefined;\nV2beta2HorizontalPodAutoscalerStatus.attributeTypeMap = [\n {\n \"name\": \"conditions\",\n \"baseName\": \"conditions\",\n \"type\": \"Array\"\n },\n {\n \"name\": \"currentMetrics\",\n \"baseName\": \"currentMetrics\",\n \"type\": \"Array\"\n },\n {\n \"name\": \"currentReplicas\",\n \"baseName\": \"currentReplicas\",\n \"type\": \"number\"\n },\n {\n \"name\": \"desiredReplicas\",\n \"baseName\": \"desiredReplicas\",\n \"type\": \"number\"\n },\n {\n \"name\": \"lastScaleTime\",\n \"baseName\": \"lastScaleTime\",\n \"type\": \"Date\"\n },\n {\n \"name\": \"observedGeneration\",\n \"baseName\": \"observedGeneration\",\n \"type\": \"number\"\n }\n];\nexports.V2beta2HorizontalPodAutoscalerStatus = V2beta2HorizontalPodAutoscalerStatus;\n/**\n* MetricIdentifier defines the name and optionally selector for a metric\n*/\nclass V2beta2MetricIdentifier {\n static getAttributeTypeMap() {\n return V2beta2MetricIdentifier.attributeTypeMap;\n }\n}\nV2beta2MetricIdentifier.discriminator = undefined;\nV2beta2MetricIdentifier.attributeTypeMap = [\n {\n \"name\": \"name\",\n \"baseName\": \"name\",\n \"type\": \"string\"\n },\n {\n \"name\": \"selector\",\n \"baseName\": \"selector\",\n \"type\": \"V1LabelSelector\"\n }\n];\nexports.V2beta2MetricIdentifier = V2beta2MetricIdentifier;\n/**\n* MetricSpec specifies how to scale based on a single metric (only `type` and one other matching field should be set at once).\n*/\nclass V2beta2MetricSpec {\n static getAttributeTypeMap() {\n return V2beta2MetricSpec.attributeTypeMap;\n }\n}\nV2beta2MetricSpec.discriminator = undefined;\nV2beta2MetricSpec.attributeTypeMap = [\n {\n \"name\": \"external\",\n \"baseName\": \"external\",\n \"type\": \"V2beta2ExternalMetricSource\"\n },\n {\n \"name\": \"object\",\n \"baseName\": \"object\",\n \"type\": \"V2beta2ObjectMetricSource\"\n },\n {\n \"name\": \"pods\",\n \"baseName\": \"pods\",\n \"type\": \"V2beta2PodsMetricSource\"\n },\n {\n \"name\": \"resource\",\n \"baseName\": \"resource\",\n \"type\": \"V2beta2ResourceMetricSource\"\n },\n {\n \"name\": \"type\",\n \"baseName\": \"type\",\n \"type\": \"string\"\n }\n];\nexports.V2beta2MetricSpec = V2beta2MetricSpec;\n/**\n* MetricStatus describes the last-read state of a single metric.\n*/\nclass V2beta2MetricStatus {\n static getAttributeTypeMap() {\n return V2beta2MetricStatus.attributeTypeMap;\n }\n}\nV2beta2MetricStatus.discriminator = undefined;\nV2beta2MetricStatus.attributeTypeMap = [\n {\n \"name\": \"external\",\n \"baseName\": \"external\",\n \"type\": \"V2beta2ExternalMetricStatus\"\n },\n {\n \"name\": \"object\",\n \"baseName\": \"object\",\n \"type\": \"V2beta2ObjectMetricStatus\"\n },\n {\n \"name\": \"pods\",\n \"baseName\": \"pods\",\n \"type\": \"V2beta2PodsMetricStatus\"\n },\n {\n \"name\": \"resource\",\n \"baseName\": \"resource\",\n \"type\": \"V2beta2ResourceMetricStatus\"\n },\n {\n \"name\": \"type\",\n \"baseName\": \"type\",\n \"type\": \"string\"\n }\n];\nexports.V2beta2MetricStatus = V2beta2MetricStatus;\n/**\n* MetricTarget defines the target value, average value, or average utilization of a specific metric\n*/\nclass V2beta2MetricTarget {\n static getAttributeTypeMap() {\n return V2beta2MetricTarget.attributeTypeMap;\n }\n}\nV2beta2MetricTarget.discriminator = undefined;\nV2beta2MetricTarget.attributeTypeMap = [\n {\n \"name\": \"averageUtilization\",\n \"baseName\": \"averageUtilization\",\n \"type\": \"number\"\n },\n {\n \"name\": \"averageValue\",\n \"baseName\": \"averageValue\",\n \"type\": \"string\"\n },\n {\n \"name\": \"type\",\n \"baseName\": \"type\",\n \"type\": \"string\"\n },\n {\n \"name\": \"value\",\n \"baseName\": \"value\",\n \"type\": \"string\"\n }\n];\nexports.V2beta2MetricTarget = V2beta2MetricTarget;\n/**\n* MetricValueStatus holds the current value for a metric\n*/\nclass V2beta2MetricValueStatus {\n static getAttributeTypeMap() {\n return V2beta2MetricValueStatus.attributeTypeMap;\n }\n}\nV2beta2MetricValueStatus.discriminator = undefined;\nV2beta2MetricValueStatus.attributeTypeMap = [\n {\n \"name\": \"averageUtilization\",\n \"baseName\": \"averageUtilization\",\n \"type\": \"number\"\n },\n {\n \"name\": \"averageValue\",\n \"baseName\": \"averageValue\",\n \"type\": \"string\"\n },\n {\n \"name\": \"value\",\n \"baseName\": \"value\",\n \"type\": \"string\"\n }\n];\nexports.V2beta2MetricValueStatus = V2beta2MetricValueStatus;\n/**\n* ObjectMetricSource indicates how to scale on a metric describing a kubernetes object (for example, hits-per-second on an Ingress object).\n*/\nclass V2beta2ObjectMetricSource {\n static getAttributeTypeMap() {\n return V2beta2ObjectMetricSource.attributeTypeMap;\n }\n}\nV2beta2ObjectMetricSource.discriminator = undefined;\nV2beta2ObjectMetricSource.attributeTypeMap = [\n {\n \"name\": \"describedObject\",\n \"baseName\": \"describedObject\",\n \"type\": \"V2beta2CrossVersionObjectReference\"\n },\n {\n \"name\": \"metric\",\n \"baseName\": \"metric\",\n \"type\": \"V2beta2MetricIdentifier\"\n },\n {\n \"name\": \"target\",\n \"baseName\": \"target\",\n \"type\": \"V2beta2MetricTarget\"\n }\n];\nexports.V2beta2ObjectMetricSource = V2beta2ObjectMetricSource;\n/**\n* ObjectMetricStatus indicates the current value of a metric describing a kubernetes object (for example, hits-per-second on an Ingress object).\n*/\nclass V2beta2ObjectMetricStatus {\n static getAttributeTypeMap() {\n return V2beta2ObjectMetricStatus.attributeTypeMap;\n }\n}\nV2beta2ObjectMetricStatus.discriminator = undefined;\nV2beta2ObjectMetricStatus.attributeTypeMap = [\n {\n \"name\": \"current\",\n \"baseName\": \"current\",\n \"type\": \"V2beta2MetricValueStatus\"\n },\n {\n \"name\": \"describedObject\",\n \"baseName\": \"describedObject\",\n \"type\": \"V2beta2CrossVersionObjectReference\"\n },\n {\n \"name\": \"metric\",\n \"baseName\": \"metric\",\n \"type\": \"V2beta2MetricIdentifier\"\n }\n];\nexports.V2beta2ObjectMetricStatus = V2beta2ObjectMetricStatus;\n/**\n* PodsMetricSource indicates how to scale on a metric describing each pod in the current scale target (for example, transactions-processed-per-second). The values will be averaged together before being compared to the target value.\n*/\nclass V2beta2PodsMetricSource {\n static getAttributeTypeMap() {\n return V2beta2PodsMetricSource.attributeTypeMap;\n }\n}\nV2beta2PodsMetricSource.discriminator = undefined;\nV2beta2PodsMetricSource.attributeTypeMap = [\n {\n \"name\": \"metric\",\n \"baseName\": \"metric\",\n \"type\": \"V2beta2MetricIdentifier\"\n },\n {\n \"name\": \"target\",\n \"baseName\": \"target\",\n \"type\": \"V2beta2MetricTarget\"\n }\n];\nexports.V2beta2PodsMetricSource = V2beta2PodsMetricSource;\n/**\n* PodsMetricStatus indicates the current value of a metric describing each pod in the current scale target (for example, transactions-processed-per-second).\n*/\nclass V2beta2PodsMetricStatus {\n static getAttributeTypeMap() {\n return V2beta2PodsMetricStatus.attributeTypeMap;\n }\n}\nV2beta2PodsMetricStatus.discriminator = undefined;\nV2beta2PodsMetricStatus.attributeTypeMap = [\n {\n \"name\": \"current\",\n \"baseName\": \"current\",\n \"type\": \"V2beta2MetricValueStatus\"\n },\n {\n \"name\": \"metric\",\n \"baseName\": \"metric\",\n \"type\": \"V2beta2MetricIdentifier\"\n }\n];\nexports.V2beta2PodsMetricStatus = V2beta2PodsMetricStatus;\n/**\n* ResourceMetricSource indicates how to scale on a resource metric known to Kubernetes, as specified in requests and limits, describing each pod in the current scale target (e.g. CPU or memory). The values will be averaged together before being compared to the target. Such metrics are built in to Kubernetes, and have special scaling options on top of those available to normal per-pod metrics using the \\\"pods\\\" source. Only one \\\"target\\\" type should be set.\n*/\nclass V2beta2ResourceMetricSource {\n static getAttributeTypeMap() {\n return V2beta2ResourceMetricSource.attributeTypeMap;\n }\n}\nV2beta2ResourceMetricSource.discriminator = undefined;\nV2beta2ResourceMetricSource.attributeTypeMap = [\n {\n \"name\": \"name\",\n \"baseName\": \"name\",\n \"type\": \"string\"\n },\n {\n \"name\": \"target\",\n \"baseName\": \"target\",\n \"type\": \"V2beta2MetricTarget\"\n }\n];\nexports.V2beta2ResourceMetricSource = V2beta2ResourceMetricSource;\n/**\n* ResourceMetricStatus indicates the current value of a resource metric known to Kubernetes, as specified in requests and limits, describing each pod in the current scale target (e.g. CPU or memory). Such metrics are built in to Kubernetes, and have special scaling options on top of those available to normal per-pod metrics using the \\\"pods\\\" source.\n*/\nclass V2beta2ResourceMetricStatus {\n static getAttributeTypeMap() {\n return V2beta2ResourceMetricStatus.attributeTypeMap;\n }\n}\nV2beta2ResourceMetricStatus.discriminator = undefined;\nV2beta2ResourceMetricStatus.attributeTypeMap = [\n {\n \"name\": \"current\",\n \"baseName\": \"current\",\n \"type\": \"V2beta2MetricValueStatus\"\n },\n {\n \"name\": \"name\",\n \"baseName\": \"name\",\n \"type\": \"string\"\n }\n];\nexports.V2beta2ResourceMetricStatus = V2beta2ResourceMetricStatus;\n/**\n* Info contains versioning information. how we'll want to distribute that information.\n*/\nclass VersionInfo {\n static getAttributeTypeMap() {\n return VersionInfo.attributeTypeMap;\n }\n}\nVersionInfo.discriminator = undefined;\nVersionInfo.attributeTypeMap = [\n {\n \"name\": \"buildDate\",\n \"baseName\": \"buildDate\",\n \"type\": \"string\"\n },\n {\n \"name\": \"compiler\",\n \"baseName\": \"compiler\",\n \"type\": \"string\"\n },\n {\n \"name\": \"gitCommit\",\n \"baseName\": \"gitCommit\",\n \"type\": \"string\"\n },\n {\n \"name\": \"gitTreeState\",\n \"baseName\": \"gitTreeState\",\n \"type\": \"string\"\n },\n {\n \"name\": \"gitVersion\",\n \"baseName\": \"gitVersion\",\n \"type\": \"string\"\n },\n {\n \"name\": \"goVersion\",\n \"baseName\": \"goVersion\",\n \"type\": \"string\"\n },\n {\n \"name\": \"major\",\n \"baseName\": \"major\",\n \"type\": \"string\"\n },\n {\n \"name\": \"minor\",\n \"baseName\": \"minor\",\n \"type\": \"string\"\n },\n {\n \"name\": \"platform\",\n \"baseName\": \"platform\",\n \"type\": \"string\"\n }\n];\nexports.VersionInfo = VersionInfo;\nlet enumsMap = {};\nlet typeMap = {\n \"AdmissionregistrationV1beta1ServiceReference\": AdmissionregistrationV1beta1ServiceReference,\n \"AdmissionregistrationV1beta1WebhookClientConfig\": AdmissionregistrationV1beta1WebhookClientConfig,\n \"ApiextensionsV1beta1ServiceReference\": ApiextensionsV1beta1ServiceReference,\n \"ApiextensionsV1beta1WebhookClientConfig\": ApiextensionsV1beta1WebhookClientConfig,\n \"ApiregistrationV1beta1ServiceReference\": ApiregistrationV1beta1ServiceReference,\n \"AppsV1beta1Deployment\": AppsV1beta1Deployment,\n \"AppsV1beta1DeploymentCondition\": AppsV1beta1DeploymentCondition,\n \"AppsV1beta1DeploymentList\": AppsV1beta1DeploymentList,\n \"AppsV1beta1DeploymentRollback\": AppsV1beta1DeploymentRollback,\n \"AppsV1beta1DeploymentSpec\": AppsV1beta1DeploymentSpec,\n \"AppsV1beta1DeploymentStatus\": AppsV1beta1DeploymentStatus,\n \"AppsV1beta1DeploymentStrategy\": AppsV1beta1DeploymentStrategy,\n \"AppsV1beta1RollbackConfig\": AppsV1beta1RollbackConfig,\n \"AppsV1beta1RollingUpdateDeployment\": AppsV1beta1RollingUpdateDeployment,\n \"AppsV1beta1Scale\": AppsV1beta1Scale,\n \"AppsV1beta1ScaleSpec\": AppsV1beta1ScaleSpec,\n \"AppsV1beta1ScaleStatus\": AppsV1beta1ScaleStatus,\n \"ExtensionsV1beta1AllowedFlexVolume\": ExtensionsV1beta1AllowedFlexVolume,\n \"ExtensionsV1beta1AllowedHostPath\": ExtensionsV1beta1AllowedHostPath,\n \"ExtensionsV1beta1Deployment\": ExtensionsV1beta1Deployment,\n \"ExtensionsV1beta1DeploymentCondition\": ExtensionsV1beta1DeploymentCondition,\n \"ExtensionsV1beta1DeploymentList\": ExtensionsV1beta1DeploymentList,\n \"ExtensionsV1beta1DeploymentRollback\": ExtensionsV1beta1DeploymentRollback,\n \"ExtensionsV1beta1DeploymentSpec\": ExtensionsV1beta1DeploymentSpec,\n \"ExtensionsV1beta1DeploymentStatus\": ExtensionsV1beta1DeploymentStatus,\n \"ExtensionsV1beta1DeploymentStrategy\": ExtensionsV1beta1DeploymentStrategy,\n \"ExtensionsV1beta1FSGroupStrategyOptions\": ExtensionsV1beta1FSGroupStrategyOptions,\n \"ExtensionsV1beta1HostPortRange\": ExtensionsV1beta1HostPortRange,\n \"ExtensionsV1beta1IDRange\": ExtensionsV1beta1IDRange,\n \"ExtensionsV1beta1PodSecurityPolicy\": ExtensionsV1beta1PodSecurityPolicy,\n \"ExtensionsV1beta1PodSecurityPolicyList\": ExtensionsV1beta1PodSecurityPolicyList,\n \"ExtensionsV1beta1PodSecurityPolicySpec\": ExtensionsV1beta1PodSecurityPolicySpec,\n \"ExtensionsV1beta1RollbackConfig\": ExtensionsV1beta1RollbackConfig,\n \"ExtensionsV1beta1RollingUpdateDeployment\": ExtensionsV1beta1RollingUpdateDeployment,\n \"ExtensionsV1beta1RunAsGroupStrategyOptions\": ExtensionsV1beta1RunAsGroupStrategyOptions,\n \"ExtensionsV1beta1RunAsUserStrategyOptions\": ExtensionsV1beta1RunAsUserStrategyOptions,\n \"ExtensionsV1beta1SELinuxStrategyOptions\": ExtensionsV1beta1SELinuxStrategyOptions,\n \"ExtensionsV1beta1Scale\": ExtensionsV1beta1Scale,\n \"ExtensionsV1beta1ScaleSpec\": ExtensionsV1beta1ScaleSpec,\n \"ExtensionsV1beta1ScaleStatus\": ExtensionsV1beta1ScaleStatus,\n \"ExtensionsV1beta1SupplementalGroupsStrategyOptions\": ExtensionsV1beta1SupplementalGroupsStrategyOptions,\n \"PolicyV1beta1AllowedFlexVolume\": PolicyV1beta1AllowedFlexVolume,\n \"PolicyV1beta1AllowedHostPath\": PolicyV1beta1AllowedHostPath,\n \"PolicyV1beta1FSGroupStrategyOptions\": PolicyV1beta1FSGroupStrategyOptions,\n \"PolicyV1beta1HostPortRange\": PolicyV1beta1HostPortRange,\n \"PolicyV1beta1IDRange\": PolicyV1beta1IDRange,\n \"PolicyV1beta1PodSecurityPolicy\": PolicyV1beta1PodSecurityPolicy,\n \"PolicyV1beta1PodSecurityPolicyList\": PolicyV1beta1PodSecurityPolicyList,\n \"PolicyV1beta1PodSecurityPolicySpec\": PolicyV1beta1PodSecurityPolicySpec,\n \"PolicyV1beta1RunAsGroupStrategyOptions\": PolicyV1beta1RunAsGroupStrategyOptions,\n \"PolicyV1beta1RunAsUserStrategyOptions\": PolicyV1beta1RunAsUserStrategyOptions,\n \"PolicyV1beta1SELinuxStrategyOptions\": PolicyV1beta1SELinuxStrategyOptions,\n \"PolicyV1beta1SupplementalGroupsStrategyOptions\": PolicyV1beta1SupplementalGroupsStrategyOptions,\n \"RuntimeRawExtension\": RuntimeRawExtension,\n \"V1APIGroup\": V1APIGroup,\n \"V1APIGroupList\": V1APIGroupList,\n \"V1APIResource\": V1APIResource,\n \"V1APIResourceList\": V1APIResourceList,\n \"V1APIService\": V1APIService,\n \"V1APIServiceCondition\": V1APIServiceCondition,\n \"V1APIServiceList\": V1APIServiceList,\n \"V1APIServiceSpec\": V1APIServiceSpec,\n \"V1APIServiceStatus\": V1APIServiceStatus,\n \"V1APIVersions\": V1APIVersions,\n \"V1AWSElasticBlockStoreVolumeSource\": V1AWSElasticBlockStoreVolumeSource,\n \"V1Affinity\": V1Affinity,\n \"V1AggregationRule\": V1AggregationRule,\n \"V1AttachedVolume\": V1AttachedVolume,\n \"V1AzureDiskVolumeSource\": V1AzureDiskVolumeSource,\n \"V1AzureFilePersistentVolumeSource\": V1AzureFilePersistentVolumeSource,\n \"V1AzureFileVolumeSource\": V1AzureFileVolumeSource,\n \"V1Binding\": V1Binding,\n \"V1CSIPersistentVolumeSource\": V1CSIPersistentVolumeSource,\n \"V1Capabilities\": V1Capabilities,\n \"V1CephFSPersistentVolumeSource\": V1CephFSPersistentVolumeSource,\n \"V1CephFSVolumeSource\": V1CephFSVolumeSource,\n \"V1CinderPersistentVolumeSource\": V1CinderPersistentVolumeSource,\n \"V1CinderVolumeSource\": V1CinderVolumeSource,\n \"V1ClientIPConfig\": V1ClientIPConfig,\n \"V1ClusterRole\": V1ClusterRole,\n \"V1ClusterRoleBinding\": V1ClusterRoleBinding,\n \"V1ClusterRoleBindingList\": V1ClusterRoleBindingList,\n \"V1ClusterRoleList\": V1ClusterRoleList,\n \"V1ComponentCondition\": V1ComponentCondition,\n \"V1ComponentStatus\": V1ComponentStatus,\n \"V1ComponentStatusList\": V1ComponentStatusList,\n \"V1ConfigMap\": V1ConfigMap,\n \"V1ConfigMapEnvSource\": V1ConfigMapEnvSource,\n \"V1ConfigMapKeySelector\": V1ConfigMapKeySelector,\n \"V1ConfigMapList\": V1ConfigMapList,\n \"V1ConfigMapNodeConfigSource\": V1ConfigMapNodeConfigSource,\n \"V1ConfigMapProjection\": V1ConfigMapProjection,\n \"V1ConfigMapVolumeSource\": V1ConfigMapVolumeSource,\n \"V1Container\": V1Container,\n \"V1ContainerImage\": V1ContainerImage,\n \"V1ContainerPort\": V1ContainerPort,\n \"V1ContainerState\": V1ContainerState,\n \"V1ContainerStateRunning\": V1ContainerStateRunning,\n \"V1ContainerStateTerminated\": V1ContainerStateTerminated,\n \"V1ContainerStateWaiting\": V1ContainerStateWaiting,\n \"V1ContainerStatus\": V1ContainerStatus,\n \"V1ControllerRevision\": V1ControllerRevision,\n \"V1ControllerRevisionList\": V1ControllerRevisionList,\n \"V1CrossVersionObjectReference\": V1CrossVersionObjectReference,\n \"V1DaemonEndpoint\": V1DaemonEndpoint,\n \"V1DaemonSet\": V1DaemonSet,\n \"V1DaemonSetCondition\": V1DaemonSetCondition,\n \"V1DaemonSetList\": V1DaemonSetList,\n \"V1DaemonSetSpec\": V1DaemonSetSpec,\n \"V1DaemonSetStatus\": V1DaemonSetStatus,\n \"V1DaemonSetUpdateStrategy\": V1DaemonSetUpdateStrategy,\n \"V1DeleteOptions\": V1DeleteOptions,\n \"V1Deployment\": V1Deployment,\n \"V1DeploymentCondition\": V1DeploymentCondition,\n \"V1DeploymentList\": V1DeploymentList,\n \"V1DeploymentSpec\": V1DeploymentSpec,\n \"V1DeploymentStatus\": V1DeploymentStatus,\n \"V1DeploymentStrategy\": V1DeploymentStrategy,\n \"V1DownwardAPIProjection\": V1DownwardAPIProjection,\n \"V1DownwardAPIVolumeFile\": V1DownwardAPIVolumeFile,\n \"V1DownwardAPIVolumeSource\": V1DownwardAPIVolumeSource,\n \"V1EmptyDirVolumeSource\": V1EmptyDirVolumeSource,\n \"V1EndpointAddress\": V1EndpointAddress,\n \"V1EndpointPort\": V1EndpointPort,\n \"V1EndpointSubset\": V1EndpointSubset,\n \"V1Endpoints\": V1Endpoints,\n \"V1EndpointsList\": V1EndpointsList,\n \"V1EnvFromSource\": V1EnvFromSource,\n \"V1EnvVar\": V1EnvVar,\n \"V1EnvVarSource\": V1EnvVarSource,\n \"V1Event\": V1Event,\n \"V1EventList\": V1EventList,\n \"V1EventSeries\": V1EventSeries,\n \"V1EventSource\": V1EventSource,\n \"V1ExecAction\": V1ExecAction,\n \"V1FCVolumeSource\": V1FCVolumeSource,\n \"V1FlexPersistentVolumeSource\": V1FlexPersistentVolumeSource,\n \"V1FlexVolumeSource\": V1FlexVolumeSource,\n \"V1FlockerVolumeSource\": V1FlockerVolumeSource,\n \"V1GCEPersistentDiskVolumeSource\": V1GCEPersistentDiskVolumeSource,\n \"V1GitRepoVolumeSource\": V1GitRepoVolumeSource,\n \"V1GlusterfsPersistentVolumeSource\": V1GlusterfsPersistentVolumeSource,\n \"V1GlusterfsVolumeSource\": V1GlusterfsVolumeSource,\n \"V1GroupVersionForDiscovery\": V1GroupVersionForDiscovery,\n \"V1HTTPGetAction\": V1HTTPGetAction,\n \"V1HTTPHeader\": V1HTTPHeader,\n \"V1Handler\": V1Handler,\n \"V1HorizontalPodAutoscaler\": V1HorizontalPodAutoscaler,\n \"V1HorizontalPodAutoscalerList\": V1HorizontalPodAutoscalerList,\n \"V1HorizontalPodAutoscalerSpec\": V1HorizontalPodAutoscalerSpec,\n \"V1HorizontalPodAutoscalerStatus\": V1HorizontalPodAutoscalerStatus,\n \"V1HostAlias\": V1HostAlias,\n \"V1HostPathVolumeSource\": V1HostPathVolumeSource,\n \"V1IPBlock\": V1IPBlock,\n \"V1ISCSIPersistentVolumeSource\": V1ISCSIPersistentVolumeSource,\n \"V1ISCSIVolumeSource\": V1ISCSIVolumeSource,\n \"V1Initializer\": V1Initializer,\n \"V1Initializers\": V1Initializers,\n \"V1Job\": V1Job,\n \"V1JobCondition\": V1JobCondition,\n \"V1JobList\": V1JobList,\n \"V1JobSpec\": V1JobSpec,\n \"V1JobStatus\": V1JobStatus,\n \"V1KeyToPath\": V1KeyToPath,\n \"V1LabelSelector\": V1LabelSelector,\n \"V1LabelSelectorRequirement\": V1LabelSelectorRequirement,\n \"V1Lifecycle\": V1Lifecycle,\n \"V1LimitRange\": V1LimitRange,\n \"V1LimitRangeItem\": V1LimitRangeItem,\n \"V1LimitRangeList\": V1LimitRangeList,\n \"V1LimitRangeSpec\": V1LimitRangeSpec,\n \"V1ListMeta\": V1ListMeta,\n \"V1LoadBalancerIngress\": V1LoadBalancerIngress,\n \"V1LoadBalancerStatus\": V1LoadBalancerStatus,\n \"V1LocalObjectReference\": V1LocalObjectReference,\n \"V1LocalSubjectAccessReview\": V1LocalSubjectAccessReview,\n \"V1LocalVolumeSource\": V1LocalVolumeSource,\n \"V1NFSVolumeSource\": V1NFSVolumeSource,\n \"V1Namespace\": V1Namespace,\n \"V1NamespaceList\": V1NamespaceList,\n \"V1NamespaceSpec\": V1NamespaceSpec,\n \"V1NamespaceStatus\": V1NamespaceStatus,\n \"V1NetworkPolicy\": V1NetworkPolicy,\n \"V1NetworkPolicyEgressRule\": V1NetworkPolicyEgressRule,\n \"V1NetworkPolicyIngressRule\": V1NetworkPolicyIngressRule,\n \"V1NetworkPolicyList\": V1NetworkPolicyList,\n \"V1NetworkPolicyPeer\": V1NetworkPolicyPeer,\n \"V1NetworkPolicyPort\": V1NetworkPolicyPort,\n \"V1NetworkPolicySpec\": V1NetworkPolicySpec,\n \"V1Node\": V1Node,\n \"V1NodeAddress\": V1NodeAddress,\n \"V1NodeAffinity\": V1NodeAffinity,\n \"V1NodeCondition\": V1NodeCondition,\n \"V1NodeConfigSource\": V1NodeConfigSource,\n \"V1NodeConfigStatus\": V1NodeConfigStatus,\n \"V1NodeDaemonEndpoints\": V1NodeDaemonEndpoints,\n \"V1NodeList\": V1NodeList,\n \"V1NodeSelector\": V1NodeSelector,\n \"V1NodeSelectorRequirement\": V1NodeSelectorRequirement,\n \"V1NodeSelectorTerm\": V1NodeSelectorTerm,\n \"V1NodeSpec\": V1NodeSpec,\n \"V1NodeStatus\": V1NodeStatus,\n \"V1NodeSystemInfo\": V1NodeSystemInfo,\n \"V1NonResourceAttributes\": V1NonResourceAttributes,\n \"V1NonResourceRule\": V1NonResourceRule,\n \"V1ObjectFieldSelector\": V1ObjectFieldSelector,\n \"V1ObjectMeta\": V1ObjectMeta,\n \"V1ObjectReference\": V1ObjectReference,\n \"V1OwnerReference\": V1OwnerReference,\n \"V1PersistentVolume\": V1PersistentVolume,\n \"V1PersistentVolumeClaim\": V1PersistentVolumeClaim,\n \"V1PersistentVolumeClaimCondition\": V1PersistentVolumeClaimCondition,\n \"V1PersistentVolumeClaimList\": V1PersistentVolumeClaimList,\n \"V1PersistentVolumeClaimSpec\": V1PersistentVolumeClaimSpec,\n \"V1PersistentVolumeClaimStatus\": V1PersistentVolumeClaimStatus,\n \"V1PersistentVolumeClaimVolumeSource\": V1PersistentVolumeClaimVolumeSource,\n \"V1PersistentVolumeList\": V1PersistentVolumeList,\n \"V1PersistentVolumeSpec\": V1PersistentVolumeSpec,\n \"V1PersistentVolumeStatus\": V1PersistentVolumeStatus,\n \"V1PhotonPersistentDiskVolumeSource\": V1PhotonPersistentDiskVolumeSource,\n \"V1Pod\": V1Pod,\n \"V1PodAffinity\": V1PodAffinity,\n \"V1PodAffinityTerm\": V1PodAffinityTerm,\n \"V1PodAntiAffinity\": V1PodAntiAffinity,\n \"V1PodCondition\": V1PodCondition,\n \"V1PodDNSConfig\": V1PodDNSConfig,\n \"V1PodDNSConfigOption\": V1PodDNSConfigOption,\n \"V1PodList\": V1PodList,\n \"V1PodReadinessGate\": V1PodReadinessGate,\n \"V1PodSecurityContext\": V1PodSecurityContext,\n \"V1PodSpec\": V1PodSpec,\n \"V1PodStatus\": V1PodStatus,\n \"V1PodTemplate\": V1PodTemplate,\n \"V1PodTemplateList\": V1PodTemplateList,\n \"V1PodTemplateSpec\": V1PodTemplateSpec,\n \"V1PolicyRule\": V1PolicyRule,\n \"V1PortworxVolumeSource\": V1PortworxVolumeSource,\n \"V1Preconditions\": V1Preconditions,\n \"V1PreferredSchedulingTerm\": V1PreferredSchedulingTerm,\n \"V1Probe\": V1Probe,\n \"V1ProjectedVolumeSource\": V1ProjectedVolumeSource,\n \"V1QuobyteVolumeSource\": V1QuobyteVolumeSource,\n \"V1RBDPersistentVolumeSource\": V1RBDPersistentVolumeSource,\n \"V1RBDVolumeSource\": V1RBDVolumeSource,\n \"V1ReplicaSet\": V1ReplicaSet,\n \"V1ReplicaSetCondition\": V1ReplicaSetCondition,\n \"V1ReplicaSetList\": V1ReplicaSetList,\n \"V1ReplicaSetSpec\": V1ReplicaSetSpec,\n \"V1ReplicaSetStatus\": V1ReplicaSetStatus,\n \"V1ReplicationController\": V1ReplicationController,\n \"V1ReplicationControllerCondition\": V1ReplicationControllerCondition,\n \"V1ReplicationControllerList\": V1ReplicationControllerList,\n \"V1ReplicationControllerSpec\": V1ReplicationControllerSpec,\n \"V1ReplicationControllerStatus\": V1ReplicationControllerStatus,\n \"V1ResourceAttributes\": V1ResourceAttributes,\n \"V1ResourceFieldSelector\": V1ResourceFieldSelector,\n \"V1ResourceQuota\": V1ResourceQuota,\n \"V1ResourceQuotaList\": V1ResourceQuotaList,\n \"V1ResourceQuotaSpec\": V1ResourceQuotaSpec,\n \"V1ResourceQuotaStatus\": V1ResourceQuotaStatus,\n \"V1ResourceRequirements\": V1ResourceRequirements,\n \"V1ResourceRule\": V1ResourceRule,\n \"V1Role\": V1Role,\n \"V1RoleBinding\": V1RoleBinding,\n \"V1RoleBindingList\": V1RoleBindingList,\n \"V1RoleList\": V1RoleList,\n \"V1RoleRef\": V1RoleRef,\n \"V1RollingUpdateDaemonSet\": V1RollingUpdateDaemonSet,\n \"V1RollingUpdateDeployment\": V1RollingUpdateDeployment,\n \"V1RollingUpdateStatefulSetStrategy\": V1RollingUpdateStatefulSetStrategy,\n \"V1SELinuxOptions\": V1SELinuxOptions,\n \"V1Scale\": V1Scale,\n \"V1ScaleIOPersistentVolumeSource\": V1ScaleIOPersistentVolumeSource,\n \"V1ScaleIOVolumeSource\": V1ScaleIOVolumeSource,\n \"V1ScaleSpec\": V1ScaleSpec,\n \"V1ScaleStatus\": V1ScaleStatus,\n \"V1ScopeSelector\": V1ScopeSelector,\n \"V1ScopedResourceSelectorRequirement\": V1ScopedResourceSelectorRequirement,\n \"V1Secret\": V1Secret,\n \"V1SecretEnvSource\": V1SecretEnvSource,\n \"V1SecretKeySelector\": V1SecretKeySelector,\n \"V1SecretList\": V1SecretList,\n \"V1SecretProjection\": V1SecretProjection,\n \"V1SecretReference\": V1SecretReference,\n \"V1SecretVolumeSource\": V1SecretVolumeSource,\n \"V1SecurityContext\": V1SecurityContext,\n \"V1SelfSubjectAccessReview\": V1SelfSubjectAccessReview,\n \"V1SelfSubjectAccessReviewSpec\": V1SelfSubjectAccessReviewSpec,\n \"V1SelfSubjectRulesReview\": V1SelfSubjectRulesReview,\n \"V1SelfSubjectRulesReviewSpec\": V1SelfSubjectRulesReviewSpec,\n \"V1ServerAddressByClientCIDR\": V1ServerAddressByClientCIDR,\n \"V1Service\": V1Service,\n \"V1ServiceAccount\": V1ServiceAccount,\n \"V1ServiceAccountList\": V1ServiceAccountList,\n \"V1ServiceAccountTokenProjection\": V1ServiceAccountTokenProjection,\n \"V1ServiceList\": V1ServiceList,\n \"V1ServicePort\": V1ServicePort,\n \"V1ServiceReference\": V1ServiceReference,\n \"V1ServiceSpec\": V1ServiceSpec,\n \"V1ServiceStatus\": V1ServiceStatus,\n \"V1SessionAffinityConfig\": V1SessionAffinityConfig,\n \"V1StatefulSet\": V1StatefulSet,\n \"V1StatefulSetCondition\": V1StatefulSetCondition,\n \"V1StatefulSetList\": V1StatefulSetList,\n \"V1StatefulSetSpec\": V1StatefulSetSpec,\n \"V1StatefulSetStatus\": V1StatefulSetStatus,\n \"V1StatefulSetUpdateStrategy\": V1StatefulSetUpdateStrategy,\n \"V1Status\": V1Status,\n \"V1StatusCause\": V1StatusCause,\n \"V1StatusDetails\": V1StatusDetails,\n \"V1StorageClass\": V1StorageClass,\n \"V1StorageClassList\": V1StorageClassList,\n \"V1StorageOSPersistentVolumeSource\": V1StorageOSPersistentVolumeSource,\n \"V1StorageOSVolumeSource\": V1StorageOSVolumeSource,\n \"V1Subject\": V1Subject,\n \"V1SubjectAccessReview\": V1SubjectAccessReview,\n \"V1SubjectAccessReviewSpec\": V1SubjectAccessReviewSpec,\n \"V1SubjectAccessReviewStatus\": V1SubjectAccessReviewStatus,\n \"V1SubjectRulesReviewStatus\": V1SubjectRulesReviewStatus,\n \"V1Sysctl\": V1Sysctl,\n \"V1TCPSocketAction\": V1TCPSocketAction,\n \"V1Taint\": V1Taint,\n \"V1TokenReview\": V1TokenReview,\n \"V1TokenReviewSpec\": V1TokenReviewSpec,\n \"V1TokenReviewStatus\": V1TokenReviewStatus,\n \"V1Toleration\": V1Toleration,\n \"V1TopologySelectorLabelRequirement\": V1TopologySelectorLabelRequirement,\n \"V1TopologySelectorTerm\": V1TopologySelectorTerm,\n \"V1TypedLocalObjectReference\": V1TypedLocalObjectReference,\n \"V1UserInfo\": V1UserInfo,\n \"V1Volume\": V1Volume,\n \"V1VolumeAttachment\": V1VolumeAttachment,\n \"V1VolumeAttachmentList\": V1VolumeAttachmentList,\n \"V1VolumeAttachmentSource\": V1VolumeAttachmentSource,\n \"V1VolumeAttachmentSpec\": V1VolumeAttachmentSpec,\n \"V1VolumeAttachmentStatus\": V1VolumeAttachmentStatus,\n \"V1VolumeDevice\": V1VolumeDevice,\n \"V1VolumeError\": V1VolumeError,\n \"V1VolumeMount\": V1VolumeMount,\n \"V1VolumeNodeAffinity\": V1VolumeNodeAffinity,\n \"V1VolumeProjection\": V1VolumeProjection,\n \"V1VsphereVirtualDiskVolumeSource\": V1VsphereVirtualDiskVolumeSource,\n \"V1WatchEvent\": V1WatchEvent,\n \"V1WeightedPodAffinityTerm\": V1WeightedPodAffinityTerm,\n \"V1alpha1AggregationRule\": V1alpha1AggregationRule,\n \"V1alpha1AuditSink\": V1alpha1AuditSink,\n \"V1alpha1AuditSinkList\": V1alpha1AuditSinkList,\n \"V1alpha1AuditSinkSpec\": V1alpha1AuditSinkSpec,\n \"V1alpha1ClusterRole\": V1alpha1ClusterRole,\n \"V1alpha1ClusterRoleBinding\": V1alpha1ClusterRoleBinding,\n \"V1alpha1ClusterRoleBindingList\": V1alpha1ClusterRoleBindingList,\n \"V1alpha1ClusterRoleList\": V1alpha1ClusterRoleList,\n \"V1alpha1Initializer\": V1alpha1Initializer,\n \"V1alpha1InitializerConfiguration\": V1alpha1InitializerConfiguration,\n \"V1alpha1InitializerConfigurationList\": V1alpha1InitializerConfigurationList,\n \"V1alpha1PodPreset\": V1alpha1PodPreset,\n \"V1alpha1PodPresetList\": V1alpha1PodPresetList,\n \"V1alpha1PodPresetSpec\": V1alpha1PodPresetSpec,\n \"V1alpha1Policy\": V1alpha1Policy,\n \"V1alpha1PolicyRule\": V1alpha1PolicyRule,\n \"V1alpha1PriorityClass\": V1alpha1PriorityClass,\n \"V1alpha1PriorityClassList\": V1alpha1PriorityClassList,\n \"V1alpha1Role\": V1alpha1Role,\n \"V1alpha1RoleBinding\": V1alpha1RoleBinding,\n \"V1alpha1RoleBindingList\": V1alpha1RoleBindingList,\n \"V1alpha1RoleList\": V1alpha1RoleList,\n \"V1alpha1RoleRef\": V1alpha1RoleRef,\n \"V1alpha1Rule\": V1alpha1Rule,\n \"V1alpha1ServiceReference\": V1alpha1ServiceReference,\n \"V1alpha1Subject\": V1alpha1Subject,\n \"V1alpha1VolumeAttachment\": V1alpha1VolumeAttachment,\n \"V1alpha1VolumeAttachmentList\": V1alpha1VolumeAttachmentList,\n \"V1alpha1VolumeAttachmentSource\": V1alpha1VolumeAttachmentSource,\n \"V1alpha1VolumeAttachmentSpec\": V1alpha1VolumeAttachmentSpec,\n \"V1alpha1VolumeAttachmentStatus\": V1alpha1VolumeAttachmentStatus,\n \"V1alpha1VolumeError\": V1alpha1VolumeError,\n \"V1alpha1Webhook\": V1alpha1Webhook,\n \"V1alpha1WebhookClientConfig\": V1alpha1WebhookClientConfig,\n \"V1alpha1WebhookThrottleConfig\": V1alpha1WebhookThrottleConfig,\n \"V1beta1APIService\": V1beta1APIService,\n \"V1beta1APIServiceCondition\": V1beta1APIServiceCondition,\n \"V1beta1APIServiceList\": V1beta1APIServiceList,\n \"V1beta1APIServiceSpec\": V1beta1APIServiceSpec,\n \"V1beta1APIServiceStatus\": V1beta1APIServiceStatus,\n \"V1beta1AggregationRule\": V1beta1AggregationRule,\n \"V1beta1CertificateSigningRequest\": V1beta1CertificateSigningRequest,\n \"V1beta1CertificateSigningRequestCondition\": V1beta1CertificateSigningRequestCondition,\n \"V1beta1CertificateSigningRequestList\": V1beta1CertificateSigningRequestList,\n \"V1beta1CertificateSigningRequestSpec\": V1beta1CertificateSigningRequestSpec,\n \"V1beta1CertificateSigningRequestStatus\": V1beta1CertificateSigningRequestStatus,\n \"V1beta1ClusterRole\": V1beta1ClusterRole,\n \"V1beta1ClusterRoleBinding\": V1beta1ClusterRoleBinding,\n \"V1beta1ClusterRoleBindingList\": V1beta1ClusterRoleBindingList,\n \"V1beta1ClusterRoleList\": V1beta1ClusterRoleList,\n \"V1beta1ControllerRevision\": V1beta1ControllerRevision,\n \"V1beta1ControllerRevisionList\": V1beta1ControllerRevisionList,\n \"V1beta1CronJob\": V1beta1CronJob,\n \"V1beta1CronJobList\": V1beta1CronJobList,\n \"V1beta1CronJobSpec\": V1beta1CronJobSpec,\n \"V1beta1CronJobStatus\": V1beta1CronJobStatus,\n \"V1beta1CustomResourceColumnDefinition\": V1beta1CustomResourceColumnDefinition,\n \"V1beta1CustomResourceConversion\": V1beta1CustomResourceConversion,\n \"V1beta1CustomResourceDefinition\": V1beta1CustomResourceDefinition,\n \"V1beta1CustomResourceDefinitionCondition\": V1beta1CustomResourceDefinitionCondition,\n \"V1beta1CustomResourceDefinitionList\": V1beta1CustomResourceDefinitionList,\n \"V1beta1CustomResourceDefinitionNames\": V1beta1CustomResourceDefinitionNames,\n \"V1beta1CustomResourceDefinitionSpec\": V1beta1CustomResourceDefinitionSpec,\n \"V1beta1CustomResourceDefinitionStatus\": V1beta1CustomResourceDefinitionStatus,\n \"V1beta1CustomResourceDefinitionVersion\": V1beta1CustomResourceDefinitionVersion,\n \"V1beta1CustomResourceSubresourceScale\": V1beta1CustomResourceSubresourceScale,\n \"V1beta1CustomResourceSubresources\": V1beta1CustomResourceSubresources,\n \"V1beta1CustomResourceValidation\": V1beta1CustomResourceValidation,\n \"V1beta1DaemonSet\": V1beta1DaemonSet,\n \"V1beta1DaemonSetCondition\": V1beta1DaemonSetCondition,\n \"V1beta1DaemonSetList\": V1beta1DaemonSetList,\n \"V1beta1DaemonSetSpec\": V1beta1DaemonSetSpec,\n \"V1beta1DaemonSetStatus\": V1beta1DaemonSetStatus,\n \"V1beta1DaemonSetUpdateStrategy\": V1beta1DaemonSetUpdateStrategy,\n \"V1beta1Event\": V1beta1Event,\n \"V1beta1EventList\": V1beta1EventList,\n \"V1beta1EventSeries\": V1beta1EventSeries,\n \"V1beta1Eviction\": V1beta1Eviction,\n \"V1beta1ExternalDocumentation\": V1beta1ExternalDocumentation,\n \"V1beta1HTTPIngressPath\": V1beta1HTTPIngressPath,\n \"V1beta1HTTPIngressRuleValue\": V1beta1HTTPIngressRuleValue,\n \"V1beta1IPBlock\": V1beta1IPBlock,\n \"V1beta1Ingress\": V1beta1Ingress,\n \"V1beta1IngressBackend\": V1beta1IngressBackend,\n \"V1beta1IngressList\": V1beta1IngressList,\n \"V1beta1IngressRule\": V1beta1IngressRule,\n \"V1beta1IngressSpec\": V1beta1IngressSpec,\n \"V1beta1IngressStatus\": V1beta1IngressStatus,\n \"V1beta1IngressTLS\": V1beta1IngressTLS,\n \"V1beta1JSONSchemaProps\": V1beta1JSONSchemaProps,\n \"V1beta1JobTemplateSpec\": V1beta1JobTemplateSpec,\n \"V1beta1Lease\": V1beta1Lease,\n \"V1beta1LeaseList\": V1beta1LeaseList,\n \"V1beta1LeaseSpec\": V1beta1LeaseSpec,\n \"V1beta1LocalSubjectAccessReview\": V1beta1LocalSubjectAccessReview,\n \"V1beta1MutatingWebhookConfiguration\": V1beta1MutatingWebhookConfiguration,\n \"V1beta1MutatingWebhookConfigurationList\": V1beta1MutatingWebhookConfigurationList,\n \"V1beta1NetworkPolicy\": V1beta1NetworkPolicy,\n \"V1beta1NetworkPolicyEgressRule\": V1beta1NetworkPolicyEgressRule,\n \"V1beta1NetworkPolicyIngressRule\": V1beta1NetworkPolicyIngressRule,\n \"V1beta1NetworkPolicyList\": V1beta1NetworkPolicyList,\n \"V1beta1NetworkPolicyPeer\": V1beta1NetworkPolicyPeer,\n \"V1beta1NetworkPolicyPort\": V1beta1NetworkPolicyPort,\n \"V1beta1NetworkPolicySpec\": V1beta1NetworkPolicySpec,\n \"V1beta1NonResourceAttributes\": V1beta1NonResourceAttributes,\n \"V1beta1NonResourceRule\": V1beta1NonResourceRule,\n \"V1beta1PodDisruptionBudget\": V1beta1PodDisruptionBudget,\n \"V1beta1PodDisruptionBudgetList\": V1beta1PodDisruptionBudgetList,\n \"V1beta1PodDisruptionBudgetSpec\": V1beta1PodDisruptionBudgetSpec,\n \"V1beta1PodDisruptionBudgetStatus\": V1beta1PodDisruptionBudgetStatus,\n \"V1beta1PolicyRule\": V1beta1PolicyRule,\n \"V1beta1PriorityClass\": V1beta1PriorityClass,\n \"V1beta1PriorityClassList\": V1beta1PriorityClassList,\n \"V1beta1ReplicaSet\": V1beta1ReplicaSet,\n \"V1beta1ReplicaSetCondition\": V1beta1ReplicaSetCondition,\n \"V1beta1ReplicaSetList\": V1beta1ReplicaSetList,\n \"V1beta1ReplicaSetSpec\": V1beta1ReplicaSetSpec,\n \"V1beta1ReplicaSetStatus\": V1beta1ReplicaSetStatus,\n \"V1beta1ResourceAttributes\": V1beta1ResourceAttributes,\n \"V1beta1ResourceRule\": V1beta1ResourceRule,\n \"V1beta1Role\": V1beta1Role,\n \"V1beta1RoleBinding\": V1beta1RoleBinding,\n \"V1beta1RoleBindingList\": V1beta1RoleBindingList,\n \"V1beta1RoleList\": V1beta1RoleList,\n \"V1beta1RoleRef\": V1beta1RoleRef,\n \"V1beta1RollingUpdateDaemonSet\": V1beta1RollingUpdateDaemonSet,\n \"V1beta1RollingUpdateStatefulSetStrategy\": V1beta1RollingUpdateStatefulSetStrategy,\n \"V1beta1RuleWithOperations\": V1beta1RuleWithOperations,\n \"V1beta1SelfSubjectAccessReview\": V1beta1SelfSubjectAccessReview,\n \"V1beta1SelfSubjectAccessReviewSpec\": V1beta1SelfSubjectAccessReviewSpec,\n \"V1beta1SelfSubjectRulesReview\": V1beta1SelfSubjectRulesReview,\n \"V1beta1SelfSubjectRulesReviewSpec\": V1beta1SelfSubjectRulesReviewSpec,\n \"V1beta1StatefulSet\": V1beta1StatefulSet,\n \"V1beta1StatefulSetCondition\": V1beta1StatefulSetCondition,\n \"V1beta1StatefulSetList\": V1beta1StatefulSetList,\n \"V1beta1StatefulSetSpec\": V1beta1StatefulSetSpec,\n \"V1beta1StatefulSetStatus\": V1beta1StatefulSetStatus,\n \"V1beta1StatefulSetUpdateStrategy\": V1beta1StatefulSetUpdateStrategy,\n \"V1beta1StorageClass\": V1beta1StorageClass,\n \"V1beta1StorageClassList\": V1beta1StorageClassList,\n \"V1beta1Subject\": V1beta1Subject,\n \"V1beta1SubjectAccessReview\": V1beta1SubjectAccessReview,\n \"V1beta1SubjectAccessReviewSpec\": V1beta1SubjectAccessReviewSpec,\n \"V1beta1SubjectAccessReviewStatus\": V1beta1SubjectAccessReviewStatus,\n \"V1beta1SubjectRulesReviewStatus\": V1beta1SubjectRulesReviewStatus,\n \"V1beta1TokenReview\": V1beta1TokenReview,\n \"V1beta1TokenReviewSpec\": V1beta1TokenReviewSpec,\n \"V1beta1TokenReviewStatus\": V1beta1TokenReviewStatus,\n \"V1beta1UserInfo\": V1beta1UserInfo,\n \"V1beta1ValidatingWebhookConfiguration\": V1beta1ValidatingWebhookConfiguration,\n \"V1beta1ValidatingWebhookConfigurationList\": V1beta1ValidatingWebhookConfigurationList,\n \"V1beta1VolumeAttachment\": V1beta1VolumeAttachment,\n \"V1beta1VolumeAttachmentList\": V1beta1VolumeAttachmentList,\n \"V1beta1VolumeAttachmentSource\": V1beta1VolumeAttachmentSource,\n \"V1beta1VolumeAttachmentSpec\": V1beta1VolumeAttachmentSpec,\n \"V1beta1VolumeAttachmentStatus\": V1beta1VolumeAttachmentStatus,\n \"V1beta1VolumeError\": V1beta1VolumeError,\n \"V1beta1Webhook\": V1beta1Webhook,\n \"V1beta2ControllerRevision\": V1beta2ControllerRevision,\n \"V1beta2ControllerRevisionList\": V1beta2ControllerRevisionList,\n \"V1beta2DaemonSet\": V1beta2DaemonSet,\n \"V1beta2DaemonSetCondition\": V1beta2DaemonSetCondition,\n \"V1beta2DaemonSetList\": V1beta2DaemonSetList,\n \"V1beta2DaemonSetSpec\": V1beta2DaemonSetSpec,\n \"V1beta2DaemonSetStatus\": V1beta2DaemonSetStatus,\n \"V1beta2DaemonSetUpdateStrategy\": V1beta2DaemonSetUpdateStrategy,\n \"V1beta2Deployment\": V1beta2Deployment,\n \"V1beta2DeploymentCondition\": V1beta2DeploymentCondition,\n \"V1beta2DeploymentList\": V1beta2DeploymentList,\n \"V1beta2DeploymentSpec\": V1beta2DeploymentSpec,\n \"V1beta2DeploymentStatus\": V1beta2DeploymentStatus,\n \"V1beta2DeploymentStrategy\": V1beta2DeploymentStrategy,\n \"V1beta2ReplicaSet\": V1beta2ReplicaSet,\n \"V1beta2ReplicaSetCondition\": V1beta2ReplicaSetCondition,\n \"V1beta2ReplicaSetList\": V1beta2ReplicaSetList,\n \"V1beta2ReplicaSetSpec\": V1beta2ReplicaSetSpec,\n \"V1beta2ReplicaSetStatus\": V1beta2ReplicaSetStatus,\n \"V1beta2RollingUpdateDaemonSet\": V1beta2RollingUpdateDaemonSet,\n \"V1beta2RollingUpdateDeployment\": V1beta2RollingUpdateDeployment,\n \"V1beta2RollingUpdateStatefulSetStrategy\": V1beta2RollingUpdateStatefulSetStrategy,\n \"V1beta2Scale\": V1beta2Scale,\n \"V1beta2ScaleSpec\": V1beta2ScaleSpec,\n \"V1beta2ScaleStatus\": V1beta2ScaleStatus,\n \"V1beta2StatefulSet\": V1beta2StatefulSet,\n \"V1beta2StatefulSetCondition\": V1beta2StatefulSetCondition,\n \"V1beta2StatefulSetList\": V1beta2StatefulSetList,\n \"V1beta2StatefulSetSpec\": V1beta2StatefulSetSpec,\n \"V1beta2StatefulSetStatus\": V1beta2StatefulSetStatus,\n \"V1beta2StatefulSetUpdateStrategy\": V1beta2StatefulSetUpdateStrategy,\n \"V2alpha1CronJob\": V2alpha1CronJob,\n \"V2alpha1CronJobList\": V2alpha1CronJobList,\n \"V2alpha1CronJobSpec\": V2alpha1CronJobSpec,\n \"V2alpha1CronJobStatus\": V2alpha1CronJobStatus,\n \"V2alpha1JobTemplateSpec\": V2alpha1JobTemplateSpec,\n \"V2beta1CrossVersionObjectReference\": V2beta1CrossVersionObjectReference,\n \"V2beta1ExternalMetricSource\": V2beta1ExternalMetricSource,\n \"V2beta1ExternalMetricStatus\": V2beta1ExternalMetricStatus,\n \"V2beta1HorizontalPodAutoscaler\": V2beta1HorizontalPodAutoscaler,\n \"V2beta1HorizontalPodAutoscalerCondition\": V2beta1HorizontalPodAutoscalerCondition,\n \"V2beta1HorizontalPodAutoscalerList\": V2beta1HorizontalPodAutoscalerList,\n \"V2beta1HorizontalPodAutoscalerSpec\": V2beta1HorizontalPodAutoscalerSpec,\n \"V2beta1HorizontalPodAutoscalerStatus\": V2beta1HorizontalPodAutoscalerStatus,\n \"V2beta1MetricSpec\": V2beta1MetricSpec,\n \"V2beta1MetricStatus\": V2beta1MetricStatus,\n \"V2beta1ObjectMetricSource\": V2beta1ObjectMetricSource,\n \"V2beta1ObjectMetricStatus\": V2beta1ObjectMetricStatus,\n \"V2beta1PodsMetricSource\": V2beta1PodsMetricSource,\n \"V2beta1PodsMetricStatus\": V2beta1PodsMetricStatus,\n \"V2beta1ResourceMetricSource\": V2beta1ResourceMetricSource,\n \"V2beta1ResourceMetricStatus\": V2beta1ResourceMetricStatus,\n \"V2beta2CrossVersionObjectReference\": V2beta2CrossVersionObjectReference,\n \"V2beta2ExternalMetricSource\": V2beta2ExternalMetricSource,\n \"V2beta2ExternalMetricStatus\": V2beta2ExternalMetricStatus,\n \"V2beta2HorizontalPodAutoscaler\": V2beta2HorizontalPodAutoscaler,\n \"V2beta2HorizontalPodAutoscalerCondition\": V2beta2HorizontalPodAutoscalerCondition,\n \"V2beta2HorizontalPodAutoscalerList\": V2beta2HorizontalPodAutoscalerList,\n \"V2beta2HorizontalPodAutoscalerSpec\": V2beta2HorizontalPodAutoscalerSpec,\n \"V2beta2HorizontalPodAutoscalerStatus\": V2beta2HorizontalPodAutoscalerStatus,\n \"V2beta2MetricIdentifier\": V2beta2MetricIdentifier,\n \"V2beta2MetricSpec\": V2beta2MetricSpec,\n \"V2beta2MetricStatus\": V2beta2MetricStatus,\n \"V2beta2MetricTarget\": V2beta2MetricTarget,\n \"V2beta2MetricValueStatus\": V2beta2MetricValueStatus,\n \"V2beta2ObjectMetricSource\": V2beta2ObjectMetricSource,\n \"V2beta2ObjectMetricStatus\": V2beta2ObjectMetricStatus,\n \"V2beta2PodsMetricSource\": V2beta2PodsMetricSource,\n \"V2beta2PodsMetricStatus\": V2beta2PodsMetricStatus,\n \"V2beta2ResourceMetricSource\": V2beta2ResourceMetricSource,\n \"V2beta2ResourceMetricStatus\": V2beta2ResourceMetricStatus,\n \"VersionInfo\": VersionInfo,\n};\nclass HttpBasicAuth {\n constructor() {\n this.username = '';\n this.password = '';\n }\n applyToRequest(requestOptions) {\n requestOptions.auth = {\n username: this.username, password: this.password\n };\n }\n}\nexports.HttpBasicAuth = HttpBasicAuth;\nclass ApiKeyAuth {\n constructor(location, paramName) {\n this.location = location;\n this.paramName = paramName;\n this.apiKey = '';\n }\n applyToRequest(requestOptions) {\n if (this.location == \"query\") {\n requestOptions.qs[this.paramName] = this.apiKey;\n }\n else if (this.location == \"header\" && requestOptions && requestOptions.headers) {\n requestOptions.headers[this.paramName] = this.apiKey;\n }\n }\n}\nexports.ApiKeyAuth = ApiKeyAuth;\nclass OAuth {\n constructor() {\n this.accessToken = '';\n }\n applyToRequest(requestOptions) {\n if (requestOptions && requestOptions.headers) {\n requestOptions.headers[\"Authorization\"] = \"Bearer \" + this.accessToken;\n }\n }\n}\nexports.OAuth = OAuth;\nclass VoidAuth {\n constructor() {\n this.username = '';\n this.password = '';\n }\n applyToRequest(_) {\n // Do nothing\n }\n}\nexports.VoidAuth = VoidAuth;\nvar AdmissionregistrationApiApiKeys;\n(function (AdmissionregistrationApiApiKeys) {\n AdmissionregistrationApiApiKeys[AdmissionregistrationApiApiKeys[\"BearerToken\"] = 0] = \"BearerToken\";\n})(AdmissionregistrationApiApiKeys = exports.AdmissionregistrationApiApiKeys || (exports.AdmissionregistrationApiApiKeys = {}));\nclass AdmissionregistrationApi {\n constructor(basePathOrUsername, password, basePath) {\n this._basePath = defaultBasePath;\n this.defaultHeaders = {};\n this._useQuerystring = false;\n this.authentications = {\n 'default': new VoidAuth(),\n 'BearerToken': new ApiKeyAuth('header', 'authorization'),\n };\n if (password) {\n if (basePath) {\n this.basePath = basePath;\n }\n }\n else {\n if (basePathOrUsername) {\n this.basePath = basePathOrUsername;\n }\n }\n }\n set useQuerystring(value) {\n this._useQuerystring = value;\n }\n set basePath(basePath) {\n this._basePath = basePath;\n }\n get basePath() {\n return this._basePath;\n }\n setDefaultAuthentication(auth) {\n this.authentications.default = auth;\n }\n setApiKey(key, value) {\n this.authentications[AdmissionregistrationApiApiKeys[key]].apiKey = value;\n }\n /**\n * get information of a group\n * @param {*} [options] Override http request options.\n */\n getAPIGroup(options = {}) {\n const localVarPath = this.basePath + '/apis/admissionregistration.k8s.io/';\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1APIGroup\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n}\nexports.AdmissionregistrationApi = AdmissionregistrationApi;\nvar AdmissionregistrationV1alpha1ApiApiKeys;\n(function (AdmissionregistrationV1alpha1ApiApiKeys) {\n AdmissionregistrationV1alpha1ApiApiKeys[AdmissionregistrationV1alpha1ApiApiKeys[\"BearerToken\"] = 0] = \"BearerToken\";\n})(AdmissionregistrationV1alpha1ApiApiKeys = exports.AdmissionregistrationV1alpha1ApiApiKeys || (exports.AdmissionregistrationV1alpha1ApiApiKeys = {}));\nclass AdmissionregistrationV1alpha1Api {\n constructor(basePathOrUsername, password, basePath) {\n this._basePath = defaultBasePath;\n this.defaultHeaders = {};\n this._useQuerystring = false;\n this.authentications = {\n 'default': new VoidAuth(),\n 'BearerToken': new ApiKeyAuth('header', 'authorization'),\n };\n if (password) {\n if (basePath) {\n this.basePath = basePath;\n }\n }\n else {\n if (basePathOrUsername) {\n this.basePath = basePathOrUsername;\n }\n }\n }\n set useQuerystring(value) {\n this._useQuerystring = value;\n }\n set basePath(basePath) {\n this._basePath = basePath;\n }\n get basePath() {\n return this._basePath;\n }\n setDefaultAuthentication(auth) {\n this.authentications.default = auth;\n }\n setApiKey(key, value) {\n this.authentications[AdmissionregistrationV1alpha1ApiApiKeys[key]].apiKey = value;\n }\n /**\n * create an InitializerConfiguration\n * @param body\n * @param includeUninitialized If true, partially initialized resources are included in the response.\n * @param pretty If 'true', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param {*} [options] Override http request options.\n */\n createInitializerConfiguration(body, includeUninitialized, pretty, dryRun, options = {}) {\n const localVarPath = this.basePath + '/apis/admissionregistration.k8s.io/v1alpha1/initializerconfigurations';\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling createInitializerConfiguration.');\n }\n if (includeUninitialized !== undefined) {\n localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, \"boolean\");\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'POST',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: ObjectSerializer.serialize(body, \"V1alpha1InitializerConfiguration\")\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1alpha1InitializerConfiguration\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * delete collection of InitializerConfiguration\n * @param includeUninitialized If true, partially initialized resources are included in the response.\n * @param pretty If 'true', then the output is pretty printed.\n * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \\"next key\\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.\n * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything.\n * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything.\n * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.\n * @param resourceVersion When specified with a watch call, shows changes that occur after that particular version of a resource. Defaults to changes from the beginning of history. When specified for list: - if unset, then the result is returned from remote storage based on quorum-read flag; - if it's 0, then we simply return what we currently have in cache, no guarantee; - if set to non zero, then the result is at least as fresh as given rv.\n * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.\n * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.\n * @param {*} [options] Override http request options.\n */\n deleteCollectionInitializerConfiguration(includeUninitialized, pretty, _continue, fieldSelector, labelSelector, limit, resourceVersion, timeoutSeconds, watch, options = {}) {\n const localVarPath = this.basePath + '/apis/admissionregistration.k8s.io/v1alpha1/initializerconfigurations';\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n if (includeUninitialized !== undefined) {\n localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, \"boolean\");\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (_continue !== undefined) {\n localVarQueryParameters['continue'] = ObjectSerializer.serialize(_continue, \"string\");\n }\n if (fieldSelector !== undefined) {\n localVarQueryParameters['fieldSelector'] = ObjectSerializer.serialize(fieldSelector, \"string\");\n }\n if (labelSelector !== undefined) {\n localVarQueryParameters['labelSelector'] = ObjectSerializer.serialize(labelSelector, \"string\");\n }\n if (limit !== undefined) {\n localVarQueryParameters['limit'] = ObjectSerializer.serialize(limit, \"number\");\n }\n if (resourceVersion !== undefined) {\n localVarQueryParameters['resourceVersion'] = ObjectSerializer.serialize(resourceVersion, \"string\");\n }\n if (timeoutSeconds !== undefined) {\n localVarQueryParameters['timeoutSeconds'] = ObjectSerializer.serialize(timeoutSeconds, \"number\");\n }\n if (watch !== undefined) {\n localVarQueryParameters['watch'] = ObjectSerializer.serialize(watch, \"boolean\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'DELETE',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1Status\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * delete an InitializerConfiguration\n * @param name name of the InitializerConfiguration\n * @param pretty If 'true', then the output is pretty printed.\n * @param body\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param gracePeriodSeconds The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately.\n * @param orphanDependents Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \\"orphan\\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both.\n * @param propagationPolicy Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground.\n * @param {*} [options] Override http request options.\n */\n deleteInitializerConfiguration(name, pretty, body, dryRun, gracePeriodSeconds, orphanDependents, propagationPolicy, options = {}) {\n const localVarPath = this.basePath + '/apis/admissionregistration.k8s.io/v1alpha1/initializerconfigurations/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling deleteInitializerConfiguration.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, \"string\");\n }\n if (gracePeriodSeconds !== undefined) {\n localVarQueryParameters['gracePeriodSeconds'] = ObjectSerializer.serialize(gracePeriodSeconds, \"number\");\n }\n if (orphanDependents !== undefined) {\n localVarQueryParameters['orphanDependents'] = ObjectSerializer.serialize(orphanDependents, \"boolean\");\n }\n if (propagationPolicy !== undefined) {\n localVarQueryParameters['propagationPolicy'] = ObjectSerializer.serialize(propagationPolicy, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'DELETE',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: ObjectSerializer.serialize(body, \"V1DeleteOptions\")\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1Status\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * get available resources\n * @param {*} [options] Override http request options.\n */\n getAPIResources(options = {}) {\n const localVarPath = this.basePath + '/apis/admissionregistration.k8s.io/v1alpha1/';\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1APIResourceList\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * list or watch objects of kind InitializerConfiguration\n * @param includeUninitialized If true, partially initialized resources are included in the response.\n * @param pretty If 'true', then the output is pretty printed.\n * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \\"next key\\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.\n * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything.\n * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything.\n * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.\n * @param resourceVersion When specified with a watch call, shows changes that occur after that particular version of a resource. Defaults to changes from the beginning of history. When specified for list: - if unset, then the result is returned from remote storage based on quorum-read flag; - if it's 0, then we simply return what we currently have in cache, no guarantee; - if set to non zero, then the result is at least as fresh as given rv.\n * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.\n * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.\n * @param {*} [options] Override http request options.\n */\n listInitializerConfiguration(includeUninitialized, pretty, _continue, fieldSelector, labelSelector, limit, resourceVersion, timeoutSeconds, watch, options = {}) {\n const localVarPath = this.basePath + '/apis/admissionregistration.k8s.io/v1alpha1/initializerconfigurations';\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n if (includeUninitialized !== undefined) {\n localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, \"boolean\");\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (_continue !== undefined) {\n localVarQueryParameters['continue'] = ObjectSerializer.serialize(_continue, \"string\");\n }\n if (fieldSelector !== undefined) {\n localVarQueryParameters['fieldSelector'] = ObjectSerializer.serialize(fieldSelector, \"string\");\n }\n if (labelSelector !== undefined) {\n localVarQueryParameters['labelSelector'] = ObjectSerializer.serialize(labelSelector, \"string\");\n }\n if (limit !== undefined) {\n localVarQueryParameters['limit'] = ObjectSerializer.serialize(limit, \"number\");\n }\n if (resourceVersion !== undefined) {\n localVarQueryParameters['resourceVersion'] = ObjectSerializer.serialize(resourceVersion, \"string\");\n }\n if (timeoutSeconds !== undefined) {\n localVarQueryParameters['timeoutSeconds'] = ObjectSerializer.serialize(timeoutSeconds, \"number\");\n }\n if (watch !== undefined) {\n localVarQueryParameters['watch'] = ObjectSerializer.serialize(watch, \"boolean\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1alpha1InitializerConfigurationList\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * partially update the specified InitializerConfiguration\n * @param name name of the InitializerConfiguration\n * @param body\n * @param pretty If 'true', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param {*} [options] Override http request options.\n */\n patchInitializerConfiguration(name, body, pretty, dryRun, options = {}) {\n const localVarPath = this.basePath + '/apis/admissionregistration.k8s.io/v1alpha1/initializerconfigurations/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling patchInitializerConfiguration.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling patchInitializerConfiguration.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'PATCH',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: ObjectSerializer.serialize(body, \"any\")\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1alpha1InitializerConfiguration\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * read the specified InitializerConfiguration\n * @param name name of the InitializerConfiguration\n * @param pretty If 'true', then the output is pretty printed.\n * @param exact Should the export be exact. Exact export maintains cluster-specific fields like 'Namespace'.\n * @param _export Should this value be exported. Export strips fields that a user can not specify.\n * @param {*} [options] Override http request options.\n */\n readInitializerConfiguration(name, pretty, exact, _export, options = {}) {\n const localVarPath = this.basePath + '/apis/admissionregistration.k8s.io/v1alpha1/initializerconfigurations/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling readInitializerConfiguration.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (exact !== undefined) {\n localVarQueryParameters['exact'] = ObjectSerializer.serialize(exact, \"boolean\");\n }\n if (_export !== undefined) {\n localVarQueryParameters['export'] = ObjectSerializer.serialize(_export, \"boolean\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1alpha1InitializerConfiguration\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * replace the specified InitializerConfiguration\n * @param name name of the InitializerConfiguration\n * @param body\n * @param pretty If 'true', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param {*} [options] Override http request options.\n */\n replaceInitializerConfiguration(name, body, pretty, dryRun, options = {}) {\n const localVarPath = this.basePath + '/apis/admissionregistration.k8s.io/v1alpha1/initializerconfigurations/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling replaceInitializerConfiguration.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling replaceInitializerConfiguration.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'PUT',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: ObjectSerializer.serialize(body, \"V1alpha1InitializerConfiguration\")\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1alpha1InitializerConfiguration\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n}\nexports.AdmissionregistrationV1alpha1Api = AdmissionregistrationV1alpha1Api;\nvar AdmissionregistrationV1beta1ApiApiKeys;\n(function (AdmissionregistrationV1beta1ApiApiKeys) {\n AdmissionregistrationV1beta1ApiApiKeys[AdmissionregistrationV1beta1ApiApiKeys[\"BearerToken\"] = 0] = \"BearerToken\";\n})(AdmissionregistrationV1beta1ApiApiKeys = exports.AdmissionregistrationV1beta1ApiApiKeys || (exports.AdmissionregistrationV1beta1ApiApiKeys = {}));\nclass AdmissionregistrationV1beta1Api {\n constructor(basePathOrUsername, password, basePath) {\n this._basePath = defaultBasePath;\n this.defaultHeaders = {};\n this._useQuerystring = false;\n this.authentications = {\n 'default': new VoidAuth(),\n 'BearerToken': new ApiKeyAuth('header', 'authorization'),\n };\n if (password) {\n if (basePath) {\n this.basePath = basePath;\n }\n }\n else {\n if (basePathOrUsername) {\n this.basePath = basePathOrUsername;\n }\n }\n }\n set useQuerystring(value) {\n this._useQuerystring = value;\n }\n set basePath(basePath) {\n this._basePath = basePath;\n }\n get basePath() {\n return this._basePath;\n }\n setDefaultAuthentication(auth) {\n this.authentications.default = auth;\n }\n setApiKey(key, value) {\n this.authentications[AdmissionregistrationV1beta1ApiApiKeys[key]].apiKey = value;\n }\n /**\n * create a MutatingWebhookConfiguration\n * @param body\n * @param includeUninitialized If true, partially initialized resources are included in the response.\n * @param pretty If 'true', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param {*} [options] Override http request options.\n */\n createMutatingWebhookConfiguration(body, includeUninitialized, pretty, dryRun, options = {}) {\n const localVarPath = this.basePath + '/apis/admissionregistration.k8s.io/v1beta1/mutatingwebhookconfigurations';\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling createMutatingWebhookConfiguration.');\n }\n if (includeUninitialized !== undefined) {\n localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, \"boolean\");\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'POST',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: ObjectSerializer.serialize(body, \"V1beta1MutatingWebhookConfiguration\")\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1beta1MutatingWebhookConfiguration\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * create a ValidatingWebhookConfiguration\n * @param body\n * @param includeUninitialized If true, partially initialized resources are included in the response.\n * @param pretty If 'true', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param {*} [options] Override http request options.\n */\n createValidatingWebhookConfiguration(body, includeUninitialized, pretty, dryRun, options = {}) {\n const localVarPath = this.basePath + '/apis/admissionregistration.k8s.io/v1beta1/validatingwebhookconfigurations';\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling createValidatingWebhookConfiguration.');\n }\n if (includeUninitialized !== undefined) {\n localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, \"boolean\");\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'POST',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: ObjectSerializer.serialize(body, \"V1beta1ValidatingWebhookConfiguration\")\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1beta1ValidatingWebhookConfiguration\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * delete collection of MutatingWebhookConfiguration\n * @param includeUninitialized If true, partially initialized resources are included in the response.\n * @param pretty If 'true', then the output is pretty printed.\n * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \\"next key\\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.\n * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything.\n * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything.\n * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.\n * @param resourceVersion When specified with a watch call, shows changes that occur after that particular version of a resource. Defaults to changes from the beginning of history. When specified for list: - if unset, then the result is returned from remote storage based on quorum-read flag; - if it's 0, then we simply return what we currently have in cache, no guarantee; - if set to non zero, then the result is at least as fresh as given rv.\n * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.\n * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.\n * @param {*} [options] Override http request options.\n */\n deleteCollectionMutatingWebhookConfiguration(includeUninitialized, pretty, _continue, fieldSelector, labelSelector, limit, resourceVersion, timeoutSeconds, watch, options = {}) {\n const localVarPath = this.basePath + '/apis/admissionregistration.k8s.io/v1beta1/mutatingwebhookconfigurations';\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n if (includeUninitialized !== undefined) {\n localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, \"boolean\");\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (_continue !== undefined) {\n localVarQueryParameters['continue'] = ObjectSerializer.serialize(_continue, \"string\");\n }\n if (fieldSelector !== undefined) {\n localVarQueryParameters['fieldSelector'] = ObjectSerializer.serialize(fieldSelector, \"string\");\n }\n if (labelSelector !== undefined) {\n localVarQueryParameters['labelSelector'] = ObjectSerializer.serialize(labelSelector, \"string\");\n }\n if (limit !== undefined) {\n localVarQueryParameters['limit'] = ObjectSerializer.serialize(limit, \"number\");\n }\n if (resourceVersion !== undefined) {\n localVarQueryParameters['resourceVersion'] = ObjectSerializer.serialize(resourceVersion, \"string\");\n }\n if (timeoutSeconds !== undefined) {\n localVarQueryParameters['timeoutSeconds'] = ObjectSerializer.serialize(timeoutSeconds, \"number\");\n }\n if (watch !== undefined) {\n localVarQueryParameters['watch'] = ObjectSerializer.serialize(watch, \"boolean\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'DELETE',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1Status\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * delete collection of ValidatingWebhookConfiguration\n * @param includeUninitialized If true, partially initialized resources are included in the response.\n * @param pretty If 'true', then the output is pretty printed.\n * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \\"next key\\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.\n * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything.\n * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything.\n * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.\n * @param resourceVersion When specified with a watch call, shows changes that occur after that particular version of a resource. Defaults to changes from the beginning of history. When specified for list: - if unset, then the result is returned from remote storage based on quorum-read flag; - if it's 0, then we simply return what we currently have in cache, no guarantee; - if set to non zero, then the result is at least as fresh as given rv.\n * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.\n * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.\n * @param {*} [options] Override http request options.\n */\n deleteCollectionValidatingWebhookConfiguration(includeUninitialized, pretty, _continue, fieldSelector, labelSelector, limit, resourceVersion, timeoutSeconds, watch, options = {}) {\n const localVarPath = this.basePath + '/apis/admissionregistration.k8s.io/v1beta1/validatingwebhookconfigurations';\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n if (includeUninitialized !== undefined) {\n localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, \"boolean\");\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (_continue !== undefined) {\n localVarQueryParameters['continue'] = ObjectSerializer.serialize(_continue, \"string\");\n }\n if (fieldSelector !== undefined) {\n localVarQueryParameters['fieldSelector'] = ObjectSerializer.serialize(fieldSelector, \"string\");\n }\n if (labelSelector !== undefined) {\n localVarQueryParameters['labelSelector'] = ObjectSerializer.serialize(labelSelector, \"string\");\n }\n if (limit !== undefined) {\n localVarQueryParameters['limit'] = ObjectSerializer.serialize(limit, \"number\");\n }\n if (resourceVersion !== undefined) {\n localVarQueryParameters['resourceVersion'] = ObjectSerializer.serialize(resourceVersion, \"string\");\n }\n if (timeoutSeconds !== undefined) {\n localVarQueryParameters['timeoutSeconds'] = ObjectSerializer.serialize(timeoutSeconds, \"number\");\n }\n if (watch !== undefined) {\n localVarQueryParameters['watch'] = ObjectSerializer.serialize(watch, \"boolean\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'DELETE',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1Status\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * delete a MutatingWebhookConfiguration\n * @param name name of the MutatingWebhookConfiguration\n * @param pretty If 'true', then the output is pretty printed.\n * @param body\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param gracePeriodSeconds The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately.\n * @param orphanDependents Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \\"orphan\\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both.\n * @param propagationPolicy Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground.\n * @param {*} [options] Override http request options.\n */\n deleteMutatingWebhookConfiguration(name, pretty, body, dryRun, gracePeriodSeconds, orphanDependents, propagationPolicy, options = {}) {\n const localVarPath = this.basePath + '/apis/admissionregistration.k8s.io/v1beta1/mutatingwebhookconfigurations/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling deleteMutatingWebhookConfiguration.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, \"string\");\n }\n if (gracePeriodSeconds !== undefined) {\n localVarQueryParameters['gracePeriodSeconds'] = ObjectSerializer.serialize(gracePeriodSeconds, \"number\");\n }\n if (orphanDependents !== undefined) {\n localVarQueryParameters['orphanDependents'] = ObjectSerializer.serialize(orphanDependents, \"boolean\");\n }\n if (propagationPolicy !== undefined) {\n localVarQueryParameters['propagationPolicy'] = ObjectSerializer.serialize(propagationPolicy, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'DELETE',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: ObjectSerializer.serialize(body, \"V1DeleteOptions\")\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1Status\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * delete a ValidatingWebhookConfiguration\n * @param name name of the ValidatingWebhookConfiguration\n * @param pretty If 'true', then the output is pretty printed.\n * @param body\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param gracePeriodSeconds The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately.\n * @param orphanDependents Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \\"orphan\\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both.\n * @param propagationPolicy Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground.\n * @param {*} [options] Override http request options.\n */\n deleteValidatingWebhookConfiguration(name, pretty, body, dryRun, gracePeriodSeconds, orphanDependents, propagationPolicy, options = {}) {\n const localVarPath = this.basePath + '/apis/admissionregistration.k8s.io/v1beta1/validatingwebhookconfigurations/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling deleteValidatingWebhookConfiguration.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, \"string\");\n }\n if (gracePeriodSeconds !== undefined) {\n localVarQueryParameters['gracePeriodSeconds'] = ObjectSerializer.serialize(gracePeriodSeconds, \"number\");\n }\n if (orphanDependents !== undefined) {\n localVarQueryParameters['orphanDependents'] = ObjectSerializer.serialize(orphanDependents, \"boolean\");\n }\n if (propagationPolicy !== undefined) {\n localVarQueryParameters['propagationPolicy'] = ObjectSerializer.serialize(propagationPolicy, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'DELETE',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: ObjectSerializer.serialize(body, \"V1DeleteOptions\")\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1Status\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * get available resources\n * @param {*} [options] Override http request options.\n */\n getAPIResources(options = {}) {\n const localVarPath = this.basePath + '/apis/admissionregistration.k8s.io/v1beta1/';\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1APIResourceList\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * list or watch objects of kind MutatingWebhookConfiguration\n * @param includeUninitialized If true, partially initialized resources are included in the response.\n * @param pretty If 'true', then the output is pretty printed.\n * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \\"next key\\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.\n * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything.\n * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything.\n * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.\n * @param resourceVersion When specified with a watch call, shows changes that occur after that particular version of a resource. Defaults to changes from the beginning of history. When specified for list: - if unset, then the result is returned from remote storage based on quorum-read flag; - if it's 0, then we simply return what we currently have in cache, no guarantee; - if set to non zero, then the result is at least as fresh as given rv.\n * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.\n * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.\n * @param {*} [options] Override http request options.\n */\n listMutatingWebhookConfiguration(includeUninitialized, pretty, _continue, fieldSelector, labelSelector, limit, resourceVersion, timeoutSeconds, watch, options = {}) {\n const localVarPath = this.basePath + '/apis/admissionregistration.k8s.io/v1beta1/mutatingwebhookconfigurations';\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n if (includeUninitialized !== undefined) {\n localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, \"boolean\");\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (_continue !== undefined) {\n localVarQueryParameters['continue'] = ObjectSerializer.serialize(_continue, \"string\");\n }\n if (fieldSelector !== undefined) {\n localVarQueryParameters['fieldSelector'] = ObjectSerializer.serialize(fieldSelector, \"string\");\n }\n if (labelSelector !== undefined) {\n localVarQueryParameters['labelSelector'] = ObjectSerializer.serialize(labelSelector, \"string\");\n }\n if (limit !== undefined) {\n localVarQueryParameters['limit'] = ObjectSerializer.serialize(limit, \"number\");\n }\n if (resourceVersion !== undefined) {\n localVarQueryParameters['resourceVersion'] = ObjectSerializer.serialize(resourceVersion, \"string\");\n }\n if (timeoutSeconds !== undefined) {\n localVarQueryParameters['timeoutSeconds'] = ObjectSerializer.serialize(timeoutSeconds, \"number\");\n }\n if (watch !== undefined) {\n localVarQueryParameters['watch'] = ObjectSerializer.serialize(watch, \"boolean\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1beta1MutatingWebhookConfigurationList\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * list or watch objects of kind ValidatingWebhookConfiguration\n * @param includeUninitialized If true, partially initialized resources are included in the response.\n * @param pretty If 'true', then the output is pretty printed.\n * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \\"next key\\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.\n * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything.\n * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything.\n * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.\n * @param resourceVersion When specified with a watch call, shows changes that occur after that particular version of a resource. Defaults to changes from the beginning of history. When specified for list: - if unset, then the result is returned from remote storage based on quorum-read flag; - if it's 0, then we simply return what we currently have in cache, no guarantee; - if set to non zero, then the result is at least as fresh as given rv.\n * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.\n * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.\n * @param {*} [options] Override http request options.\n */\n listValidatingWebhookConfiguration(includeUninitialized, pretty, _continue, fieldSelector, labelSelector, limit, resourceVersion, timeoutSeconds, watch, options = {}) {\n const localVarPath = this.basePath + '/apis/admissionregistration.k8s.io/v1beta1/validatingwebhookconfigurations';\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n if (includeUninitialized !== undefined) {\n localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, \"boolean\");\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (_continue !== undefined) {\n localVarQueryParameters['continue'] = ObjectSerializer.serialize(_continue, \"string\");\n }\n if (fieldSelector !== undefined) {\n localVarQueryParameters['fieldSelector'] = ObjectSerializer.serialize(fieldSelector, \"string\");\n }\n if (labelSelector !== undefined) {\n localVarQueryParameters['labelSelector'] = ObjectSerializer.serialize(labelSelector, \"string\");\n }\n if (limit !== undefined) {\n localVarQueryParameters['limit'] = ObjectSerializer.serialize(limit, \"number\");\n }\n if (resourceVersion !== undefined) {\n localVarQueryParameters['resourceVersion'] = ObjectSerializer.serialize(resourceVersion, \"string\");\n }\n if (timeoutSeconds !== undefined) {\n localVarQueryParameters['timeoutSeconds'] = ObjectSerializer.serialize(timeoutSeconds, \"number\");\n }\n if (watch !== undefined) {\n localVarQueryParameters['watch'] = ObjectSerializer.serialize(watch, \"boolean\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1beta1ValidatingWebhookConfigurationList\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * partially update the specified MutatingWebhookConfiguration\n * @param name name of the MutatingWebhookConfiguration\n * @param body\n * @param pretty If 'true', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param {*} [options] Override http request options.\n */\n patchMutatingWebhookConfiguration(name, body, pretty, dryRun, options = {}) {\n const localVarPath = this.basePath + '/apis/admissionregistration.k8s.io/v1beta1/mutatingwebhookconfigurations/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling patchMutatingWebhookConfiguration.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling patchMutatingWebhookConfiguration.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'PATCH',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: ObjectSerializer.serialize(body, \"any\")\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1beta1MutatingWebhookConfiguration\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * partially update the specified ValidatingWebhookConfiguration\n * @param name name of the ValidatingWebhookConfiguration\n * @param body\n * @param pretty If 'true', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param {*} [options] Override http request options.\n */\n patchValidatingWebhookConfiguration(name, body, pretty, dryRun, options = {}) {\n const localVarPath = this.basePath + '/apis/admissionregistration.k8s.io/v1beta1/validatingwebhookconfigurations/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling patchValidatingWebhookConfiguration.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling patchValidatingWebhookConfiguration.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'PATCH',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: ObjectSerializer.serialize(body, \"any\")\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1beta1ValidatingWebhookConfiguration\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * read the specified MutatingWebhookConfiguration\n * @param name name of the MutatingWebhookConfiguration\n * @param pretty If 'true', then the output is pretty printed.\n * @param exact Should the export be exact. Exact export maintains cluster-specific fields like 'Namespace'.\n * @param _export Should this value be exported. Export strips fields that a user can not specify.\n * @param {*} [options] Override http request options.\n */\n readMutatingWebhookConfiguration(name, pretty, exact, _export, options = {}) {\n const localVarPath = this.basePath + '/apis/admissionregistration.k8s.io/v1beta1/mutatingwebhookconfigurations/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling readMutatingWebhookConfiguration.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (exact !== undefined) {\n localVarQueryParameters['exact'] = ObjectSerializer.serialize(exact, \"boolean\");\n }\n if (_export !== undefined) {\n localVarQueryParameters['export'] = ObjectSerializer.serialize(_export, \"boolean\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1beta1MutatingWebhookConfiguration\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * read the specified ValidatingWebhookConfiguration\n * @param name name of the ValidatingWebhookConfiguration\n * @param pretty If 'true', then the output is pretty printed.\n * @param exact Should the export be exact. Exact export maintains cluster-specific fields like 'Namespace'.\n * @param _export Should this value be exported. Export strips fields that a user can not specify.\n * @param {*} [options] Override http request options.\n */\n readValidatingWebhookConfiguration(name, pretty, exact, _export, options = {}) {\n const localVarPath = this.basePath + '/apis/admissionregistration.k8s.io/v1beta1/validatingwebhookconfigurations/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling readValidatingWebhookConfiguration.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (exact !== undefined) {\n localVarQueryParameters['exact'] = ObjectSerializer.serialize(exact, \"boolean\");\n }\n if (_export !== undefined) {\n localVarQueryParameters['export'] = ObjectSerializer.serialize(_export, \"boolean\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1beta1ValidatingWebhookConfiguration\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * replace the specified MutatingWebhookConfiguration\n * @param name name of the MutatingWebhookConfiguration\n * @param body\n * @param pretty If 'true', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param {*} [options] Override http request options.\n */\n replaceMutatingWebhookConfiguration(name, body, pretty, dryRun, options = {}) {\n const localVarPath = this.basePath + '/apis/admissionregistration.k8s.io/v1beta1/mutatingwebhookconfigurations/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling replaceMutatingWebhookConfiguration.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling replaceMutatingWebhookConfiguration.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'PUT',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: ObjectSerializer.serialize(body, \"V1beta1MutatingWebhookConfiguration\")\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1beta1MutatingWebhookConfiguration\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * replace the specified ValidatingWebhookConfiguration\n * @param name name of the ValidatingWebhookConfiguration\n * @param body\n * @param pretty If 'true', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param {*} [options] Override http request options.\n */\n replaceValidatingWebhookConfiguration(name, body, pretty, dryRun, options = {}) {\n const localVarPath = this.basePath + '/apis/admissionregistration.k8s.io/v1beta1/validatingwebhookconfigurations/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling replaceValidatingWebhookConfiguration.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling replaceValidatingWebhookConfiguration.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'PUT',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: ObjectSerializer.serialize(body, \"V1beta1ValidatingWebhookConfiguration\")\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1beta1ValidatingWebhookConfiguration\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n}\nexports.AdmissionregistrationV1beta1Api = AdmissionregistrationV1beta1Api;\nvar ApiextensionsApiApiKeys;\n(function (ApiextensionsApiApiKeys) {\n ApiextensionsApiApiKeys[ApiextensionsApiApiKeys[\"BearerToken\"] = 0] = \"BearerToken\";\n})(ApiextensionsApiApiKeys = exports.ApiextensionsApiApiKeys || (exports.ApiextensionsApiApiKeys = {}));\nclass ApiextensionsApi {\n constructor(basePathOrUsername, password, basePath) {\n this._basePath = defaultBasePath;\n this.defaultHeaders = {};\n this._useQuerystring = false;\n this.authentications = {\n 'default': new VoidAuth(),\n 'BearerToken': new ApiKeyAuth('header', 'authorization'),\n };\n if (password) {\n if (basePath) {\n this.basePath = basePath;\n }\n }\n else {\n if (basePathOrUsername) {\n this.basePath = basePathOrUsername;\n }\n }\n }\n set useQuerystring(value) {\n this._useQuerystring = value;\n }\n set basePath(basePath) {\n this._basePath = basePath;\n }\n get basePath() {\n return this._basePath;\n }\n setDefaultAuthentication(auth) {\n this.authentications.default = auth;\n }\n setApiKey(key, value) {\n this.authentications[ApiextensionsApiApiKeys[key]].apiKey = value;\n }\n /**\n * get information of a group\n * @param {*} [options] Override http request options.\n */\n getAPIGroup(options = {}) {\n const localVarPath = this.basePath + '/apis/apiextensions.k8s.io/';\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1APIGroup\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n}\nexports.ApiextensionsApi = ApiextensionsApi;\nvar ApiextensionsV1beta1ApiApiKeys;\n(function (ApiextensionsV1beta1ApiApiKeys) {\n ApiextensionsV1beta1ApiApiKeys[ApiextensionsV1beta1ApiApiKeys[\"BearerToken\"] = 0] = \"BearerToken\";\n})(ApiextensionsV1beta1ApiApiKeys = exports.ApiextensionsV1beta1ApiApiKeys || (exports.ApiextensionsV1beta1ApiApiKeys = {}));\nclass ApiextensionsV1beta1Api {\n constructor(basePathOrUsername, password, basePath) {\n this._basePath = defaultBasePath;\n this.defaultHeaders = {};\n this._useQuerystring = false;\n this.authentications = {\n 'default': new VoidAuth(),\n 'BearerToken': new ApiKeyAuth('header', 'authorization'),\n };\n if (password) {\n if (basePath) {\n this.basePath = basePath;\n }\n }\n else {\n if (basePathOrUsername) {\n this.basePath = basePathOrUsername;\n }\n }\n }\n set useQuerystring(value) {\n this._useQuerystring = value;\n }\n set basePath(basePath) {\n this._basePath = basePath;\n }\n get basePath() {\n return this._basePath;\n }\n setDefaultAuthentication(auth) {\n this.authentications.default = auth;\n }\n setApiKey(key, value) {\n this.authentications[ApiextensionsV1beta1ApiApiKeys[key]].apiKey = value;\n }\n /**\n * create a CustomResourceDefinition\n * @param body\n * @param includeUninitialized If true, partially initialized resources are included in the response.\n * @param pretty If 'true', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param {*} [options] Override http request options.\n */\n createCustomResourceDefinition(body, includeUninitialized, pretty, dryRun, options = {}) {\n const localVarPath = this.basePath + '/apis/apiextensions.k8s.io/v1beta1/customresourcedefinitions';\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling createCustomResourceDefinition.');\n }\n if (includeUninitialized !== undefined) {\n localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, \"boolean\");\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'POST',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: ObjectSerializer.serialize(body, \"V1beta1CustomResourceDefinition\")\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1beta1CustomResourceDefinition\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * delete collection of CustomResourceDefinition\n * @param includeUninitialized If true, partially initialized resources are included in the response.\n * @param pretty If 'true', then the output is pretty printed.\n * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \\"next key\\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.\n * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything.\n * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything.\n * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.\n * @param resourceVersion When specified with a watch call, shows changes that occur after that particular version of a resource. Defaults to changes from the beginning of history. When specified for list: - if unset, then the result is returned from remote storage based on quorum-read flag; - if it's 0, then we simply return what we currently have in cache, no guarantee; - if set to non zero, then the result is at least as fresh as given rv.\n * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.\n * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.\n * @param {*} [options] Override http request options.\n */\n deleteCollectionCustomResourceDefinition(includeUninitialized, pretty, _continue, fieldSelector, labelSelector, limit, resourceVersion, timeoutSeconds, watch, options = {}) {\n const localVarPath = this.basePath + '/apis/apiextensions.k8s.io/v1beta1/customresourcedefinitions';\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n if (includeUninitialized !== undefined) {\n localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, \"boolean\");\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (_continue !== undefined) {\n localVarQueryParameters['continue'] = ObjectSerializer.serialize(_continue, \"string\");\n }\n if (fieldSelector !== undefined) {\n localVarQueryParameters['fieldSelector'] = ObjectSerializer.serialize(fieldSelector, \"string\");\n }\n if (labelSelector !== undefined) {\n localVarQueryParameters['labelSelector'] = ObjectSerializer.serialize(labelSelector, \"string\");\n }\n if (limit !== undefined) {\n localVarQueryParameters['limit'] = ObjectSerializer.serialize(limit, \"number\");\n }\n if (resourceVersion !== undefined) {\n localVarQueryParameters['resourceVersion'] = ObjectSerializer.serialize(resourceVersion, \"string\");\n }\n if (timeoutSeconds !== undefined) {\n localVarQueryParameters['timeoutSeconds'] = ObjectSerializer.serialize(timeoutSeconds, \"number\");\n }\n if (watch !== undefined) {\n localVarQueryParameters['watch'] = ObjectSerializer.serialize(watch, \"boolean\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'DELETE',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1Status\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * delete a CustomResourceDefinition\n * @param name name of the CustomResourceDefinition\n * @param pretty If 'true', then the output is pretty printed.\n * @param body\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param gracePeriodSeconds The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately.\n * @param orphanDependents Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \\"orphan\\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both.\n * @param propagationPolicy Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground.\n * @param {*} [options] Override http request options.\n */\n deleteCustomResourceDefinition(name, pretty, body, dryRun, gracePeriodSeconds, orphanDependents, propagationPolicy, options = {}) {\n const localVarPath = this.basePath + '/apis/apiextensions.k8s.io/v1beta1/customresourcedefinitions/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling deleteCustomResourceDefinition.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, \"string\");\n }\n if (gracePeriodSeconds !== undefined) {\n localVarQueryParameters['gracePeriodSeconds'] = ObjectSerializer.serialize(gracePeriodSeconds, \"number\");\n }\n if (orphanDependents !== undefined) {\n localVarQueryParameters['orphanDependents'] = ObjectSerializer.serialize(orphanDependents, \"boolean\");\n }\n if (propagationPolicy !== undefined) {\n localVarQueryParameters['propagationPolicy'] = ObjectSerializer.serialize(propagationPolicy, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'DELETE',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: ObjectSerializer.serialize(body, \"V1DeleteOptions\")\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1Status\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * get available resources\n * @param {*} [options] Override http request options.\n */\n getAPIResources(options = {}) {\n const localVarPath = this.basePath + '/apis/apiextensions.k8s.io/v1beta1/';\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1APIResourceList\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * list or watch objects of kind CustomResourceDefinition\n * @param includeUninitialized If true, partially initialized resources are included in the response.\n * @param pretty If 'true', then the output is pretty printed.\n * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \\"next key\\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.\n * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything.\n * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything.\n * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.\n * @param resourceVersion When specified with a watch call, shows changes that occur after that particular version of a resource. Defaults to changes from the beginning of history. When specified for list: - if unset, then the result is returned from remote storage based on quorum-read flag; - if it's 0, then we simply return what we currently have in cache, no guarantee; - if set to non zero, then the result is at least as fresh as given rv.\n * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.\n * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.\n * @param {*} [options] Override http request options.\n */\n listCustomResourceDefinition(includeUninitialized, pretty, _continue, fieldSelector, labelSelector, limit, resourceVersion, timeoutSeconds, watch, options = {}) {\n const localVarPath = this.basePath + '/apis/apiextensions.k8s.io/v1beta1/customresourcedefinitions';\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n if (includeUninitialized !== undefined) {\n localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, \"boolean\");\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (_continue !== undefined) {\n localVarQueryParameters['continue'] = ObjectSerializer.serialize(_continue, \"string\");\n }\n if (fieldSelector !== undefined) {\n localVarQueryParameters['fieldSelector'] = ObjectSerializer.serialize(fieldSelector, \"string\");\n }\n if (labelSelector !== undefined) {\n localVarQueryParameters['labelSelector'] = ObjectSerializer.serialize(labelSelector, \"string\");\n }\n if (limit !== undefined) {\n localVarQueryParameters['limit'] = ObjectSerializer.serialize(limit, \"number\");\n }\n if (resourceVersion !== undefined) {\n localVarQueryParameters['resourceVersion'] = ObjectSerializer.serialize(resourceVersion, \"string\");\n }\n if (timeoutSeconds !== undefined) {\n localVarQueryParameters['timeoutSeconds'] = ObjectSerializer.serialize(timeoutSeconds, \"number\");\n }\n if (watch !== undefined) {\n localVarQueryParameters['watch'] = ObjectSerializer.serialize(watch, \"boolean\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1beta1CustomResourceDefinitionList\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * partially update the specified CustomResourceDefinition\n * @param name name of the CustomResourceDefinition\n * @param body\n * @param pretty If 'true', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param {*} [options] Override http request options.\n */\n patchCustomResourceDefinition(name, body, pretty, dryRun, options = {}) {\n const localVarPath = this.basePath + '/apis/apiextensions.k8s.io/v1beta1/customresourcedefinitions/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling patchCustomResourceDefinition.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling patchCustomResourceDefinition.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'PATCH',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: ObjectSerializer.serialize(body, \"any\")\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1beta1CustomResourceDefinition\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * partially update status of the specified CustomResourceDefinition\n * @param name name of the CustomResourceDefinition\n * @param body\n * @param pretty If 'true', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param {*} [options] Override http request options.\n */\n patchCustomResourceDefinitionStatus(name, body, pretty, dryRun, options = {}) {\n const localVarPath = this.basePath + '/apis/apiextensions.k8s.io/v1beta1/customresourcedefinitions/{name}/status'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling patchCustomResourceDefinitionStatus.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling patchCustomResourceDefinitionStatus.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'PATCH',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: ObjectSerializer.serialize(body, \"any\")\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1beta1CustomResourceDefinition\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * read the specified CustomResourceDefinition\n * @param name name of the CustomResourceDefinition\n * @param pretty If 'true', then the output is pretty printed.\n * @param exact Should the export be exact. Exact export maintains cluster-specific fields like 'Namespace'.\n * @param _export Should this value be exported. Export strips fields that a user can not specify.\n * @param {*} [options] Override http request options.\n */\n readCustomResourceDefinition(name, pretty, exact, _export, options = {}) {\n const localVarPath = this.basePath + '/apis/apiextensions.k8s.io/v1beta1/customresourcedefinitions/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling readCustomResourceDefinition.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (exact !== undefined) {\n localVarQueryParameters['exact'] = ObjectSerializer.serialize(exact, \"boolean\");\n }\n if (_export !== undefined) {\n localVarQueryParameters['export'] = ObjectSerializer.serialize(_export, \"boolean\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1beta1CustomResourceDefinition\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * read status of the specified CustomResourceDefinition\n * @param name name of the CustomResourceDefinition\n * @param pretty If 'true', then the output is pretty printed.\n * @param {*} [options] Override http request options.\n */\n readCustomResourceDefinitionStatus(name, pretty, options = {}) {\n const localVarPath = this.basePath + '/apis/apiextensions.k8s.io/v1beta1/customresourcedefinitions/{name}/status'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling readCustomResourceDefinitionStatus.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1beta1CustomResourceDefinition\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * replace the specified CustomResourceDefinition\n * @param name name of the CustomResourceDefinition\n * @param body\n * @param pretty If 'true', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param {*} [options] Override http request options.\n */\n replaceCustomResourceDefinition(name, body, pretty, dryRun, options = {}) {\n const localVarPath = this.basePath + '/apis/apiextensions.k8s.io/v1beta1/customresourcedefinitions/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling replaceCustomResourceDefinition.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling replaceCustomResourceDefinition.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'PUT',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: ObjectSerializer.serialize(body, \"V1beta1CustomResourceDefinition\")\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1beta1CustomResourceDefinition\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * replace status of the specified CustomResourceDefinition\n * @param name name of the CustomResourceDefinition\n * @param body\n * @param pretty If 'true', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param {*} [options] Override http request options.\n */\n replaceCustomResourceDefinitionStatus(name, body, pretty, dryRun, options = {}) {\n const localVarPath = this.basePath + '/apis/apiextensions.k8s.io/v1beta1/customresourcedefinitions/{name}/status'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling replaceCustomResourceDefinitionStatus.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling replaceCustomResourceDefinitionStatus.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'PUT',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: ObjectSerializer.serialize(body, \"V1beta1CustomResourceDefinition\")\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1beta1CustomResourceDefinition\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n}\nexports.ApiextensionsV1beta1Api = ApiextensionsV1beta1Api;\nvar ApiregistrationApiApiKeys;\n(function (ApiregistrationApiApiKeys) {\n ApiregistrationApiApiKeys[ApiregistrationApiApiKeys[\"BearerToken\"] = 0] = \"BearerToken\";\n})(ApiregistrationApiApiKeys = exports.ApiregistrationApiApiKeys || (exports.ApiregistrationApiApiKeys = {}));\nclass ApiregistrationApi {\n constructor(basePathOrUsername, password, basePath) {\n this._basePath = defaultBasePath;\n this.defaultHeaders = {};\n this._useQuerystring = false;\n this.authentications = {\n 'default': new VoidAuth(),\n 'BearerToken': new ApiKeyAuth('header', 'authorization'),\n };\n if (password) {\n if (basePath) {\n this.basePath = basePath;\n }\n }\n else {\n if (basePathOrUsername) {\n this.basePath = basePathOrUsername;\n }\n }\n }\n set useQuerystring(value) {\n this._useQuerystring = value;\n }\n set basePath(basePath) {\n this._basePath = basePath;\n }\n get basePath() {\n return this._basePath;\n }\n setDefaultAuthentication(auth) {\n this.authentications.default = auth;\n }\n setApiKey(key, value) {\n this.authentications[ApiregistrationApiApiKeys[key]].apiKey = value;\n }\n /**\n * get information of a group\n * @param {*} [options] Override http request options.\n */\n getAPIGroup(options = {}) {\n const localVarPath = this.basePath + '/apis/apiregistration.k8s.io/';\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1APIGroup\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n}\nexports.ApiregistrationApi = ApiregistrationApi;\nvar ApiregistrationV1ApiApiKeys;\n(function (ApiregistrationV1ApiApiKeys) {\n ApiregistrationV1ApiApiKeys[ApiregistrationV1ApiApiKeys[\"BearerToken\"] = 0] = \"BearerToken\";\n})(ApiregistrationV1ApiApiKeys = exports.ApiregistrationV1ApiApiKeys || (exports.ApiregistrationV1ApiApiKeys = {}));\nclass ApiregistrationV1Api {\n constructor(basePathOrUsername, password, basePath) {\n this._basePath = defaultBasePath;\n this.defaultHeaders = {};\n this._useQuerystring = false;\n this.authentications = {\n 'default': new VoidAuth(),\n 'BearerToken': new ApiKeyAuth('header', 'authorization'),\n };\n if (password) {\n if (basePath) {\n this.basePath = basePath;\n }\n }\n else {\n if (basePathOrUsername) {\n this.basePath = basePathOrUsername;\n }\n }\n }\n set useQuerystring(value) {\n this._useQuerystring = value;\n }\n set basePath(basePath) {\n this._basePath = basePath;\n }\n get basePath() {\n return this._basePath;\n }\n setDefaultAuthentication(auth) {\n this.authentications.default = auth;\n }\n setApiKey(key, value) {\n this.authentications[ApiregistrationV1ApiApiKeys[key]].apiKey = value;\n }\n /**\n * create an APIService\n * @param body\n * @param includeUninitialized If true, partially initialized resources are included in the response.\n * @param pretty If 'true', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param {*} [options] Override http request options.\n */\n createAPIService(body, includeUninitialized, pretty, dryRun, options = {}) {\n const localVarPath = this.basePath + '/apis/apiregistration.k8s.io/v1/apiservices';\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling createAPIService.');\n }\n if (includeUninitialized !== undefined) {\n localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, \"boolean\");\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'POST',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: ObjectSerializer.serialize(body, \"V1APIService\")\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1APIService\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * delete an APIService\n * @param name name of the APIService\n * @param pretty If 'true', then the output is pretty printed.\n * @param body\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param gracePeriodSeconds The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately.\n * @param orphanDependents Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \\"orphan\\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both.\n * @param propagationPolicy Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground.\n * @param {*} [options] Override http request options.\n */\n deleteAPIService(name, pretty, body, dryRun, gracePeriodSeconds, orphanDependents, propagationPolicy, options = {}) {\n const localVarPath = this.basePath + '/apis/apiregistration.k8s.io/v1/apiservices/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling deleteAPIService.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, \"string\");\n }\n if (gracePeriodSeconds !== undefined) {\n localVarQueryParameters['gracePeriodSeconds'] = ObjectSerializer.serialize(gracePeriodSeconds, \"number\");\n }\n if (orphanDependents !== undefined) {\n localVarQueryParameters['orphanDependents'] = ObjectSerializer.serialize(orphanDependents, \"boolean\");\n }\n if (propagationPolicy !== undefined) {\n localVarQueryParameters['propagationPolicy'] = ObjectSerializer.serialize(propagationPolicy, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'DELETE',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: ObjectSerializer.serialize(body, \"V1DeleteOptions\")\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1Status\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * delete collection of APIService\n * @param includeUninitialized If true, partially initialized resources are included in the response.\n * @param pretty If 'true', then the output is pretty printed.\n * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \\"next key\\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.\n * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything.\n * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything.\n * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.\n * @param resourceVersion When specified with a watch call, shows changes that occur after that particular version of a resource. Defaults to changes from the beginning of history. When specified for list: - if unset, then the result is returned from remote storage based on quorum-read flag; - if it's 0, then we simply return what we currently have in cache, no guarantee; - if set to non zero, then the result is at least as fresh as given rv.\n * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.\n * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.\n * @param {*} [options] Override http request options.\n */\n deleteCollectionAPIService(includeUninitialized, pretty, _continue, fieldSelector, labelSelector, limit, resourceVersion, timeoutSeconds, watch, options = {}) {\n const localVarPath = this.basePath + '/apis/apiregistration.k8s.io/v1/apiservices';\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n if (includeUninitialized !== undefined) {\n localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, \"boolean\");\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (_continue !== undefined) {\n localVarQueryParameters['continue'] = ObjectSerializer.serialize(_continue, \"string\");\n }\n if (fieldSelector !== undefined) {\n localVarQueryParameters['fieldSelector'] = ObjectSerializer.serialize(fieldSelector, \"string\");\n }\n if (labelSelector !== undefined) {\n localVarQueryParameters['labelSelector'] = ObjectSerializer.serialize(labelSelector, \"string\");\n }\n if (limit !== undefined) {\n localVarQueryParameters['limit'] = ObjectSerializer.serialize(limit, \"number\");\n }\n if (resourceVersion !== undefined) {\n localVarQueryParameters['resourceVersion'] = ObjectSerializer.serialize(resourceVersion, \"string\");\n }\n if (timeoutSeconds !== undefined) {\n localVarQueryParameters['timeoutSeconds'] = ObjectSerializer.serialize(timeoutSeconds, \"number\");\n }\n if (watch !== undefined) {\n localVarQueryParameters['watch'] = ObjectSerializer.serialize(watch, \"boolean\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'DELETE',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1Status\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * get available resources\n * @param {*} [options] Override http request options.\n */\n getAPIResources(options = {}) {\n const localVarPath = this.basePath + '/apis/apiregistration.k8s.io/v1/';\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1APIResourceList\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * list or watch objects of kind APIService\n * @param includeUninitialized If true, partially initialized resources are included in the response.\n * @param pretty If 'true', then the output is pretty printed.\n * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \\"next key\\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.\n * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything.\n * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything.\n * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.\n * @param resourceVersion When specified with a watch call, shows changes that occur after that particular version of a resource. Defaults to changes from the beginning of history. When specified for list: - if unset, then the result is returned from remote storage based on quorum-read flag; - if it's 0, then we simply return what we currently have in cache, no guarantee; - if set to non zero, then the result is at least as fresh as given rv.\n * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.\n * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.\n * @param {*} [options] Override http request options.\n */\n listAPIService(includeUninitialized, pretty, _continue, fieldSelector, labelSelector, limit, resourceVersion, timeoutSeconds, watch, options = {}) {\n const localVarPath = this.basePath + '/apis/apiregistration.k8s.io/v1/apiservices';\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n if (includeUninitialized !== undefined) {\n localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, \"boolean\");\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (_continue !== undefined) {\n localVarQueryParameters['continue'] = ObjectSerializer.serialize(_continue, \"string\");\n }\n if (fieldSelector !== undefined) {\n localVarQueryParameters['fieldSelector'] = ObjectSerializer.serialize(fieldSelector, \"string\");\n }\n if (labelSelector !== undefined) {\n localVarQueryParameters['labelSelector'] = ObjectSerializer.serialize(labelSelector, \"string\");\n }\n if (limit !== undefined) {\n localVarQueryParameters['limit'] = ObjectSerializer.serialize(limit, \"number\");\n }\n if (resourceVersion !== undefined) {\n localVarQueryParameters['resourceVersion'] = ObjectSerializer.serialize(resourceVersion, \"string\");\n }\n if (timeoutSeconds !== undefined) {\n localVarQueryParameters['timeoutSeconds'] = ObjectSerializer.serialize(timeoutSeconds, \"number\");\n }\n if (watch !== undefined) {\n localVarQueryParameters['watch'] = ObjectSerializer.serialize(watch, \"boolean\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1APIServiceList\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * partially update the specified APIService\n * @param name name of the APIService\n * @param body\n * @param pretty If 'true', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param {*} [options] Override http request options.\n */\n patchAPIService(name, body, pretty, dryRun, options = {}) {\n const localVarPath = this.basePath + '/apis/apiregistration.k8s.io/v1/apiservices/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling patchAPIService.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling patchAPIService.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'PATCH',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: ObjectSerializer.serialize(body, \"any\")\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1APIService\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * partially update status of the specified APIService\n * @param name name of the APIService\n * @param body\n * @param pretty If 'true', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param {*} [options] Override http request options.\n */\n patchAPIServiceStatus(name, body, pretty, dryRun, options = {}) {\n const localVarPath = this.basePath + '/apis/apiregistration.k8s.io/v1/apiservices/{name}/status'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling patchAPIServiceStatus.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling patchAPIServiceStatus.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'PATCH',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: ObjectSerializer.serialize(body, \"any\")\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1APIService\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * read the specified APIService\n * @param name name of the APIService\n * @param pretty If 'true', then the output is pretty printed.\n * @param exact Should the export be exact. Exact export maintains cluster-specific fields like 'Namespace'.\n * @param _export Should this value be exported. Export strips fields that a user can not specify.\n * @param {*} [options] Override http request options.\n */\n readAPIService(name, pretty, exact, _export, options = {}) {\n const localVarPath = this.basePath + '/apis/apiregistration.k8s.io/v1/apiservices/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling readAPIService.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (exact !== undefined) {\n localVarQueryParameters['exact'] = ObjectSerializer.serialize(exact, \"boolean\");\n }\n if (_export !== undefined) {\n localVarQueryParameters['export'] = ObjectSerializer.serialize(_export, \"boolean\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1APIService\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * read status of the specified APIService\n * @param name name of the APIService\n * @param pretty If 'true', then the output is pretty printed.\n * @param {*} [options] Override http request options.\n */\n readAPIServiceStatus(name, pretty, options = {}) {\n const localVarPath = this.basePath + '/apis/apiregistration.k8s.io/v1/apiservices/{name}/status'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling readAPIServiceStatus.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1APIService\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * replace the specified APIService\n * @param name name of the APIService\n * @param body\n * @param pretty If 'true', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param {*} [options] Override http request options.\n */\n replaceAPIService(name, body, pretty, dryRun, options = {}) {\n const localVarPath = this.basePath + '/apis/apiregistration.k8s.io/v1/apiservices/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling replaceAPIService.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling replaceAPIService.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'PUT',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: ObjectSerializer.serialize(body, \"V1APIService\")\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1APIService\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * replace status of the specified APIService\n * @param name name of the APIService\n * @param body\n * @param pretty If 'true', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param {*} [options] Override http request options.\n */\n replaceAPIServiceStatus(name, body, pretty, dryRun, options = {}) {\n const localVarPath = this.basePath + '/apis/apiregistration.k8s.io/v1/apiservices/{name}/status'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling replaceAPIServiceStatus.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling replaceAPIServiceStatus.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'PUT',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: ObjectSerializer.serialize(body, \"V1APIService\")\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1APIService\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n}\nexports.ApiregistrationV1Api = ApiregistrationV1Api;\nvar ApiregistrationV1beta1ApiApiKeys;\n(function (ApiregistrationV1beta1ApiApiKeys) {\n ApiregistrationV1beta1ApiApiKeys[ApiregistrationV1beta1ApiApiKeys[\"BearerToken\"] = 0] = \"BearerToken\";\n})(ApiregistrationV1beta1ApiApiKeys = exports.ApiregistrationV1beta1ApiApiKeys || (exports.ApiregistrationV1beta1ApiApiKeys = {}));\nclass ApiregistrationV1beta1Api {\n constructor(basePathOrUsername, password, basePath) {\n this._basePath = defaultBasePath;\n this.defaultHeaders = {};\n this._useQuerystring = false;\n this.authentications = {\n 'default': new VoidAuth(),\n 'BearerToken': new ApiKeyAuth('header', 'authorization'),\n };\n if (password) {\n if (basePath) {\n this.basePath = basePath;\n }\n }\n else {\n if (basePathOrUsername) {\n this.basePath = basePathOrUsername;\n }\n }\n }\n set useQuerystring(value) {\n this._useQuerystring = value;\n }\n set basePath(basePath) {\n this._basePath = basePath;\n }\n get basePath() {\n return this._basePath;\n }\n setDefaultAuthentication(auth) {\n this.authentications.default = auth;\n }\n setApiKey(key, value) {\n this.authentications[ApiregistrationV1beta1ApiApiKeys[key]].apiKey = value;\n }\n /**\n * create an APIService\n * @param body\n * @param includeUninitialized If true, partially initialized resources are included in the response.\n * @param pretty If 'true', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param {*} [options] Override http request options.\n */\n createAPIService(body, includeUninitialized, pretty, dryRun, options = {}) {\n const localVarPath = this.basePath + '/apis/apiregistration.k8s.io/v1beta1/apiservices';\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling createAPIService.');\n }\n if (includeUninitialized !== undefined) {\n localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, \"boolean\");\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'POST',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: ObjectSerializer.serialize(body, \"V1beta1APIService\")\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1beta1APIService\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * delete an APIService\n * @param name name of the APIService\n * @param pretty If 'true', then the output is pretty printed.\n * @param body\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param gracePeriodSeconds The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately.\n * @param orphanDependents Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \\"orphan\\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both.\n * @param propagationPolicy Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground.\n * @param {*} [options] Override http request options.\n */\n deleteAPIService(name, pretty, body, dryRun, gracePeriodSeconds, orphanDependents, propagationPolicy, options = {}) {\n const localVarPath = this.basePath + '/apis/apiregistration.k8s.io/v1beta1/apiservices/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling deleteAPIService.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, \"string\");\n }\n if (gracePeriodSeconds !== undefined) {\n localVarQueryParameters['gracePeriodSeconds'] = ObjectSerializer.serialize(gracePeriodSeconds, \"number\");\n }\n if (orphanDependents !== undefined) {\n localVarQueryParameters['orphanDependents'] = ObjectSerializer.serialize(orphanDependents, \"boolean\");\n }\n if (propagationPolicy !== undefined) {\n localVarQueryParameters['propagationPolicy'] = ObjectSerializer.serialize(propagationPolicy, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'DELETE',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: ObjectSerializer.serialize(body, \"V1DeleteOptions\")\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1Status\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * delete collection of APIService\n * @param includeUninitialized If true, partially initialized resources are included in the response.\n * @param pretty If 'true', then the output is pretty printed.\n * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \\"next key\\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.\n * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything.\n * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything.\n * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.\n * @param resourceVersion When specified with a watch call, shows changes that occur after that particular version of a resource. Defaults to changes from the beginning of history. When specified for list: - if unset, then the result is returned from remote storage based on quorum-read flag; - if it's 0, then we simply return what we currently have in cache, no guarantee; - if set to non zero, then the result is at least as fresh as given rv.\n * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.\n * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.\n * @param {*} [options] Override http request options.\n */\n deleteCollectionAPIService(includeUninitialized, pretty, _continue, fieldSelector, labelSelector, limit, resourceVersion, timeoutSeconds, watch, options = {}) {\n const localVarPath = this.basePath + '/apis/apiregistration.k8s.io/v1beta1/apiservices';\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n if (includeUninitialized !== undefined) {\n localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, \"boolean\");\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (_continue !== undefined) {\n localVarQueryParameters['continue'] = ObjectSerializer.serialize(_continue, \"string\");\n }\n if (fieldSelector !== undefined) {\n localVarQueryParameters['fieldSelector'] = ObjectSerializer.serialize(fieldSelector, \"string\");\n }\n if (labelSelector !== undefined) {\n localVarQueryParameters['labelSelector'] = ObjectSerializer.serialize(labelSelector, \"string\");\n }\n if (limit !== undefined) {\n localVarQueryParameters['limit'] = ObjectSerializer.serialize(limit, \"number\");\n }\n if (resourceVersion !== undefined) {\n localVarQueryParameters['resourceVersion'] = ObjectSerializer.serialize(resourceVersion, \"string\");\n }\n if (timeoutSeconds !== undefined) {\n localVarQueryParameters['timeoutSeconds'] = ObjectSerializer.serialize(timeoutSeconds, \"number\");\n }\n if (watch !== undefined) {\n localVarQueryParameters['watch'] = ObjectSerializer.serialize(watch, \"boolean\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'DELETE',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1Status\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * get available resources\n * @param {*} [options] Override http request options.\n */\n getAPIResources(options = {}) {\n const localVarPath = this.basePath + '/apis/apiregistration.k8s.io/v1beta1/';\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1APIResourceList\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * list or watch objects of kind APIService\n * @param includeUninitialized If true, partially initialized resources are included in the response.\n * @param pretty If 'true', then the output is pretty printed.\n * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \\"next key\\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.\n * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything.\n * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything.\n * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.\n * @param resourceVersion When specified with a watch call, shows changes that occur after that particular version of a resource. Defaults to changes from the beginning of history. When specified for list: - if unset, then the result is returned from remote storage based on quorum-read flag; - if it's 0, then we simply return what we currently have in cache, no guarantee; - if set to non zero, then the result is at least as fresh as given rv.\n * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.\n * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.\n * @param {*} [options] Override http request options.\n */\n listAPIService(includeUninitialized, pretty, _continue, fieldSelector, labelSelector, limit, resourceVersion, timeoutSeconds, watch, options = {}) {\n const localVarPath = this.basePath + '/apis/apiregistration.k8s.io/v1beta1/apiservices';\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n if (includeUninitialized !== undefined) {\n localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, \"boolean\");\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (_continue !== undefined) {\n localVarQueryParameters['continue'] = ObjectSerializer.serialize(_continue, \"string\");\n }\n if (fieldSelector !== undefined) {\n localVarQueryParameters['fieldSelector'] = ObjectSerializer.serialize(fieldSelector, \"string\");\n }\n if (labelSelector !== undefined) {\n localVarQueryParameters['labelSelector'] = ObjectSerializer.serialize(labelSelector, \"string\");\n }\n if (limit !== undefined) {\n localVarQueryParameters['limit'] = ObjectSerializer.serialize(limit, \"number\");\n }\n if (resourceVersion !== undefined) {\n localVarQueryParameters['resourceVersion'] = ObjectSerializer.serialize(resourceVersion, \"string\");\n }\n if (timeoutSeconds !== undefined) {\n localVarQueryParameters['timeoutSeconds'] = ObjectSerializer.serialize(timeoutSeconds, \"number\");\n }\n if (watch !== undefined) {\n localVarQueryParameters['watch'] = ObjectSerializer.serialize(watch, \"boolean\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1beta1APIServiceList\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * partially update the specified APIService\n * @param name name of the APIService\n * @param body\n * @param pretty If 'true', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param {*} [options] Override http request options.\n */\n patchAPIService(name, body, pretty, dryRun, options = {}) {\n const localVarPath = this.basePath + '/apis/apiregistration.k8s.io/v1beta1/apiservices/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling patchAPIService.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling patchAPIService.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'PATCH',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: ObjectSerializer.serialize(body, \"any\")\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1beta1APIService\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * partially update status of the specified APIService\n * @param name name of the APIService\n * @param body\n * @param pretty If 'true', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param {*} [options] Override http request options.\n */\n patchAPIServiceStatus(name, body, pretty, dryRun, options = {}) {\n const localVarPath = this.basePath + '/apis/apiregistration.k8s.io/v1beta1/apiservices/{name}/status'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling patchAPIServiceStatus.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling patchAPIServiceStatus.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'PATCH',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: ObjectSerializer.serialize(body, \"any\")\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1beta1APIService\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * read the specified APIService\n * @param name name of the APIService\n * @param pretty If 'true', then the output is pretty printed.\n * @param exact Should the export be exact. Exact export maintains cluster-specific fields like 'Namespace'.\n * @param _export Should this value be exported. Export strips fields that a user can not specify.\n * @param {*} [options] Override http request options.\n */\n readAPIService(name, pretty, exact, _export, options = {}) {\n const localVarPath = this.basePath + '/apis/apiregistration.k8s.io/v1beta1/apiservices/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling readAPIService.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (exact !== undefined) {\n localVarQueryParameters['exact'] = ObjectSerializer.serialize(exact, \"boolean\");\n }\n if (_export !== undefined) {\n localVarQueryParameters['export'] = ObjectSerializer.serialize(_export, \"boolean\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1beta1APIService\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * read status of the specified APIService\n * @param name name of the APIService\n * @param pretty If 'true', then the output is pretty printed.\n * @param {*} [options] Override http request options.\n */\n readAPIServiceStatus(name, pretty, options = {}) {\n const localVarPath = this.basePath + '/apis/apiregistration.k8s.io/v1beta1/apiservices/{name}/status'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling readAPIServiceStatus.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1beta1APIService\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * replace the specified APIService\n * @param name name of the APIService\n * @param body\n * @param pretty If 'true', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param {*} [options] Override http request options.\n */\n replaceAPIService(name, body, pretty, dryRun, options = {}) {\n const localVarPath = this.basePath + '/apis/apiregistration.k8s.io/v1beta1/apiservices/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling replaceAPIService.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling replaceAPIService.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'PUT',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: ObjectSerializer.serialize(body, \"V1beta1APIService\")\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1beta1APIService\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * replace status of the specified APIService\n * @param name name of the APIService\n * @param body\n * @param pretty If 'true', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param {*} [options] Override http request options.\n */\n replaceAPIServiceStatus(name, body, pretty, dryRun, options = {}) {\n const localVarPath = this.basePath + '/apis/apiregistration.k8s.io/v1beta1/apiservices/{name}/status'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling replaceAPIServiceStatus.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling replaceAPIServiceStatus.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'PUT',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: ObjectSerializer.serialize(body, \"V1beta1APIService\")\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1beta1APIService\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n}\nexports.ApiregistrationV1beta1Api = ApiregistrationV1beta1Api;\nvar ApisApiApiKeys;\n(function (ApisApiApiKeys) {\n ApisApiApiKeys[ApisApiApiKeys[\"BearerToken\"] = 0] = \"BearerToken\";\n})(ApisApiApiKeys = exports.ApisApiApiKeys || (exports.ApisApiApiKeys = {}));\nclass ApisApi {\n constructor(basePathOrUsername, password, basePath) {\n this._basePath = defaultBasePath;\n this.defaultHeaders = {};\n this._useQuerystring = false;\n this.authentications = {\n 'default': new VoidAuth(),\n 'BearerToken': new ApiKeyAuth('header', 'authorization'),\n };\n if (password) {\n if (basePath) {\n this.basePath = basePath;\n }\n }\n else {\n if (basePathOrUsername) {\n this.basePath = basePathOrUsername;\n }\n }\n }\n set useQuerystring(value) {\n this._useQuerystring = value;\n }\n set basePath(basePath) {\n this._basePath = basePath;\n }\n get basePath() {\n return this._basePath;\n }\n setDefaultAuthentication(auth) {\n this.authentications.default = auth;\n }\n setApiKey(key, value) {\n this.authentications[ApisApiApiKeys[key]].apiKey = value;\n }\n /**\n * get available API versions\n * @param {*} [options] Override http request options.\n */\n getAPIVersions(options = {}) {\n const localVarPath = this.basePath + '/apis/';\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1APIGroupList\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n}\nexports.ApisApi = ApisApi;\nvar AppsApiApiKeys;\n(function (AppsApiApiKeys) {\n AppsApiApiKeys[AppsApiApiKeys[\"BearerToken\"] = 0] = \"BearerToken\";\n})(AppsApiApiKeys = exports.AppsApiApiKeys || (exports.AppsApiApiKeys = {}));\nclass AppsApi {\n constructor(basePathOrUsername, password, basePath) {\n this._basePath = defaultBasePath;\n this.defaultHeaders = {};\n this._useQuerystring = false;\n this.authentications = {\n 'default': new VoidAuth(),\n 'BearerToken': new ApiKeyAuth('header', 'authorization'),\n };\n if (password) {\n if (basePath) {\n this.basePath = basePath;\n }\n }\n else {\n if (basePathOrUsername) {\n this.basePath = basePathOrUsername;\n }\n }\n }\n set useQuerystring(value) {\n this._useQuerystring = value;\n }\n set basePath(basePath) {\n this._basePath = basePath;\n }\n get basePath() {\n return this._basePath;\n }\n setDefaultAuthentication(auth) {\n this.authentications.default = auth;\n }\n setApiKey(key, value) {\n this.authentications[AppsApiApiKeys[key]].apiKey = value;\n }\n /**\n * get information of a group\n * @param {*} [options] Override http request options.\n */\n getAPIGroup(options = {}) {\n const localVarPath = this.basePath + '/apis/apps/';\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1APIGroup\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n}\nexports.AppsApi = AppsApi;\nvar AppsV1ApiApiKeys;\n(function (AppsV1ApiApiKeys) {\n AppsV1ApiApiKeys[AppsV1ApiApiKeys[\"BearerToken\"] = 0] = \"BearerToken\";\n})(AppsV1ApiApiKeys = exports.AppsV1ApiApiKeys || (exports.AppsV1ApiApiKeys = {}));\nclass AppsV1Api {\n constructor(basePathOrUsername, password, basePath) {\n this._basePath = defaultBasePath;\n this.defaultHeaders = {};\n this._useQuerystring = false;\n this.authentications = {\n 'default': new VoidAuth(),\n 'BearerToken': new ApiKeyAuth('header', 'authorization'),\n };\n if (password) {\n if (basePath) {\n this.basePath = basePath;\n }\n }\n else {\n if (basePathOrUsername) {\n this.basePath = basePathOrUsername;\n }\n }\n }\n set useQuerystring(value) {\n this._useQuerystring = value;\n }\n set basePath(basePath) {\n this._basePath = basePath;\n }\n get basePath() {\n return this._basePath;\n }\n setDefaultAuthentication(auth) {\n this.authentications.default = auth;\n }\n setApiKey(key, value) {\n this.authentications[AppsV1ApiApiKeys[key]].apiKey = value;\n }\n /**\n * create a ControllerRevision\n * @param namespace object name and auth scope, such as for teams and projects\n * @param body\n * @param includeUninitialized If true, partially initialized resources are included in the response.\n * @param pretty If 'true', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param {*} [options] Override http request options.\n */\n createNamespacedControllerRevision(namespace, body, includeUninitialized, pretty, dryRun, options = {}) {\n const localVarPath = this.basePath + '/apis/apps/v1/namespaces/{namespace}/controllerrevisions'\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling createNamespacedControllerRevision.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling createNamespacedControllerRevision.');\n }\n if (includeUninitialized !== undefined) {\n localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, \"boolean\");\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'POST',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: ObjectSerializer.serialize(body, \"V1ControllerRevision\")\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1ControllerRevision\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * create a DaemonSet\n * @param namespace object name and auth scope, such as for teams and projects\n * @param body\n * @param includeUninitialized If true, partially initialized resources are included in the response.\n * @param pretty If 'true', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param {*} [options] Override http request options.\n */\n createNamespacedDaemonSet(namespace, body, includeUninitialized, pretty, dryRun, options = {}) {\n const localVarPath = this.basePath + '/apis/apps/v1/namespaces/{namespace}/daemonsets'\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling createNamespacedDaemonSet.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling createNamespacedDaemonSet.');\n }\n if (includeUninitialized !== undefined) {\n localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, \"boolean\");\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'POST',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: ObjectSerializer.serialize(body, \"V1DaemonSet\")\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1DaemonSet\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * create a Deployment\n * @param namespace object name and auth scope, such as for teams and projects\n * @param body\n * @param includeUninitialized If true, partially initialized resources are included in the response.\n * @param pretty If 'true', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param {*} [options] Override http request options.\n */\n createNamespacedDeployment(namespace, body, includeUninitialized, pretty, dryRun, options = {}) {\n const localVarPath = this.basePath + '/apis/apps/v1/namespaces/{namespace}/deployments'\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling createNamespacedDeployment.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling createNamespacedDeployment.');\n }\n if (includeUninitialized !== undefined) {\n localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, \"boolean\");\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'POST',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: ObjectSerializer.serialize(body, \"V1Deployment\")\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1Deployment\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * create a ReplicaSet\n * @param namespace object name and auth scope, such as for teams and projects\n * @param body\n * @param includeUninitialized If true, partially initialized resources are included in the response.\n * @param pretty If 'true', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param {*} [options] Override http request options.\n */\n createNamespacedReplicaSet(namespace, body, includeUninitialized, pretty, dryRun, options = {}) {\n const localVarPath = this.basePath + '/apis/apps/v1/namespaces/{namespace}/replicasets'\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling createNamespacedReplicaSet.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling createNamespacedReplicaSet.');\n }\n if (includeUninitialized !== undefined) {\n localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, \"boolean\");\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'POST',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: ObjectSerializer.serialize(body, \"V1ReplicaSet\")\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1ReplicaSet\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * create a StatefulSet\n * @param namespace object name and auth scope, such as for teams and projects\n * @param body\n * @param includeUninitialized If true, partially initialized resources are included in the response.\n * @param pretty If 'true', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param {*} [options] Override http request options.\n */\n createNamespacedStatefulSet(namespace, body, includeUninitialized, pretty, dryRun, options = {}) {\n const localVarPath = this.basePath + '/apis/apps/v1/namespaces/{namespace}/statefulsets'\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling createNamespacedStatefulSet.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling createNamespacedStatefulSet.');\n }\n if (includeUninitialized !== undefined) {\n localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, \"boolean\");\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'POST',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: ObjectSerializer.serialize(body, \"V1StatefulSet\")\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1StatefulSet\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * delete collection of ControllerRevision\n * @param namespace object name and auth scope, such as for teams and projects\n * @param includeUninitialized If true, partially initialized resources are included in the response.\n * @param pretty If 'true', then the output is pretty printed.\n * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \\"next key\\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.\n * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything.\n * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything.\n * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.\n * @param resourceVersion When specified with a watch call, shows changes that occur after that particular version of a resource. Defaults to changes from the beginning of history. When specified for list: - if unset, then the result is returned from remote storage based on quorum-read flag; - if it's 0, then we simply return what we currently have in cache, no guarantee; - if set to non zero, then the result is at least as fresh as given rv.\n * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.\n * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.\n * @param {*} [options] Override http request options.\n */\n deleteCollectionNamespacedControllerRevision(namespace, includeUninitialized, pretty, _continue, fieldSelector, labelSelector, limit, resourceVersion, timeoutSeconds, watch, options = {}) {\n const localVarPath = this.basePath + '/apis/apps/v1/namespaces/{namespace}/controllerrevisions'\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling deleteCollectionNamespacedControllerRevision.');\n }\n if (includeUninitialized !== undefined) {\n localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, \"boolean\");\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (_continue !== undefined) {\n localVarQueryParameters['continue'] = ObjectSerializer.serialize(_continue, \"string\");\n }\n if (fieldSelector !== undefined) {\n localVarQueryParameters['fieldSelector'] = ObjectSerializer.serialize(fieldSelector, \"string\");\n }\n if (labelSelector !== undefined) {\n localVarQueryParameters['labelSelector'] = ObjectSerializer.serialize(labelSelector, \"string\");\n }\n if (limit !== undefined) {\n localVarQueryParameters['limit'] = ObjectSerializer.serialize(limit, \"number\");\n }\n if (resourceVersion !== undefined) {\n localVarQueryParameters['resourceVersion'] = ObjectSerializer.serialize(resourceVersion, \"string\");\n }\n if (timeoutSeconds !== undefined) {\n localVarQueryParameters['timeoutSeconds'] = ObjectSerializer.serialize(timeoutSeconds, \"number\");\n }\n if (watch !== undefined) {\n localVarQueryParameters['watch'] = ObjectSerializer.serialize(watch, \"boolean\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'DELETE',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1Status\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * delete collection of DaemonSet\n * @param namespace object name and auth scope, such as for teams and projects\n * @param includeUninitialized If true, partially initialized resources are included in the response.\n * @param pretty If 'true', then the output is pretty printed.\n * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \\"next key\\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.\n * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything.\n * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything.\n * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.\n * @param resourceVersion When specified with a watch call, shows changes that occur after that particular version of a resource. Defaults to changes from the beginning of history. When specified for list: - if unset, then the result is returned from remote storage based on quorum-read flag; - if it's 0, then we simply return what we currently have in cache, no guarantee; - if set to non zero, then the result is at least as fresh as given rv.\n * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.\n * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.\n * @param {*} [options] Override http request options.\n */\n deleteCollectionNamespacedDaemonSet(namespace, includeUninitialized, pretty, _continue, fieldSelector, labelSelector, limit, resourceVersion, timeoutSeconds, watch, options = {}) {\n const localVarPath = this.basePath + '/apis/apps/v1/namespaces/{namespace}/daemonsets'\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling deleteCollectionNamespacedDaemonSet.');\n }\n if (includeUninitialized !== undefined) {\n localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, \"boolean\");\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (_continue !== undefined) {\n localVarQueryParameters['continue'] = ObjectSerializer.serialize(_continue, \"string\");\n }\n if (fieldSelector !== undefined) {\n localVarQueryParameters['fieldSelector'] = ObjectSerializer.serialize(fieldSelector, \"string\");\n }\n if (labelSelector !== undefined) {\n localVarQueryParameters['labelSelector'] = ObjectSerializer.serialize(labelSelector, \"string\");\n }\n if (limit !== undefined) {\n localVarQueryParameters['limit'] = ObjectSerializer.serialize(limit, \"number\");\n }\n if (resourceVersion !== undefined) {\n localVarQueryParameters['resourceVersion'] = ObjectSerializer.serialize(resourceVersion, \"string\");\n }\n if (timeoutSeconds !== undefined) {\n localVarQueryParameters['timeoutSeconds'] = ObjectSerializer.serialize(timeoutSeconds, \"number\");\n }\n if (watch !== undefined) {\n localVarQueryParameters['watch'] = ObjectSerializer.serialize(watch, \"boolean\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'DELETE',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1Status\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * delete collection of Deployment\n * @param namespace object name and auth scope, such as for teams and projects\n * @param includeUninitialized If true, partially initialized resources are included in the response.\n * @param pretty If 'true', then the output is pretty printed.\n * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \\"next key\\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.\n * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything.\n * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything.\n * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.\n * @param resourceVersion When specified with a watch call, shows changes that occur after that particular version of a resource. Defaults to changes from the beginning of history. When specified for list: - if unset, then the result is returned from remote storage based on quorum-read flag; - if it's 0, then we simply return what we currently have in cache, no guarantee; - if set to non zero, then the result is at least as fresh as given rv.\n * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.\n * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.\n * @param {*} [options] Override http request options.\n */\n deleteCollectionNamespacedDeployment(namespace, includeUninitialized, pretty, _continue, fieldSelector, labelSelector, limit, resourceVersion, timeoutSeconds, watch, options = {}) {\n const localVarPath = this.basePath + '/apis/apps/v1/namespaces/{namespace}/deployments'\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling deleteCollectionNamespacedDeployment.');\n }\n if (includeUninitialized !== undefined) {\n localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, \"boolean\");\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (_continue !== undefined) {\n localVarQueryParameters['continue'] = ObjectSerializer.serialize(_continue, \"string\");\n }\n if (fieldSelector !== undefined) {\n localVarQueryParameters['fieldSelector'] = ObjectSerializer.serialize(fieldSelector, \"string\");\n }\n if (labelSelector !== undefined) {\n localVarQueryParameters['labelSelector'] = ObjectSerializer.serialize(labelSelector, \"string\");\n }\n if (limit !== undefined) {\n localVarQueryParameters['limit'] = ObjectSerializer.serialize(limit, \"number\");\n }\n if (resourceVersion !== undefined) {\n localVarQueryParameters['resourceVersion'] = ObjectSerializer.serialize(resourceVersion, \"string\");\n }\n if (timeoutSeconds !== undefined) {\n localVarQueryParameters['timeoutSeconds'] = ObjectSerializer.serialize(timeoutSeconds, \"number\");\n }\n if (watch !== undefined) {\n localVarQueryParameters['watch'] = ObjectSerializer.serialize(watch, \"boolean\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'DELETE',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1Status\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * delete collection of ReplicaSet\n * @param namespace object name and auth scope, such as for teams and projects\n * @param includeUninitialized If true, partially initialized resources are included in the response.\n * @param pretty If 'true', then the output is pretty printed.\n * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \\"next key\\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.\n * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything.\n * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything.\n * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.\n * @param resourceVersion When specified with a watch call, shows changes that occur after that particular version of a resource. Defaults to changes from the beginning of history. When specified for list: - if unset, then the result is returned from remote storage based on quorum-read flag; - if it's 0, then we simply return what we currently have in cache, no guarantee; - if set to non zero, then the result is at least as fresh as given rv.\n * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.\n * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.\n * @param {*} [options] Override http request options.\n */\n deleteCollectionNamespacedReplicaSet(namespace, includeUninitialized, pretty, _continue, fieldSelector, labelSelector, limit, resourceVersion, timeoutSeconds, watch, options = {}) {\n const localVarPath = this.basePath + '/apis/apps/v1/namespaces/{namespace}/replicasets'\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling deleteCollectionNamespacedReplicaSet.');\n }\n if (includeUninitialized !== undefined) {\n localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, \"boolean\");\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (_continue !== undefined) {\n localVarQueryParameters['continue'] = ObjectSerializer.serialize(_continue, \"string\");\n }\n if (fieldSelector !== undefined) {\n localVarQueryParameters['fieldSelector'] = ObjectSerializer.serialize(fieldSelector, \"string\");\n }\n if (labelSelector !== undefined) {\n localVarQueryParameters['labelSelector'] = ObjectSerializer.serialize(labelSelector, \"string\");\n }\n if (limit !== undefined) {\n localVarQueryParameters['limit'] = ObjectSerializer.serialize(limit, \"number\");\n }\n if (resourceVersion !== undefined) {\n localVarQueryParameters['resourceVersion'] = ObjectSerializer.serialize(resourceVersion, \"string\");\n }\n if (timeoutSeconds !== undefined) {\n localVarQueryParameters['timeoutSeconds'] = ObjectSerializer.serialize(timeoutSeconds, \"number\");\n }\n if (watch !== undefined) {\n localVarQueryParameters['watch'] = ObjectSerializer.serialize(watch, \"boolean\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'DELETE',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1Status\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * delete collection of StatefulSet\n * @param namespace object name and auth scope, such as for teams and projects\n * @param includeUninitialized If true, partially initialized resources are included in the response.\n * @param pretty If 'true', then the output is pretty printed.\n * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \\"next key\\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.\n * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything.\n * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything.\n * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.\n * @param resourceVersion When specified with a watch call, shows changes that occur after that particular version of a resource. Defaults to changes from the beginning of history. When specified for list: - if unset, then the result is returned from remote storage based on quorum-read flag; - if it's 0, then we simply return what we currently have in cache, no guarantee; - if set to non zero, then the result is at least as fresh as given rv.\n * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.\n * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.\n * @param {*} [options] Override http request options.\n */\n deleteCollectionNamespacedStatefulSet(namespace, includeUninitialized, pretty, _continue, fieldSelector, labelSelector, limit, resourceVersion, timeoutSeconds, watch, options = {}) {\n const localVarPath = this.basePath + '/apis/apps/v1/namespaces/{namespace}/statefulsets'\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling deleteCollectionNamespacedStatefulSet.');\n }\n if (includeUninitialized !== undefined) {\n localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, \"boolean\");\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (_continue !== undefined) {\n localVarQueryParameters['continue'] = ObjectSerializer.serialize(_continue, \"string\");\n }\n if (fieldSelector !== undefined) {\n localVarQueryParameters['fieldSelector'] = ObjectSerializer.serialize(fieldSelector, \"string\");\n }\n if (labelSelector !== undefined) {\n localVarQueryParameters['labelSelector'] = ObjectSerializer.serialize(labelSelector, \"string\");\n }\n if (limit !== undefined) {\n localVarQueryParameters['limit'] = ObjectSerializer.serialize(limit, \"number\");\n }\n if (resourceVersion !== undefined) {\n localVarQueryParameters['resourceVersion'] = ObjectSerializer.serialize(resourceVersion, \"string\");\n }\n if (timeoutSeconds !== undefined) {\n localVarQueryParameters['timeoutSeconds'] = ObjectSerializer.serialize(timeoutSeconds, \"number\");\n }\n if (watch !== undefined) {\n localVarQueryParameters['watch'] = ObjectSerializer.serialize(watch, \"boolean\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'DELETE',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1Status\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * delete a ControllerRevision\n * @param name name of the ControllerRevision\n * @param namespace object name and auth scope, such as for teams and projects\n * @param pretty If 'true', then the output is pretty printed.\n * @param body\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param gracePeriodSeconds The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately.\n * @param orphanDependents Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \\"orphan\\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both.\n * @param propagationPolicy Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground.\n * @param {*} [options] Override http request options.\n */\n deleteNamespacedControllerRevision(name, namespace, pretty, body, dryRun, gracePeriodSeconds, orphanDependents, propagationPolicy, options = {}) {\n const localVarPath = this.basePath + '/apis/apps/v1/namespaces/{namespace}/controllerrevisions/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling deleteNamespacedControllerRevision.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling deleteNamespacedControllerRevision.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, \"string\");\n }\n if (gracePeriodSeconds !== undefined) {\n localVarQueryParameters['gracePeriodSeconds'] = ObjectSerializer.serialize(gracePeriodSeconds, \"number\");\n }\n if (orphanDependents !== undefined) {\n localVarQueryParameters['orphanDependents'] = ObjectSerializer.serialize(orphanDependents, \"boolean\");\n }\n if (propagationPolicy !== undefined) {\n localVarQueryParameters['propagationPolicy'] = ObjectSerializer.serialize(propagationPolicy, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'DELETE',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: ObjectSerializer.serialize(body, \"V1DeleteOptions\")\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1Status\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * delete a DaemonSet\n * @param name name of the DaemonSet\n * @param namespace object name and auth scope, such as for teams and projects\n * @param pretty If 'true', then the output is pretty printed.\n * @param body\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param gracePeriodSeconds The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately.\n * @param orphanDependents Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \\"orphan\\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both.\n * @param propagationPolicy Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground.\n * @param {*} [options] Override http request options.\n */\n deleteNamespacedDaemonSet(name, namespace, pretty, body, dryRun, gracePeriodSeconds, orphanDependents, propagationPolicy, options = {}) {\n const localVarPath = this.basePath + '/apis/apps/v1/namespaces/{namespace}/daemonsets/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling deleteNamespacedDaemonSet.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling deleteNamespacedDaemonSet.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, \"string\");\n }\n if (gracePeriodSeconds !== undefined) {\n localVarQueryParameters['gracePeriodSeconds'] = ObjectSerializer.serialize(gracePeriodSeconds, \"number\");\n }\n if (orphanDependents !== undefined) {\n localVarQueryParameters['orphanDependents'] = ObjectSerializer.serialize(orphanDependents, \"boolean\");\n }\n if (propagationPolicy !== undefined) {\n localVarQueryParameters['propagationPolicy'] = ObjectSerializer.serialize(propagationPolicy, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'DELETE',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: ObjectSerializer.serialize(body, \"V1DeleteOptions\")\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1Status\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * delete a Deployment\n * @param name name of the Deployment\n * @param namespace object name and auth scope, such as for teams and projects\n * @param pretty If 'true', then the output is pretty printed.\n * @param body\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param gracePeriodSeconds The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately.\n * @param orphanDependents Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \\"orphan\\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both.\n * @param propagationPolicy Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground.\n * @param {*} [options] Override http request options.\n */\n deleteNamespacedDeployment(name, namespace, pretty, body, dryRun, gracePeriodSeconds, orphanDependents, propagationPolicy, options = {}) {\n const localVarPath = this.basePath + '/apis/apps/v1/namespaces/{namespace}/deployments/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling deleteNamespacedDeployment.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling deleteNamespacedDeployment.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, \"string\");\n }\n if (gracePeriodSeconds !== undefined) {\n localVarQueryParameters['gracePeriodSeconds'] = ObjectSerializer.serialize(gracePeriodSeconds, \"number\");\n }\n if (orphanDependents !== undefined) {\n localVarQueryParameters['orphanDependents'] = ObjectSerializer.serialize(orphanDependents, \"boolean\");\n }\n if (propagationPolicy !== undefined) {\n localVarQueryParameters['propagationPolicy'] = ObjectSerializer.serialize(propagationPolicy, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'DELETE',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: ObjectSerializer.serialize(body, \"V1DeleteOptions\")\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1Status\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * delete a ReplicaSet\n * @param name name of the ReplicaSet\n * @param namespace object name and auth scope, such as for teams and projects\n * @param pretty If 'true', then the output is pretty printed.\n * @param body\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param gracePeriodSeconds The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately.\n * @param orphanDependents Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \\"orphan\\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both.\n * @param propagationPolicy Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground.\n * @param {*} [options] Override http request options.\n */\n deleteNamespacedReplicaSet(name, namespace, pretty, body, dryRun, gracePeriodSeconds, orphanDependents, propagationPolicy, options = {}) {\n const localVarPath = this.basePath + '/apis/apps/v1/namespaces/{namespace}/replicasets/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling deleteNamespacedReplicaSet.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling deleteNamespacedReplicaSet.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, \"string\");\n }\n if (gracePeriodSeconds !== undefined) {\n localVarQueryParameters['gracePeriodSeconds'] = ObjectSerializer.serialize(gracePeriodSeconds, \"number\");\n }\n if (orphanDependents !== undefined) {\n localVarQueryParameters['orphanDependents'] = ObjectSerializer.serialize(orphanDependents, \"boolean\");\n }\n if (propagationPolicy !== undefined) {\n localVarQueryParameters['propagationPolicy'] = ObjectSerializer.serialize(propagationPolicy, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'DELETE',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: ObjectSerializer.serialize(body, \"V1DeleteOptions\")\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1Status\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * delete a StatefulSet\n * @param name name of the StatefulSet\n * @param namespace object name and auth scope, such as for teams and projects\n * @param pretty If 'true', then the output is pretty printed.\n * @param body\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param gracePeriodSeconds The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately.\n * @param orphanDependents Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \\"orphan\\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both.\n * @param propagationPolicy Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground.\n * @param {*} [options] Override http request options.\n */\n deleteNamespacedStatefulSet(name, namespace, pretty, body, dryRun, gracePeriodSeconds, orphanDependents, propagationPolicy, options = {}) {\n const localVarPath = this.basePath + '/apis/apps/v1/namespaces/{namespace}/statefulsets/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling deleteNamespacedStatefulSet.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling deleteNamespacedStatefulSet.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, \"string\");\n }\n if (gracePeriodSeconds !== undefined) {\n localVarQueryParameters['gracePeriodSeconds'] = ObjectSerializer.serialize(gracePeriodSeconds, \"number\");\n }\n if (orphanDependents !== undefined) {\n localVarQueryParameters['orphanDependents'] = ObjectSerializer.serialize(orphanDependents, \"boolean\");\n }\n if (propagationPolicy !== undefined) {\n localVarQueryParameters['propagationPolicy'] = ObjectSerializer.serialize(propagationPolicy, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'DELETE',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: ObjectSerializer.serialize(body, \"V1DeleteOptions\")\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1Status\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * get available resources\n * @param {*} [options] Override http request options.\n */\n getAPIResources(options = {}) {\n const localVarPath = this.basePath + '/apis/apps/v1/';\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1APIResourceList\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * list or watch objects of kind ControllerRevision\n * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \\"next key\\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.\n * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything.\n * @param includeUninitialized If true, partially initialized resources are included in the response.\n * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything.\n * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.\n * @param pretty If 'true', then the output is pretty printed.\n * @param resourceVersion When specified with a watch call, shows changes that occur after that particular version of a resource. Defaults to changes from the beginning of history. When specified for list: - if unset, then the result is returned from remote storage based on quorum-read flag; - if it's 0, then we simply return what we currently have in cache, no guarantee; - if set to non zero, then the result is at least as fresh as given rv.\n * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.\n * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.\n * @param {*} [options] Override http request options.\n */\n listControllerRevisionForAllNamespaces(_continue, fieldSelector, includeUninitialized, labelSelector, limit, pretty, resourceVersion, timeoutSeconds, watch, options = {}) {\n const localVarPath = this.basePath + '/apis/apps/v1/controllerrevisions';\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n if (_continue !== undefined) {\n localVarQueryParameters['continue'] = ObjectSerializer.serialize(_continue, \"string\");\n }\n if (fieldSelector !== undefined) {\n localVarQueryParameters['fieldSelector'] = ObjectSerializer.serialize(fieldSelector, \"string\");\n }\n if (includeUninitialized !== undefined) {\n localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, \"boolean\");\n }\n if (labelSelector !== undefined) {\n localVarQueryParameters['labelSelector'] = ObjectSerializer.serialize(labelSelector, \"string\");\n }\n if (limit !== undefined) {\n localVarQueryParameters['limit'] = ObjectSerializer.serialize(limit, \"number\");\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (resourceVersion !== undefined) {\n localVarQueryParameters['resourceVersion'] = ObjectSerializer.serialize(resourceVersion, \"string\");\n }\n if (timeoutSeconds !== undefined) {\n localVarQueryParameters['timeoutSeconds'] = ObjectSerializer.serialize(timeoutSeconds, \"number\");\n }\n if (watch !== undefined) {\n localVarQueryParameters['watch'] = ObjectSerializer.serialize(watch, \"boolean\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1ControllerRevisionList\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * list or watch objects of kind DaemonSet\n * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \\"next key\\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.\n * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything.\n * @param includeUninitialized If true, partially initialized resources are included in the response.\n * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything.\n * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.\n * @param pretty If 'true', then the output is pretty printed.\n * @param resourceVersion When specified with a watch call, shows changes that occur after that particular version of a resource. Defaults to changes from the beginning of history. When specified for list: - if unset, then the result is returned from remote storage based on quorum-read flag; - if it's 0, then we simply return what we currently have in cache, no guarantee; - if set to non zero, then the result is at least as fresh as given rv.\n * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.\n * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.\n * @param {*} [options] Override http request options.\n */\n listDaemonSetForAllNamespaces(_continue, fieldSelector, includeUninitialized, labelSelector, limit, pretty, resourceVersion, timeoutSeconds, watch, options = {}) {\n const localVarPath = this.basePath + '/apis/apps/v1/daemonsets';\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n if (_continue !== undefined) {\n localVarQueryParameters['continue'] = ObjectSerializer.serialize(_continue, \"string\");\n }\n if (fieldSelector !== undefined) {\n localVarQueryParameters['fieldSelector'] = ObjectSerializer.serialize(fieldSelector, \"string\");\n }\n if (includeUninitialized !== undefined) {\n localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, \"boolean\");\n }\n if (labelSelector !== undefined) {\n localVarQueryParameters['labelSelector'] = ObjectSerializer.serialize(labelSelector, \"string\");\n }\n if (limit !== undefined) {\n localVarQueryParameters['limit'] = ObjectSerializer.serialize(limit, \"number\");\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (resourceVersion !== undefined) {\n localVarQueryParameters['resourceVersion'] = ObjectSerializer.serialize(resourceVersion, \"string\");\n }\n if (timeoutSeconds !== undefined) {\n localVarQueryParameters['timeoutSeconds'] = ObjectSerializer.serialize(timeoutSeconds, \"number\");\n }\n if (watch !== undefined) {\n localVarQueryParameters['watch'] = ObjectSerializer.serialize(watch, \"boolean\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1DaemonSetList\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * list or watch objects of kind Deployment\n * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \\"next key\\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.\n * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything.\n * @param includeUninitialized If true, partially initialized resources are included in the response.\n * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything.\n * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.\n * @param pretty If 'true', then the output is pretty printed.\n * @param resourceVersion When specified with a watch call, shows changes that occur after that particular version of a resource. Defaults to changes from the beginning of history. When specified for list: - if unset, then the result is returned from remote storage based on quorum-read flag; - if it's 0, then we simply return what we currently have in cache, no guarantee; - if set to non zero, then the result is at least as fresh as given rv.\n * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.\n * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.\n * @param {*} [options] Override http request options.\n */\n listDeploymentForAllNamespaces(_continue, fieldSelector, includeUninitialized, labelSelector, limit, pretty, resourceVersion, timeoutSeconds, watch, options = {}) {\n const localVarPath = this.basePath + '/apis/apps/v1/deployments';\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n if (_continue !== undefined) {\n localVarQueryParameters['continue'] = ObjectSerializer.serialize(_continue, \"string\");\n }\n if (fieldSelector !== undefined) {\n localVarQueryParameters['fieldSelector'] = ObjectSerializer.serialize(fieldSelector, \"string\");\n }\n if (includeUninitialized !== undefined) {\n localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, \"boolean\");\n }\n if (labelSelector !== undefined) {\n localVarQueryParameters['labelSelector'] = ObjectSerializer.serialize(labelSelector, \"string\");\n }\n if (limit !== undefined) {\n localVarQueryParameters['limit'] = ObjectSerializer.serialize(limit, \"number\");\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (resourceVersion !== undefined) {\n localVarQueryParameters['resourceVersion'] = ObjectSerializer.serialize(resourceVersion, \"string\");\n }\n if (timeoutSeconds !== undefined) {\n localVarQueryParameters['timeoutSeconds'] = ObjectSerializer.serialize(timeoutSeconds, \"number\");\n }\n if (watch !== undefined) {\n localVarQueryParameters['watch'] = ObjectSerializer.serialize(watch, \"boolean\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1DeploymentList\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * list or watch objects of kind ControllerRevision\n * @param namespace object name and auth scope, such as for teams and projects\n * @param includeUninitialized If true, partially initialized resources are included in the response.\n * @param pretty If 'true', then the output is pretty printed.\n * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \\"next key\\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.\n * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything.\n * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything.\n * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.\n * @param resourceVersion When specified with a watch call, shows changes that occur after that particular version of a resource. Defaults to changes from the beginning of history. When specified for list: - if unset, then the result is returned from remote storage based on quorum-read flag; - if it's 0, then we simply return what we currently have in cache, no guarantee; - if set to non zero, then the result is at least as fresh as given rv.\n * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.\n * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.\n * @param {*} [options] Override http request options.\n */\n listNamespacedControllerRevision(namespace, includeUninitialized, pretty, _continue, fieldSelector, labelSelector, limit, resourceVersion, timeoutSeconds, watch, options = {}) {\n const localVarPath = this.basePath + '/apis/apps/v1/namespaces/{namespace}/controllerrevisions'\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling listNamespacedControllerRevision.');\n }\n if (includeUninitialized !== undefined) {\n localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, \"boolean\");\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (_continue !== undefined) {\n localVarQueryParameters['continue'] = ObjectSerializer.serialize(_continue, \"string\");\n }\n if (fieldSelector !== undefined) {\n localVarQueryParameters['fieldSelector'] = ObjectSerializer.serialize(fieldSelector, \"string\");\n }\n if (labelSelector !== undefined) {\n localVarQueryParameters['labelSelector'] = ObjectSerializer.serialize(labelSelector, \"string\");\n }\n if (limit !== undefined) {\n localVarQueryParameters['limit'] = ObjectSerializer.serialize(limit, \"number\");\n }\n if (resourceVersion !== undefined) {\n localVarQueryParameters['resourceVersion'] = ObjectSerializer.serialize(resourceVersion, \"string\");\n }\n if (timeoutSeconds !== undefined) {\n localVarQueryParameters['timeoutSeconds'] = ObjectSerializer.serialize(timeoutSeconds, \"number\");\n }\n if (watch !== undefined) {\n localVarQueryParameters['watch'] = ObjectSerializer.serialize(watch, \"boolean\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1ControllerRevisionList\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * list or watch objects of kind DaemonSet\n * @param namespace object name and auth scope, such as for teams and projects\n * @param includeUninitialized If true, partially initialized resources are included in the response.\n * @param pretty If 'true', then the output is pretty printed.\n * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \\"next key\\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.\n * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything.\n * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything.\n * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.\n * @param resourceVersion When specified with a watch call, shows changes that occur after that particular version of a resource. Defaults to changes from the beginning of history. When specified for list: - if unset, then the result is returned from remote storage based on quorum-read flag; - if it's 0, then we simply return what we currently have in cache, no guarantee; - if set to non zero, then the result is at least as fresh as given rv.\n * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.\n * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.\n * @param {*} [options] Override http request options.\n */\n listNamespacedDaemonSet(namespace, includeUninitialized, pretty, _continue, fieldSelector, labelSelector, limit, resourceVersion, timeoutSeconds, watch, options = {}) {\n const localVarPath = this.basePath + '/apis/apps/v1/namespaces/{namespace}/daemonsets'\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling listNamespacedDaemonSet.');\n }\n if (includeUninitialized !== undefined) {\n localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, \"boolean\");\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (_continue !== undefined) {\n localVarQueryParameters['continue'] = ObjectSerializer.serialize(_continue, \"string\");\n }\n if (fieldSelector !== undefined) {\n localVarQueryParameters['fieldSelector'] = ObjectSerializer.serialize(fieldSelector, \"string\");\n }\n if (labelSelector !== undefined) {\n localVarQueryParameters['labelSelector'] = ObjectSerializer.serialize(labelSelector, \"string\");\n }\n if (limit !== undefined) {\n localVarQueryParameters['limit'] = ObjectSerializer.serialize(limit, \"number\");\n }\n if (resourceVersion !== undefined) {\n localVarQueryParameters['resourceVersion'] = ObjectSerializer.serialize(resourceVersion, \"string\");\n }\n if (timeoutSeconds !== undefined) {\n localVarQueryParameters['timeoutSeconds'] = ObjectSerializer.serialize(timeoutSeconds, \"number\");\n }\n if (watch !== undefined) {\n localVarQueryParameters['watch'] = ObjectSerializer.serialize(watch, \"boolean\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1DaemonSetList\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * list or watch objects of kind Deployment\n * @param namespace object name and auth scope, such as for teams and projects\n * @param includeUninitialized If true, partially initialized resources are included in the response.\n * @param pretty If 'true', then the output is pretty printed.\n * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \\"next key\\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.\n * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything.\n * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything.\n * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.\n * @param resourceVersion When specified with a watch call, shows changes that occur after that particular version of a resource. Defaults to changes from the beginning of history. When specified for list: - if unset, then the result is returned from remote storage based on quorum-read flag; - if it's 0, then we simply return what we currently have in cache, no guarantee; - if set to non zero, then the result is at least as fresh as given rv.\n * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.\n * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.\n * @param {*} [options] Override http request options.\n */\n listNamespacedDeployment(namespace, includeUninitialized, pretty, _continue, fieldSelector, labelSelector, limit, resourceVersion, timeoutSeconds, watch, options = {}) {\n const localVarPath = this.basePath + '/apis/apps/v1/namespaces/{namespace}/deployments'\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling listNamespacedDeployment.');\n }\n if (includeUninitialized !== undefined) {\n localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, \"boolean\");\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (_continue !== undefined) {\n localVarQueryParameters['continue'] = ObjectSerializer.serialize(_continue, \"string\");\n }\n if (fieldSelector !== undefined) {\n localVarQueryParameters['fieldSelector'] = ObjectSerializer.serialize(fieldSelector, \"string\");\n }\n if (labelSelector !== undefined) {\n localVarQueryParameters['labelSelector'] = ObjectSerializer.serialize(labelSelector, \"string\");\n }\n if (limit !== undefined) {\n localVarQueryParameters['limit'] = ObjectSerializer.serialize(limit, \"number\");\n }\n if (resourceVersion !== undefined) {\n localVarQueryParameters['resourceVersion'] = ObjectSerializer.serialize(resourceVersion, \"string\");\n }\n if (timeoutSeconds !== undefined) {\n localVarQueryParameters['timeoutSeconds'] = ObjectSerializer.serialize(timeoutSeconds, \"number\");\n }\n if (watch !== undefined) {\n localVarQueryParameters['watch'] = ObjectSerializer.serialize(watch, \"boolean\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1DeploymentList\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * list or watch objects of kind ReplicaSet\n * @param namespace object name and auth scope, such as for teams and projects\n * @param includeUninitialized If true, partially initialized resources are included in the response.\n * @param pretty If 'true', then the output is pretty printed.\n * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \\"next key\\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.\n * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything.\n * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything.\n * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.\n * @param resourceVersion When specified with a watch call, shows changes that occur after that particular version of a resource. Defaults to changes from the beginning of history. When specified for list: - if unset, then the result is returned from remote storage based on quorum-read flag; - if it's 0, then we simply return what we currently have in cache, no guarantee; - if set to non zero, then the result is at least as fresh as given rv.\n * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.\n * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.\n * @param {*} [options] Override http request options.\n */\n listNamespacedReplicaSet(namespace, includeUninitialized, pretty, _continue, fieldSelector, labelSelector, limit, resourceVersion, timeoutSeconds, watch, options = {}) {\n const localVarPath = this.basePath + '/apis/apps/v1/namespaces/{namespace}/replicasets'\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling listNamespacedReplicaSet.');\n }\n if (includeUninitialized !== undefined) {\n localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, \"boolean\");\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (_continue !== undefined) {\n localVarQueryParameters['continue'] = ObjectSerializer.serialize(_continue, \"string\");\n }\n if (fieldSelector !== undefined) {\n localVarQueryParameters['fieldSelector'] = ObjectSerializer.serialize(fieldSelector, \"string\");\n }\n if (labelSelector !== undefined) {\n localVarQueryParameters['labelSelector'] = ObjectSerializer.serialize(labelSelector, \"string\");\n }\n if (limit !== undefined) {\n localVarQueryParameters['limit'] = ObjectSerializer.serialize(limit, \"number\");\n }\n if (resourceVersion !== undefined) {\n localVarQueryParameters['resourceVersion'] = ObjectSerializer.serialize(resourceVersion, \"string\");\n }\n if (timeoutSeconds !== undefined) {\n localVarQueryParameters['timeoutSeconds'] = ObjectSerializer.serialize(timeoutSeconds, \"number\");\n }\n if (watch !== undefined) {\n localVarQueryParameters['watch'] = ObjectSerializer.serialize(watch, \"boolean\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1ReplicaSetList\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * list or watch objects of kind StatefulSet\n * @param namespace object name and auth scope, such as for teams and projects\n * @param includeUninitialized If true, partially initialized resources are included in the response.\n * @param pretty If 'true', then the output is pretty printed.\n * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \\"next key\\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.\n * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything.\n * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything.\n * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.\n * @param resourceVersion When specified with a watch call, shows changes that occur after that particular version of a resource. Defaults to changes from the beginning of history. When specified for list: - if unset, then the result is returned from remote storage based on quorum-read flag; - if it's 0, then we simply return what we currently have in cache, no guarantee; - if set to non zero, then the result is at least as fresh as given rv.\n * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.\n * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.\n * @param {*} [options] Override http request options.\n */\n listNamespacedStatefulSet(namespace, includeUninitialized, pretty, _continue, fieldSelector, labelSelector, limit, resourceVersion, timeoutSeconds, watch, options = {}) {\n const localVarPath = this.basePath + '/apis/apps/v1/namespaces/{namespace}/statefulsets'\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling listNamespacedStatefulSet.');\n }\n if (includeUninitialized !== undefined) {\n localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, \"boolean\");\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (_continue !== undefined) {\n localVarQueryParameters['continue'] = ObjectSerializer.serialize(_continue, \"string\");\n }\n if (fieldSelector !== undefined) {\n localVarQueryParameters['fieldSelector'] = ObjectSerializer.serialize(fieldSelector, \"string\");\n }\n if (labelSelector !== undefined) {\n localVarQueryParameters['labelSelector'] = ObjectSerializer.serialize(labelSelector, \"string\");\n }\n if (limit !== undefined) {\n localVarQueryParameters['limit'] = ObjectSerializer.serialize(limit, \"number\");\n }\n if (resourceVersion !== undefined) {\n localVarQueryParameters['resourceVersion'] = ObjectSerializer.serialize(resourceVersion, \"string\");\n }\n if (timeoutSeconds !== undefined) {\n localVarQueryParameters['timeoutSeconds'] = ObjectSerializer.serialize(timeoutSeconds, \"number\");\n }\n if (watch !== undefined) {\n localVarQueryParameters['watch'] = ObjectSerializer.serialize(watch, \"boolean\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1StatefulSetList\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * list or watch objects of kind ReplicaSet\n * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \\"next key\\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.\n * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything.\n * @param includeUninitialized If true, partially initialized resources are included in the response.\n * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything.\n * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.\n * @param pretty If 'true', then the output is pretty printed.\n * @param resourceVersion When specified with a watch call, shows changes that occur after that particular version of a resource. Defaults to changes from the beginning of history. When specified for list: - if unset, then the result is returned from remote storage based on quorum-read flag; - if it's 0, then we simply return what we currently have in cache, no guarantee; - if set to non zero, then the result is at least as fresh as given rv.\n * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.\n * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.\n * @param {*} [options] Override http request options.\n */\n listReplicaSetForAllNamespaces(_continue, fieldSelector, includeUninitialized, labelSelector, limit, pretty, resourceVersion, timeoutSeconds, watch, options = {}) {\n const localVarPath = this.basePath + '/apis/apps/v1/replicasets';\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n if (_continue !== undefined) {\n localVarQueryParameters['continue'] = ObjectSerializer.serialize(_continue, \"string\");\n }\n if (fieldSelector !== undefined) {\n localVarQueryParameters['fieldSelector'] = ObjectSerializer.serialize(fieldSelector, \"string\");\n }\n if (includeUninitialized !== undefined) {\n localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, \"boolean\");\n }\n if (labelSelector !== undefined) {\n localVarQueryParameters['labelSelector'] = ObjectSerializer.serialize(labelSelector, \"string\");\n }\n if (limit !== undefined) {\n localVarQueryParameters['limit'] = ObjectSerializer.serialize(limit, \"number\");\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (resourceVersion !== undefined) {\n localVarQueryParameters['resourceVersion'] = ObjectSerializer.serialize(resourceVersion, \"string\");\n }\n if (timeoutSeconds !== undefined) {\n localVarQueryParameters['timeoutSeconds'] = ObjectSerializer.serialize(timeoutSeconds, \"number\");\n }\n if (watch !== undefined) {\n localVarQueryParameters['watch'] = ObjectSerializer.serialize(watch, \"boolean\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1ReplicaSetList\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * list or watch objects of kind StatefulSet\n * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \\"next key\\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.\n * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything.\n * @param includeUninitialized If true, partially initialized resources are included in the response.\n * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything.\n * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.\n * @param pretty If 'true', then the output is pretty printed.\n * @param resourceVersion When specified with a watch call, shows changes that occur after that particular version of a resource. Defaults to changes from the beginning of history. When specified for list: - if unset, then the result is returned from remote storage based on quorum-read flag; - if it's 0, then we simply return what we currently have in cache, no guarantee; - if set to non zero, then the result is at least as fresh as given rv.\n * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.\n * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.\n * @param {*} [options] Override http request options.\n */\n listStatefulSetForAllNamespaces(_continue, fieldSelector, includeUninitialized, labelSelector, limit, pretty, resourceVersion, timeoutSeconds, watch, options = {}) {\n const localVarPath = this.basePath + '/apis/apps/v1/statefulsets';\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n if (_continue !== undefined) {\n localVarQueryParameters['continue'] = ObjectSerializer.serialize(_continue, \"string\");\n }\n if (fieldSelector !== undefined) {\n localVarQueryParameters['fieldSelector'] = ObjectSerializer.serialize(fieldSelector, \"string\");\n }\n if (includeUninitialized !== undefined) {\n localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, \"boolean\");\n }\n if (labelSelector !== undefined) {\n localVarQueryParameters['labelSelector'] = ObjectSerializer.serialize(labelSelector, \"string\");\n }\n if (limit !== undefined) {\n localVarQueryParameters['limit'] = ObjectSerializer.serialize(limit, \"number\");\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (resourceVersion !== undefined) {\n localVarQueryParameters['resourceVersion'] = ObjectSerializer.serialize(resourceVersion, \"string\");\n }\n if (timeoutSeconds !== undefined) {\n localVarQueryParameters['timeoutSeconds'] = ObjectSerializer.serialize(timeoutSeconds, \"number\");\n }\n if (watch !== undefined) {\n localVarQueryParameters['watch'] = ObjectSerializer.serialize(watch, \"boolean\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1StatefulSetList\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * partially update the specified ControllerRevision\n * @param name name of the ControllerRevision\n * @param namespace object name and auth scope, such as for teams and projects\n * @param body\n * @param pretty If 'true', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param {*} [options] Override http request options.\n */\n patchNamespacedControllerRevision(name, namespace, body, pretty, dryRun, options = {}) {\n const localVarPath = this.basePath + '/apis/apps/v1/namespaces/{namespace}/controllerrevisions/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling patchNamespacedControllerRevision.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling patchNamespacedControllerRevision.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling patchNamespacedControllerRevision.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'PATCH',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: ObjectSerializer.serialize(body, \"any\")\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1ControllerRevision\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * partially update the specified DaemonSet\n * @param name name of the DaemonSet\n * @param namespace object name and auth scope, such as for teams and projects\n * @param body\n * @param pretty If 'true', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param {*} [options] Override http request options.\n */\n patchNamespacedDaemonSet(name, namespace, body, pretty, dryRun, options = {}) {\n const localVarPath = this.basePath + '/apis/apps/v1/namespaces/{namespace}/daemonsets/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling patchNamespacedDaemonSet.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling patchNamespacedDaemonSet.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling patchNamespacedDaemonSet.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'PATCH',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: ObjectSerializer.serialize(body, \"any\")\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1DaemonSet\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * partially update status of the specified DaemonSet\n * @param name name of the DaemonSet\n * @param namespace object name and auth scope, such as for teams and projects\n * @param body\n * @param pretty If 'true', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param {*} [options] Override http request options.\n */\n patchNamespacedDaemonSetStatus(name, namespace, body, pretty, dryRun, options = {}) {\n const localVarPath = this.basePath + '/apis/apps/v1/namespaces/{namespace}/daemonsets/{name}/status'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling patchNamespacedDaemonSetStatus.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling patchNamespacedDaemonSetStatus.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling patchNamespacedDaemonSetStatus.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'PATCH',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: ObjectSerializer.serialize(body, \"any\")\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1DaemonSet\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * partially update the specified Deployment\n * @param name name of the Deployment\n * @param namespace object name and auth scope, such as for teams and projects\n * @param body\n * @param pretty If 'true', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param {*} [options] Override http request options.\n */\n patchNamespacedDeployment(name, namespace, body, pretty, dryRun, options = {}) {\n const localVarPath = this.basePath + '/apis/apps/v1/namespaces/{namespace}/deployments/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling patchNamespacedDeployment.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling patchNamespacedDeployment.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling patchNamespacedDeployment.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'PATCH',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: ObjectSerializer.serialize(body, \"any\")\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1Deployment\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * partially update scale of the specified Deployment\n * @param name name of the Scale\n * @param namespace object name and auth scope, such as for teams and projects\n * @param body\n * @param pretty If 'true', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param {*} [options] Override http request options.\n */\n patchNamespacedDeploymentScale(name, namespace, body, pretty, dryRun, options = {}) {\n const localVarPath = this.basePath + '/apis/apps/v1/namespaces/{namespace}/deployments/{name}/scale'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling patchNamespacedDeploymentScale.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling patchNamespacedDeploymentScale.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling patchNamespacedDeploymentScale.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'PATCH',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: ObjectSerializer.serialize(body, \"any\")\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1Scale\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * partially update status of the specified Deployment\n * @param name name of the Deployment\n * @param namespace object name and auth scope, such as for teams and projects\n * @param body\n * @param pretty If 'true', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param {*} [options] Override http request options.\n */\n patchNamespacedDeploymentStatus(name, namespace, body, pretty, dryRun, options = {}) {\n const localVarPath = this.basePath + '/apis/apps/v1/namespaces/{namespace}/deployments/{name}/status'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling patchNamespacedDeploymentStatus.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling patchNamespacedDeploymentStatus.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling patchNamespacedDeploymentStatus.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'PATCH',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: ObjectSerializer.serialize(body, \"any\")\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1Deployment\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * partially update the specified ReplicaSet\n * @param name name of the ReplicaSet\n * @param namespace object name and auth scope, such as for teams and projects\n * @param body\n * @param pretty If 'true', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param {*} [options] Override http request options.\n */\n patchNamespacedReplicaSet(name, namespace, body, pretty, dryRun, options = {}) {\n const localVarPath = this.basePath + '/apis/apps/v1/namespaces/{namespace}/replicasets/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling patchNamespacedReplicaSet.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling patchNamespacedReplicaSet.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling patchNamespacedReplicaSet.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'PATCH',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: ObjectSerializer.serialize(body, \"any\")\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1ReplicaSet\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * partially update scale of the specified ReplicaSet\n * @param name name of the Scale\n * @param namespace object name and auth scope, such as for teams and projects\n * @param body\n * @param pretty If 'true', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param {*} [options] Override http request options.\n */\n patchNamespacedReplicaSetScale(name, namespace, body, pretty, dryRun, options = {}) {\n const localVarPath = this.basePath + '/apis/apps/v1/namespaces/{namespace}/replicasets/{name}/scale'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling patchNamespacedReplicaSetScale.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling patchNamespacedReplicaSetScale.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling patchNamespacedReplicaSetScale.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'PATCH',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: ObjectSerializer.serialize(body, \"any\")\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1Scale\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * partially update status of the specified ReplicaSet\n * @param name name of the ReplicaSet\n * @param namespace object name and auth scope, such as for teams and projects\n * @param body\n * @param pretty If 'true', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param {*} [options] Override http request options.\n */\n patchNamespacedReplicaSetStatus(name, namespace, body, pretty, dryRun, options = {}) {\n const localVarPath = this.basePath + '/apis/apps/v1/namespaces/{namespace}/replicasets/{name}/status'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling patchNamespacedReplicaSetStatus.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling patchNamespacedReplicaSetStatus.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling patchNamespacedReplicaSetStatus.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'PATCH',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: ObjectSerializer.serialize(body, \"any\")\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1ReplicaSet\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * partially update the specified StatefulSet\n * @param name name of the StatefulSet\n * @param namespace object name and auth scope, such as for teams and projects\n * @param body\n * @param pretty If 'true', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param {*} [options] Override http request options.\n */\n patchNamespacedStatefulSet(name, namespace, body, pretty, dryRun, options = {}) {\n const localVarPath = this.basePath + '/apis/apps/v1/namespaces/{namespace}/statefulsets/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling patchNamespacedStatefulSet.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling patchNamespacedStatefulSet.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling patchNamespacedStatefulSet.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'PATCH',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: ObjectSerializer.serialize(body, \"any\")\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1StatefulSet\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * partially update scale of the specified StatefulSet\n * @param name name of the Scale\n * @param namespace object name and auth scope, such as for teams and projects\n * @param body\n * @param pretty If 'true', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param {*} [options] Override http request options.\n */\n patchNamespacedStatefulSetScale(name, namespace, body, pretty, dryRun, options = {}) {\n const localVarPath = this.basePath + '/apis/apps/v1/namespaces/{namespace}/statefulsets/{name}/scale'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling patchNamespacedStatefulSetScale.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling patchNamespacedStatefulSetScale.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling patchNamespacedStatefulSetScale.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'PATCH',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: ObjectSerializer.serialize(body, \"any\")\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1Scale\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * partially update status of the specified StatefulSet\n * @param name name of the StatefulSet\n * @param namespace object name and auth scope, such as for teams and projects\n * @param body\n * @param pretty If 'true', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param {*} [options] Override http request options.\n */\n patchNamespacedStatefulSetStatus(name, namespace, body, pretty, dryRun, options = {}) {\n const localVarPath = this.basePath + '/apis/apps/v1/namespaces/{namespace}/statefulsets/{name}/status'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling patchNamespacedStatefulSetStatus.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling patchNamespacedStatefulSetStatus.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling patchNamespacedStatefulSetStatus.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'PATCH',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: ObjectSerializer.serialize(body, \"any\")\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1StatefulSet\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * read the specified ControllerRevision\n * @param name name of the ControllerRevision\n * @param namespace object name and auth scope, such as for teams and projects\n * @param pretty If 'true', then the output is pretty printed.\n * @param exact Should the export be exact. Exact export maintains cluster-specific fields like 'Namespace'.\n * @param _export Should this value be exported. Export strips fields that a user can not specify.\n * @param {*} [options] Override http request options.\n */\n readNamespacedControllerRevision(name, namespace, pretty, exact, _export, options = {}) {\n const localVarPath = this.basePath + '/apis/apps/v1/namespaces/{namespace}/controllerrevisions/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling readNamespacedControllerRevision.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling readNamespacedControllerRevision.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (exact !== undefined) {\n localVarQueryParameters['exact'] = ObjectSerializer.serialize(exact, \"boolean\");\n }\n if (_export !== undefined) {\n localVarQueryParameters['export'] = ObjectSerializer.serialize(_export, \"boolean\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1ControllerRevision\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * read the specified DaemonSet\n * @param name name of the DaemonSet\n * @param namespace object name and auth scope, such as for teams and projects\n * @param pretty If 'true', then the output is pretty printed.\n * @param exact Should the export be exact. Exact export maintains cluster-specific fields like 'Namespace'.\n * @param _export Should this value be exported. Export strips fields that a user can not specify.\n * @param {*} [options] Override http request options.\n */\n readNamespacedDaemonSet(name, namespace, pretty, exact, _export, options = {}) {\n const localVarPath = this.basePath + '/apis/apps/v1/namespaces/{namespace}/daemonsets/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling readNamespacedDaemonSet.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling readNamespacedDaemonSet.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (exact !== undefined) {\n localVarQueryParameters['exact'] = ObjectSerializer.serialize(exact, \"boolean\");\n }\n if (_export !== undefined) {\n localVarQueryParameters['export'] = ObjectSerializer.serialize(_export, \"boolean\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1DaemonSet\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * read status of the specified DaemonSet\n * @param name name of the DaemonSet\n * @param namespace object name and auth scope, such as for teams and projects\n * @param pretty If 'true', then the output is pretty printed.\n * @param {*} [options] Override http request options.\n */\n readNamespacedDaemonSetStatus(name, namespace, pretty, options = {}) {\n const localVarPath = this.basePath + '/apis/apps/v1/namespaces/{namespace}/daemonsets/{name}/status'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling readNamespacedDaemonSetStatus.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling readNamespacedDaemonSetStatus.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1DaemonSet\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * read the specified Deployment\n * @param name name of the Deployment\n * @param namespace object name and auth scope, such as for teams and projects\n * @param pretty If 'true', then the output is pretty printed.\n * @param exact Should the export be exact. Exact export maintains cluster-specific fields like 'Namespace'.\n * @param _export Should this value be exported. Export strips fields that a user can not specify.\n * @param {*} [options] Override http request options.\n */\n readNamespacedDeployment(name, namespace, pretty, exact, _export, options = {}) {\n const localVarPath = this.basePath + '/apis/apps/v1/namespaces/{namespace}/deployments/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling readNamespacedDeployment.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling readNamespacedDeployment.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (exact !== undefined) {\n localVarQueryParameters['exact'] = ObjectSerializer.serialize(exact, \"boolean\");\n }\n if (_export !== undefined) {\n localVarQueryParameters['export'] = ObjectSerializer.serialize(_export, \"boolean\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1Deployment\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * read scale of the specified Deployment\n * @param name name of the Scale\n * @param namespace object name and auth scope, such as for teams and projects\n * @param pretty If 'true', then the output is pretty printed.\n * @param {*} [options] Override http request options.\n */\n readNamespacedDeploymentScale(name, namespace, pretty, options = {}) {\n const localVarPath = this.basePath + '/apis/apps/v1/namespaces/{namespace}/deployments/{name}/scale'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling readNamespacedDeploymentScale.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling readNamespacedDeploymentScale.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1Scale\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * read status of the specified Deployment\n * @param name name of the Deployment\n * @param namespace object name and auth scope, such as for teams and projects\n * @param pretty If 'true', then the output is pretty printed.\n * @param {*} [options] Override http request options.\n */\n readNamespacedDeploymentStatus(name, namespace, pretty, options = {}) {\n const localVarPath = this.basePath + '/apis/apps/v1/namespaces/{namespace}/deployments/{name}/status'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling readNamespacedDeploymentStatus.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling readNamespacedDeploymentStatus.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1Deployment\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * read the specified ReplicaSet\n * @param name name of the ReplicaSet\n * @param namespace object name and auth scope, such as for teams and projects\n * @param pretty If 'true', then the output is pretty printed.\n * @param exact Should the export be exact. Exact export maintains cluster-specific fields like 'Namespace'.\n * @param _export Should this value be exported. Export strips fields that a user can not specify.\n * @param {*} [options] Override http request options.\n */\n readNamespacedReplicaSet(name, namespace, pretty, exact, _export, options = {}) {\n const localVarPath = this.basePath + '/apis/apps/v1/namespaces/{namespace}/replicasets/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling readNamespacedReplicaSet.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling readNamespacedReplicaSet.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (exact !== undefined) {\n localVarQueryParameters['exact'] = ObjectSerializer.serialize(exact, \"boolean\");\n }\n if (_export !== undefined) {\n localVarQueryParameters['export'] = ObjectSerializer.serialize(_export, \"boolean\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1ReplicaSet\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * read scale of the specified ReplicaSet\n * @param name name of the Scale\n * @param namespace object name and auth scope, such as for teams and projects\n * @param pretty If 'true', then the output is pretty printed.\n * @param {*} [options] Override http request options.\n */\n readNamespacedReplicaSetScale(name, namespace, pretty, options = {}) {\n const localVarPath = this.basePath + '/apis/apps/v1/namespaces/{namespace}/replicasets/{name}/scale'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling readNamespacedReplicaSetScale.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling readNamespacedReplicaSetScale.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1Scale\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * read status of the specified ReplicaSet\n * @param name name of the ReplicaSet\n * @param namespace object name and auth scope, such as for teams and projects\n * @param pretty If 'true', then the output is pretty printed.\n * @param {*} [options] Override http request options.\n */\n readNamespacedReplicaSetStatus(name, namespace, pretty, options = {}) {\n const localVarPath = this.basePath + '/apis/apps/v1/namespaces/{namespace}/replicasets/{name}/status'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling readNamespacedReplicaSetStatus.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling readNamespacedReplicaSetStatus.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1ReplicaSet\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * read the specified StatefulSet\n * @param name name of the StatefulSet\n * @param namespace object name and auth scope, such as for teams and projects\n * @param pretty If 'true', then the output is pretty printed.\n * @param exact Should the export be exact. Exact export maintains cluster-specific fields like 'Namespace'.\n * @param _export Should this value be exported. Export strips fields that a user can not specify.\n * @param {*} [options] Override http request options.\n */\n readNamespacedStatefulSet(name, namespace, pretty, exact, _export, options = {}) {\n const localVarPath = this.basePath + '/apis/apps/v1/namespaces/{namespace}/statefulsets/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling readNamespacedStatefulSet.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling readNamespacedStatefulSet.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (exact !== undefined) {\n localVarQueryParameters['exact'] = ObjectSerializer.serialize(exact, \"boolean\");\n }\n if (_export !== undefined) {\n localVarQueryParameters['export'] = ObjectSerializer.serialize(_export, \"boolean\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1StatefulSet\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * read scale of the specified StatefulSet\n * @param name name of the Scale\n * @param namespace object name and auth scope, such as for teams and projects\n * @param pretty If 'true', then the output is pretty printed.\n * @param {*} [options] Override http request options.\n */\n readNamespacedStatefulSetScale(name, namespace, pretty, options = {}) {\n const localVarPath = this.basePath + '/apis/apps/v1/namespaces/{namespace}/statefulsets/{name}/scale'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling readNamespacedStatefulSetScale.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling readNamespacedStatefulSetScale.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1Scale\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * read status of the specified StatefulSet\n * @param name name of the StatefulSet\n * @param namespace object name and auth scope, such as for teams and projects\n * @param pretty If 'true', then the output is pretty printed.\n * @param {*} [options] Override http request options.\n */\n readNamespacedStatefulSetStatus(name, namespace, pretty, options = {}) {\n const localVarPath = this.basePath + '/apis/apps/v1/namespaces/{namespace}/statefulsets/{name}/status'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling readNamespacedStatefulSetStatus.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling readNamespacedStatefulSetStatus.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1StatefulSet\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * replace the specified ControllerRevision\n * @param name name of the ControllerRevision\n * @param namespace object name and auth scope, such as for teams and projects\n * @param body\n * @param pretty If 'true', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param {*} [options] Override http request options.\n */\n replaceNamespacedControllerRevision(name, namespace, body, pretty, dryRun, options = {}) {\n const localVarPath = this.basePath + '/apis/apps/v1/namespaces/{namespace}/controllerrevisions/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling replaceNamespacedControllerRevision.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling replaceNamespacedControllerRevision.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling replaceNamespacedControllerRevision.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'PUT',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: ObjectSerializer.serialize(body, \"V1ControllerRevision\")\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1ControllerRevision\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * replace the specified DaemonSet\n * @param name name of the DaemonSet\n * @param namespace object name and auth scope, such as for teams and projects\n * @param body\n * @param pretty If 'true', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param {*} [options] Override http request options.\n */\n replaceNamespacedDaemonSet(name, namespace, body, pretty, dryRun, options = {}) {\n const localVarPath = this.basePath + '/apis/apps/v1/namespaces/{namespace}/daemonsets/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling replaceNamespacedDaemonSet.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling replaceNamespacedDaemonSet.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling replaceNamespacedDaemonSet.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'PUT',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: ObjectSerializer.serialize(body, \"V1DaemonSet\")\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1DaemonSet\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * replace status of the specified DaemonSet\n * @param name name of the DaemonSet\n * @param namespace object name and auth scope, such as for teams and projects\n * @param body\n * @param pretty If 'true', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param {*} [options] Override http request options.\n */\n replaceNamespacedDaemonSetStatus(name, namespace, body, pretty, dryRun, options = {}) {\n const localVarPath = this.basePath + '/apis/apps/v1/namespaces/{namespace}/daemonsets/{name}/status'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling replaceNamespacedDaemonSetStatus.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling replaceNamespacedDaemonSetStatus.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling replaceNamespacedDaemonSetStatus.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'PUT',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: ObjectSerializer.serialize(body, \"V1DaemonSet\")\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1DaemonSet\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * replace the specified Deployment\n * @param name name of the Deployment\n * @param namespace object name and auth scope, such as for teams and projects\n * @param body\n * @param pretty If 'true', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param {*} [options] Override http request options.\n */\n replaceNamespacedDeployment(name, namespace, body, pretty, dryRun, options = {}) {\n const localVarPath = this.basePath + '/apis/apps/v1/namespaces/{namespace}/deployments/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling replaceNamespacedDeployment.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling replaceNamespacedDeployment.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling replaceNamespacedDeployment.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'PUT',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: ObjectSerializer.serialize(body, \"V1Deployment\")\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1Deployment\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * replace scale of the specified Deployment\n * @param name name of the Scale\n * @param namespace object name and auth scope, such as for teams and projects\n * @param body\n * @param pretty If 'true', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param {*} [options] Override http request options.\n */\n replaceNamespacedDeploymentScale(name, namespace, body, pretty, dryRun, options = {}) {\n const localVarPath = this.basePath + '/apis/apps/v1/namespaces/{namespace}/deployments/{name}/scale'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling replaceNamespacedDeploymentScale.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling replaceNamespacedDeploymentScale.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling replaceNamespacedDeploymentScale.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'PUT',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: ObjectSerializer.serialize(body, \"V1Scale\")\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1Scale\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * replace status of the specified Deployment\n * @param name name of the Deployment\n * @param namespace object name and auth scope, such as for teams and projects\n * @param body\n * @param pretty If 'true', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param {*} [options] Override http request options.\n */\n replaceNamespacedDeploymentStatus(name, namespace, body, pretty, dryRun, options = {}) {\n const localVarPath = this.basePath + '/apis/apps/v1/namespaces/{namespace}/deployments/{name}/status'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling replaceNamespacedDeploymentStatus.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling replaceNamespacedDeploymentStatus.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling replaceNamespacedDeploymentStatus.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'PUT',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: ObjectSerializer.serialize(body, \"V1Deployment\")\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1Deployment\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * replace the specified ReplicaSet\n * @param name name of the ReplicaSet\n * @param namespace object name and auth scope, such as for teams and projects\n * @param body\n * @param pretty If 'true', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param {*} [options] Override http request options.\n */\n replaceNamespacedReplicaSet(name, namespace, body, pretty, dryRun, options = {}) {\n const localVarPath = this.basePath + '/apis/apps/v1/namespaces/{namespace}/replicasets/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling replaceNamespacedReplicaSet.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling replaceNamespacedReplicaSet.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling replaceNamespacedReplicaSet.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'PUT',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: ObjectSerializer.serialize(body, \"V1ReplicaSet\")\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1ReplicaSet\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * replace scale of the specified ReplicaSet\n * @param name name of the Scale\n * @param namespace object name and auth scope, such as for teams and projects\n * @param body\n * @param pretty If 'true', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param {*} [options] Override http request options.\n */\n replaceNamespacedReplicaSetScale(name, namespace, body, pretty, dryRun, options = {}) {\n const localVarPath = this.basePath + '/apis/apps/v1/namespaces/{namespace}/replicasets/{name}/scale'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling replaceNamespacedReplicaSetScale.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling replaceNamespacedReplicaSetScale.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling replaceNamespacedReplicaSetScale.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'PUT',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: ObjectSerializer.serialize(body, \"V1Scale\")\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1Scale\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * replace status of the specified ReplicaSet\n * @param name name of the ReplicaSet\n * @param namespace object name and auth scope, such as for teams and projects\n * @param body\n * @param pretty If 'true', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param {*} [options] Override http request options.\n */\n replaceNamespacedReplicaSetStatus(name, namespace, body, pretty, dryRun, options = {}) {\n const localVarPath = this.basePath + '/apis/apps/v1/namespaces/{namespace}/replicasets/{name}/status'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling replaceNamespacedReplicaSetStatus.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling replaceNamespacedReplicaSetStatus.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling replaceNamespacedReplicaSetStatus.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'PUT',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: ObjectSerializer.serialize(body, \"V1ReplicaSet\")\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1ReplicaSet\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * replace the specified StatefulSet\n * @param name name of the StatefulSet\n * @param namespace object name and auth scope, such as for teams and projects\n * @param body\n * @param pretty If 'true', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param {*} [options] Override http request options.\n */\n replaceNamespacedStatefulSet(name, namespace, body, pretty, dryRun, options = {}) {\n const localVarPath = this.basePath + '/apis/apps/v1/namespaces/{namespace}/statefulsets/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling replaceNamespacedStatefulSet.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling replaceNamespacedStatefulSet.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling replaceNamespacedStatefulSet.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'PUT',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: ObjectSerializer.serialize(body, \"V1StatefulSet\")\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1StatefulSet\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * replace scale of the specified StatefulSet\n * @param name name of the Scale\n * @param namespace object name and auth scope, such as for teams and projects\n * @param body\n * @param pretty If 'true', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param {*} [options] Override http request options.\n */\n replaceNamespacedStatefulSetScale(name, namespace, body, pretty, dryRun, options = {}) {\n const localVarPath = this.basePath + '/apis/apps/v1/namespaces/{namespace}/statefulsets/{name}/scale'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling replaceNamespacedStatefulSetScale.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling replaceNamespacedStatefulSetScale.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling replaceNamespacedStatefulSetScale.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'PUT',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: ObjectSerializer.serialize(body, \"V1Scale\")\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1Scale\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * replace status of the specified StatefulSet\n * @param name name of the StatefulSet\n * @param namespace object name and auth scope, such as for teams and projects\n * @param body\n * @param pretty If 'true', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param {*} [options] Override http request options.\n */\n replaceNamespacedStatefulSetStatus(name, namespace, body, pretty, dryRun, options = {}) {\n const localVarPath = this.basePath + '/apis/apps/v1/namespaces/{namespace}/statefulsets/{name}/status'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling replaceNamespacedStatefulSetStatus.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling replaceNamespacedStatefulSetStatus.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling replaceNamespacedStatefulSetStatus.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'PUT',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: ObjectSerializer.serialize(body, \"V1StatefulSet\")\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1StatefulSet\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n}\nexports.AppsV1Api = AppsV1Api;\nvar AppsV1beta1ApiApiKeys;\n(function (AppsV1beta1ApiApiKeys) {\n AppsV1beta1ApiApiKeys[AppsV1beta1ApiApiKeys[\"BearerToken\"] = 0] = \"BearerToken\";\n})(AppsV1beta1ApiApiKeys = exports.AppsV1beta1ApiApiKeys || (exports.AppsV1beta1ApiApiKeys = {}));\nclass AppsV1beta1Api {\n constructor(basePathOrUsername, password, basePath) {\n this._basePath = defaultBasePath;\n this.defaultHeaders = {};\n this._useQuerystring = false;\n this.authentications = {\n 'default': new VoidAuth(),\n 'BearerToken': new ApiKeyAuth('header', 'authorization'),\n };\n if (password) {\n if (basePath) {\n this.basePath = basePath;\n }\n }\n else {\n if (basePathOrUsername) {\n this.basePath = basePathOrUsername;\n }\n }\n }\n set useQuerystring(value) {\n this._useQuerystring = value;\n }\n set basePath(basePath) {\n this._basePath = basePath;\n }\n get basePath() {\n return this._basePath;\n }\n setDefaultAuthentication(auth) {\n this.authentications.default = auth;\n }\n setApiKey(key, value) {\n this.authentications[AppsV1beta1ApiApiKeys[key]].apiKey = value;\n }\n /**\n * create a ControllerRevision\n * @param namespace object name and auth scope, such as for teams and projects\n * @param body\n * @param includeUninitialized If true, partially initialized resources are included in the response.\n * @param pretty If 'true', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param {*} [options] Override http request options.\n */\n createNamespacedControllerRevision(namespace, body, includeUninitialized, pretty, dryRun, options = {}) {\n const localVarPath = this.basePath + '/apis/apps/v1beta1/namespaces/{namespace}/controllerrevisions'\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling createNamespacedControllerRevision.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling createNamespacedControllerRevision.');\n }\n if (includeUninitialized !== undefined) {\n localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, \"boolean\");\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'POST',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: ObjectSerializer.serialize(body, \"V1beta1ControllerRevision\")\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1beta1ControllerRevision\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * create a Deployment\n * @param namespace object name and auth scope, such as for teams and projects\n * @param body\n * @param includeUninitialized If true, partially initialized resources are included in the response.\n * @param pretty If 'true', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param {*} [options] Override http request options.\n */\n createNamespacedDeployment(namespace, body, includeUninitialized, pretty, dryRun, options = {}) {\n const localVarPath = this.basePath + '/apis/apps/v1beta1/namespaces/{namespace}/deployments'\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling createNamespacedDeployment.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling createNamespacedDeployment.');\n }\n if (includeUninitialized !== undefined) {\n localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, \"boolean\");\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'POST',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: ObjectSerializer.serialize(body, \"AppsV1beta1Deployment\")\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"AppsV1beta1Deployment\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * create rollback of a Deployment\n * @param name name of the DeploymentRollback\n * @param namespace object name and auth scope, such as for teams and projects\n * @param body\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param includeUninitialized If IncludeUninitialized is specified, the object may be returned without completing initialization.\n * @param pretty If 'true', then the output is pretty printed.\n * @param {*} [options] Override http request options.\n */\n createNamespacedDeploymentRollback(name, namespace, body, dryRun, includeUninitialized, pretty, options = {}) {\n const localVarPath = this.basePath + '/apis/apps/v1beta1/namespaces/{namespace}/deployments/{name}/rollback'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling createNamespacedDeploymentRollback.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling createNamespacedDeploymentRollback.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling createNamespacedDeploymentRollback.');\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, \"string\");\n }\n if (includeUninitialized !== undefined) {\n localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, \"boolean\");\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'POST',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: ObjectSerializer.serialize(body, \"AppsV1beta1DeploymentRollback\")\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1Status\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * create a StatefulSet\n * @param namespace object name and auth scope, such as for teams and projects\n * @param body\n * @param includeUninitialized If true, partially initialized resources are included in the response.\n * @param pretty If 'true', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param {*} [options] Override http request options.\n */\n createNamespacedStatefulSet(namespace, body, includeUninitialized, pretty, dryRun, options = {}) {\n const localVarPath = this.basePath + '/apis/apps/v1beta1/namespaces/{namespace}/statefulsets'\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling createNamespacedStatefulSet.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling createNamespacedStatefulSet.');\n }\n if (includeUninitialized !== undefined) {\n localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, \"boolean\");\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'POST',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: ObjectSerializer.serialize(body, \"V1beta1StatefulSet\")\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1beta1StatefulSet\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * delete collection of ControllerRevision\n * @param namespace object name and auth scope, such as for teams and projects\n * @param includeUninitialized If true, partially initialized resources are included in the response.\n * @param pretty If 'true', then the output is pretty printed.\n * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \\"next key\\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.\n * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything.\n * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything.\n * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.\n * @param resourceVersion When specified with a watch call, shows changes that occur after that particular version of a resource. Defaults to changes from the beginning of history. When specified for list: - if unset, then the result is returned from remote storage based on quorum-read flag; - if it's 0, then we simply return what we currently have in cache, no guarantee; - if set to non zero, then the result is at least as fresh as given rv.\n * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.\n * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.\n * @param {*} [options] Override http request options.\n */\n deleteCollectionNamespacedControllerRevision(namespace, includeUninitialized, pretty, _continue, fieldSelector, labelSelector, limit, resourceVersion, timeoutSeconds, watch, options = {}) {\n const localVarPath = this.basePath + '/apis/apps/v1beta1/namespaces/{namespace}/controllerrevisions'\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling deleteCollectionNamespacedControllerRevision.');\n }\n if (includeUninitialized !== undefined) {\n localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, \"boolean\");\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (_continue !== undefined) {\n localVarQueryParameters['continue'] = ObjectSerializer.serialize(_continue, \"string\");\n }\n if (fieldSelector !== undefined) {\n localVarQueryParameters['fieldSelector'] = ObjectSerializer.serialize(fieldSelector, \"string\");\n }\n if (labelSelector !== undefined) {\n localVarQueryParameters['labelSelector'] = ObjectSerializer.serialize(labelSelector, \"string\");\n }\n if (limit !== undefined) {\n localVarQueryParameters['limit'] = ObjectSerializer.serialize(limit, \"number\");\n }\n if (resourceVersion !== undefined) {\n localVarQueryParameters['resourceVersion'] = ObjectSerializer.serialize(resourceVersion, \"string\");\n }\n if (timeoutSeconds !== undefined) {\n localVarQueryParameters['timeoutSeconds'] = ObjectSerializer.serialize(timeoutSeconds, \"number\");\n }\n if (watch !== undefined) {\n localVarQueryParameters['watch'] = ObjectSerializer.serialize(watch, \"boolean\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'DELETE',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1Status\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * delete collection of Deployment\n * @param namespace object name and auth scope, such as for teams and projects\n * @param includeUninitialized If true, partially initialized resources are included in the response.\n * @param pretty If 'true', then the output is pretty printed.\n * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \\"next key\\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.\n * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything.\n * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything.\n * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.\n * @param resourceVersion When specified with a watch call, shows changes that occur after that particular version of a resource. Defaults to changes from the beginning of history. When specified for list: - if unset, then the result is returned from remote storage based on quorum-read flag; - if it's 0, then we simply return what we currently have in cache, no guarantee; - if set to non zero, then the result is at least as fresh as given rv.\n * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.\n * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.\n * @param {*} [options] Override http request options.\n */\n deleteCollectionNamespacedDeployment(namespace, includeUninitialized, pretty, _continue, fieldSelector, labelSelector, limit, resourceVersion, timeoutSeconds, watch, options = {}) {\n const localVarPath = this.basePath + '/apis/apps/v1beta1/namespaces/{namespace}/deployments'\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling deleteCollectionNamespacedDeployment.');\n }\n if (includeUninitialized !== undefined) {\n localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, \"boolean\");\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (_continue !== undefined) {\n localVarQueryParameters['continue'] = ObjectSerializer.serialize(_continue, \"string\");\n }\n if (fieldSelector !== undefined) {\n localVarQueryParameters['fieldSelector'] = ObjectSerializer.serialize(fieldSelector, \"string\");\n }\n if (labelSelector !== undefined) {\n localVarQueryParameters['labelSelector'] = ObjectSerializer.serialize(labelSelector, \"string\");\n }\n if (limit !== undefined) {\n localVarQueryParameters['limit'] = ObjectSerializer.serialize(limit, \"number\");\n }\n if (resourceVersion !== undefined) {\n localVarQueryParameters['resourceVersion'] = ObjectSerializer.serialize(resourceVersion, \"string\");\n }\n if (timeoutSeconds !== undefined) {\n localVarQueryParameters['timeoutSeconds'] = ObjectSerializer.serialize(timeoutSeconds, \"number\");\n }\n if (watch !== undefined) {\n localVarQueryParameters['watch'] = ObjectSerializer.serialize(watch, \"boolean\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'DELETE',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1Status\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * delete collection of StatefulSet\n * @param namespace object name and auth scope, such as for teams and projects\n * @param includeUninitialized If true, partially initialized resources are included in the response.\n * @param pretty If 'true', then the output is pretty printed.\n * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \\"next key\\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.\n * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything.\n * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything.\n * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.\n * @param resourceVersion When specified with a watch call, shows changes that occur after that particular version of a resource. Defaults to changes from the beginning of history. When specified for list: - if unset, then the result is returned from remote storage based on quorum-read flag; - if it's 0, then we simply return what we currently have in cache, no guarantee; - if set to non zero, then the result is at least as fresh as given rv.\n * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.\n * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.\n * @param {*} [options] Override http request options.\n */\n deleteCollectionNamespacedStatefulSet(namespace, includeUninitialized, pretty, _continue, fieldSelector, labelSelector, limit, resourceVersion, timeoutSeconds, watch, options = {}) {\n const localVarPath = this.basePath + '/apis/apps/v1beta1/namespaces/{namespace}/statefulsets'\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling deleteCollectionNamespacedStatefulSet.');\n }\n if (includeUninitialized !== undefined) {\n localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, \"boolean\");\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (_continue !== undefined) {\n localVarQueryParameters['continue'] = ObjectSerializer.serialize(_continue, \"string\");\n }\n if (fieldSelector !== undefined) {\n localVarQueryParameters['fieldSelector'] = ObjectSerializer.serialize(fieldSelector, \"string\");\n }\n if (labelSelector !== undefined) {\n localVarQueryParameters['labelSelector'] = ObjectSerializer.serialize(labelSelector, \"string\");\n }\n if (limit !== undefined) {\n localVarQueryParameters['limit'] = ObjectSerializer.serialize(limit, \"number\");\n }\n if (resourceVersion !== undefined) {\n localVarQueryParameters['resourceVersion'] = ObjectSerializer.serialize(resourceVersion, \"string\");\n }\n if (timeoutSeconds !== undefined) {\n localVarQueryParameters['timeoutSeconds'] = ObjectSerializer.serialize(timeoutSeconds, \"number\");\n }\n if (watch !== undefined) {\n localVarQueryParameters['watch'] = ObjectSerializer.serialize(watch, \"boolean\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'DELETE',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1Status\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * delete a ControllerRevision\n * @param name name of the ControllerRevision\n * @param namespace object name and auth scope, such as for teams and projects\n * @param pretty If 'true', then the output is pretty printed.\n * @param body\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param gracePeriodSeconds The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately.\n * @param orphanDependents Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \\"orphan\\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both.\n * @param propagationPolicy Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground.\n * @param {*} [options] Override http request options.\n */\n deleteNamespacedControllerRevision(name, namespace, pretty, body, dryRun, gracePeriodSeconds, orphanDependents, propagationPolicy, options = {}) {\n const localVarPath = this.basePath + '/apis/apps/v1beta1/namespaces/{namespace}/controllerrevisions/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling deleteNamespacedControllerRevision.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling deleteNamespacedControllerRevision.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, \"string\");\n }\n if (gracePeriodSeconds !== undefined) {\n localVarQueryParameters['gracePeriodSeconds'] = ObjectSerializer.serialize(gracePeriodSeconds, \"number\");\n }\n if (orphanDependents !== undefined) {\n localVarQueryParameters['orphanDependents'] = ObjectSerializer.serialize(orphanDependents, \"boolean\");\n }\n if (propagationPolicy !== undefined) {\n localVarQueryParameters['propagationPolicy'] = ObjectSerializer.serialize(propagationPolicy, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'DELETE',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: ObjectSerializer.serialize(body, \"V1DeleteOptions\")\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1Status\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * delete a Deployment\n * @param name name of the Deployment\n * @param namespace object name and auth scope, such as for teams and projects\n * @param pretty If 'true', then the output is pretty printed.\n * @param body\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param gracePeriodSeconds The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately.\n * @param orphanDependents Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \\"orphan\\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both.\n * @param propagationPolicy Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground.\n * @param {*} [options] Override http request options.\n */\n deleteNamespacedDeployment(name, namespace, pretty, body, dryRun, gracePeriodSeconds, orphanDependents, propagationPolicy, options = {}) {\n const localVarPath = this.basePath + '/apis/apps/v1beta1/namespaces/{namespace}/deployments/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling deleteNamespacedDeployment.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling deleteNamespacedDeployment.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, \"string\");\n }\n if (gracePeriodSeconds !== undefined) {\n localVarQueryParameters['gracePeriodSeconds'] = ObjectSerializer.serialize(gracePeriodSeconds, \"number\");\n }\n if (orphanDependents !== undefined) {\n localVarQueryParameters['orphanDependents'] = ObjectSerializer.serialize(orphanDependents, \"boolean\");\n }\n if (propagationPolicy !== undefined) {\n localVarQueryParameters['propagationPolicy'] = ObjectSerializer.serialize(propagationPolicy, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'DELETE',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: ObjectSerializer.serialize(body, \"V1DeleteOptions\")\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1Status\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * delete a StatefulSet\n * @param name name of the StatefulSet\n * @param namespace object name and auth scope, such as for teams and projects\n * @param pretty If 'true', then the output is pretty printed.\n * @param body\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param gracePeriodSeconds The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately.\n * @param orphanDependents Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \\"orphan\\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both.\n * @param propagationPolicy Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground.\n * @param {*} [options] Override http request options.\n */\n deleteNamespacedStatefulSet(name, namespace, pretty, body, dryRun, gracePeriodSeconds, orphanDependents, propagationPolicy, options = {}) {\n const localVarPath = this.basePath + '/apis/apps/v1beta1/namespaces/{namespace}/statefulsets/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling deleteNamespacedStatefulSet.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling deleteNamespacedStatefulSet.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, \"string\");\n }\n if (gracePeriodSeconds !== undefined) {\n localVarQueryParameters['gracePeriodSeconds'] = ObjectSerializer.serialize(gracePeriodSeconds, \"number\");\n }\n if (orphanDependents !== undefined) {\n localVarQueryParameters['orphanDependents'] = ObjectSerializer.serialize(orphanDependents, \"boolean\");\n }\n if (propagationPolicy !== undefined) {\n localVarQueryParameters['propagationPolicy'] = ObjectSerializer.serialize(propagationPolicy, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'DELETE',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: ObjectSerializer.serialize(body, \"V1DeleteOptions\")\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1Status\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * get available resources\n * @param {*} [options] Override http request options.\n */\n getAPIResources(options = {}) {\n const localVarPath = this.basePath + '/apis/apps/v1beta1/';\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1APIResourceList\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * list or watch objects of kind ControllerRevision\n * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \\"next key\\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.\n * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything.\n * @param includeUninitialized If true, partially initialized resources are included in the response.\n * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything.\n * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.\n * @param pretty If 'true', then the output is pretty printed.\n * @param resourceVersion When specified with a watch call, shows changes that occur after that particular version of a resource. Defaults to changes from the beginning of history. When specified for list: - if unset, then the result is returned from remote storage based on quorum-read flag; - if it's 0, then we simply return what we currently have in cache, no guarantee; - if set to non zero, then the result is at least as fresh as given rv.\n * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.\n * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.\n * @param {*} [options] Override http request options.\n */\n listControllerRevisionForAllNamespaces(_continue, fieldSelector, includeUninitialized, labelSelector, limit, pretty, resourceVersion, timeoutSeconds, watch, options = {}) {\n const localVarPath = this.basePath + '/apis/apps/v1beta1/controllerrevisions';\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n if (_continue !== undefined) {\n localVarQueryParameters['continue'] = ObjectSerializer.serialize(_continue, \"string\");\n }\n if (fieldSelector !== undefined) {\n localVarQueryParameters['fieldSelector'] = ObjectSerializer.serialize(fieldSelector, \"string\");\n }\n if (includeUninitialized !== undefined) {\n localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, \"boolean\");\n }\n if (labelSelector !== undefined) {\n localVarQueryParameters['labelSelector'] = ObjectSerializer.serialize(labelSelector, \"string\");\n }\n if (limit !== undefined) {\n localVarQueryParameters['limit'] = ObjectSerializer.serialize(limit, \"number\");\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (resourceVersion !== undefined) {\n localVarQueryParameters['resourceVersion'] = ObjectSerializer.serialize(resourceVersion, \"string\");\n }\n if (timeoutSeconds !== undefined) {\n localVarQueryParameters['timeoutSeconds'] = ObjectSerializer.serialize(timeoutSeconds, \"number\");\n }\n if (watch !== undefined) {\n localVarQueryParameters['watch'] = ObjectSerializer.serialize(watch, \"boolean\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1beta1ControllerRevisionList\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * list or watch objects of kind Deployment\n * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \\"next key\\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.\n * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything.\n * @param includeUninitialized If true, partially initialized resources are included in the response.\n * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything.\n * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.\n * @param pretty If 'true', then the output is pretty printed.\n * @param resourceVersion When specified with a watch call, shows changes that occur after that particular version of a resource. Defaults to changes from the beginning of history. When specified for list: - if unset, then the result is returned from remote storage based on quorum-read flag; - if it's 0, then we simply return what we currently have in cache, no guarantee; - if set to non zero, then the result is at least as fresh as given rv.\n * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.\n * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.\n * @param {*} [options] Override http request options.\n */\n listDeploymentForAllNamespaces(_continue, fieldSelector, includeUninitialized, labelSelector, limit, pretty, resourceVersion, timeoutSeconds, watch, options = {}) {\n const localVarPath = this.basePath + '/apis/apps/v1beta1/deployments';\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n if (_continue !== undefined) {\n localVarQueryParameters['continue'] = ObjectSerializer.serialize(_continue, \"string\");\n }\n if (fieldSelector !== undefined) {\n localVarQueryParameters['fieldSelector'] = ObjectSerializer.serialize(fieldSelector, \"string\");\n }\n if (includeUninitialized !== undefined) {\n localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, \"boolean\");\n }\n if (labelSelector !== undefined) {\n localVarQueryParameters['labelSelector'] = ObjectSerializer.serialize(labelSelector, \"string\");\n }\n if (limit !== undefined) {\n localVarQueryParameters['limit'] = ObjectSerializer.serialize(limit, \"number\");\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (resourceVersion !== undefined) {\n localVarQueryParameters['resourceVersion'] = ObjectSerializer.serialize(resourceVersion, \"string\");\n }\n if (timeoutSeconds !== undefined) {\n localVarQueryParameters['timeoutSeconds'] = ObjectSerializer.serialize(timeoutSeconds, \"number\");\n }\n if (watch !== undefined) {\n localVarQueryParameters['watch'] = ObjectSerializer.serialize(watch, \"boolean\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"AppsV1beta1DeploymentList\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * list or watch objects of kind ControllerRevision\n * @param namespace object name and auth scope, such as for teams and projects\n * @param includeUninitialized If true, partially initialized resources are included in the response.\n * @param pretty If 'true', then the output is pretty printed.\n * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \\"next key\\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.\n * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything.\n * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything.\n * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.\n * @param resourceVersion When specified with a watch call, shows changes that occur after that particular version of a resource. Defaults to changes from the beginning of history. When specified for list: - if unset, then the result is returned from remote storage based on quorum-read flag; - if it's 0, then we simply return what we currently have in cache, no guarantee; - if set to non zero, then the result is at least as fresh as given rv.\n * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.\n * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.\n * @param {*} [options] Override http request options.\n */\n listNamespacedControllerRevision(namespace, includeUninitialized, pretty, _continue, fieldSelector, labelSelector, limit, resourceVersion, timeoutSeconds, watch, options = {}) {\n const localVarPath = this.basePath + '/apis/apps/v1beta1/namespaces/{namespace}/controllerrevisions'\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling listNamespacedControllerRevision.');\n }\n if (includeUninitialized !== undefined) {\n localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, \"boolean\");\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (_continue !== undefined) {\n localVarQueryParameters['continue'] = ObjectSerializer.serialize(_continue, \"string\");\n }\n if (fieldSelector !== undefined) {\n localVarQueryParameters['fieldSelector'] = ObjectSerializer.serialize(fieldSelector, \"string\");\n }\n if (labelSelector !== undefined) {\n localVarQueryParameters['labelSelector'] = ObjectSerializer.serialize(labelSelector, \"string\");\n }\n if (limit !== undefined) {\n localVarQueryParameters['limit'] = ObjectSerializer.serialize(limit, \"number\");\n }\n if (resourceVersion !== undefined) {\n localVarQueryParameters['resourceVersion'] = ObjectSerializer.serialize(resourceVersion, \"string\");\n }\n if (timeoutSeconds !== undefined) {\n localVarQueryParameters['timeoutSeconds'] = ObjectSerializer.serialize(timeoutSeconds, \"number\");\n }\n if (watch !== undefined) {\n localVarQueryParameters['watch'] = ObjectSerializer.serialize(watch, \"boolean\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1beta1ControllerRevisionList\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * list or watch objects of kind Deployment\n * @param namespace object name and auth scope, such as for teams and projects\n * @param includeUninitialized If true, partially initialized resources are included in the response.\n * @param pretty If 'true', then the output is pretty printed.\n * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \\"next key\\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.\n * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything.\n * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything.\n * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.\n * @param resourceVersion When specified with a watch call, shows changes that occur after that particular version of a resource. Defaults to changes from the beginning of history. When specified for list: - if unset, then the result is returned from remote storage based on quorum-read flag; - if it's 0, then we simply return what we currently have in cache, no guarantee; - if set to non zero, then the result is at least as fresh as given rv.\n * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.\n * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.\n * @param {*} [options] Override http request options.\n */\n listNamespacedDeployment(namespace, includeUninitialized, pretty, _continue, fieldSelector, labelSelector, limit, resourceVersion, timeoutSeconds, watch, options = {}) {\n const localVarPath = this.basePath + '/apis/apps/v1beta1/namespaces/{namespace}/deployments'\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling listNamespacedDeployment.');\n }\n if (includeUninitialized !== undefined) {\n localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, \"boolean\");\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (_continue !== undefined) {\n localVarQueryParameters['continue'] = ObjectSerializer.serialize(_continue, \"string\");\n }\n if (fieldSelector !== undefined) {\n localVarQueryParameters['fieldSelector'] = ObjectSerializer.serialize(fieldSelector, \"string\");\n }\n if (labelSelector !== undefined) {\n localVarQueryParameters['labelSelector'] = ObjectSerializer.serialize(labelSelector, \"string\");\n }\n if (limit !== undefined) {\n localVarQueryParameters['limit'] = ObjectSerializer.serialize(limit, \"number\");\n }\n if (resourceVersion !== undefined) {\n localVarQueryParameters['resourceVersion'] = ObjectSerializer.serialize(resourceVersion, \"string\");\n }\n if (timeoutSeconds !== undefined) {\n localVarQueryParameters['timeoutSeconds'] = ObjectSerializer.serialize(timeoutSeconds, \"number\");\n }\n if (watch !== undefined) {\n localVarQueryParameters['watch'] = ObjectSerializer.serialize(watch, \"boolean\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"AppsV1beta1DeploymentList\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * list or watch objects of kind StatefulSet\n * @param namespace object name and auth scope, such as for teams and projects\n * @param includeUninitialized If true, partially initialized resources are included in the response.\n * @param pretty If 'true', then the output is pretty printed.\n * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \\"next key\\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.\n * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything.\n * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything.\n * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.\n * @param resourceVersion When specified with a watch call, shows changes that occur after that particular version of a resource. Defaults to changes from the beginning of history. When specified for list: - if unset, then the result is returned from remote storage based on quorum-read flag; - if it's 0, then we simply return what we currently have in cache, no guarantee; - if set to non zero, then the result is at least as fresh as given rv.\n * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.\n * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.\n * @param {*} [options] Override http request options.\n */\n listNamespacedStatefulSet(namespace, includeUninitialized, pretty, _continue, fieldSelector, labelSelector, limit, resourceVersion, timeoutSeconds, watch, options = {}) {\n const localVarPath = this.basePath + '/apis/apps/v1beta1/namespaces/{namespace}/statefulsets'\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling listNamespacedStatefulSet.');\n }\n if (includeUninitialized !== undefined) {\n localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, \"boolean\");\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (_continue !== undefined) {\n localVarQueryParameters['continue'] = ObjectSerializer.serialize(_continue, \"string\");\n }\n if (fieldSelector !== undefined) {\n localVarQueryParameters['fieldSelector'] = ObjectSerializer.serialize(fieldSelector, \"string\");\n }\n if (labelSelector !== undefined) {\n localVarQueryParameters['labelSelector'] = ObjectSerializer.serialize(labelSelector, \"string\");\n }\n if (limit !== undefined) {\n localVarQueryParameters['limit'] = ObjectSerializer.serialize(limit, \"number\");\n }\n if (resourceVersion !== undefined) {\n localVarQueryParameters['resourceVersion'] = ObjectSerializer.serialize(resourceVersion, \"string\");\n }\n if (timeoutSeconds !== undefined) {\n localVarQueryParameters['timeoutSeconds'] = ObjectSerializer.serialize(timeoutSeconds, \"number\");\n }\n if (watch !== undefined) {\n localVarQueryParameters['watch'] = ObjectSerializer.serialize(watch, \"boolean\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1beta1StatefulSetList\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * list or watch objects of kind StatefulSet\n * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \\"next key\\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.\n * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything.\n * @param includeUninitialized If true, partially initialized resources are included in the response.\n * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything.\n * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.\n * @param pretty If 'true', then the output is pretty printed.\n * @param resourceVersion When specified with a watch call, shows changes that occur after that particular version of a resource. Defaults to changes from the beginning of history. When specified for list: - if unset, then the result is returned from remote storage based on quorum-read flag; - if it's 0, then we simply return what we currently have in cache, no guarantee; - if set to non zero, then the result is at least as fresh as given rv.\n * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.\n * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.\n * @param {*} [options] Override http request options.\n */\n listStatefulSetForAllNamespaces(_continue, fieldSelector, includeUninitialized, labelSelector, limit, pretty, resourceVersion, timeoutSeconds, watch, options = {}) {\n const localVarPath = this.basePath + '/apis/apps/v1beta1/statefulsets';\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n if (_continue !== undefined) {\n localVarQueryParameters['continue'] = ObjectSerializer.serialize(_continue, \"string\");\n }\n if (fieldSelector !== undefined) {\n localVarQueryParameters['fieldSelector'] = ObjectSerializer.serialize(fieldSelector, \"string\");\n }\n if (includeUninitialized !== undefined) {\n localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, \"boolean\");\n }\n if (labelSelector !== undefined) {\n localVarQueryParameters['labelSelector'] = ObjectSerializer.serialize(labelSelector, \"string\");\n }\n if (limit !== undefined) {\n localVarQueryParameters['limit'] = ObjectSerializer.serialize(limit, \"number\");\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (resourceVersion !== undefined) {\n localVarQueryParameters['resourceVersion'] = ObjectSerializer.serialize(resourceVersion, \"string\");\n }\n if (timeoutSeconds !== undefined) {\n localVarQueryParameters['timeoutSeconds'] = ObjectSerializer.serialize(timeoutSeconds, \"number\");\n }\n if (watch !== undefined) {\n localVarQueryParameters['watch'] = ObjectSerializer.serialize(watch, \"boolean\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1beta1StatefulSetList\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * partially update the specified ControllerRevision\n * @param name name of the ControllerRevision\n * @param namespace object name and auth scope, such as for teams and projects\n * @param body\n * @param pretty If 'true', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param {*} [options] Override http request options.\n */\n patchNamespacedControllerRevision(name, namespace, body, pretty, dryRun, options = {}) {\n const localVarPath = this.basePath + '/apis/apps/v1beta1/namespaces/{namespace}/controllerrevisions/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling patchNamespacedControllerRevision.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling patchNamespacedControllerRevision.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling patchNamespacedControllerRevision.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'PATCH',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: ObjectSerializer.serialize(body, \"any\")\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1beta1ControllerRevision\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * partially update the specified Deployment\n * @param name name of the Deployment\n * @param namespace object name and auth scope, such as for teams and projects\n * @param body\n * @param pretty If 'true', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param {*} [options] Override http request options.\n */\n patchNamespacedDeployment(name, namespace, body, pretty, dryRun, options = {}) {\n const localVarPath = this.basePath + '/apis/apps/v1beta1/namespaces/{namespace}/deployments/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling patchNamespacedDeployment.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling patchNamespacedDeployment.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling patchNamespacedDeployment.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'PATCH',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: ObjectSerializer.serialize(body, \"any\")\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"AppsV1beta1Deployment\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * partially update scale of the specified Deployment\n * @param name name of the Scale\n * @param namespace object name and auth scope, such as for teams and projects\n * @param body\n * @param pretty If 'true', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param {*} [options] Override http request options.\n */\n patchNamespacedDeploymentScale(name, namespace, body, pretty, dryRun, options = {}) {\n const localVarPath = this.basePath + '/apis/apps/v1beta1/namespaces/{namespace}/deployments/{name}/scale'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling patchNamespacedDeploymentScale.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling patchNamespacedDeploymentScale.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling patchNamespacedDeploymentScale.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'PATCH',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: ObjectSerializer.serialize(body, \"any\")\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"AppsV1beta1Scale\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * partially update status of the specified Deployment\n * @param name name of the Deployment\n * @param namespace object name and auth scope, such as for teams and projects\n * @param body\n * @param pretty If 'true', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param {*} [options] Override http request options.\n */\n patchNamespacedDeploymentStatus(name, namespace, body, pretty, dryRun, options = {}) {\n const localVarPath = this.basePath + '/apis/apps/v1beta1/namespaces/{namespace}/deployments/{name}/status'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling patchNamespacedDeploymentStatus.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling patchNamespacedDeploymentStatus.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling patchNamespacedDeploymentStatus.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'PATCH',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: ObjectSerializer.serialize(body, \"any\")\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"AppsV1beta1Deployment\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * partially update the specified StatefulSet\n * @param name name of the StatefulSet\n * @param namespace object name and auth scope, such as for teams and projects\n * @param body\n * @param pretty If 'true', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param {*} [options] Override http request options.\n */\n patchNamespacedStatefulSet(name, namespace, body, pretty, dryRun, options = {}) {\n const localVarPath = this.basePath + '/apis/apps/v1beta1/namespaces/{namespace}/statefulsets/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling patchNamespacedStatefulSet.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling patchNamespacedStatefulSet.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling patchNamespacedStatefulSet.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'PATCH',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: ObjectSerializer.serialize(body, \"any\")\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1beta1StatefulSet\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * partially update scale of the specified StatefulSet\n * @param name name of the Scale\n * @param namespace object name and auth scope, such as for teams and projects\n * @param body\n * @param pretty If 'true', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param {*} [options] Override http request options.\n */\n patchNamespacedStatefulSetScale(name, namespace, body, pretty, dryRun, options = {}) {\n const localVarPath = this.basePath + '/apis/apps/v1beta1/namespaces/{namespace}/statefulsets/{name}/scale'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling patchNamespacedStatefulSetScale.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling patchNamespacedStatefulSetScale.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling patchNamespacedStatefulSetScale.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'PATCH',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: ObjectSerializer.serialize(body, \"any\")\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"AppsV1beta1Scale\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * partially update status of the specified StatefulSet\n * @param name name of the StatefulSet\n * @param namespace object name and auth scope, such as for teams and projects\n * @param body\n * @param pretty If 'true', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param {*} [options] Override http request options.\n */\n patchNamespacedStatefulSetStatus(name, namespace, body, pretty, dryRun, options = {}) {\n const localVarPath = this.basePath + '/apis/apps/v1beta1/namespaces/{namespace}/statefulsets/{name}/status'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling patchNamespacedStatefulSetStatus.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling patchNamespacedStatefulSetStatus.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling patchNamespacedStatefulSetStatus.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'PATCH',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: ObjectSerializer.serialize(body, \"any\")\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1beta1StatefulSet\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * read the specified ControllerRevision\n * @param name name of the ControllerRevision\n * @param namespace object name and auth scope, such as for teams and projects\n * @param pretty If 'true', then the output is pretty printed.\n * @param exact Should the export be exact. Exact export maintains cluster-specific fields like 'Namespace'.\n * @param _export Should this value be exported. Export strips fields that a user can not specify.\n * @param {*} [options] Override http request options.\n */\n readNamespacedControllerRevision(name, namespace, pretty, exact, _export, options = {}) {\n const localVarPath = this.basePath + '/apis/apps/v1beta1/namespaces/{namespace}/controllerrevisions/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling readNamespacedControllerRevision.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling readNamespacedControllerRevision.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (exact !== undefined) {\n localVarQueryParameters['exact'] = ObjectSerializer.serialize(exact, \"boolean\");\n }\n if (_export !== undefined) {\n localVarQueryParameters['export'] = ObjectSerializer.serialize(_export, \"boolean\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1beta1ControllerRevision\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * read the specified Deployment\n * @param name name of the Deployment\n * @param namespace object name and auth scope, such as for teams and projects\n * @param pretty If 'true', then the output is pretty printed.\n * @param exact Should the export be exact. Exact export maintains cluster-specific fields like 'Namespace'.\n * @param _export Should this value be exported. Export strips fields that a user can not specify.\n * @param {*} [options] Override http request options.\n */\n readNamespacedDeployment(name, namespace, pretty, exact, _export, options = {}) {\n const localVarPath = this.basePath + '/apis/apps/v1beta1/namespaces/{namespace}/deployments/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling readNamespacedDeployment.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling readNamespacedDeployment.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (exact !== undefined) {\n localVarQueryParameters['exact'] = ObjectSerializer.serialize(exact, \"boolean\");\n }\n if (_export !== undefined) {\n localVarQueryParameters['export'] = ObjectSerializer.serialize(_export, \"boolean\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"AppsV1beta1Deployment\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * read scale of the specified Deployment\n * @param name name of the Scale\n * @param namespace object name and auth scope, such as for teams and projects\n * @param pretty If 'true', then the output is pretty printed.\n * @param {*} [options] Override http request options.\n */\n readNamespacedDeploymentScale(name, namespace, pretty, options = {}) {\n const localVarPath = this.basePath + '/apis/apps/v1beta1/namespaces/{namespace}/deployments/{name}/scale'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling readNamespacedDeploymentScale.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling readNamespacedDeploymentScale.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"AppsV1beta1Scale\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * read status of the specified Deployment\n * @param name name of the Deployment\n * @param namespace object name and auth scope, such as for teams and projects\n * @param pretty If 'true', then the output is pretty printed.\n * @param {*} [options] Override http request options.\n */\n readNamespacedDeploymentStatus(name, namespace, pretty, options = {}) {\n const localVarPath = this.basePath + '/apis/apps/v1beta1/namespaces/{namespace}/deployments/{name}/status'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling readNamespacedDeploymentStatus.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling readNamespacedDeploymentStatus.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"AppsV1beta1Deployment\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * read the specified StatefulSet\n * @param name name of the StatefulSet\n * @param namespace object name and auth scope, such as for teams and projects\n * @param pretty If 'true', then the output is pretty printed.\n * @param exact Should the export be exact. Exact export maintains cluster-specific fields like 'Namespace'.\n * @param _export Should this value be exported. Export strips fields that a user can not specify.\n * @param {*} [options] Override http request options.\n */\n readNamespacedStatefulSet(name, namespace, pretty, exact, _export, options = {}) {\n const localVarPath = this.basePath + '/apis/apps/v1beta1/namespaces/{namespace}/statefulsets/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling readNamespacedStatefulSet.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling readNamespacedStatefulSet.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (exact !== undefined) {\n localVarQueryParameters['exact'] = ObjectSerializer.serialize(exact, \"boolean\");\n }\n if (_export !== undefined) {\n localVarQueryParameters['export'] = ObjectSerializer.serialize(_export, \"boolean\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1beta1StatefulSet\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * read scale of the specified StatefulSet\n * @param name name of the Scale\n * @param namespace object name and auth scope, such as for teams and projects\n * @param pretty If 'true', then the output is pretty printed.\n * @param {*} [options] Override http request options.\n */\n readNamespacedStatefulSetScale(name, namespace, pretty, options = {}) {\n const localVarPath = this.basePath + '/apis/apps/v1beta1/namespaces/{namespace}/statefulsets/{name}/scale'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling readNamespacedStatefulSetScale.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling readNamespacedStatefulSetScale.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"AppsV1beta1Scale\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * read status of the specified StatefulSet\n * @param name name of the StatefulSet\n * @param namespace object name and auth scope, such as for teams and projects\n * @param pretty If 'true', then the output is pretty printed.\n * @param {*} [options] Override http request options.\n */\n readNamespacedStatefulSetStatus(name, namespace, pretty, options = {}) {\n const localVarPath = this.basePath + '/apis/apps/v1beta1/namespaces/{namespace}/statefulsets/{name}/status'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling readNamespacedStatefulSetStatus.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling readNamespacedStatefulSetStatus.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1beta1StatefulSet\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * replace the specified ControllerRevision\n * @param name name of the ControllerRevision\n * @param namespace object name and auth scope, such as for teams and projects\n * @param body\n * @param pretty If 'true', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param {*} [options] Override http request options.\n */\n replaceNamespacedControllerRevision(name, namespace, body, pretty, dryRun, options = {}) {\n const localVarPath = this.basePath + '/apis/apps/v1beta1/namespaces/{namespace}/controllerrevisions/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling replaceNamespacedControllerRevision.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling replaceNamespacedControllerRevision.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling replaceNamespacedControllerRevision.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'PUT',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: ObjectSerializer.serialize(body, \"V1beta1ControllerRevision\")\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1beta1ControllerRevision\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * replace the specified Deployment\n * @param name name of the Deployment\n * @param namespace object name and auth scope, such as for teams and projects\n * @param body\n * @param pretty If 'true', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param {*} [options] Override http request options.\n */\n replaceNamespacedDeployment(name, namespace, body, pretty, dryRun, options = {}) {\n const localVarPath = this.basePath + '/apis/apps/v1beta1/namespaces/{namespace}/deployments/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling replaceNamespacedDeployment.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling replaceNamespacedDeployment.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling replaceNamespacedDeployment.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'PUT',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: ObjectSerializer.serialize(body, \"AppsV1beta1Deployment\")\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"AppsV1beta1Deployment\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * replace scale of the specified Deployment\n * @param name name of the Scale\n * @param namespace object name and auth scope, such as for teams and projects\n * @param body\n * @param pretty If 'true', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param {*} [options] Override http request options.\n */\n replaceNamespacedDeploymentScale(name, namespace, body, pretty, dryRun, options = {}) {\n const localVarPath = this.basePath + '/apis/apps/v1beta1/namespaces/{namespace}/deployments/{name}/scale'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling replaceNamespacedDeploymentScale.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling replaceNamespacedDeploymentScale.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling replaceNamespacedDeploymentScale.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'PUT',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: ObjectSerializer.serialize(body, \"AppsV1beta1Scale\")\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"AppsV1beta1Scale\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * replace status of the specified Deployment\n * @param name name of the Deployment\n * @param namespace object name and auth scope, such as for teams and projects\n * @param body\n * @param pretty If 'true', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param {*} [options] Override http request options.\n */\n replaceNamespacedDeploymentStatus(name, namespace, body, pretty, dryRun, options = {}) {\n const localVarPath = this.basePath + '/apis/apps/v1beta1/namespaces/{namespace}/deployments/{name}/status'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling replaceNamespacedDeploymentStatus.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling replaceNamespacedDeploymentStatus.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling replaceNamespacedDeploymentStatus.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'PUT',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: ObjectSerializer.serialize(body, \"AppsV1beta1Deployment\")\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"AppsV1beta1Deployment\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * replace the specified StatefulSet\n * @param name name of the StatefulSet\n * @param namespace object name and auth scope, such as for teams and projects\n * @param body\n * @param pretty If 'true', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param {*} [options] Override http request options.\n */\n replaceNamespacedStatefulSet(name, namespace, body, pretty, dryRun, options = {}) {\n const localVarPath = this.basePath + '/apis/apps/v1beta1/namespaces/{namespace}/statefulsets/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling replaceNamespacedStatefulSet.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling replaceNamespacedStatefulSet.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling replaceNamespacedStatefulSet.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'PUT',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: ObjectSerializer.serialize(body, \"V1beta1StatefulSet\")\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1beta1StatefulSet\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * replace scale of the specified StatefulSet\n * @param name name of the Scale\n * @param namespace object name and auth scope, such as for teams and projects\n * @param body\n * @param pretty If 'true', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param {*} [options] Override http request options.\n */\n replaceNamespacedStatefulSetScale(name, namespace, body, pretty, dryRun, options = {}) {\n const localVarPath = this.basePath + '/apis/apps/v1beta1/namespaces/{namespace}/statefulsets/{name}/scale'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling replaceNamespacedStatefulSetScale.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling replaceNamespacedStatefulSetScale.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling replaceNamespacedStatefulSetScale.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'PUT',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: ObjectSerializer.serialize(body, \"AppsV1beta1Scale\")\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"AppsV1beta1Scale\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * replace status of the specified StatefulSet\n * @param name name of the StatefulSet\n * @param namespace object name and auth scope, such as for teams and projects\n * @param body\n * @param pretty If 'true', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param {*} [options] Override http request options.\n */\n replaceNamespacedStatefulSetStatus(name, namespace, body, pretty, dryRun, options = {}) {\n const localVarPath = this.basePath + '/apis/apps/v1beta1/namespaces/{namespace}/statefulsets/{name}/status'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling replaceNamespacedStatefulSetStatus.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling replaceNamespacedStatefulSetStatus.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling replaceNamespacedStatefulSetStatus.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'PUT',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: ObjectSerializer.serialize(body, \"V1beta1StatefulSet\")\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1beta1StatefulSet\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n}\nexports.AppsV1beta1Api = AppsV1beta1Api;\nvar AppsV1beta2ApiApiKeys;\n(function (AppsV1beta2ApiApiKeys) {\n AppsV1beta2ApiApiKeys[AppsV1beta2ApiApiKeys[\"BearerToken\"] = 0] = \"BearerToken\";\n})(AppsV1beta2ApiApiKeys = exports.AppsV1beta2ApiApiKeys || (exports.AppsV1beta2ApiApiKeys = {}));\nclass AppsV1beta2Api {\n constructor(basePathOrUsername, password, basePath) {\n this._basePath = defaultBasePath;\n this.defaultHeaders = {};\n this._useQuerystring = false;\n this.authentications = {\n 'default': new VoidAuth(),\n 'BearerToken': new ApiKeyAuth('header', 'authorization'),\n };\n if (password) {\n if (basePath) {\n this.basePath = basePath;\n }\n }\n else {\n if (basePathOrUsername) {\n this.basePath = basePathOrUsername;\n }\n }\n }\n set useQuerystring(value) {\n this._useQuerystring = value;\n }\n set basePath(basePath) {\n this._basePath = basePath;\n }\n get basePath() {\n return this._basePath;\n }\n setDefaultAuthentication(auth) {\n this.authentications.default = auth;\n }\n setApiKey(key, value) {\n this.authentications[AppsV1beta2ApiApiKeys[key]].apiKey = value;\n }\n /**\n * create a ControllerRevision\n * @param namespace object name and auth scope, such as for teams and projects\n * @param body\n * @param includeUninitialized If true, partially initialized resources are included in the response.\n * @param pretty If 'true', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param {*} [options] Override http request options.\n */\n createNamespacedControllerRevision(namespace, body, includeUninitialized, pretty, dryRun, options = {}) {\n const localVarPath = this.basePath + '/apis/apps/v1beta2/namespaces/{namespace}/controllerrevisions'\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling createNamespacedControllerRevision.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling createNamespacedControllerRevision.');\n }\n if (includeUninitialized !== undefined) {\n localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, \"boolean\");\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'POST',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: ObjectSerializer.serialize(body, \"V1beta2ControllerRevision\")\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1beta2ControllerRevision\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * create a DaemonSet\n * @param namespace object name and auth scope, such as for teams and projects\n * @param body\n * @param includeUninitialized If true, partially initialized resources are included in the response.\n * @param pretty If 'true', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param {*} [options] Override http request options.\n */\n createNamespacedDaemonSet(namespace, body, includeUninitialized, pretty, dryRun, options = {}) {\n const localVarPath = this.basePath + '/apis/apps/v1beta2/namespaces/{namespace}/daemonsets'\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling createNamespacedDaemonSet.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling createNamespacedDaemonSet.');\n }\n if (includeUninitialized !== undefined) {\n localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, \"boolean\");\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'POST',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: ObjectSerializer.serialize(body, \"V1beta2DaemonSet\")\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1beta2DaemonSet\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * create a Deployment\n * @param namespace object name and auth scope, such as for teams and projects\n * @param body\n * @param includeUninitialized If true, partially initialized resources are included in the response.\n * @param pretty If 'true', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param {*} [options] Override http request options.\n */\n createNamespacedDeployment(namespace, body, includeUninitialized, pretty, dryRun, options = {}) {\n const localVarPath = this.basePath + '/apis/apps/v1beta2/namespaces/{namespace}/deployments'\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling createNamespacedDeployment.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling createNamespacedDeployment.');\n }\n if (includeUninitialized !== undefined) {\n localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, \"boolean\");\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'POST',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: ObjectSerializer.serialize(body, \"V1beta2Deployment\")\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1beta2Deployment\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * create a ReplicaSet\n * @param namespace object name and auth scope, such as for teams and projects\n * @param body\n * @param includeUninitialized If true, partially initialized resources are included in the response.\n * @param pretty If 'true', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param {*} [options] Override http request options.\n */\n createNamespacedReplicaSet(namespace, body, includeUninitialized, pretty, dryRun, options = {}) {\n const localVarPath = this.basePath + '/apis/apps/v1beta2/namespaces/{namespace}/replicasets'\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling createNamespacedReplicaSet.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling createNamespacedReplicaSet.');\n }\n if (includeUninitialized !== undefined) {\n localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, \"boolean\");\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'POST',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: ObjectSerializer.serialize(body, \"V1beta2ReplicaSet\")\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1beta2ReplicaSet\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * create a StatefulSet\n * @param namespace object name and auth scope, such as for teams and projects\n * @param body\n * @param includeUninitialized If true, partially initialized resources are included in the response.\n * @param pretty If 'true', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param {*} [options] Override http request options.\n */\n createNamespacedStatefulSet(namespace, body, includeUninitialized, pretty, dryRun, options = {}) {\n const localVarPath = this.basePath + '/apis/apps/v1beta2/namespaces/{namespace}/statefulsets'\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling createNamespacedStatefulSet.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling createNamespacedStatefulSet.');\n }\n if (includeUninitialized !== undefined) {\n localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, \"boolean\");\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'POST',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: ObjectSerializer.serialize(body, \"V1beta2StatefulSet\")\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1beta2StatefulSet\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * delete collection of ControllerRevision\n * @param namespace object name and auth scope, such as for teams and projects\n * @param includeUninitialized If true, partially initialized resources are included in the response.\n * @param pretty If 'true', then the output is pretty printed.\n * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \\"next key\\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.\n * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything.\n * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything.\n * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.\n * @param resourceVersion When specified with a watch call, shows changes that occur after that particular version of a resource. Defaults to changes from the beginning of history. When specified for list: - if unset, then the result is returned from remote storage based on quorum-read flag; - if it's 0, then we simply return what we currently have in cache, no guarantee; - if set to non zero, then the result is at least as fresh as given rv.\n * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.\n * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.\n * @param {*} [options] Override http request options.\n */\n deleteCollectionNamespacedControllerRevision(namespace, includeUninitialized, pretty, _continue, fieldSelector, labelSelector, limit, resourceVersion, timeoutSeconds, watch, options = {}) {\n const localVarPath = this.basePath + '/apis/apps/v1beta2/namespaces/{namespace}/controllerrevisions'\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling deleteCollectionNamespacedControllerRevision.');\n }\n if (includeUninitialized !== undefined) {\n localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, \"boolean\");\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (_continue !== undefined) {\n localVarQueryParameters['continue'] = ObjectSerializer.serialize(_continue, \"string\");\n }\n if (fieldSelector !== undefined) {\n localVarQueryParameters['fieldSelector'] = ObjectSerializer.serialize(fieldSelector, \"string\");\n }\n if (labelSelector !== undefined) {\n localVarQueryParameters['labelSelector'] = ObjectSerializer.serialize(labelSelector, \"string\");\n }\n if (limit !== undefined) {\n localVarQueryParameters['limit'] = ObjectSerializer.serialize(limit, \"number\");\n }\n if (resourceVersion !== undefined) {\n localVarQueryParameters['resourceVersion'] = ObjectSerializer.serialize(resourceVersion, \"string\");\n }\n if (timeoutSeconds !== undefined) {\n localVarQueryParameters['timeoutSeconds'] = ObjectSerializer.serialize(timeoutSeconds, \"number\");\n }\n if (watch !== undefined) {\n localVarQueryParameters['watch'] = ObjectSerializer.serialize(watch, \"boolean\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'DELETE',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1Status\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * delete collection of DaemonSet\n * @param namespace object name and auth scope, such as for teams and projects\n * @param includeUninitialized If true, partially initialized resources are included in the response.\n * @param pretty If 'true', then the output is pretty printed.\n * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \\"next key\\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.\n * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything.\n * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything.\n * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.\n * @param resourceVersion When specified with a watch call, shows changes that occur after that particular version of a resource. Defaults to changes from the beginning of history. When specified for list: - if unset, then the result is returned from remote storage based on quorum-read flag; - if it's 0, then we simply return what we currently have in cache, no guarantee; - if set to non zero, then the result is at least as fresh as given rv.\n * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.\n * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.\n * @param {*} [options] Override http request options.\n */\n deleteCollectionNamespacedDaemonSet(namespace, includeUninitialized, pretty, _continue, fieldSelector, labelSelector, limit, resourceVersion, timeoutSeconds, watch, options = {}) {\n const localVarPath = this.basePath + '/apis/apps/v1beta2/namespaces/{namespace}/daemonsets'\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling deleteCollectionNamespacedDaemonSet.');\n }\n if (includeUninitialized !== undefined) {\n localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, \"boolean\");\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (_continue !== undefined) {\n localVarQueryParameters['continue'] = ObjectSerializer.serialize(_continue, \"string\");\n }\n if (fieldSelector !== undefined) {\n localVarQueryParameters['fieldSelector'] = ObjectSerializer.serialize(fieldSelector, \"string\");\n }\n if (labelSelector !== undefined) {\n localVarQueryParameters['labelSelector'] = ObjectSerializer.serialize(labelSelector, \"string\");\n }\n if (limit !== undefined) {\n localVarQueryParameters['limit'] = ObjectSerializer.serialize(limit, \"number\");\n }\n if (resourceVersion !== undefined) {\n localVarQueryParameters['resourceVersion'] = ObjectSerializer.serialize(resourceVersion, \"string\");\n }\n if (timeoutSeconds !== undefined) {\n localVarQueryParameters['timeoutSeconds'] = ObjectSerializer.serialize(timeoutSeconds, \"number\");\n }\n if (watch !== undefined) {\n localVarQueryParameters['watch'] = ObjectSerializer.serialize(watch, \"boolean\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'DELETE',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1Status\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * delete collection of Deployment\n * @param namespace object name and auth scope, such as for teams and projects\n * @param includeUninitialized If true, partially initialized resources are included in the response.\n * @param pretty If 'true', then the output is pretty printed.\n * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \\"next key\\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.\n * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything.\n * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything.\n * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.\n * @param resourceVersion When specified with a watch call, shows changes that occur after that particular version of a resource. Defaults to changes from the beginning of history. When specified for list: - if unset, then the result is returned from remote storage based on quorum-read flag; - if it's 0, then we simply return what we currently have in cache, no guarantee; - if set to non zero, then the result is at least as fresh as given rv.\n * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.\n * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.\n * @param {*} [options] Override http request options.\n */\n deleteCollectionNamespacedDeployment(namespace, includeUninitialized, pretty, _continue, fieldSelector, labelSelector, limit, resourceVersion, timeoutSeconds, watch, options = {}) {\n const localVarPath = this.basePath + '/apis/apps/v1beta2/namespaces/{namespace}/deployments'\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling deleteCollectionNamespacedDeployment.');\n }\n if (includeUninitialized !== undefined) {\n localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, \"boolean\");\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (_continue !== undefined) {\n localVarQueryParameters['continue'] = ObjectSerializer.serialize(_continue, \"string\");\n }\n if (fieldSelector !== undefined) {\n localVarQueryParameters['fieldSelector'] = ObjectSerializer.serialize(fieldSelector, \"string\");\n }\n if (labelSelector !== undefined) {\n localVarQueryParameters['labelSelector'] = ObjectSerializer.serialize(labelSelector, \"string\");\n }\n if (limit !== undefined) {\n localVarQueryParameters['limit'] = ObjectSerializer.serialize(limit, \"number\");\n }\n if (resourceVersion !== undefined) {\n localVarQueryParameters['resourceVersion'] = ObjectSerializer.serialize(resourceVersion, \"string\");\n }\n if (timeoutSeconds !== undefined) {\n localVarQueryParameters['timeoutSeconds'] = ObjectSerializer.serialize(timeoutSeconds, \"number\");\n }\n if (watch !== undefined) {\n localVarQueryParameters['watch'] = ObjectSerializer.serialize(watch, \"boolean\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'DELETE',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1Status\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * delete collection of ReplicaSet\n * @param namespace object name and auth scope, such as for teams and projects\n * @param includeUninitialized If true, partially initialized resources are included in the response.\n * @param pretty If 'true', then the output is pretty printed.\n * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \\"next key\\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.\n * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything.\n * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything.\n * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.\n * @param resourceVersion When specified with a watch call, shows changes that occur after that particular version of a resource. Defaults to changes from the beginning of history. When specified for list: - if unset, then the result is returned from remote storage based on quorum-read flag; - if it's 0, then we simply return what we currently have in cache, no guarantee; - if set to non zero, then the result is at least as fresh as given rv.\n * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.\n * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.\n * @param {*} [options] Override http request options.\n */\n deleteCollectionNamespacedReplicaSet(namespace, includeUninitialized, pretty, _continue, fieldSelector, labelSelector, limit, resourceVersion, timeoutSeconds, watch, options = {}) {\n const localVarPath = this.basePath + '/apis/apps/v1beta2/namespaces/{namespace}/replicasets'\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling deleteCollectionNamespacedReplicaSet.');\n }\n if (includeUninitialized !== undefined) {\n localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, \"boolean\");\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (_continue !== undefined) {\n localVarQueryParameters['continue'] = ObjectSerializer.serialize(_continue, \"string\");\n }\n if (fieldSelector !== undefined) {\n localVarQueryParameters['fieldSelector'] = ObjectSerializer.serialize(fieldSelector, \"string\");\n }\n if (labelSelector !== undefined) {\n localVarQueryParameters['labelSelector'] = ObjectSerializer.serialize(labelSelector, \"string\");\n }\n if (limit !== undefined) {\n localVarQueryParameters['limit'] = ObjectSerializer.serialize(limit, \"number\");\n }\n if (resourceVersion !== undefined) {\n localVarQueryParameters['resourceVersion'] = ObjectSerializer.serialize(resourceVersion, \"string\");\n }\n if (timeoutSeconds !== undefined) {\n localVarQueryParameters['timeoutSeconds'] = ObjectSerializer.serialize(timeoutSeconds, \"number\");\n }\n if (watch !== undefined) {\n localVarQueryParameters['watch'] = ObjectSerializer.serialize(watch, \"boolean\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'DELETE',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1Status\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * delete collection of StatefulSet\n * @param namespace object name and auth scope, such as for teams and projects\n * @param includeUninitialized If true, partially initialized resources are included in the response.\n * @param pretty If 'true', then the output is pretty printed.\n * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \\"next key\\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.\n * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything.\n * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything.\n * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.\n * @param resourceVersion When specified with a watch call, shows changes that occur after that particular version of a resource. Defaults to changes from the beginning of history. When specified for list: - if unset, then the result is returned from remote storage based on quorum-read flag; - if it's 0, then we simply return what we currently have in cache, no guarantee; - if set to non zero, then the result is at least as fresh as given rv.\n * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.\n * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.\n * @param {*} [options] Override http request options.\n */\n deleteCollectionNamespacedStatefulSet(namespace, includeUninitialized, pretty, _continue, fieldSelector, labelSelector, limit, resourceVersion, timeoutSeconds, watch, options = {}) {\n const localVarPath = this.basePath + '/apis/apps/v1beta2/namespaces/{namespace}/statefulsets'\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling deleteCollectionNamespacedStatefulSet.');\n }\n if (includeUninitialized !== undefined) {\n localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, \"boolean\");\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (_continue !== undefined) {\n localVarQueryParameters['continue'] = ObjectSerializer.serialize(_continue, \"string\");\n }\n if (fieldSelector !== undefined) {\n localVarQueryParameters['fieldSelector'] = ObjectSerializer.serialize(fieldSelector, \"string\");\n }\n if (labelSelector !== undefined) {\n localVarQueryParameters['labelSelector'] = ObjectSerializer.serialize(labelSelector, \"string\");\n }\n if (limit !== undefined) {\n localVarQueryParameters['limit'] = ObjectSerializer.serialize(limit, \"number\");\n }\n if (resourceVersion !== undefined) {\n localVarQueryParameters['resourceVersion'] = ObjectSerializer.serialize(resourceVersion, \"string\");\n }\n if (timeoutSeconds !== undefined) {\n localVarQueryParameters['timeoutSeconds'] = ObjectSerializer.serialize(timeoutSeconds, \"number\");\n }\n if (watch !== undefined) {\n localVarQueryParameters['watch'] = ObjectSerializer.serialize(watch, \"boolean\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'DELETE',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1Status\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * delete a ControllerRevision\n * @param name name of the ControllerRevision\n * @param namespace object name and auth scope, such as for teams and projects\n * @param pretty If 'true', then the output is pretty printed.\n * @param body\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param gracePeriodSeconds The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately.\n * @param orphanDependents Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \\"orphan\\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both.\n * @param propagationPolicy Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground.\n * @param {*} [options] Override http request options.\n */\n deleteNamespacedControllerRevision(name, namespace, pretty, body, dryRun, gracePeriodSeconds, orphanDependents, propagationPolicy, options = {}) {\n const localVarPath = this.basePath + '/apis/apps/v1beta2/namespaces/{namespace}/controllerrevisions/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling deleteNamespacedControllerRevision.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling deleteNamespacedControllerRevision.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, \"string\");\n }\n if (gracePeriodSeconds !== undefined) {\n localVarQueryParameters['gracePeriodSeconds'] = ObjectSerializer.serialize(gracePeriodSeconds, \"number\");\n }\n if (orphanDependents !== undefined) {\n localVarQueryParameters['orphanDependents'] = ObjectSerializer.serialize(orphanDependents, \"boolean\");\n }\n if (propagationPolicy !== undefined) {\n localVarQueryParameters['propagationPolicy'] = ObjectSerializer.serialize(propagationPolicy, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'DELETE',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: ObjectSerializer.serialize(body, \"V1DeleteOptions\")\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1Status\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * delete a DaemonSet\n * @param name name of the DaemonSet\n * @param namespace object name and auth scope, such as for teams and projects\n * @param pretty If 'true', then the output is pretty printed.\n * @param body\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param gracePeriodSeconds The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately.\n * @param orphanDependents Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \\"orphan\\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both.\n * @param propagationPolicy Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground.\n * @param {*} [options] Override http request options.\n */\n deleteNamespacedDaemonSet(name, namespace, pretty, body, dryRun, gracePeriodSeconds, orphanDependents, propagationPolicy, options = {}) {\n const localVarPath = this.basePath + '/apis/apps/v1beta2/namespaces/{namespace}/daemonsets/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling deleteNamespacedDaemonSet.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling deleteNamespacedDaemonSet.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, \"string\");\n }\n if (gracePeriodSeconds !== undefined) {\n localVarQueryParameters['gracePeriodSeconds'] = ObjectSerializer.serialize(gracePeriodSeconds, \"number\");\n }\n if (orphanDependents !== undefined) {\n localVarQueryParameters['orphanDependents'] = ObjectSerializer.serialize(orphanDependents, \"boolean\");\n }\n if (propagationPolicy !== undefined) {\n localVarQueryParameters['propagationPolicy'] = ObjectSerializer.serialize(propagationPolicy, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'DELETE',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: ObjectSerializer.serialize(body, \"V1DeleteOptions\")\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1Status\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * delete a Deployment\n * @param name name of the Deployment\n * @param namespace object name and auth scope, such as for teams and projects\n * @param pretty If 'true', then the output is pretty printed.\n * @param body\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param gracePeriodSeconds The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately.\n * @param orphanDependents Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \\"orphan\\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both.\n * @param propagationPolicy Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground.\n * @param {*} [options] Override http request options.\n */\n deleteNamespacedDeployment(name, namespace, pretty, body, dryRun, gracePeriodSeconds, orphanDependents, propagationPolicy, options = {}) {\n const localVarPath = this.basePath + '/apis/apps/v1beta2/namespaces/{namespace}/deployments/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling deleteNamespacedDeployment.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling deleteNamespacedDeployment.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, \"string\");\n }\n if (gracePeriodSeconds !== undefined) {\n localVarQueryParameters['gracePeriodSeconds'] = ObjectSerializer.serialize(gracePeriodSeconds, \"number\");\n }\n if (orphanDependents !== undefined) {\n localVarQueryParameters['orphanDependents'] = ObjectSerializer.serialize(orphanDependents, \"boolean\");\n }\n if (propagationPolicy !== undefined) {\n localVarQueryParameters['propagationPolicy'] = ObjectSerializer.serialize(propagationPolicy, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'DELETE',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: ObjectSerializer.serialize(body, \"V1DeleteOptions\")\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1Status\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * delete a ReplicaSet\n * @param name name of the ReplicaSet\n * @param namespace object name and auth scope, such as for teams and projects\n * @param pretty If 'true', then the output is pretty printed.\n * @param body\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param gracePeriodSeconds The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately.\n * @param orphanDependents Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \\"orphan\\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both.\n * @param propagationPolicy Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground.\n * @param {*} [options] Override http request options.\n */\n deleteNamespacedReplicaSet(name, namespace, pretty, body, dryRun, gracePeriodSeconds, orphanDependents, propagationPolicy, options = {}) {\n const localVarPath = this.basePath + '/apis/apps/v1beta2/namespaces/{namespace}/replicasets/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling deleteNamespacedReplicaSet.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling deleteNamespacedReplicaSet.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, \"string\");\n }\n if (gracePeriodSeconds !== undefined) {\n localVarQueryParameters['gracePeriodSeconds'] = ObjectSerializer.serialize(gracePeriodSeconds, \"number\");\n }\n if (orphanDependents !== undefined) {\n localVarQueryParameters['orphanDependents'] = ObjectSerializer.serialize(orphanDependents, \"boolean\");\n }\n if (propagationPolicy !== undefined) {\n localVarQueryParameters['propagationPolicy'] = ObjectSerializer.serialize(propagationPolicy, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'DELETE',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: ObjectSerializer.serialize(body, \"V1DeleteOptions\")\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1Status\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * delete a StatefulSet\n * @param name name of the StatefulSet\n * @param namespace object name and auth scope, such as for teams and projects\n * @param pretty If 'true', then the output is pretty printed.\n * @param body\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param gracePeriodSeconds The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately.\n * @param orphanDependents Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \\"orphan\\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both.\n * @param propagationPolicy Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground.\n * @param {*} [options] Override http request options.\n */\n deleteNamespacedStatefulSet(name, namespace, pretty, body, dryRun, gracePeriodSeconds, orphanDependents, propagationPolicy, options = {}) {\n const localVarPath = this.basePath + '/apis/apps/v1beta2/namespaces/{namespace}/statefulsets/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling deleteNamespacedStatefulSet.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling deleteNamespacedStatefulSet.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, \"string\");\n }\n if (gracePeriodSeconds !== undefined) {\n localVarQueryParameters['gracePeriodSeconds'] = ObjectSerializer.serialize(gracePeriodSeconds, \"number\");\n }\n if (orphanDependents !== undefined) {\n localVarQueryParameters['orphanDependents'] = ObjectSerializer.serialize(orphanDependents, \"boolean\");\n }\n if (propagationPolicy !== undefined) {\n localVarQueryParameters['propagationPolicy'] = ObjectSerializer.serialize(propagationPolicy, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'DELETE',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: ObjectSerializer.serialize(body, \"V1DeleteOptions\")\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1Status\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * get available resources\n * @param {*} [options] Override http request options.\n */\n getAPIResources(options = {}) {\n const localVarPath = this.basePath + '/apis/apps/v1beta2/';\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1APIResourceList\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * list or watch objects of kind ControllerRevision\n * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \\"next key\\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.\n * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything.\n * @param includeUninitialized If true, partially initialized resources are included in the response.\n * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything.\n * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.\n * @param pretty If 'true', then the output is pretty printed.\n * @param resourceVersion When specified with a watch call, shows changes that occur after that particular version of a resource. Defaults to changes from the beginning of history. When specified for list: - if unset, then the result is returned from remote storage based on quorum-read flag; - if it's 0, then we simply return what we currently have in cache, no guarantee; - if set to non zero, then the result is at least as fresh as given rv.\n * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.\n * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.\n * @param {*} [options] Override http request options.\n */\n listControllerRevisionForAllNamespaces(_continue, fieldSelector, includeUninitialized, labelSelector, limit, pretty, resourceVersion, timeoutSeconds, watch, options = {}) {\n const localVarPath = this.basePath + '/apis/apps/v1beta2/controllerrevisions';\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n if (_continue !== undefined) {\n localVarQueryParameters['continue'] = ObjectSerializer.serialize(_continue, \"string\");\n }\n if (fieldSelector !== undefined) {\n localVarQueryParameters['fieldSelector'] = ObjectSerializer.serialize(fieldSelector, \"string\");\n }\n if (includeUninitialized !== undefined) {\n localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, \"boolean\");\n }\n if (labelSelector !== undefined) {\n localVarQueryParameters['labelSelector'] = ObjectSerializer.serialize(labelSelector, \"string\");\n }\n if (limit !== undefined) {\n localVarQueryParameters['limit'] = ObjectSerializer.serialize(limit, \"number\");\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (resourceVersion !== undefined) {\n localVarQueryParameters['resourceVersion'] = ObjectSerializer.serialize(resourceVersion, \"string\");\n }\n if (timeoutSeconds !== undefined) {\n localVarQueryParameters['timeoutSeconds'] = ObjectSerializer.serialize(timeoutSeconds, \"number\");\n }\n if (watch !== undefined) {\n localVarQueryParameters['watch'] = ObjectSerializer.serialize(watch, \"boolean\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1beta2ControllerRevisionList\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * list or watch objects of kind DaemonSet\n * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \\"next key\\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.\n * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything.\n * @param includeUninitialized If true, partially initialized resources are included in the response.\n * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything.\n * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.\n * @param pretty If 'true', then the output is pretty printed.\n * @param resourceVersion When specified with a watch call, shows changes that occur after that particular version of a resource. Defaults to changes from the beginning of history. When specified for list: - if unset, then the result is returned from remote storage based on quorum-read flag; - if it's 0, then we simply return what we currently have in cache, no guarantee; - if set to non zero, then the result is at least as fresh as given rv.\n * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.\n * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.\n * @param {*} [options] Override http request options.\n */\n listDaemonSetForAllNamespaces(_continue, fieldSelector, includeUninitialized, labelSelector, limit, pretty, resourceVersion, timeoutSeconds, watch, options = {}) {\n const localVarPath = this.basePath + '/apis/apps/v1beta2/daemonsets';\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n if (_continue !== undefined) {\n localVarQueryParameters['continue'] = ObjectSerializer.serialize(_continue, \"string\");\n }\n if (fieldSelector !== undefined) {\n localVarQueryParameters['fieldSelector'] = ObjectSerializer.serialize(fieldSelector, \"string\");\n }\n if (includeUninitialized !== undefined) {\n localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, \"boolean\");\n }\n if (labelSelector !== undefined) {\n localVarQueryParameters['labelSelector'] = ObjectSerializer.serialize(labelSelector, \"string\");\n }\n if (limit !== undefined) {\n localVarQueryParameters['limit'] = ObjectSerializer.serialize(limit, \"number\");\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (resourceVersion !== undefined) {\n localVarQueryParameters['resourceVersion'] = ObjectSerializer.serialize(resourceVersion, \"string\");\n }\n if (timeoutSeconds !== undefined) {\n localVarQueryParameters['timeoutSeconds'] = ObjectSerializer.serialize(timeoutSeconds, \"number\");\n }\n if (watch !== undefined) {\n localVarQueryParameters['watch'] = ObjectSerializer.serialize(watch, \"boolean\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1beta2DaemonSetList\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * list or watch objects of kind Deployment\n * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \\"next key\\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.\n * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything.\n * @param includeUninitialized If true, partially initialized resources are included in the response.\n * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything.\n * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.\n * @param pretty If 'true', then the output is pretty printed.\n * @param resourceVersion When specified with a watch call, shows changes that occur after that particular version of a resource. Defaults to changes from the beginning of history. When specified for list: - if unset, then the result is returned from remote storage based on quorum-read flag; - if it's 0, then we simply return what we currently have in cache, no guarantee; - if set to non zero, then the result is at least as fresh as given rv.\n * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.\n * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.\n * @param {*} [options] Override http request options.\n */\n listDeploymentForAllNamespaces(_continue, fieldSelector, includeUninitialized, labelSelector, limit, pretty, resourceVersion, timeoutSeconds, watch, options = {}) {\n const localVarPath = this.basePath + '/apis/apps/v1beta2/deployments';\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n if (_continue !== undefined) {\n localVarQueryParameters['continue'] = ObjectSerializer.serialize(_continue, \"string\");\n }\n if (fieldSelector !== undefined) {\n localVarQueryParameters['fieldSelector'] = ObjectSerializer.serialize(fieldSelector, \"string\");\n }\n if (includeUninitialized !== undefined) {\n localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, \"boolean\");\n }\n if (labelSelector !== undefined) {\n localVarQueryParameters['labelSelector'] = ObjectSerializer.serialize(labelSelector, \"string\");\n }\n if (limit !== undefined) {\n localVarQueryParameters['limit'] = ObjectSerializer.serialize(limit, \"number\");\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (resourceVersion !== undefined) {\n localVarQueryParameters['resourceVersion'] = ObjectSerializer.serialize(resourceVersion, \"string\");\n }\n if (timeoutSeconds !== undefined) {\n localVarQueryParameters['timeoutSeconds'] = ObjectSerializer.serialize(timeoutSeconds, \"number\");\n }\n if (watch !== undefined) {\n localVarQueryParameters['watch'] = ObjectSerializer.serialize(watch, \"boolean\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1beta2DeploymentList\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * list or watch objects of kind ControllerRevision\n * @param namespace object name and auth scope, such as for teams and projects\n * @param includeUninitialized If true, partially initialized resources are included in the response.\n * @param pretty If 'true', then the output is pretty printed.\n * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \\"next key\\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.\n * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything.\n * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything.\n * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.\n * @param resourceVersion When specified with a watch call, shows changes that occur after that particular version of a resource. Defaults to changes from the beginning of history. When specified for list: - if unset, then the result is returned from remote storage based on quorum-read flag; - if it's 0, then we simply return what we currently have in cache, no guarantee; - if set to non zero, then the result is at least as fresh as given rv.\n * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.\n * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.\n * @param {*} [options] Override http request options.\n */\n listNamespacedControllerRevision(namespace, includeUninitialized, pretty, _continue, fieldSelector, labelSelector, limit, resourceVersion, timeoutSeconds, watch, options = {}) {\n const localVarPath = this.basePath + '/apis/apps/v1beta2/namespaces/{namespace}/controllerrevisions'\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling listNamespacedControllerRevision.');\n }\n if (includeUninitialized !== undefined) {\n localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, \"boolean\");\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (_continue !== undefined) {\n localVarQueryParameters['continue'] = ObjectSerializer.serialize(_continue, \"string\");\n }\n if (fieldSelector !== undefined) {\n localVarQueryParameters['fieldSelector'] = ObjectSerializer.serialize(fieldSelector, \"string\");\n }\n if (labelSelector !== undefined) {\n localVarQueryParameters['labelSelector'] = ObjectSerializer.serialize(labelSelector, \"string\");\n }\n if (limit !== undefined) {\n localVarQueryParameters['limit'] = ObjectSerializer.serialize(limit, \"number\");\n }\n if (resourceVersion !== undefined) {\n localVarQueryParameters['resourceVersion'] = ObjectSerializer.serialize(resourceVersion, \"string\");\n }\n if (timeoutSeconds !== undefined) {\n localVarQueryParameters['timeoutSeconds'] = ObjectSerializer.serialize(timeoutSeconds, \"number\");\n }\n if (watch !== undefined) {\n localVarQueryParameters['watch'] = ObjectSerializer.serialize(watch, \"boolean\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1beta2ControllerRevisionList\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * list or watch objects of kind DaemonSet\n * @param namespace object name and auth scope, such as for teams and projects\n * @param includeUninitialized If true, partially initialized resources are included in the response.\n * @param pretty If 'true', then the output is pretty printed.\n * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \\"next key\\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.\n * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything.\n * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything.\n * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.\n * @param resourceVersion When specified with a watch call, shows changes that occur after that particular version of a resource. Defaults to changes from the beginning of history. When specified for list: - if unset, then the result is returned from remote storage based on quorum-read flag; - if it's 0, then we simply return what we currently have in cache, no guarantee; - if set to non zero, then the result is at least as fresh as given rv.\n * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.\n * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.\n * @param {*} [options] Override http request options.\n */\n listNamespacedDaemonSet(namespace, includeUninitialized, pretty, _continue, fieldSelector, labelSelector, limit, resourceVersion, timeoutSeconds, watch, options = {}) {\n const localVarPath = this.basePath + '/apis/apps/v1beta2/namespaces/{namespace}/daemonsets'\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling listNamespacedDaemonSet.');\n }\n if (includeUninitialized !== undefined) {\n localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, \"boolean\");\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (_continue !== undefined) {\n localVarQueryParameters['continue'] = ObjectSerializer.serialize(_continue, \"string\");\n }\n if (fieldSelector !== undefined) {\n localVarQueryParameters['fieldSelector'] = ObjectSerializer.serialize(fieldSelector, \"string\");\n }\n if (labelSelector !== undefined) {\n localVarQueryParameters['labelSelector'] = ObjectSerializer.serialize(labelSelector, \"string\");\n }\n if (limit !== undefined) {\n localVarQueryParameters['limit'] = ObjectSerializer.serialize(limit, \"number\");\n }\n if (resourceVersion !== undefined) {\n localVarQueryParameters['resourceVersion'] = ObjectSerializer.serialize(resourceVersion, \"string\");\n }\n if (timeoutSeconds !== undefined) {\n localVarQueryParameters['timeoutSeconds'] = ObjectSerializer.serialize(timeoutSeconds, \"number\");\n }\n if (watch !== undefined) {\n localVarQueryParameters['watch'] = ObjectSerializer.serialize(watch, \"boolean\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1beta2DaemonSetList\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * list or watch objects of kind Deployment\n * @param namespace object name and auth scope, such as for teams and projects\n * @param includeUninitialized If true, partially initialized resources are included in the response.\n * @param pretty If 'true', then the output is pretty printed.\n * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \\"next key\\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.\n * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything.\n * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything.\n * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.\n * @param resourceVersion When specified with a watch call, shows changes that occur after that particular version of a resource. Defaults to changes from the beginning of history. When specified for list: - if unset, then the result is returned from remote storage based on quorum-read flag; - if it's 0, then we simply return what we currently have in cache, no guarantee; - if set to non zero, then the result is at least as fresh as given rv.\n * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.\n * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.\n * @param {*} [options] Override http request options.\n */\n listNamespacedDeployment(namespace, includeUninitialized, pretty, _continue, fieldSelector, labelSelector, limit, resourceVersion, timeoutSeconds, watch, options = {}) {\n const localVarPath = this.basePath + '/apis/apps/v1beta2/namespaces/{namespace}/deployments'\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling listNamespacedDeployment.');\n }\n if (includeUninitialized !== undefined) {\n localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, \"boolean\");\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (_continue !== undefined) {\n localVarQueryParameters['continue'] = ObjectSerializer.serialize(_continue, \"string\");\n }\n if (fieldSelector !== undefined) {\n localVarQueryParameters['fieldSelector'] = ObjectSerializer.serialize(fieldSelector, \"string\");\n }\n if (labelSelector !== undefined) {\n localVarQueryParameters['labelSelector'] = ObjectSerializer.serialize(labelSelector, \"string\");\n }\n if (limit !== undefined) {\n localVarQueryParameters['limit'] = ObjectSerializer.serialize(limit, \"number\");\n }\n if (resourceVersion !== undefined) {\n localVarQueryParameters['resourceVersion'] = ObjectSerializer.serialize(resourceVersion, \"string\");\n }\n if (timeoutSeconds !== undefined) {\n localVarQueryParameters['timeoutSeconds'] = ObjectSerializer.serialize(timeoutSeconds, \"number\");\n }\n if (watch !== undefined) {\n localVarQueryParameters['watch'] = ObjectSerializer.serialize(watch, \"boolean\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1beta2DeploymentList\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * list or watch objects of kind ReplicaSet\n * @param namespace object name and auth scope, such as for teams and projects\n * @param includeUninitialized If true, partially initialized resources are included in the response.\n * @param pretty If 'true', then the output is pretty printed.\n * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \\"next key\\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.\n * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything.\n * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything.\n * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.\n * @param resourceVersion When specified with a watch call, shows changes that occur after that particular version of a resource. Defaults to changes from the beginning of history. When specified for list: - if unset, then the result is returned from remote storage based on quorum-read flag; - if it's 0, then we simply return what we currently have in cache, no guarantee; - if set to non zero, then the result is at least as fresh as given rv.\n * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.\n * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.\n * @param {*} [options] Override http request options.\n */\n listNamespacedReplicaSet(namespace, includeUninitialized, pretty, _continue, fieldSelector, labelSelector, limit, resourceVersion, timeoutSeconds, watch, options = {}) {\n const localVarPath = this.basePath + '/apis/apps/v1beta2/namespaces/{namespace}/replicasets'\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling listNamespacedReplicaSet.');\n }\n if (includeUninitialized !== undefined) {\n localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, \"boolean\");\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (_continue !== undefined) {\n localVarQueryParameters['continue'] = ObjectSerializer.serialize(_continue, \"string\");\n }\n if (fieldSelector !== undefined) {\n localVarQueryParameters['fieldSelector'] = ObjectSerializer.serialize(fieldSelector, \"string\");\n }\n if (labelSelector !== undefined) {\n localVarQueryParameters['labelSelector'] = ObjectSerializer.serialize(labelSelector, \"string\");\n }\n if (limit !== undefined) {\n localVarQueryParameters['limit'] = ObjectSerializer.serialize(limit, \"number\");\n }\n if (resourceVersion !== undefined) {\n localVarQueryParameters['resourceVersion'] = ObjectSerializer.serialize(resourceVersion, \"string\");\n }\n if (timeoutSeconds !== undefined) {\n localVarQueryParameters['timeoutSeconds'] = ObjectSerializer.serialize(timeoutSeconds, \"number\");\n }\n if (watch !== undefined) {\n localVarQueryParameters['watch'] = ObjectSerializer.serialize(watch, \"boolean\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1beta2ReplicaSetList\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * list or watch objects of kind StatefulSet\n * @param namespace object name and auth scope, such as for teams and projects\n * @param includeUninitialized If true, partially initialized resources are included in the response.\n * @param pretty If 'true', then the output is pretty printed.\n * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \\"next key\\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.\n * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything.\n * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything.\n * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.\n * @param resourceVersion When specified with a watch call, shows changes that occur after that particular version of a resource. Defaults to changes from the beginning of history. When specified for list: - if unset, then the result is returned from remote storage based on quorum-read flag; - if it's 0, then we simply return what we currently have in cache, no guarantee; - if set to non zero, then the result is at least as fresh as given rv.\n * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.\n * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.\n * @param {*} [options] Override http request options.\n */\n listNamespacedStatefulSet(namespace, includeUninitialized, pretty, _continue, fieldSelector, labelSelector, limit, resourceVersion, timeoutSeconds, watch, options = {}) {\n const localVarPath = this.basePath + '/apis/apps/v1beta2/namespaces/{namespace}/statefulsets'\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling listNamespacedStatefulSet.');\n }\n if (includeUninitialized !== undefined) {\n localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, \"boolean\");\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (_continue !== undefined) {\n localVarQueryParameters['continue'] = ObjectSerializer.serialize(_continue, \"string\");\n }\n if (fieldSelector !== undefined) {\n localVarQueryParameters['fieldSelector'] = ObjectSerializer.serialize(fieldSelector, \"string\");\n }\n if (labelSelector !== undefined) {\n localVarQueryParameters['labelSelector'] = ObjectSerializer.serialize(labelSelector, \"string\");\n }\n if (limit !== undefined) {\n localVarQueryParameters['limit'] = ObjectSerializer.serialize(limit, \"number\");\n }\n if (resourceVersion !== undefined) {\n localVarQueryParameters['resourceVersion'] = ObjectSerializer.serialize(resourceVersion, \"string\");\n }\n if (timeoutSeconds !== undefined) {\n localVarQueryParameters['timeoutSeconds'] = ObjectSerializer.serialize(timeoutSeconds, \"number\");\n }\n if (watch !== undefined) {\n localVarQueryParameters['watch'] = ObjectSerializer.serialize(watch, \"boolean\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1beta2StatefulSetList\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * list or watch objects of kind ReplicaSet\n * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \\"next key\\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.\n * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything.\n * @param includeUninitialized If true, partially initialized resources are included in the response.\n * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything.\n * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.\n * @param pretty If 'true', then the output is pretty printed.\n * @param resourceVersion When specified with a watch call, shows changes that occur after that particular version of a resource. Defaults to changes from the beginning of history. When specified for list: - if unset, then the result is returned from remote storage based on quorum-read flag; - if it's 0, then we simply return what we currently have in cache, no guarantee; - if set to non zero, then the result is at least as fresh as given rv.\n * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.\n * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.\n * @param {*} [options] Override http request options.\n */\n listReplicaSetForAllNamespaces(_continue, fieldSelector, includeUninitialized, labelSelector, limit, pretty, resourceVersion, timeoutSeconds, watch, options = {}) {\n const localVarPath = this.basePath + '/apis/apps/v1beta2/replicasets';\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n if (_continue !== undefined) {\n localVarQueryParameters['continue'] = ObjectSerializer.serialize(_continue, \"string\");\n }\n if (fieldSelector !== undefined) {\n localVarQueryParameters['fieldSelector'] = ObjectSerializer.serialize(fieldSelector, \"string\");\n }\n if (includeUninitialized !== undefined) {\n localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, \"boolean\");\n }\n if (labelSelector !== undefined) {\n localVarQueryParameters['labelSelector'] = ObjectSerializer.serialize(labelSelector, \"string\");\n }\n if (limit !== undefined) {\n localVarQueryParameters['limit'] = ObjectSerializer.serialize(limit, \"number\");\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (resourceVersion !== undefined) {\n localVarQueryParameters['resourceVersion'] = ObjectSerializer.serialize(resourceVersion, \"string\");\n }\n if (timeoutSeconds !== undefined) {\n localVarQueryParameters['timeoutSeconds'] = ObjectSerializer.serialize(timeoutSeconds, \"number\");\n }\n if (watch !== undefined) {\n localVarQueryParameters['watch'] = ObjectSerializer.serialize(watch, \"boolean\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1beta2ReplicaSetList\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * list or watch objects of kind StatefulSet\n * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \\"next key\\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.\n * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything.\n * @param includeUninitialized If true, partially initialized resources are included in the response.\n * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything.\n * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.\n * @param pretty If 'true', then the output is pretty printed.\n * @param resourceVersion When specified with a watch call, shows changes that occur after that particular version of a resource. Defaults to changes from the beginning of history. When specified for list: - if unset, then the result is returned from remote storage based on quorum-read flag; - if it's 0, then we simply return what we currently have in cache, no guarantee; - if set to non zero, then the result is at least as fresh as given rv.\n * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.\n * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.\n * @param {*} [options] Override http request options.\n */\n listStatefulSetForAllNamespaces(_continue, fieldSelector, includeUninitialized, labelSelector, limit, pretty, resourceVersion, timeoutSeconds, watch, options = {}) {\n const localVarPath = this.basePath + '/apis/apps/v1beta2/statefulsets';\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n if (_continue !== undefined) {\n localVarQueryParameters['continue'] = ObjectSerializer.serialize(_continue, \"string\");\n }\n if (fieldSelector !== undefined) {\n localVarQueryParameters['fieldSelector'] = ObjectSerializer.serialize(fieldSelector, \"string\");\n }\n if (includeUninitialized !== undefined) {\n localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, \"boolean\");\n }\n if (labelSelector !== undefined) {\n localVarQueryParameters['labelSelector'] = ObjectSerializer.serialize(labelSelector, \"string\");\n }\n if (limit !== undefined) {\n localVarQueryParameters['limit'] = ObjectSerializer.serialize(limit, \"number\");\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (resourceVersion !== undefined) {\n localVarQueryParameters['resourceVersion'] = ObjectSerializer.serialize(resourceVersion, \"string\");\n }\n if (timeoutSeconds !== undefined) {\n localVarQueryParameters['timeoutSeconds'] = ObjectSerializer.serialize(timeoutSeconds, \"number\");\n }\n if (watch !== undefined) {\n localVarQueryParameters['watch'] = ObjectSerializer.serialize(watch, \"boolean\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1beta2StatefulSetList\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * partially update the specified ControllerRevision\n * @param name name of the ControllerRevision\n * @param namespace object name and auth scope, such as for teams and projects\n * @param body\n * @param pretty If 'true', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param {*} [options] Override http request options.\n */\n patchNamespacedControllerRevision(name, namespace, body, pretty, dryRun, options = {}) {\n const localVarPath = this.basePath + '/apis/apps/v1beta2/namespaces/{namespace}/controllerrevisions/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling patchNamespacedControllerRevision.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling patchNamespacedControllerRevision.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling patchNamespacedControllerRevision.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'PATCH',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: ObjectSerializer.serialize(body, \"any\")\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1beta2ControllerRevision\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * partially update the specified DaemonSet\n * @param name name of the DaemonSet\n * @param namespace object name and auth scope, such as for teams and projects\n * @param body\n * @param pretty If 'true', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param {*} [options] Override http request options.\n */\n patchNamespacedDaemonSet(name, namespace, body, pretty, dryRun, options = {}) {\n const localVarPath = this.basePath + '/apis/apps/v1beta2/namespaces/{namespace}/daemonsets/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling patchNamespacedDaemonSet.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling patchNamespacedDaemonSet.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling patchNamespacedDaemonSet.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'PATCH',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: ObjectSerializer.serialize(body, \"any\")\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1beta2DaemonSet\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * partially update status of the specified DaemonSet\n * @param name name of the DaemonSet\n * @param namespace object name and auth scope, such as for teams and projects\n * @param body\n * @param pretty If 'true', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param {*} [options] Override http request options.\n */\n patchNamespacedDaemonSetStatus(name, namespace, body, pretty, dryRun, options = {}) {\n const localVarPath = this.basePath + '/apis/apps/v1beta2/namespaces/{namespace}/daemonsets/{name}/status'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling patchNamespacedDaemonSetStatus.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling patchNamespacedDaemonSetStatus.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling patchNamespacedDaemonSetStatus.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'PATCH',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: ObjectSerializer.serialize(body, \"any\")\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1beta2DaemonSet\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * partially update the specified Deployment\n * @param name name of the Deployment\n * @param namespace object name and auth scope, such as for teams and projects\n * @param body\n * @param pretty If 'true', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param {*} [options] Override http request options.\n */\n patchNamespacedDeployment(name, namespace, body, pretty, dryRun, options = {}) {\n const localVarPath = this.basePath + '/apis/apps/v1beta2/namespaces/{namespace}/deployments/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling patchNamespacedDeployment.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling patchNamespacedDeployment.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling patchNamespacedDeployment.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'PATCH',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: ObjectSerializer.serialize(body, \"any\")\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1beta2Deployment\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * partially update scale of the specified Deployment\n * @param name name of the Scale\n * @param namespace object name and auth scope, such as for teams and projects\n * @param body\n * @param pretty If 'true', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param {*} [options] Override http request options.\n */\n patchNamespacedDeploymentScale(name, namespace, body, pretty, dryRun, options = {}) {\n const localVarPath = this.basePath + '/apis/apps/v1beta2/namespaces/{namespace}/deployments/{name}/scale'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling patchNamespacedDeploymentScale.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling patchNamespacedDeploymentScale.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling patchNamespacedDeploymentScale.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'PATCH',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: ObjectSerializer.serialize(body, \"any\")\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1beta2Scale\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * partially update status of the specified Deployment\n * @param name name of the Deployment\n * @param namespace object name and auth scope, such as for teams and projects\n * @param body\n * @param pretty If 'true', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param {*} [options] Override http request options.\n */\n patchNamespacedDeploymentStatus(name, namespace, body, pretty, dryRun, options = {}) {\n const localVarPath = this.basePath + '/apis/apps/v1beta2/namespaces/{namespace}/deployments/{name}/status'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling patchNamespacedDeploymentStatus.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling patchNamespacedDeploymentStatus.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling patchNamespacedDeploymentStatus.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'PATCH',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: ObjectSerializer.serialize(body, \"any\")\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1beta2Deployment\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * partially update the specified ReplicaSet\n * @param name name of the ReplicaSet\n * @param namespace object name and auth scope, such as for teams and projects\n * @param body\n * @param pretty If 'true', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param {*} [options] Override http request options.\n */\n patchNamespacedReplicaSet(name, namespace, body, pretty, dryRun, options = {}) {\n const localVarPath = this.basePath + '/apis/apps/v1beta2/namespaces/{namespace}/replicasets/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling patchNamespacedReplicaSet.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling patchNamespacedReplicaSet.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling patchNamespacedReplicaSet.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'PATCH',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: ObjectSerializer.serialize(body, \"any\")\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1beta2ReplicaSet\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * partially update scale of the specified ReplicaSet\n * @param name name of the Scale\n * @param namespace object name and auth scope, such as for teams and projects\n * @param body\n * @param pretty If 'true', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param {*} [options] Override http request options.\n */\n patchNamespacedReplicaSetScale(name, namespace, body, pretty, dryRun, options = {}) {\n const localVarPath = this.basePath + '/apis/apps/v1beta2/namespaces/{namespace}/replicasets/{name}/scale'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling patchNamespacedReplicaSetScale.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling patchNamespacedReplicaSetScale.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling patchNamespacedReplicaSetScale.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'PATCH',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: ObjectSerializer.serialize(body, \"any\")\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1beta2Scale\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * partially update status of the specified ReplicaSet\n * @param name name of the ReplicaSet\n * @param namespace object name and auth scope, such as for teams and projects\n * @param body\n * @param pretty If 'true', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param {*} [options] Override http request options.\n */\n patchNamespacedReplicaSetStatus(name, namespace, body, pretty, dryRun, options = {}) {\n const localVarPath = this.basePath + '/apis/apps/v1beta2/namespaces/{namespace}/replicasets/{name}/status'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling patchNamespacedReplicaSetStatus.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling patchNamespacedReplicaSetStatus.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling patchNamespacedReplicaSetStatus.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'PATCH',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: ObjectSerializer.serialize(body, \"any\")\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1beta2ReplicaSet\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * partially update the specified StatefulSet\n * @param name name of the StatefulSet\n * @param namespace object name and auth scope, such as for teams and projects\n * @param body\n * @param pretty If 'true', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param {*} [options] Override http request options.\n */\n patchNamespacedStatefulSet(name, namespace, body, pretty, dryRun, options = {}) {\n const localVarPath = this.basePath + '/apis/apps/v1beta2/namespaces/{namespace}/statefulsets/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling patchNamespacedStatefulSet.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling patchNamespacedStatefulSet.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling patchNamespacedStatefulSet.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'PATCH',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: ObjectSerializer.serialize(body, \"any\")\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1beta2StatefulSet\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * partially update scale of the specified StatefulSet\n * @param name name of the Scale\n * @param namespace object name and auth scope, such as for teams and projects\n * @param body\n * @param pretty If 'true', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param {*} [options] Override http request options.\n */\n patchNamespacedStatefulSetScale(name, namespace, body, pretty, dryRun, options = {}) {\n const localVarPath = this.basePath + '/apis/apps/v1beta2/namespaces/{namespace}/statefulsets/{name}/scale'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling patchNamespacedStatefulSetScale.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling patchNamespacedStatefulSetScale.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling patchNamespacedStatefulSetScale.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'PATCH',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: ObjectSerializer.serialize(body, \"any\")\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1beta2Scale\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * partially update status of the specified StatefulSet\n * @param name name of the StatefulSet\n * @param namespace object name and auth scope, such as for teams and projects\n * @param body\n * @param pretty If 'true', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param {*} [options] Override http request options.\n */\n patchNamespacedStatefulSetStatus(name, namespace, body, pretty, dryRun, options = {}) {\n const localVarPath = this.basePath + '/apis/apps/v1beta2/namespaces/{namespace}/statefulsets/{name}/status'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling patchNamespacedStatefulSetStatus.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling patchNamespacedStatefulSetStatus.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling patchNamespacedStatefulSetStatus.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'PATCH',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: ObjectSerializer.serialize(body, \"any\")\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1beta2StatefulSet\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * read the specified ControllerRevision\n * @param name name of the ControllerRevision\n * @param namespace object name and auth scope, such as for teams and projects\n * @param pretty If 'true', then the output is pretty printed.\n * @param exact Should the export be exact. Exact export maintains cluster-specific fields like 'Namespace'.\n * @param _export Should this value be exported. Export strips fields that a user can not specify.\n * @param {*} [options] Override http request options.\n */\n readNamespacedControllerRevision(name, namespace, pretty, exact, _export, options = {}) {\n const localVarPath = this.basePath + '/apis/apps/v1beta2/namespaces/{namespace}/controllerrevisions/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling readNamespacedControllerRevision.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling readNamespacedControllerRevision.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (exact !== undefined) {\n localVarQueryParameters['exact'] = ObjectSerializer.serialize(exact, \"boolean\");\n }\n if (_export !== undefined) {\n localVarQueryParameters['export'] = ObjectSerializer.serialize(_export, \"boolean\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1beta2ControllerRevision\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * read the specified DaemonSet\n * @param name name of the DaemonSet\n * @param namespace object name and auth scope, such as for teams and projects\n * @param pretty If 'true', then the output is pretty printed.\n * @param exact Should the export be exact. Exact export maintains cluster-specific fields like 'Namespace'.\n * @param _export Should this value be exported. Export strips fields that a user can not specify.\n * @param {*} [options] Override http request options.\n */\n readNamespacedDaemonSet(name, namespace, pretty, exact, _export, options = {}) {\n const localVarPath = this.basePath + '/apis/apps/v1beta2/namespaces/{namespace}/daemonsets/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling readNamespacedDaemonSet.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling readNamespacedDaemonSet.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (exact !== undefined) {\n localVarQueryParameters['exact'] = ObjectSerializer.serialize(exact, \"boolean\");\n }\n if (_export !== undefined) {\n localVarQueryParameters['export'] = ObjectSerializer.serialize(_export, \"boolean\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1beta2DaemonSet\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * read status of the specified DaemonSet\n * @param name name of the DaemonSet\n * @param namespace object name and auth scope, such as for teams and projects\n * @param pretty If 'true', then the output is pretty printed.\n * @param {*} [options] Override http request options.\n */\n readNamespacedDaemonSetStatus(name, namespace, pretty, options = {}) {\n const localVarPath = this.basePath + '/apis/apps/v1beta2/namespaces/{namespace}/daemonsets/{name}/status'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling readNamespacedDaemonSetStatus.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling readNamespacedDaemonSetStatus.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1beta2DaemonSet\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * read the specified Deployment\n * @param name name of the Deployment\n * @param namespace object name and auth scope, such as for teams and projects\n * @param pretty If 'true', then the output is pretty printed.\n * @param exact Should the export be exact. Exact export maintains cluster-specific fields like 'Namespace'.\n * @param _export Should this value be exported. Export strips fields that a user can not specify.\n * @param {*} [options] Override http request options.\n */\n readNamespacedDeployment(name, namespace, pretty, exact, _export, options = {}) {\n const localVarPath = this.basePath + '/apis/apps/v1beta2/namespaces/{namespace}/deployments/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling readNamespacedDeployment.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling readNamespacedDeployment.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (exact !== undefined) {\n localVarQueryParameters['exact'] = ObjectSerializer.serialize(exact, \"boolean\");\n }\n if (_export !== undefined) {\n localVarQueryParameters['export'] = ObjectSerializer.serialize(_export, \"boolean\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1beta2Deployment\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * read scale of the specified Deployment\n * @param name name of the Scale\n * @param namespace object name and auth scope, such as for teams and projects\n * @param pretty If 'true', then the output is pretty printed.\n * @param {*} [options] Override http request options.\n */\n readNamespacedDeploymentScale(name, namespace, pretty, options = {}) {\n const localVarPath = this.basePath + '/apis/apps/v1beta2/namespaces/{namespace}/deployments/{name}/scale'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling readNamespacedDeploymentScale.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling readNamespacedDeploymentScale.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1beta2Scale\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * read status of the specified Deployment\n * @param name name of the Deployment\n * @param namespace object name and auth scope, such as for teams and projects\n * @param pretty If 'true', then the output is pretty printed.\n * @param {*} [options] Override http request options.\n */\n readNamespacedDeploymentStatus(name, namespace, pretty, options = {}) {\n const localVarPath = this.basePath + '/apis/apps/v1beta2/namespaces/{namespace}/deployments/{name}/status'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling readNamespacedDeploymentStatus.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling readNamespacedDeploymentStatus.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1beta2Deployment\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * read the specified ReplicaSet\n * @param name name of the ReplicaSet\n * @param namespace object name and auth scope, such as for teams and projects\n * @param pretty If 'true', then the output is pretty printed.\n * @param exact Should the export be exact. Exact export maintains cluster-specific fields like 'Namespace'.\n * @param _export Should this value be exported. Export strips fields that a user can not specify.\n * @param {*} [options] Override http request options.\n */\n readNamespacedReplicaSet(name, namespace, pretty, exact, _export, options = {}) {\n const localVarPath = this.basePath + '/apis/apps/v1beta2/namespaces/{namespace}/replicasets/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling readNamespacedReplicaSet.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling readNamespacedReplicaSet.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (exact !== undefined) {\n localVarQueryParameters['exact'] = ObjectSerializer.serialize(exact, \"boolean\");\n }\n if (_export !== undefined) {\n localVarQueryParameters['export'] = ObjectSerializer.serialize(_export, \"boolean\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1beta2ReplicaSet\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * read scale of the specified ReplicaSet\n * @param name name of the Scale\n * @param namespace object name and auth scope, such as for teams and projects\n * @param pretty If 'true', then the output is pretty printed.\n * @param {*} [options] Override http request options.\n */\n readNamespacedReplicaSetScale(name, namespace, pretty, options = {}) {\n const localVarPath = this.basePath + '/apis/apps/v1beta2/namespaces/{namespace}/replicasets/{name}/scale'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling readNamespacedReplicaSetScale.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling readNamespacedReplicaSetScale.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1beta2Scale\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * read status of the specified ReplicaSet\n * @param name name of the ReplicaSet\n * @param namespace object name and auth scope, such as for teams and projects\n * @param pretty If 'true', then the output is pretty printed.\n * @param {*} [options] Override http request options.\n */\n readNamespacedReplicaSetStatus(name, namespace, pretty, options = {}) {\n const localVarPath = this.basePath + '/apis/apps/v1beta2/namespaces/{namespace}/replicasets/{name}/status'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling readNamespacedReplicaSetStatus.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling readNamespacedReplicaSetStatus.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1beta2ReplicaSet\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * read the specified StatefulSet\n * @param name name of the StatefulSet\n * @param namespace object name and auth scope, such as for teams and projects\n * @param pretty If 'true', then the output is pretty printed.\n * @param exact Should the export be exact. Exact export maintains cluster-specific fields like 'Namespace'.\n * @param _export Should this value be exported. Export strips fields that a user can not specify.\n * @param {*} [options] Override http request options.\n */\n readNamespacedStatefulSet(name, namespace, pretty, exact, _export, options = {}) {\n const localVarPath = this.basePath + '/apis/apps/v1beta2/namespaces/{namespace}/statefulsets/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling readNamespacedStatefulSet.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling readNamespacedStatefulSet.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (exact !== undefined) {\n localVarQueryParameters['exact'] = ObjectSerializer.serialize(exact, \"boolean\");\n }\n if (_export !== undefined) {\n localVarQueryParameters['export'] = ObjectSerializer.serialize(_export, \"boolean\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1beta2StatefulSet\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * read scale of the specified StatefulSet\n * @param name name of the Scale\n * @param namespace object name and auth scope, such as for teams and projects\n * @param pretty If 'true', then the output is pretty printed.\n * @param {*} [options] Override http request options.\n */\n readNamespacedStatefulSetScale(name, namespace, pretty, options = {}) {\n const localVarPath = this.basePath + '/apis/apps/v1beta2/namespaces/{namespace}/statefulsets/{name}/scale'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling readNamespacedStatefulSetScale.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling readNamespacedStatefulSetScale.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1beta2Scale\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * read status of the specified StatefulSet\n * @param name name of the StatefulSet\n * @param namespace object name and auth scope, such as for teams and projects\n * @param pretty If 'true', then the output is pretty printed.\n * @param {*} [options] Override http request options.\n */\n readNamespacedStatefulSetStatus(name, namespace, pretty, options = {}) {\n const localVarPath = this.basePath + '/apis/apps/v1beta2/namespaces/{namespace}/statefulsets/{name}/status'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling readNamespacedStatefulSetStatus.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling readNamespacedStatefulSetStatus.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1beta2StatefulSet\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * replace the specified ControllerRevision\n * @param name name of the ControllerRevision\n * @param namespace object name and auth scope, such as for teams and projects\n * @param body\n * @param pretty If 'true', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param {*} [options] Override http request options.\n */\n replaceNamespacedControllerRevision(name, namespace, body, pretty, dryRun, options = {}) {\n const localVarPath = this.basePath + '/apis/apps/v1beta2/namespaces/{namespace}/controllerrevisions/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling replaceNamespacedControllerRevision.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling replaceNamespacedControllerRevision.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling replaceNamespacedControllerRevision.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'PUT',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: ObjectSerializer.serialize(body, \"V1beta2ControllerRevision\")\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1beta2ControllerRevision\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * replace the specified DaemonSet\n * @param name name of the DaemonSet\n * @param namespace object name and auth scope, such as for teams and projects\n * @param body\n * @param pretty If 'true', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param {*} [options] Override http request options.\n */\n replaceNamespacedDaemonSet(name, namespace, body, pretty, dryRun, options = {}) {\n const localVarPath = this.basePath + '/apis/apps/v1beta2/namespaces/{namespace}/daemonsets/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling replaceNamespacedDaemonSet.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling replaceNamespacedDaemonSet.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling replaceNamespacedDaemonSet.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'PUT',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: ObjectSerializer.serialize(body, \"V1beta2DaemonSet\")\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1beta2DaemonSet\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * replace status of the specified DaemonSet\n * @param name name of the DaemonSet\n * @param namespace object name and auth scope, such as for teams and projects\n * @param body\n * @param pretty If 'true', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param {*} [options] Override http request options.\n */\n replaceNamespacedDaemonSetStatus(name, namespace, body, pretty, dryRun, options = {}) {\n const localVarPath = this.basePath + '/apis/apps/v1beta2/namespaces/{namespace}/daemonsets/{name}/status'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling replaceNamespacedDaemonSetStatus.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling replaceNamespacedDaemonSetStatus.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling replaceNamespacedDaemonSetStatus.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'PUT',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: ObjectSerializer.serialize(body, \"V1beta2DaemonSet\")\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1beta2DaemonSet\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * replace the specified Deployment\n * @param name name of the Deployment\n * @param namespace object name and auth scope, such as for teams and projects\n * @param body\n * @param pretty If 'true', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param {*} [options] Override http request options.\n */\n replaceNamespacedDeployment(name, namespace, body, pretty, dryRun, options = {}) {\n const localVarPath = this.basePath + '/apis/apps/v1beta2/namespaces/{namespace}/deployments/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling replaceNamespacedDeployment.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling replaceNamespacedDeployment.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling replaceNamespacedDeployment.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'PUT',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: ObjectSerializer.serialize(body, \"V1beta2Deployment\")\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1beta2Deployment\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * replace scale of the specified Deployment\n * @param name name of the Scale\n * @param namespace object name and auth scope, such as for teams and projects\n * @param body\n * @param pretty If 'true', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param {*} [options] Override http request options.\n */\n replaceNamespacedDeploymentScale(name, namespace, body, pretty, dryRun, options = {}) {\n const localVarPath = this.basePath + '/apis/apps/v1beta2/namespaces/{namespace}/deployments/{name}/scale'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling replaceNamespacedDeploymentScale.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling replaceNamespacedDeploymentScale.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling replaceNamespacedDeploymentScale.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'PUT',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: ObjectSerializer.serialize(body, \"V1beta2Scale\")\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1beta2Scale\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * replace status of the specified Deployment\n * @param name name of the Deployment\n * @param namespace object name and auth scope, such as for teams and projects\n * @param body\n * @param pretty If 'true', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param {*} [options] Override http request options.\n */\n replaceNamespacedDeploymentStatus(name, namespace, body, pretty, dryRun, options = {}) {\n const localVarPath = this.basePath + '/apis/apps/v1beta2/namespaces/{namespace}/deployments/{name}/status'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling replaceNamespacedDeploymentStatus.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling replaceNamespacedDeploymentStatus.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling replaceNamespacedDeploymentStatus.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'PUT',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: ObjectSerializer.serialize(body, \"V1beta2Deployment\")\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1beta2Deployment\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * replace the specified ReplicaSet\n * @param name name of the ReplicaSet\n * @param namespace object name and auth scope, such as for teams and projects\n * @param body\n * @param pretty If 'true', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param {*} [options] Override http request options.\n */\n replaceNamespacedReplicaSet(name, namespace, body, pretty, dryRun, options = {}) {\n const localVarPath = this.basePath + '/apis/apps/v1beta2/namespaces/{namespace}/replicasets/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling replaceNamespacedReplicaSet.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling replaceNamespacedReplicaSet.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling replaceNamespacedReplicaSet.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'PUT',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: ObjectSerializer.serialize(body, \"V1beta2ReplicaSet\")\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1beta2ReplicaSet\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * replace scale of the specified ReplicaSet\n * @param name name of the Scale\n * @param namespace object name and auth scope, such as for teams and projects\n * @param body\n * @param pretty If 'true', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param {*} [options] Override http request options.\n */\n replaceNamespacedReplicaSetScale(name, namespace, body, pretty, dryRun, options = {}) {\n const localVarPath = this.basePath + '/apis/apps/v1beta2/namespaces/{namespace}/replicasets/{name}/scale'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling replaceNamespacedReplicaSetScale.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling replaceNamespacedReplicaSetScale.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling replaceNamespacedReplicaSetScale.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'PUT',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: ObjectSerializer.serialize(body, \"V1beta2Scale\")\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1beta2Scale\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * replace status of the specified ReplicaSet\n * @param name name of the ReplicaSet\n * @param namespace object name and auth scope, such as for teams and projects\n * @param body\n * @param pretty If 'true', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param {*} [options] Override http request options.\n */\n replaceNamespacedReplicaSetStatus(name, namespace, body, pretty, dryRun, options = {}) {\n const localVarPath = this.basePath + '/apis/apps/v1beta2/namespaces/{namespace}/replicasets/{name}/status'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling replaceNamespacedReplicaSetStatus.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling replaceNamespacedReplicaSetStatus.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling replaceNamespacedReplicaSetStatus.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'PUT',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: ObjectSerializer.serialize(body, \"V1beta2ReplicaSet\")\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1beta2ReplicaSet\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * replace the specified StatefulSet\n * @param name name of the StatefulSet\n * @param namespace object name and auth scope, such as for teams and projects\n * @param body\n * @param pretty If 'true', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param {*} [options] Override http request options.\n */\n replaceNamespacedStatefulSet(name, namespace, body, pretty, dryRun, options = {}) {\n const localVarPath = this.basePath + '/apis/apps/v1beta2/namespaces/{namespace}/statefulsets/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling replaceNamespacedStatefulSet.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling replaceNamespacedStatefulSet.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling replaceNamespacedStatefulSet.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'PUT',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: ObjectSerializer.serialize(body, \"V1beta2StatefulSet\")\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1beta2StatefulSet\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * replace scale of the specified StatefulSet\n * @param name name of the Scale\n * @param namespace object name and auth scope, such as for teams and projects\n * @param body\n * @param pretty If 'true', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param {*} [options] Override http request options.\n */\n replaceNamespacedStatefulSetScale(name, namespace, body, pretty, dryRun, options = {}) {\n const localVarPath = this.basePath + '/apis/apps/v1beta2/namespaces/{namespace}/statefulsets/{name}/scale'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling replaceNamespacedStatefulSetScale.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling replaceNamespacedStatefulSetScale.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling replaceNamespacedStatefulSetScale.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'PUT',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: ObjectSerializer.serialize(body, \"V1beta2Scale\")\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1beta2Scale\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * replace status of the specified StatefulSet\n * @param name name of the StatefulSet\n * @param namespace object name and auth scope, such as for teams and projects\n * @param body\n * @param pretty If 'true', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param {*} [options] Override http request options.\n */\n replaceNamespacedStatefulSetStatus(name, namespace, body, pretty, dryRun, options = {}) {\n const localVarPath = this.basePath + '/apis/apps/v1beta2/namespaces/{namespace}/statefulsets/{name}/status'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling replaceNamespacedStatefulSetStatus.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling replaceNamespacedStatefulSetStatus.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling replaceNamespacedStatefulSetStatus.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'PUT',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: ObjectSerializer.serialize(body, \"V1beta2StatefulSet\")\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1beta2StatefulSet\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n}\nexports.AppsV1beta2Api = AppsV1beta2Api;\nvar AuditregistrationApiApiKeys;\n(function (AuditregistrationApiApiKeys) {\n AuditregistrationApiApiKeys[AuditregistrationApiApiKeys[\"BearerToken\"] = 0] = \"BearerToken\";\n})(AuditregistrationApiApiKeys = exports.AuditregistrationApiApiKeys || (exports.AuditregistrationApiApiKeys = {}));\nclass AuditregistrationApi {\n constructor(basePathOrUsername, password, basePath) {\n this._basePath = defaultBasePath;\n this.defaultHeaders = {};\n this._useQuerystring = false;\n this.authentications = {\n 'default': new VoidAuth(),\n 'BearerToken': new ApiKeyAuth('header', 'authorization'),\n };\n if (password) {\n if (basePath) {\n this.basePath = basePath;\n }\n }\n else {\n if (basePathOrUsername) {\n this.basePath = basePathOrUsername;\n }\n }\n }\n set useQuerystring(value) {\n this._useQuerystring = value;\n }\n set basePath(basePath) {\n this._basePath = basePath;\n }\n get basePath() {\n return this._basePath;\n }\n setDefaultAuthentication(auth) {\n this.authentications.default = auth;\n }\n setApiKey(key, value) {\n this.authentications[AuditregistrationApiApiKeys[key]].apiKey = value;\n }\n /**\n * get information of a group\n * @param {*} [options] Override http request options.\n */\n getAPIGroup(options = {}) {\n const localVarPath = this.basePath + '/apis/auditregistration.k8s.io/';\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1APIGroup\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n}\nexports.AuditregistrationApi = AuditregistrationApi;\nvar AuditregistrationV1alpha1ApiApiKeys;\n(function (AuditregistrationV1alpha1ApiApiKeys) {\n AuditregistrationV1alpha1ApiApiKeys[AuditregistrationV1alpha1ApiApiKeys[\"BearerToken\"] = 0] = \"BearerToken\";\n})(AuditregistrationV1alpha1ApiApiKeys = exports.AuditregistrationV1alpha1ApiApiKeys || (exports.AuditregistrationV1alpha1ApiApiKeys = {}));\nclass AuditregistrationV1alpha1Api {\n constructor(basePathOrUsername, password, basePath) {\n this._basePath = defaultBasePath;\n this.defaultHeaders = {};\n this._useQuerystring = false;\n this.authentications = {\n 'default': new VoidAuth(),\n 'BearerToken': new ApiKeyAuth('header', 'authorization'),\n };\n if (password) {\n if (basePath) {\n this.basePath = basePath;\n }\n }\n else {\n if (basePathOrUsername) {\n this.basePath = basePathOrUsername;\n }\n }\n }\n set useQuerystring(value) {\n this._useQuerystring = value;\n }\n set basePath(basePath) {\n this._basePath = basePath;\n }\n get basePath() {\n return this._basePath;\n }\n setDefaultAuthentication(auth) {\n this.authentications.default = auth;\n }\n setApiKey(key, value) {\n this.authentications[AuditregistrationV1alpha1ApiApiKeys[key]].apiKey = value;\n }\n /**\n * create an AuditSink\n * @param body\n * @param includeUninitialized If true, partially initialized resources are included in the response.\n * @param pretty If 'true', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param {*} [options] Override http request options.\n */\n createAuditSink(body, includeUninitialized, pretty, dryRun, options = {}) {\n const localVarPath = this.basePath + '/apis/auditregistration.k8s.io/v1alpha1/auditsinks';\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling createAuditSink.');\n }\n if (includeUninitialized !== undefined) {\n localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, \"boolean\");\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'POST',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: ObjectSerializer.serialize(body, \"V1alpha1AuditSink\")\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1alpha1AuditSink\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * delete an AuditSink\n * @param name name of the AuditSink\n * @param pretty If 'true', then the output is pretty printed.\n * @param body\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param gracePeriodSeconds The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately.\n * @param orphanDependents Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \\"orphan\\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both.\n * @param propagationPolicy Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground.\n * @param {*} [options] Override http request options.\n */\n deleteAuditSink(name, pretty, body, dryRun, gracePeriodSeconds, orphanDependents, propagationPolicy, options = {}) {\n const localVarPath = this.basePath + '/apis/auditregistration.k8s.io/v1alpha1/auditsinks/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling deleteAuditSink.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, \"string\");\n }\n if (gracePeriodSeconds !== undefined) {\n localVarQueryParameters['gracePeriodSeconds'] = ObjectSerializer.serialize(gracePeriodSeconds, \"number\");\n }\n if (orphanDependents !== undefined) {\n localVarQueryParameters['orphanDependents'] = ObjectSerializer.serialize(orphanDependents, \"boolean\");\n }\n if (propagationPolicy !== undefined) {\n localVarQueryParameters['propagationPolicy'] = ObjectSerializer.serialize(propagationPolicy, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'DELETE',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: ObjectSerializer.serialize(body, \"V1DeleteOptions\")\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1Status\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * delete collection of AuditSink\n * @param includeUninitialized If true, partially initialized resources are included in the response.\n * @param pretty If 'true', then the output is pretty printed.\n * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \\"next key\\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.\n * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything.\n * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything.\n * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.\n * @param resourceVersion When specified with a watch call, shows changes that occur after that particular version of a resource. Defaults to changes from the beginning of history. When specified for list: - if unset, then the result is returned from remote storage based on quorum-read flag; - if it's 0, then we simply return what we currently have in cache, no guarantee; - if set to non zero, then the result is at least as fresh as given rv.\n * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.\n * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.\n * @param {*} [options] Override http request options.\n */\n deleteCollectionAuditSink(includeUninitialized, pretty, _continue, fieldSelector, labelSelector, limit, resourceVersion, timeoutSeconds, watch, options = {}) {\n const localVarPath = this.basePath + '/apis/auditregistration.k8s.io/v1alpha1/auditsinks';\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n if (includeUninitialized !== undefined) {\n localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, \"boolean\");\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (_continue !== undefined) {\n localVarQueryParameters['continue'] = ObjectSerializer.serialize(_continue, \"string\");\n }\n if (fieldSelector !== undefined) {\n localVarQueryParameters['fieldSelector'] = ObjectSerializer.serialize(fieldSelector, \"string\");\n }\n if (labelSelector !== undefined) {\n localVarQueryParameters['labelSelector'] = ObjectSerializer.serialize(labelSelector, \"string\");\n }\n if (limit !== undefined) {\n localVarQueryParameters['limit'] = ObjectSerializer.serialize(limit, \"number\");\n }\n if (resourceVersion !== undefined) {\n localVarQueryParameters['resourceVersion'] = ObjectSerializer.serialize(resourceVersion, \"string\");\n }\n if (timeoutSeconds !== undefined) {\n localVarQueryParameters['timeoutSeconds'] = ObjectSerializer.serialize(timeoutSeconds, \"number\");\n }\n if (watch !== undefined) {\n localVarQueryParameters['watch'] = ObjectSerializer.serialize(watch, \"boolean\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'DELETE',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1Status\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * get available resources\n * @param {*} [options] Override http request options.\n */\n getAPIResources(options = {}) {\n const localVarPath = this.basePath + '/apis/auditregistration.k8s.io/v1alpha1/';\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1APIResourceList\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * list or watch objects of kind AuditSink\n * @param includeUninitialized If true, partially initialized resources are included in the response.\n * @param pretty If 'true', then the output is pretty printed.\n * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \\"next key\\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.\n * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything.\n * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything.\n * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.\n * @param resourceVersion When specified with a watch call, shows changes that occur after that particular version of a resource. Defaults to changes from the beginning of history. When specified for list: - if unset, then the result is returned from remote storage based on quorum-read flag; - if it's 0, then we simply return what we currently have in cache, no guarantee; - if set to non zero, then the result is at least as fresh as given rv.\n * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.\n * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.\n * @param {*} [options] Override http request options.\n */\n listAuditSink(includeUninitialized, pretty, _continue, fieldSelector, labelSelector, limit, resourceVersion, timeoutSeconds, watch, options = {}) {\n const localVarPath = this.basePath + '/apis/auditregistration.k8s.io/v1alpha1/auditsinks';\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n if (includeUninitialized !== undefined) {\n localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, \"boolean\");\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (_continue !== undefined) {\n localVarQueryParameters['continue'] = ObjectSerializer.serialize(_continue, \"string\");\n }\n if (fieldSelector !== undefined) {\n localVarQueryParameters['fieldSelector'] = ObjectSerializer.serialize(fieldSelector, \"string\");\n }\n if (labelSelector !== undefined) {\n localVarQueryParameters['labelSelector'] = ObjectSerializer.serialize(labelSelector, \"string\");\n }\n if (limit !== undefined) {\n localVarQueryParameters['limit'] = ObjectSerializer.serialize(limit, \"number\");\n }\n if (resourceVersion !== undefined) {\n localVarQueryParameters['resourceVersion'] = ObjectSerializer.serialize(resourceVersion, \"string\");\n }\n if (timeoutSeconds !== undefined) {\n localVarQueryParameters['timeoutSeconds'] = ObjectSerializer.serialize(timeoutSeconds, \"number\");\n }\n if (watch !== undefined) {\n localVarQueryParameters['watch'] = ObjectSerializer.serialize(watch, \"boolean\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1alpha1AuditSinkList\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * partially update the specified AuditSink\n * @param name name of the AuditSink\n * @param body\n * @param pretty If 'true', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param {*} [options] Override http request options.\n */\n patchAuditSink(name, body, pretty, dryRun, options = {}) {\n const localVarPath = this.basePath + '/apis/auditregistration.k8s.io/v1alpha1/auditsinks/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling patchAuditSink.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling patchAuditSink.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'PATCH',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: ObjectSerializer.serialize(body, \"any\")\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1alpha1AuditSink\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * read the specified AuditSink\n * @param name name of the AuditSink\n * @param pretty If 'true', then the output is pretty printed.\n * @param exact Should the export be exact. Exact export maintains cluster-specific fields like 'Namespace'.\n * @param _export Should this value be exported. Export strips fields that a user can not specify.\n * @param {*} [options] Override http request options.\n */\n readAuditSink(name, pretty, exact, _export, options = {}) {\n const localVarPath = this.basePath + '/apis/auditregistration.k8s.io/v1alpha1/auditsinks/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling readAuditSink.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (exact !== undefined) {\n localVarQueryParameters['exact'] = ObjectSerializer.serialize(exact, \"boolean\");\n }\n if (_export !== undefined) {\n localVarQueryParameters['export'] = ObjectSerializer.serialize(_export, \"boolean\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1alpha1AuditSink\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * replace the specified AuditSink\n * @param name name of the AuditSink\n * @param body\n * @param pretty If 'true', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param {*} [options] Override http request options.\n */\n replaceAuditSink(name, body, pretty, dryRun, options = {}) {\n const localVarPath = this.basePath + '/apis/auditregistration.k8s.io/v1alpha1/auditsinks/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling replaceAuditSink.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling replaceAuditSink.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'PUT',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: ObjectSerializer.serialize(body, \"V1alpha1AuditSink\")\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1alpha1AuditSink\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n}\nexports.AuditregistrationV1alpha1Api = AuditregistrationV1alpha1Api;\nvar AuthenticationApiApiKeys;\n(function (AuthenticationApiApiKeys) {\n AuthenticationApiApiKeys[AuthenticationApiApiKeys[\"BearerToken\"] = 0] = \"BearerToken\";\n})(AuthenticationApiApiKeys = exports.AuthenticationApiApiKeys || (exports.AuthenticationApiApiKeys = {}));\nclass AuthenticationApi {\n constructor(basePathOrUsername, password, basePath) {\n this._basePath = defaultBasePath;\n this.defaultHeaders = {};\n this._useQuerystring = false;\n this.authentications = {\n 'default': new VoidAuth(),\n 'BearerToken': new ApiKeyAuth('header', 'authorization'),\n };\n if (password) {\n if (basePath) {\n this.basePath = basePath;\n }\n }\n else {\n if (basePathOrUsername) {\n this.basePath = basePathOrUsername;\n }\n }\n }\n set useQuerystring(value) {\n this._useQuerystring = value;\n }\n set basePath(basePath) {\n this._basePath = basePath;\n }\n get basePath() {\n return this._basePath;\n }\n setDefaultAuthentication(auth) {\n this.authentications.default = auth;\n }\n setApiKey(key, value) {\n this.authentications[AuthenticationApiApiKeys[key]].apiKey = value;\n }\n /**\n * get information of a group\n * @param {*} [options] Override http request options.\n */\n getAPIGroup(options = {}) {\n const localVarPath = this.basePath + '/apis/authentication.k8s.io/';\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1APIGroup\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n}\nexports.AuthenticationApi = AuthenticationApi;\nvar AuthenticationV1ApiApiKeys;\n(function (AuthenticationV1ApiApiKeys) {\n AuthenticationV1ApiApiKeys[AuthenticationV1ApiApiKeys[\"BearerToken\"] = 0] = \"BearerToken\";\n})(AuthenticationV1ApiApiKeys = exports.AuthenticationV1ApiApiKeys || (exports.AuthenticationV1ApiApiKeys = {}));\nclass AuthenticationV1Api {\n constructor(basePathOrUsername, password, basePath) {\n this._basePath = defaultBasePath;\n this.defaultHeaders = {};\n this._useQuerystring = false;\n this.authentications = {\n 'default': new VoidAuth(),\n 'BearerToken': new ApiKeyAuth('header', 'authorization'),\n };\n if (password) {\n if (basePath) {\n this.basePath = basePath;\n }\n }\n else {\n if (basePathOrUsername) {\n this.basePath = basePathOrUsername;\n }\n }\n }\n set useQuerystring(value) {\n this._useQuerystring = value;\n }\n set basePath(basePath) {\n this._basePath = basePath;\n }\n get basePath() {\n return this._basePath;\n }\n setDefaultAuthentication(auth) {\n this.authentications.default = auth;\n }\n setApiKey(key, value) {\n this.authentications[AuthenticationV1ApiApiKeys[key]].apiKey = value;\n }\n /**\n * create a TokenReview\n * @param body\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param includeUninitialized If IncludeUninitialized is specified, the object may be returned without completing initialization.\n * @param pretty If 'true', then the output is pretty printed.\n * @param {*} [options] Override http request options.\n */\n createTokenReview(body, dryRun, includeUninitialized, pretty, options = {}) {\n const localVarPath = this.basePath + '/apis/authentication.k8s.io/v1/tokenreviews';\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling createTokenReview.');\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, \"string\");\n }\n if (includeUninitialized !== undefined) {\n localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, \"boolean\");\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'POST',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: ObjectSerializer.serialize(body, \"V1TokenReview\")\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1TokenReview\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * get available resources\n * @param {*} [options] Override http request options.\n */\n getAPIResources(options = {}) {\n const localVarPath = this.basePath + '/apis/authentication.k8s.io/v1/';\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1APIResourceList\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n}\nexports.AuthenticationV1Api = AuthenticationV1Api;\nvar AuthenticationV1beta1ApiApiKeys;\n(function (AuthenticationV1beta1ApiApiKeys) {\n AuthenticationV1beta1ApiApiKeys[AuthenticationV1beta1ApiApiKeys[\"BearerToken\"] = 0] = \"BearerToken\";\n})(AuthenticationV1beta1ApiApiKeys = exports.AuthenticationV1beta1ApiApiKeys || (exports.AuthenticationV1beta1ApiApiKeys = {}));\nclass AuthenticationV1beta1Api {\n constructor(basePathOrUsername, password, basePath) {\n this._basePath = defaultBasePath;\n this.defaultHeaders = {};\n this._useQuerystring = false;\n this.authentications = {\n 'default': new VoidAuth(),\n 'BearerToken': new ApiKeyAuth('header', 'authorization'),\n };\n if (password) {\n if (basePath) {\n this.basePath = basePath;\n }\n }\n else {\n if (basePathOrUsername) {\n this.basePath = basePathOrUsername;\n }\n }\n }\n set useQuerystring(value) {\n this._useQuerystring = value;\n }\n set basePath(basePath) {\n this._basePath = basePath;\n }\n get basePath() {\n return this._basePath;\n }\n setDefaultAuthentication(auth) {\n this.authentications.default = auth;\n }\n setApiKey(key, value) {\n this.authentications[AuthenticationV1beta1ApiApiKeys[key]].apiKey = value;\n }\n /**\n * create a TokenReview\n * @param body\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param includeUninitialized If IncludeUninitialized is specified, the object may be returned without completing initialization.\n * @param pretty If 'true', then the output is pretty printed.\n * @param {*} [options] Override http request options.\n */\n createTokenReview(body, dryRun, includeUninitialized, pretty, options = {}) {\n const localVarPath = this.basePath + '/apis/authentication.k8s.io/v1beta1/tokenreviews';\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling createTokenReview.');\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, \"string\");\n }\n if (includeUninitialized !== undefined) {\n localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, \"boolean\");\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'POST',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: ObjectSerializer.serialize(body, \"V1beta1TokenReview\")\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1beta1TokenReview\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * get available resources\n * @param {*} [options] Override http request options.\n */\n getAPIResources(options = {}) {\n const localVarPath = this.basePath + '/apis/authentication.k8s.io/v1beta1/';\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1APIResourceList\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n}\nexports.AuthenticationV1beta1Api = AuthenticationV1beta1Api;\nvar AuthorizationApiApiKeys;\n(function (AuthorizationApiApiKeys) {\n AuthorizationApiApiKeys[AuthorizationApiApiKeys[\"BearerToken\"] = 0] = \"BearerToken\";\n})(AuthorizationApiApiKeys = exports.AuthorizationApiApiKeys || (exports.AuthorizationApiApiKeys = {}));\nclass AuthorizationApi {\n constructor(basePathOrUsername, password, basePath) {\n this._basePath = defaultBasePath;\n this.defaultHeaders = {};\n this._useQuerystring = false;\n this.authentications = {\n 'default': new VoidAuth(),\n 'BearerToken': new ApiKeyAuth('header', 'authorization'),\n };\n if (password) {\n if (basePath) {\n this.basePath = basePath;\n }\n }\n else {\n if (basePathOrUsername) {\n this.basePath = basePathOrUsername;\n }\n }\n }\n set useQuerystring(value) {\n this._useQuerystring = value;\n }\n set basePath(basePath) {\n this._basePath = basePath;\n }\n get basePath() {\n return this._basePath;\n }\n setDefaultAuthentication(auth) {\n this.authentications.default = auth;\n }\n setApiKey(key, value) {\n this.authentications[AuthorizationApiApiKeys[key]].apiKey = value;\n }\n /**\n * get information of a group\n * @param {*} [options] Override http request options.\n */\n getAPIGroup(options = {}) {\n const localVarPath = this.basePath + '/apis/authorization.k8s.io/';\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1APIGroup\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n}\nexports.AuthorizationApi = AuthorizationApi;\nvar AuthorizationV1ApiApiKeys;\n(function (AuthorizationV1ApiApiKeys) {\n AuthorizationV1ApiApiKeys[AuthorizationV1ApiApiKeys[\"BearerToken\"] = 0] = \"BearerToken\";\n})(AuthorizationV1ApiApiKeys = exports.AuthorizationV1ApiApiKeys || (exports.AuthorizationV1ApiApiKeys = {}));\nclass AuthorizationV1Api {\n constructor(basePathOrUsername, password, basePath) {\n this._basePath = defaultBasePath;\n this.defaultHeaders = {};\n this._useQuerystring = false;\n this.authentications = {\n 'default': new VoidAuth(),\n 'BearerToken': new ApiKeyAuth('header', 'authorization'),\n };\n if (password) {\n if (basePath) {\n this.basePath = basePath;\n }\n }\n else {\n if (basePathOrUsername) {\n this.basePath = basePathOrUsername;\n }\n }\n }\n set useQuerystring(value) {\n this._useQuerystring = value;\n }\n set basePath(basePath) {\n this._basePath = basePath;\n }\n get basePath() {\n return this._basePath;\n }\n setDefaultAuthentication(auth) {\n this.authentications.default = auth;\n }\n setApiKey(key, value) {\n this.authentications[AuthorizationV1ApiApiKeys[key]].apiKey = value;\n }\n /**\n * create a LocalSubjectAccessReview\n * @param namespace object name and auth scope, such as for teams and projects\n * @param body\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param includeUninitialized If IncludeUninitialized is specified, the object may be returned without completing initialization.\n * @param pretty If 'true', then the output is pretty printed.\n * @param {*} [options] Override http request options.\n */\n createNamespacedLocalSubjectAccessReview(namespace, body, dryRun, includeUninitialized, pretty, options = {}) {\n const localVarPath = this.basePath + '/apis/authorization.k8s.io/v1/namespaces/{namespace}/localsubjectaccessreviews'\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling createNamespacedLocalSubjectAccessReview.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling createNamespacedLocalSubjectAccessReview.');\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, \"string\");\n }\n if (includeUninitialized !== undefined) {\n localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, \"boolean\");\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'POST',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: ObjectSerializer.serialize(body, \"V1LocalSubjectAccessReview\")\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1LocalSubjectAccessReview\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * create a SelfSubjectAccessReview\n * @param body\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param includeUninitialized If IncludeUninitialized is specified, the object may be returned without completing initialization.\n * @param pretty If 'true', then the output is pretty printed.\n * @param {*} [options] Override http request options.\n */\n createSelfSubjectAccessReview(body, dryRun, includeUninitialized, pretty, options = {}) {\n const localVarPath = this.basePath + '/apis/authorization.k8s.io/v1/selfsubjectaccessreviews';\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling createSelfSubjectAccessReview.');\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, \"string\");\n }\n if (includeUninitialized !== undefined) {\n localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, \"boolean\");\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'POST',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: ObjectSerializer.serialize(body, \"V1SelfSubjectAccessReview\")\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1SelfSubjectAccessReview\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * create a SelfSubjectRulesReview\n * @param body\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param includeUninitialized If IncludeUninitialized is specified, the object may be returned without completing initialization.\n * @param pretty If 'true', then the output is pretty printed.\n * @param {*} [options] Override http request options.\n */\n createSelfSubjectRulesReview(body, dryRun, includeUninitialized, pretty, options = {}) {\n const localVarPath = this.basePath + '/apis/authorization.k8s.io/v1/selfsubjectrulesreviews';\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling createSelfSubjectRulesReview.');\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, \"string\");\n }\n if (includeUninitialized !== undefined) {\n localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, \"boolean\");\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'POST',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: ObjectSerializer.serialize(body, \"V1SelfSubjectRulesReview\")\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1SelfSubjectRulesReview\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * create a SubjectAccessReview\n * @param body\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param includeUninitialized If IncludeUninitialized is specified, the object may be returned without completing initialization.\n * @param pretty If 'true', then the output is pretty printed.\n * @param {*} [options] Override http request options.\n */\n createSubjectAccessReview(body, dryRun, includeUninitialized, pretty, options = {}) {\n const localVarPath = this.basePath + '/apis/authorization.k8s.io/v1/subjectaccessreviews';\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling createSubjectAccessReview.');\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, \"string\");\n }\n if (includeUninitialized !== undefined) {\n localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, \"boolean\");\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'POST',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: ObjectSerializer.serialize(body, \"V1SubjectAccessReview\")\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1SubjectAccessReview\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * get available resources\n * @param {*} [options] Override http request options.\n */\n getAPIResources(options = {}) {\n const localVarPath = this.basePath + '/apis/authorization.k8s.io/v1/';\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1APIResourceList\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n}\nexports.AuthorizationV1Api = AuthorizationV1Api;\nvar AuthorizationV1beta1ApiApiKeys;\n(function (AuthorizationV1beta1ApiApiKeys) {\n AuthorizationV1beta1ApiApiKeys[AuthorizationV1beta1ApiApiKeys[\"BearerToken\"] = 0] = \"BearerToken\";\n})(AuthorizationV1beta1ApiApiKeys = exports.AuthorizationV1beta1ApiApiKeys || (exports.AuthorizationV1beta1ApiApiKeys = {}));\nclass AuthorizationV1beta1Api {\n constructor(basePathOrUsername, password, basePath) {\n this._basePath = defaultBasePath;\n this.defaultHeaders = {};\n this._useQuerystring = false;\n this.authentications = {\n 'default': new VoidAuth(),\n 'BearerToken': new ApiKeyAuth('header', 'authorization'),\n };\n if (password) {\n if (basePath) {\n this.basePath = basePath;\n }\n }\n else {\n if (basePathOrUsername) {\n this.basePath = basePathOrUsername;\n }\n }\n }\n set useQuerystring(value) {\n this._useQuerystring = value;\n }\n set basePath(basePath) {\n this._basePath = basePath;\n }\n get basePath() {\n return this._basePath;\n }\n setDefaultAuthentication(auth) {\n this.authentications.default = auth;\n }\n setApiKey(key, value) {\n this.authentications[AuthorizationV1beta1ApiApiKeys[key]].apiKey = value;\n }\n /**\n * create a LocalSubjectAccessReview\n * @param namespace object name and auth scope, such as for teams and projects\n * @param body\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param includeUninitialized If IncludeUninitialized is specified, the object may be returned without completing initialization.\n * @param pretty If 'true', then the output is pretty printed.\n * @param {*} [options] Override http request options.\n */\n createNamespacedLocalSubjectAccessReview(namespace, body, dryRun, includeUninitialized, pretty, options = {}) {\n const localVarPath = this.basePath + '/apis/authorization.k8s.io/v1beta1/namespaces/{namespace}/localsubjectaccessreviews'\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling createNamespacedLocalSubjectAccessReview.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling createNamespacedLocalSubjectAccessReview.');\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, \"string\");\n }\n if (includeUninitialized !== undefined) {\n localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, \"boolean\");\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'POST',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: ObjectSerializer.serialize(body, \"V1beta1LocalSubjectAccessReview\")\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1beta1LocalSubjectAccessReview\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * create a SelfSubjectAccessReview\n * @param body\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param includeUninitialized If IncludeUninitialized is specified, the object may be returned without completing initialization.\n * @param pretty If 'true', then the output is pretty printed.\n * @param {*} [options] Override http request options.\n */\n createSelfSubjectAccessReview(body, dryRun, includeUninitialized, pretty, options = {}) {\n const localVarPath = this.basePath + '/apis/authorization.k8s.io/v1beta1/selfsubjectaccessreviews';\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling createSelfSubjectAccessReview.');\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, \"string\");\n }\n if (includeUninitialized !== undefined) {\n localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, \"boolean\");\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'POST',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: ObjectSerializer.serialize(body, \"V1beta1SelfSubjectAccessReview\")\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1beta1SelfSubjectAccessReview\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * create a SelfSubjectRulesReview\n * @param body\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param includeUninitialized If IncludeUninitialized is specified, the object may be returned without completing initialization.\n * @param pretty If 'true', then the output is pretty printed.\n * @param {*} [options] Override http request options.\n */\n createSelfSubjectRulesReview(body, dryRun, includeUninitialized, pretty, options = {}) {\n const localVarPath = this.basePath + '/apis/authorization.k8s.io/v1beta1/selfsubjectrulesreviews';\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling createSelfSubjectRulesReview.');\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, \"string\");\n }\n if (includeUninitialized !== undefined) {\n localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, \"boolean\");\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'POST',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: ObjectSerializer.serialize(body, \"V1beta1SelfSubjectRulesReview\")\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1beta1SelfSubjectRulesReview\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * create a SubjectAccessReview\n * @param body\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param includeUninitialized If IncludeUninitialized is specified, the object may be returned without completing initialization.\n * @param pretty If 'true', then the output is pretty printed.\n * @param {*} [options] Override http request options.\n */\n createSubjectAccessReview(body, dryRun, includeUninitialized, pretty, options = {}) {\n const localVarPath = this.basePath + '/apis/authorization.k8s.io/v1beta1/subjectaccessreviews';\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling createSubjectAccessReview.');\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, \"string\");\n }\n if (includeUninitialized !== undefined) {\n localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, \"boolean\");\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'POST',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: ObjectSerializer.serialize(body, \"V1beta1SubjectAccessReview\")\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1beta1SubjectAccessReview\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * get available resources\n * @param {*} [options] Override http request options.\n */\n getAPIResources(options = {}) {\n const localVarPath = this.basePath + '/apis/authorization.k8s.io/v1beta1/';\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1APIResourceList\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n}\nexports.AuthorizationV1beta1Api = AuthorizationV1beta1Api;\nvar AutoscalingApiApiKeys;\n(function (AutoscalingApiApiKeys) {\n AutoscalingApiApiKeys[AutoscalingApiApiKeys[\"BearerToken\"] = 0] = \"BearerToken\";\n})(AutoscalingApiApiKeys = exports.AutoscalingApiApiKeys || (exports.AutoscalingApiApiKeys = {}));\nclass AutoscalingApi {\n constructor(basePathOrUsername, password, basePath) {\n this._basePath = defaultBasePath;\n this.defaultHeaders = {};\n this._useQuerystring = false;\n this.authentications = {\n 'default': new VoidAuth(),\n 'BearerToken': new ApiKeyAuth('header', 'authorization'),\n };\n if (password) {\n if (basePath) {\n this.basePath = basePath;\n }\n }\n else {\n if (basePathOrUsername) {\n this.basePath = basePathOrUsername;\n }\n }\n }\n set useQuerystring(value) {\n this._useQuerystring = value;\n }\n set basePath(basePath) {\n this._basePath = basePath;\n }\n get basePath() {\n return this._basePath;\n }\n setDefaultAuthentication(auth) {\n this.authentications.default = auth;\n }\n setApiKey(key, value) {\n this.authentications[AutoscalingApiApiKeys[key]].apiKey = value;\n }\n /**\n * get information of a group\n * @param {*} [options] Override http request options.\n */\n getAPIGroup(options = {}) {\n const localVarPath = this.basePath + '/apis/autoscaling/';\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1APIGroup\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n}\nexports.AutoscalingApi = AutoscalingApi;\nvar AutoscalingV1ApiApiKeys;\n(function (AutoscalingV1ApiApiKeys) {\n AutoscalingV1ApiApiKeys[AutoscalingV1ApiApiKeys[\"BearerToken\"] = 0] = \"BearerToken\";\n})(AutoscalingV1ApiApiKeys = exports.AutoscalingV1ApiApiKeys || (exports.AutoscalingV1ApiApiKeys = {}));\nclass AutoscalingV1Api {\n constructor(basePathOrUsername, password, basePath) {\n this._basePath = defaultBasePath;\n this.defaultHeaders = {};\n this._useQuerystring = false;\n this.authentications = {\n 'default': new VoidAuth(),\n 'BearerToken': new ApiKeyAuth('header', 'authorization'),\n };\n if (password) {\n if (basePath) {\n this.basePath = basePath;\n }\n }\n else {\n if (basePathOrUsername) {\n this.basePath = basePathOrUsername;\n }\n }\n }\n set useQuerystring(value) {\n this._useQuerystring = value;\n }\n set basePath(basePath) {\n this._basePath = basePath;\n }\n get basePath() {\n return this._basePath;\n }\n setDefaultAuthentication(auth) {\n this.authentications.default = auth;\n }\n setApiKey(key, value) {\n this.authentications[AutoscalingV1ApiApiKeys[key]].apiKey = value;\n }\n /**\n * create a HorizontalPodAutoscaler\n * @param namespace object name and auth scope, such as for teams and projects\n * @param body\n * @param includeUninitialized If true, partially initialized resources are included in the response.\n * @param pretty If 'true', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param {*} [options] Override http request options.\n */\n createNamespacedHorizontalPodAutoscaler(namespace, body, includeUninitialized, pretty, dryRun, options = {}) {\n const localVarPath = this.basePath + '/apis/autoscaling/v1/namespaces/{namespace}/horizontalpodautoscalers'\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling createNamespacedHorizontalPodAutoscaler.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling createNamespacedHorizontalPodAutoscaler.');\n }\n if (includeUninitialized !== undefined) {\n localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, \"boolean\");\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'POST',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: ObjectSerializer.serialize(body, \"V1HorizontalPodAutoscaler\")\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1HorizontalPodAutoscaler\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * delete collection of HorizontalPodAutoscaler\n * @param namespace object name and auth scope, such as for teams and projects\n * @param includeUninitialized If true, partially initialized resources are included in the response.\n * @param pretty If 'true', then the output is pretty printed.\n * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \\"next key\\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.\n * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything.\n * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything.\n * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.\n * @param resourceVersion When specified with a watch call, shows changes that occur after that particular version of a resource. Defaults to changes from the beginning of history. When specified for list: - if unset, then the result is returned from remote storage based on quorum-read flag; - if it's 0, then we simply return what we currently have in cache, no guarantee; - if set to non zero, then the result is at least as fresh as given rv.\n * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.\n * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.\n * @param {*} [options] Override http request options.\n */\n deleteCollectionNamespacedHorizontalPodAutoscaler(namespace, includeUninitialized, pretty, _continue, fieldSelector, labelSelector, limit, resourceVersion, timeoutSeconds, watch, options = {}) {\n const localVarPath = this.basePath + '/apis/autoscaling/v1/namespaces/{namespace}/horizontalpodautoscalers'\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling deleteCollectionNamespacedHorizontalPodAutoscaler.');\n }\n if (includeUninitialized !== undefined) {\n localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, \"boolean\");\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (_continue !== undefined) {\n localVarQueryParameters['continue'] = ObjectSerializer.serialize(_continue, \"string\");\n }\n if (fieldSelector !== undefined) {\n localVarQueryParameters['fieldSelector'] = ObjectSerializer.serialize(fieldSelector, \"string\");\n }\n if (labelSelector !== undefined) {\n localVarQueryParameters['labelSelector'] = ObjectSerializer.serialize(labelSelector, \"string\");\n }\n if (limit !== undefined) {\n localVarQueryParameters['limit'] = ObjectSerializer.serialize(limit, \"number\");\n }\n if (resourceVersion !== undefined) {\n localVarQueryParameters['resourceVersion'] = ObjectSerializer.serialize(resourceVersion, \"string\");\n }\n if (timeoutSeconds !== undefined) {\n localVarQueryParameters['timeoutSeconds'] = ObjectSerializer.serialize(timeoutSeconds, \"number\");\n }\n if (watch !== undefined) {\n localVarQueryParameters['watch'] = ObjectSerializer.serialize(watch, \"boolean\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'DELETE',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1Status\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * delete a HorizontalPodAutoscaler\n * @param name name of the HorizontalPodAutoscaler\n * @param namespace object name and auth scope, such as for teams and projects\n * @param pretty If 'true', then the output is pretty printed.\n * @param body\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param gracePeriodSeconds The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately.\n * @param orphanDependents Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \\"orphan\\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both.\n * @param propagationPolicy Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground.\n * @param {*} [options] Override http request options.\n */\n deleteNamespacedHorizontalPodAutoscaler(name, namespace, pretty, body, dryRun, gracePeriodSeconds, orphanDependents, propagationPolicy, options = {}) {\n const localVarPath = this.basePath + '/apis/autoscaling/v1/namespaces/{namespace}/horizontalpodautoscalers/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling deleteNamespacedHorizontalPodAutoscaler.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling deleteNamespacedHorizontalPodAutoscaler.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, \"string\");\n }\n if (gracePeriodSeconds !== undefined) {\n localVarQueryParameters['gracePeriodSeconds'] = ObjectSerializer.serialize(gracePeriodSeconds, \"number\");\n }\n if (orphanDependents !== undefined) {\n localVarQueryParameters['orphanDependents'] = ObjectSerializer.serialize(orphanDependents, \"boolean\");\n }\n if (propagationPolicy !== undefined) {\n localVarQueryParameters['propagationPolicy'] = ObjectSerializer.serialize(propagationPolicy, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'DELETE',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: ObjectSerializer.serialize(body, \"V1DeleteOptions\")\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1Status\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * get available resources\n * @param {*} [options] Override http request options.\n */\n getAPIResources(options = {}) {\n const localVarPath = this.basePath + '/apis/autoscaling/v1/';\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1APIResourceList\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * list or watch objects of kind HorizontalPodAutoscaler\n * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \\"next key\\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.\n * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything.\n * @param includeUninitialized If true, partially initialized resources are included in the response.\n * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything.\n * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.\n * @param pretty If 'true', then the output is pretty printed.\n * @param resourceVersion When specified with a watch call, shows changes that occur after that particular version of a resource. Defaults to changes from the beginning of history. When specified for list: - if unset, then the result is returned from remote storage based on quorum-read flag; - if it's 0, then we simply return what we currently have in cache, no guarantee; - if set to non zero, then the result is at least as fresh as given rv.\n * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.\n * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.\n * @param {*} [options] Override http request options.\n */\n listHorizontalPodAutoscalerForAllNamespaces(_continue, fieldSelector, includeUninitialized, labelSelector, limit, pretty, resourceVersion, timeoutSeconds, watch, options = {}) {\n const localVarPath = this.basePath + '/apis/autoscaling/v1/horizontalpodautoscalers';\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n if (_continue !== undefined) {\n localVarQueryParameters['continue'] = ObjectSerializer.serialize(_continue, \"string\");\n }\n if (fieldSelector !== undefined) {\n localVarQueryParameters['fieldSelector'] = ObjectSerializer.serialize(fieldSelector, \"string\");\n }\n if (includeUninitialized !== undefined) {\n localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, \"boolean\");\n }\n if (labelSelector !== undefined) {\n localVarQueryParameters['labelSelector'] = ObjectSerializer.serialize(labelSelector, \"string\");\n }\n if (limit !== undefined) {\n localVarQueryParameters['limit'] = ObjectSerializer.serialize(limit, \"number\");\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (resourceVersion !== undefined) {\n localVarQueryParameters['resourceVersion'] = ObjectSerializer.serialize(resourceVersion, \"string\");\n }\n if (timeoutSeconds !== undefined) {\n localVarQueryParameters['timeoutSeconds'] = ObjectSerializer.serialize(timeoutSeconds, \"number\");\n }\n if (watch !== undefined) {\n localVarQueryParameters['watch'] = ObjectSerializer.serialize(watch, \"boolean\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1HorizontalPodAutoscalerList\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * list or watch objects of kind HorizontalPodAutoscaler\n * @param namespace object name and auth scope, such as for teams and projects\n * @param includeUninitialized If true, partially initialized resources are included in the response.\n * @param pretty If 'true', then the output is pretty printed.\n * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \\"next key\\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.\n * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything.\n * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything.\n * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.\n * @param resourceVersion When specified with a watch call, shows changes that occur after that particular version of a resource. Defaults to changes from the beginning of history. When specified for list: - if unset, then the result is returned from remote storage based on quorum-read flag; - if it's 0, then we simply return what we currently have in cache, no guarantee; - if set to non zero, then the result is at least as fresh as given rv.\n * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.\n * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.\n * @param {*} [options] Override http request options.\n */\n listNamespacedHorizontalPodAutoscaler(namespace, includeUninitialized, pretty, _continue, fieldSelector, labelSelector, limit, resourceVersion, timeoutSeconds, watch, options = {}) {\n const localVarPath = this.basePath + '/apis/autoscaling/v1/namespaces/{namespace}/horizontalpodautoscalers'\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling listNamespacedHorizontalPodAutoscaler.');\n }\n if (includeUninitialized !== undefined) {\n localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, \"boolean\");\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (_continue !== undefined) {\n localVarQueryParameters['continue'] = ObjectSerializer.serialize(_continue, \"string\");\n }\n if (fieldSelector !== undefined) {\n localVarQueryParameters['fieldSelector'] = ObjectSerializer.serialize(fieldSelector, \"string\");\n }\n if (labelSelector !== undefined) {\n localVarQueryParameters['labelSelector'] = ObjectSerializer.serialize(labelSelector, \"string\");\n }\n if (limit !== undefined) {\n localVarQueryParameters['limit'] = ObjectSerializer.serialize(limit, \"number\");\n }\n if (resourceVersion !== undefined) {\n localVarQueryParameters['resourceVersion'] = ObjectSerializer.serialize(resourceVersion, \"string\");\n }\n if (timeoutSeconds !== undefined) {\n localVarQueryParameters['timeoutSeconds'] = ObjectSerializer.serialize(timeoutSeconds, \"number\");\n }\n if (watch !== undefined) {\n localVarQueryParameters['watch'] = ObjectSerializer.serialize(watch, \"boolean\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1HorizontalPodAutoscalerList\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * partially update the specified HorizontalPodAutoscaler\n * @param name name of the HorizontalPodAutoscaler\n * @param namespace object name and auth scope, such as for teams and projects\n * @param body\n * @param pretty If 'true', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param {*} [options] Override http request options.\n */\n patchNamespacedHorizontalPodAutoscaler(name, namespace, body, pretty, dryRun, options = {}) {\n const localVarPath = this.basePath + '/apis/autoscaling/v1/namespaces/{namespace}/horizontalpodautoscalers/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling patchNamespacedHorizontalPodAutoscaler.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling patchNamespacedHorizontalPodAutoscaler.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling patchNamespacedHorizontalPodAutoscaler.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'PATCH',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: ObjectSerializer.serialize(body, \"any\")\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1HorizontalPodAutoscaler\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * partially update status of the specified HorizontalPodAutoscaler\n * @param name name of the HorizontalPodAutoscaler\n * @param namespace object name and auth scope, such as for teams and projects\n * @param body\n * @param pretty If 'true', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param {*} [options] Override http request options.\n */\n patchNamespacedHorizontalPodAutoscalerStatus(name, namespace, body, pretty, dryRun, options = {}) {\n const localVarPath = this.basePath + '/apis/autoscaling/v1/namespaces/{namespace}/horizontalpodautoscalers/{name}/status'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling patchNamespacedHorizontalPodAutoscalerStatus.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling patchNamespacedHorizontalPodAutoscalerStatus.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling patchNamespacedHorizontalPodAutoscalerStatus.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'PATCH',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: ObjectSerializer.serialize(body, \"any\")\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1HorizontalPodAutoscaler\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * read the specified HorizontalPodAutoscaler\n * @param name name of the HorizontalPodAutoscaler\n * @param namespace object name and auth scope, such as for teams and projects\n * @param pretty If 'true', then the output is pretty printed.\n * @param exact Should the export be exact. Exact export maintains cluster-specific fields like 'Namespace'.\n * @param _export Should this value be exported. Export strips fields that a user can not specify.\n * @param {*} [options] Override http request options.\n */\n readNamespacedHorizontalPodAutoscaler(name, namespace, pretty, exact, _export, options = {}) {\n const localVarPath = this.basePath + '/apis/autoscaling/v1/namespaces/{namespace}/horizontalpodautoscalers/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling readNamespacedHorizontalPodAutoscaler.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling readNamespacedHorizontalPodAutoscaler.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (exact !== undefined) {\n localVarQueryParameters['exact'] = ObjectSerializer.serialize(exact, \"boolean\");\n }\n if (_export !== undefined) {\n localVarQueryParameters['export'] = ObjectSerializer.serialize(_export, \"boolean\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1HorizontalPodAutoscaler\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * read status of the specified HorizontalPodAutoscaler\n * @param name name of the HorizontalPodAutoscaler\n * @param namespace object name and auth scope, such as for teams and projects\n * @param pretty If 'true', then the output is pretty printed.\n * @param {*} [options] Override http request options.\n */\n readNamespacedHorizontalPodAutoscalerStatus(name, namespace, pretty, options = {}) {\n const localVarPath = this.basePath + '/apis/autoscaling/v1/namespaces/{namespace}/horizontalpodautoscalers/{name}/status'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling readNamespacedHorizontalPodAutoscalerStatus.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling readNamespacedHorizontalPodAutoscalerStatus.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1HorizontalPodAutoscaler\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * replace the specified HorizontalPodAutoscaler\n * @param name name of the HorizontalPodAutoscaler\n * @param namespace object name and auth scope, such as for teams and projects\n * @param body\n * @param pretty If 'true', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param {*} [options] Override http request options.\n */\n replaceNamespacedHorizontalPodAutoscaler(name, namespace, body, pretty, dryRun, options = {}) {\n const localVarPath = this.basePath + '/apis/autoscaling/v1/namespaces/{namespace}/horizontalpodautoscalers/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling replaceNamespacedHorizontalPodAutoscaler.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling replaceNamespacedHorizontalPodAutoscaler.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling replaceNamespacedHorizontalPodAutoscaler.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'PUT',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: ObjectSerializer.serialize(body, \"V1HorizontalPodAutoscaler\")\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1HorizontalPodAutoscaler\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * replace status of the specified HorizontalPodAutoscaler\n * @param name name of the HorizontalPodAutoscaler\n * @param namespace object name and auth scope, such as for teams and projects\n * @param body\n * @param pretty If 'true', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param {*} [options] Override http request options.\n */\n replaceNamespacedHorizontalPodAutoscalerStatus(name, namespace, body, pretty, dryRun, options = {}) {\n const localVarPath = this.basePath + '/apis/autoscaling/v1/namespaces/{namespace}/horizontalpodautoscalers/{name}/status'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling replaceNamespacedHorizontalPodAutoscalerStatus.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling replaceNamespacedHorizontalPodAutoscalerStatus.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling replaceNamespacedHorizontalPodAutoscalerStatus.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'PUT',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: ObjectSerializer.serialize(body, \"V1HorizontalPodAutoscaler\")\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1HorizontalPodAutoscaler\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n}\nexports.AutoscalingV1Api = AutoscalingV1Api;\nvar AutoscalingV2beta1ApiApiKeys;\n(function (AutoscalingV2beta1ApiApiKeys) {\n AutoscalingV2beta1ApiApiKeys[AutoscalingV2beta1ApiApiKeys[\"BearerToken\"] = 0] = \"BearerToken\";\n})(AutoscalingV2beta1ApiApiKeys = exports.AutoscalingV2beta1ApiApiKeys || (exports.AutoscalingV2beta1ApiApiKeys = {}));\nclass AutoscalingV2beta1Api {\n constructor(basePathOrUsername, password, basePath) {\n this._basePath = defaultBasePath;\n this.defaultHeaders = {};\n this._useQuerystring = false;\n this.authentications = {\n 'default': new VoidAuth(),\n 'BearerToken': new ApiKeyAuth('header', 'authorization'),\n };\n if (password) {\n if (basePath) {\n this.basePath = basePath;\n }\n }\n else {\n if (basePathOrUsername) {\n this.basePath = basePathOrUsername;\n }\n }\n }\n set useQuerystring(value) {\n this._useQuerystring = value;\n }\n set basePath(basePath) {\n this._basePath = basePath;\n }\n get basePath() {\n return this._basePath;\n }\n setDefaultAuthentication(auth) {\n this.authentications.default = auth;\n }\n setApiKey(key, value) {\n this.authentications[AutoscalingV2beta1ApiApiKeys[key]].apiKey = value;\n }\n /**\n * create a HorizontalPodAutoscaler\n * @param namespace object name and auth scope, such as for teams and projects\n * @param body\n * @param includeUninitialized If true, partially initialized resources are included in the response.\n * @param pretty If 'true', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param {*} [options] Override http request options.\n */\n createNamespacedHorizontalPodAutoscaler(namespace, body, includeUninitialized, pretty, dryRun, options = {}) {\n const localVarPath = this.basePath + '/apis/autoscaling/v2beta1/namespaces/{namespace}/horizontalpodautoscalers'\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling createNamespacedHorizontalPodAutoscaler.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling createNamespacedHorizontalPodAutoscaler.');\n }\n if (includeUninitialized !== undefined) {\n localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, \"boolean\");\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'POST',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: ObjectSerializer.serialize(body, \"V2beta1HorizontalPodAutoscaler\")\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V2beta1HorizontalPodAutoscaler\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * delete collection of HorizontalPodAutoscaler\n * @param namespace object name and auth scope, such as for teams and projects\n * @param includeUninitialized If true, partially initialized resources are included in the response.\n * @param pretty If 'true', then the output is pretty printed.\n * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \\"next key\\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.\n * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything.\n * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything.\n * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.\n * @param resourceVersion When specified with a watch call, shows changes that occur after that particular version of a resource. Defaults to changes from the beginning of history. When specified for list: - if unset, then the result is returned from remote storage based on quorum-read flag; - if it's 0, then we simply return what we currently have in cache, no guarantee; - if set to non zero, then the result is at least as fresh as given rv.\n * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.\n * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.\n * @param {*} [options] Override http request options.\n */\n deleteCollectionNamespacedHorizontalPodAutoscaler(namespace, includeUninitialized, pretty, _continue, fieldSelector, labelSelector, limit, resourceVersion, timeoutSeconds, watch, options = {}) {\n const localVarPath = this.basePath + '/apis/autoscaling/v2beta1/namespaces/{namespace}/horizontalpodautoscalers'\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling deleteCollectionNamespacedHorizontalPodAutoscaler.');\n }\n if (includeUninitialized !== undefined) {\n localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, \"boolean\");\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (_continue !== undefined) {\n localVarQueryParameters['continue'] = ObjectSerializer.serialize(_continue, \"string\");\n }\n if (fieldSelector !== undefined) {\n localVarQueryParameters['fieldSelector'] = ObjectSerializer.serialize(fieldSelector, \"string\");\n }\n if (labelSelector !== undefined) {\n localVarQueryParameters['labelSelector'] = ObjectSerializer.serialize(labelSelector, \"string\");\n }\n if (limit !== undefined) {\n localVarQueryParameters['limit'] = ObjectSerializer.serialize(limit, \"number\");\n }\n if (resourceVersion !== undefined) {\n localVarQueryParameters['resourceVersion'] = ObjectSerializer.serialize(resourceVersion, \"string\");\n }\n if (timeoutSeconds !== undefined) {\n localVarQueryParameters['timeoutSeconds'] = ObjectSerializer.serialize(timeoutSeconds, \"number\");\n }\n if (watch !== undefined) {\n localVarQueryParameters['watch'] = ObjectSerializer.serialize(watch, \"boolean\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'DELETE',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1Status\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * delete a HorizontalPodAutoscaler\n * @param name name of the HorizontalPodAutoscaler\n * @param namespace object name and auth scope, such as for teams and projects\n * @param pretty If 'true', then the output is pretty printed.\n * @param body\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param gracePeriodSeconds The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately.\n * @param orphanDependents Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \\"orphan\\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both.\n * @param propagationPolicy Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground.\n * @param {*} [options] Override http request options.\n */\n deleteNamespacedHorizontalPodAutoscaler(name, namespace, pretty, body, dryRun, gracePeriodSeconds, orphanDependents, propagationPolicy, options = {}) {\n const localVarPath = this.basePath + '/apis/autoscaling/v2beta1/namespaces/{namespace}/horizontalpodautoscalers/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling deleteNamespacedHorizontalPodAutoscaler.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling deleteNamespacedHorizontalPodAutoscaler.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, \"string\");\n }\n if (gracePeriodSeconds !== undefined) {\n localVarQueryParameters['gracePeriodSeconds'] = ObjectSerializer.serialize(gracePeriodSeconds, \"number\");\n }\n if (orphanDependents !== undefined) {\n localVarQueryParameters['orphanDependents'] = ObjectSerializer.serialize(orphanDependents, \"boolean\");\n }\n if (propagationPolicy !== undefined) {\n localVarQueryParameters['propagationPolicy'] = ObjectSerializer.serialize(propagationPolicy, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'DELETE',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: ObjectSerializer.serialize(body, \"V1DeleteOptions\")\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1Status\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * get available resources\n * @param {*} [options] Override http request options.\n */\n getAPIResources(options = {}) {\n const localVarPath = this.basePath + '/apis/autoscaling/v2beta1/';\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1APIResourceList\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * list or watch objects of kind HorizontalPodAutoscaler\n * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \\"next key\\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.\n * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything.\n * @param includeUninitialized If true, partially initialized resources are included in the response.\n * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything.\n * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.\n * @param pretty If 'true', then the output is pretty printed.\n * @param resourceVersion When specified with a watch call, shows changes that occur after that particular version of a resource. Defaults to changes from the beginning of history. When specified for list: - if unset, then the result is returned from remote storage based on quorum-read flag; - if it's 0, then we simply return what we currently have in cache, no guarantee; - if set to non zero, then the result is at least as fresh as given rv.\n * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.\n * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.\n * @param {*} [options] Override http request options.\n */\n listHorizontalPodAutoscalerForAllNamespaces(_continue, fieldSelector, includeUninitialized, labelSelector, limit, pretty, resourceVersion, timeoutSeconds, watch, options = {}) {\n const localVarPath = this.basePath + '/apis/autoscaling/v2beta1/horizontalpodautoscalers';\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n if (_continue !== undefined) {\n localVarQueryParameters['continue'] = ObjectSerializer.serialize(_continue, \"string\");\n }\n if (fieldSelector !== undefined) {\n localVarQueryParameters['fieldSelector'] = ObjectSerializer.serialize(fieldSelector, \"string\");\n }\n if (includeUninitialized !== undefined) {\n localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, \"boolean\");\n }\n if (labelSelector !== undefined) {\n localVarQueryParameters['labelSelector'] = ObjectSerializer.serialize(labelSelector, \"string\");\n }\n if (limit !== undefined) {\n localVarQueryParameters['limit'] = ObjectSerializer.serialize(limit, \"number\");\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (resourceVersion !== undefined) {\n localVarQueryParameters['resourceVersion'] = ObjectSerializer.serialize(resourceVersion, \"string\");\n }\n if (timeoutSeconds !== undefined) {\n localVarQueryParameters['timeoutSeconds'] = ObjectSerializer.serialize(timeoutSeconds, \"number\");\n }\n if (watch !== undefined) {\n localVarQueryParameters['watch'] = ObjectSerializer.serialize(watch, \"boolean\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V2beta1HorizontalPodAutoscalerList\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * list or watch objects of kind HorizontalPodAutoscaler\n * @param namespace object name and auth scope, such as for teams and projects\n * @param includeUninitialized If true, partially initialized resources are included in the response.\n * @param pretty If 'true', then the output is pretty printed.\n * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \\"next key\\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.\n * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything.\n * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything.\n * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.\n * @param resourceVersion When specified with a watch call, shows changes that occur after that particular version of a resource. Defaults to changes from the beginning of history. When specified for list: - if unset, then the result is returned from remote storage based on quorum-read flag; - if it's 0, then we simply return what we currently have in cache, no guarantee; - if set to non zero, then the result is at least as fresh as given rv.\n * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.\n * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.\n * @param {*} [options] Override http request options.\n */\n listNamespacedHorizontalPodAutoscaler(namespace, includeUninitialized, pretty, _continue, fieldSelector, labelSelector, limit, resourceVersion, timeoutSeconds, watch, options = {}) {\n const localVarPath = this.basePath + '/apis/autoscaling/v2beta1/namespaces/{namespace}/horizontalpodautoscalers'\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling listNamespacedHorizontalPodAutoscaler.');\n }\n if (includeUninitialized !== undefined) {\n localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, \"boolean\");\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (_continue !== undefined) {\n localVarQueryParameters['continue'] = ObjectSerializer.serialize(_continue, \"string\");\n }\n if (fieldSelector !== undefined) {\n localVarQueryParameters['fieldSelector'] = ObjectSerializer.serialize(fieldSelector, \"string\");\n }\n if (labelSelector !== undefined) {\n localVarQueryParameters['labelSelector'] = ObjectSerializer.serialize(labelSelector, \"string\");\n }\n if (limit !== undefined) {\n localVarQueryParameters['limit'] = ObjectSerializer.serialize(limit, \"number\");\n }\n if (resourceVersion !== undefined) {\n localVarQueryParameters['resourceVersion'] = ObjectSerializer.serialize(resourceVersion, \"string\");\n }\n if (timeoutSeconds !== undefined) {\n localVarQueryParameters['timeoutSeconds'] = ObjectSerializer.serialize(timeoutSeconds, \"number\");\n }\n if (watch !== undefined) {\n localVarQueryParameters['watch'] = ObjectSerializer.serialize(watch, \"boolean\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V2beta1HorizontalPodAutoscalerList\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * partially update the specified HorizontalPodAutoscaler\n * @param name name of the HorizontalPodAutoscaler\n * @param namespace object name and auth scope, such as for teams and projects\n * @param body\n * @param pretty If 'true', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param {*} [options] Override http request options.\n */\n patchNamespacedHorizontalPodAutoscaler(name, namespace, body, pretty, dryRun, options = {}) {\n const localVarPath = this.basePath + '/apis/autoscaling/v2beta1/namespaces/{namespace}/horizontalpodautoscalers/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling patchNamespacedHorizontalPodAutoscaler.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling patchNamespacedHorizontalPodAutoscaler.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling patchNamespacedHorizontalPodAutoscaler.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'PATCH',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: ObjectSerializer.serialize(body, \"any\")\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V2beta1HorizontalPodAutoscaler\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * partially update status of the specified HorizontalPodAutoscaler\n * @param name name of the HorizontalPodAutoscaler\n * @param namespace object name and auth scope, such as for teams and projects\n * @param body\n * @param pretty If 'true', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param {*} [options] Override http request options.\n */\n patchNamespacedHorizontalPodAutoscalerStatus(name, namespace, body, pretty, dryRun, options = {}) {\n const localVarPath = this.basePath + '/apis/autoscaling/v2beta1/namespaces/{namespace}/horizontalpodautoscalers/{name}/status'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling patchNamespacedHorizontalPodAutoscalerStatus.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling patchNamespacedHorizontalPodAutoscalerStatus.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling patchNamespacedHorizontalPodAutoscalerStatus.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'PATCH',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: ObjectSerializer.serialize(body, \"any\")\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V2beta1HorizontalPodAutoscaler\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * read the specified HorizontalPodAutoscaler\n * @param name name of the HorizontalPodAutoscaler\n * @param namespace object name and auth scope, such as for teams and projects\n * @param pretty If 'true', then the output is pretty printed.\n * @param exact Should the export be exact. Exact export maintains cluster-specific fields like 'Namespace'.\n * @param _export Should this value be exported. Export strips fields that a user can not specify.\n * @param {*} [options] Override http request options.\n */\n readNamespacedHorizontalPodAutoscaler(name, namespace, pretty, exact, _export, options = {}) {\n const localVarPath = this.basePath + '/apis/autoscaling/v2beta1/namespaces/{namespace}/horizontalpodautoscalers/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling readNamespacedHorizontalPodAutoscaler.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling readNamespacedHorizontalPodAutoscaler.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (exact !== undefined) {\n localVarQueryParameters['exact'] = ObjectSerializer.serialize(exact, \"boolean\");\n }\n if (_export !== undefined) {\n localVarQueryParameters['export'] = ObjectSerializer.serialize(_export, \"boolean\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V2beta1HorizontalPodAutoscaler\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * read status of the specified HorizontalPodAutoscaler\n * @param name name of the HorizontalPodAutoscaler\n * @param namespace object name and auth scope, such as for teams and projects\n * @param pretty If 'true', then the output is pretty printed.\n * @param {*} [options] Override http request options.\n */\n readNamespacedHorizontalPodAutoscalerStatus(name, namespace, pretty, options = {}) {\n const localVarPath = this.basePath + '/apis/autoscaling/v2beta1/namespaces/{namespace}/horizontalpodautoscalers/{name}/status'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling readNamespacedHorizontalPodAutoscalerStatus.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling readNamespacedHorizontalPodAutoscalerStatus.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V2beta1HorizontalPodAutoscaler\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * replace the specified HorizontalPodAutoscaler\n * @param name name of the HorizontalPodAutoscaler\n * @param namespace object name and auth scope, such as for teams and projects\n * @param body\n * @param pretty If 'true', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param {*} [options] Override http request options.\n */\n replaceNamespacedHorizontalPodAutoscaler(name, namespace, body, pretty, dryRun, options = {}) {\n const localVarPath = this.basePath + '/apis/autoscaling/v2beta1/namespaces/{namespace}/horizontalpodautoscalers/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling replaceNamespacedHorizontalPodAutoscaler.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling replaceNamespacedHorizontalPodAutoscaler.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling replaceNamespacedHorizontalPodAutoscaler.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'PUT',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: ObjectSerializer.serialize(body, \"V2beta1HorizontalPodAutoscaler\")\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V2beta1HorizontalPodAutoscaler\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * replace status of the specified HorizontalPodAutoscaler\n * @param name name of the HorizontalPodAutoscaler\n * @param namespace object name and auth scope, such as for teams and projects\n * @param body\n * @param pretty If 'true', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param {*} [options] Override http request options.\n */\n replaceNamespacedHorizontalPodAutoscalerStatus(name, namespace, body, pretty, dryRun, options = {}) {\n const localVarPath = this.basePath + '/apis/autoscaling/v2beta1/namespaces/{namespace}/horizontalpodautoscalers/{name}/status'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling replaceNamespacedHorizontalPodAutoscalerStatus.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling replaceNamespacedHorizontalPodAutoscalerStatus.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling replaceNamespacedHorizontalPodAutoscalerStatus.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'PUT',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: ObjectSerializer.serialize(body, \"V2beta1HorizontalPodAutoscaler\")\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V2beta1HorizontalPodAutoscaler\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n}\nexports.AutoscalingV2beta1Api = AutoscalingV2beta1Api;\nvar AutoscalingV2beta2ApiApiKeys;\n(function (AutoscalingV2beta2ApiApiKeys) {\n AutoscalingV2beta2ApiApiKeys[AutoscalingV2beta2ApiApiKeys[\"BearerToken\"] = 0] = \"BearerToken\";\n})(AutoscalingV2beta2ApiApiKeys = exports.AutoscalingV2beta2ApiApiKeys || (exports.AutoscalingV2beta2ApiApiKeys = {}));\nclass AutoscalingV2beta2Api {\n constructor(basePathOrUsername, password, basePath) {\n this._basePath = defaultBasePath;\n this.defaultHeaders = {};\n this._useQuerystring = false;\n this.authentications = {\n 'default': new VoidAuth(),\n 'BearerToken': new ApiKeyAuth('header', 'authorization'),\n };\n if (password) {\n if (basePath) {\n this.basePath = basePath;\n }\n }\n else {\n if (basePathOrUsername) {\n this.basePath = basePathOrUsername;\n }\n }\n }\n set useQuerystring(value) {\n this._useQuerystring = value;\n }\n set basePath(basePath) {\n this._basePath = basePath;\n }\n get basePath() {\n return this._basePath;\n }\n setDefaultAuthentication(auth) {\n this.authentications.default = auth;\n }\n setApiKey(key, value) {\n this.authentications[AutoscalingV2beta2ApiApiKeys[key]].apiKey = value;\n }\n /**\n * create a HorizontalPodAutoscaler\n * @param namespace object name and auth scope, such as for teams and projects\n * @param body\n * @param includeUninitialized If true, partially initialized resources are included in the response.\n * @param pretty If 'true', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param {*} [options] Override http request options.\n */\n createNamespacedHorizontalPodAutoscaler(namespace, body, includeUninitialized, pretty, dryRun, options = {}) {\n const localVarPath = this.basePath + '/apis/autoscaling/v2beta2/namespaces/{namespace}/horizontalpodautoscalers'\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling createNamespacedHorizontalPodAutoscaler.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling createNamespacedHorizontalPodAutoscaler.');\n }\n if (includeUninitialized !== undefined) {\n localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, \"boolean\");\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'POST',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: ObjectSerializer.serialize(body, \"V2beta2HorizontalPodAutoscaler\")\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V2beta2HorizontalPodAutoscaler\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * delete collection of HorizontalPodAutoscaler\n * @param namespace object name and auth scope, such as for teams and projects\n * @param includeUninitialized If true, partially initialized resources are included in the response.\n * @param pretty If 'true', then the output is pretty printed.\n * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \\"next key\\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.\n * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything.\n * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything.\n * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.\n * @param resourceVersion When specified with a watch call, shows changes that occur after that particular version of a resource. Defaults to changes from the beginning of history. When specified for list: - if unset, then the result is returned from remote storage based on quorum-read flag; - if it's 0, then we simply return what we currently have in cache, no guarantee; - if set to non zero, then the result is at least as fresh as given rv.\n * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.\n * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.\n * @param {*} [options] Override http request options.\n */\n deleteCollectionNamespacedHorizontalPodAutoscaler(namespace, includeUninitialized, pretty, _continue, fieldSelector, labelSelector, limit, resourceVersion, timeoutSeconds, watch, options = {}) {\n const localVarPath = this.basePath + '/apis/autoscaling/v2beta2/namespaces/{namespace}/horizontalpodautoscalers'\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling deleteCollectionNamespacedHorizontalPodAutoscaler.');\n }\n if (includeUninitialized !== undefined) {\n localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, \"boolean\");\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (_continue !== undefined) {\n localVarQueryParameters['continue'] = ObjectSerializer.serialize(_continue, \"string\");\n }\n if (fieldSelector !== undefined) {\n localVarQueryParameters['fieldSelector'] = ObjectSerializer.serialize(fieldSelector, \"string\");\n }\n if (labelSelector !== undefined) {\n localVarQueryParameters['labelSelector'] = ObjectSerializer.serialize(labelSelector, \"string\");\n }\n if (limit !== undefined) {\n localVarQueryParameters['limit'] = ObjectSerializer.serialize(limit, \"number\");\n }\n if (resourceVersion !== undefined) {\n localVarQueryParameters['resourceVersion'] = ObjectSerializer.serialize(resourceVersion, \"string\");\n }\n if (timeoutSeconds !== undefined) {\n localVarQueryParameters['timeoutSeconds'] = ObjectSerializer.serialize(timeoutSeconds, \"number\");\n }\n if (watch !== undefined) {\n localVarQueryParameters['watch'] = ObjectSerializer.serialize(watch, \"boolean\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'DELETE',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1Status\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * delete a HorizontalPodAutoscaler\n * @param name name of the HorizontalPodAutoscaler\n * @param namespace object name and auth scope, such as for teams and projects\n * @param pretty If 'true', then the output is pretty printed.\n * @param body\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param gracePeriodSeconds The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately.\n * @param orphanDependents Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \\"orphan\\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both.\n * @param propagationPolicy Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground.\n * @param {*} [options] Override http request options.\n */\n deleteNamespacedHorizontalPodAutoscaler(name, namespace, pretty, body, dryRun, gracePeriodSeconds, orphanDependents, propagationPolicy, options = {}) {\n const localVarPath = this.basePath + '/apis/autoscaling/v2beta2/namespaces/{namespace}/horizontalpodautoscalers/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling deleteNamespacedHorizontalPodAutoscaler.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling deleteNamespacedHorizontalPodAutoscaler.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, \"string\");\n }\n if (gracePeriodSeconds !== undefined) {\n localVarQueryParameters['gracePeriodSeconds'] = ObjectSerializer.serialize(gracePeriodSeconds, \"number\");\n }\n if (orphanDependents !== undefined) {\n localVarQueryParameters['orphanDependents'] = ObjectSerializer.serialize(orphanDependents, \"boolean\");\n }\n if (propagationPolicy !== undefined) {\n localVarQueryParameters['propagationPolicy'] = ObjectSerializer.serialize(propagationPolicy, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'DELETE',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: ObjectSerializer.serialize(body, \"V1DeleteOptions\")\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1Status\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * get available resources\n * @param {*} [options] Override http request options.\n */\n getAPIResources(options = {}) {\n const localVarPath = this.basePath + '/apis/autoscaling/v2beta2/';\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1APIResourceList\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * list or watch objects of kind HorizontalPodAutoscaler\n * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \\"next key\\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.\n * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything.\n * @param includeUninitialized If true, partially initialized resources are included in the response.\n * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything.\n * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.\n * @param pretty If 'true', then the output is pretty printed.\n * @param resourceVersion When specified with a watch call, shows changes that occur after that particular version of a resource. Defaults to changes from the beginning of history. When specified for list: - if unset, then the result is returned from remote storage based on quorum-read flag; - if it's 0, then we simply return what we currently have in cache, no guarantee; - if set to non zero, then the result is at least as fresh as given rv.\n * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.\n * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.\n * @param {*} [options] Override http request options.\n */\n listHorizontalPodAutoscalerForAllNamespaces(_continue, fieldSelector, includeUninitialized, labelSelector, limit, pretty, resourceVersion, timeoutSeconds, watch, options = {}) {\n const localVarPath = this.basePath + '/apis/autoscaling/v2beta2/horizontalpodautoscalers';\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n if (_continue !== undefined) {\n localVarQueryParameters['continue'] = ObjectSerializer.serialize(_continue, \"string\");\n }\n if (fieldSelector !== undefined) {\n localVarQueryParameters['fieldSelector'] = ObjectSerializer.serialize(fieldSelector, \"string\");\n }\n if (includeUninitialized !== undefined) {\n localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, \"boolean\");\n }\n if (labelSelector !== undefined) {\n localVarQueryParameters['labelSelector'] = ObjectSerializer.serialize(labelSelector, \"string\");\n }\n if (limit !== undefined) {\n localVarQueryParameters['limit'] = ObjectSerializer.serialize(limit, \"number\");\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (resourceVersion !== undefined) {\n localVarQueryParameters['resourceVersion'] = ObjectSerializer.serialize(resourceVersion, \"string\");\n }\n if (timeoutSeconds !== undefined) {\n localVarQueryParameters['timeoutSeconds'] = ObjectSerializer.serialize(timeoutSeconds, \"number\");\n }\n if (watch !== undefined) {\n localVarQueryParameters['watch'] = ObjectSerializer.serialize(watch, \"boolean\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V2beta2HorizontalPodAutoscalerList\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * list or watch objects of kind HorizontalPodAutoscaler\n * @param namespace object name and auth scope, such as for teams and projects\n * @param includeUninitialized If true, partially initialized resources are included in the response.\n * @param pretty If 'true', then the output is pretty printed.\n * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \\"next key\\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.\n * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything.\n * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything.\n * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.\n * @param resourceVersion When specified with a watch call, shows changes that occur after that particular version of a resource. Defaults to changes from the beginning of history. When specified for list: - if unset, then the result is returned from remote storage based on quorum-read flag; - if it's 0, then we simply return what we currently have in cache, no guarantee; - if set to non zero, then the result is at least as fresh as given rv.\n * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.\n * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.\n * @param {*} [options] Override http request options.\n */\n listNamespacedHorizontalPodAutoscaler(namespace, includeUninitialized, pretty, _continue, fieldSelector, labelSelector, limit, resourceVersion, timeoutSeconds, watch, options = {}) {\n const localVarPath = this.basePath + '/apis/autoscaling/v2beta2/namespaces/{namespace}/horizontalpodautoscalers'\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling listNamespacedHorizontalPodAutoscaler.');\n }\n if (includeUninitialized !== undefined) {\n localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, \"boolean\");\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (_continue !== undefined) {\n localVarQueryParameters['continue'] = ObjectSerializer.serialize(_continue, \"string\");\n }\n if (fieldSelector !== undefined) {\n localVarQueryParameters['fieldSelector'] = ObjectSerializer.serialize(fieldSelector, \"string\");\n }\n if (labelSelector !== undefined) {\n localVarQueryParameters['labelSelector'] = ObjectSerializer.serialize(labelSelector, \"string\");\n }\n if (limit !== undefined) {\n localVarQueryParameters['limit'] = ObjectSerializer.serialize(limit, \"number\");\n }\n if (resourceVersion !== undefined) {\n localVarQueryParameters['resourceVersion'] = ObjectSerializer.serialize(resourceVersion, \"string\");\n }\n if (timeoutSeconds !== undefined) {\n localVarQueryParameters['timeoutSeconds'] = ObjectSerializer.serialize(timeoutSeconds, \"number\");\n }\n if (watch !== undefined) {\n localVarQueryParameters['watch'] = ObjectSerializer.serialize(watch, \"boolean\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V2beta2HorizontalPodAutoscalerList\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * partially update the specified HorizontalPodAutoscaler\n * @param name name of the HorizontalPodAutoscaler\n * @param namespace object name and auth scope, such as for teams and projects\n * @param body\n * @param pretty If 'true', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param {*} [options] Override http request options.\n */\n patchNamespacedHorizontalPodAutoscaler(name, namespace, body, pretty, dryRun, options = {}) {\n const localVarPath = this.basePath + '/apis/autoscaling/v2beta2/namespaces/{namespace}/horizontalpodautoscalers/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling patchNamespacedHorizontalPodAutoscaler.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling patchNamespacedHorizontalPodAutoscaler.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling patchNamespacedHorizontalPodAutoscaler.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'PATCH',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: ObjectSerializer.serialize(body, \"any\")\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V2beta2HorizontalPodAutoscaler\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * partially update status of the specified HorizontalPodAutoscaler\n * @param name name of the HorizontalPodAutoscaler\n * @param namespace object name and auth scope, such as for teams and projects\n * @param body\n * @param pretty If 'true', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param {*} [options] Override http request options.\n */\n patchNamespacedHorizontalPodAutoscalerStatus(name, namespace, body, pretty, dryRun, options = {}) {\n const localVarPath = this.basePath + '/apis/autoscaling/v2beta2/namespaces/{namespace}/horizontalpodautoscalers/{name}/status'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling patchNamespacedHorizontalPodAutoscalerStatus.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling patchNamespacedHorizontalPodAutoscalerStatus.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling patchNamespacedHorizontalPodAutoscalerStatus.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'PATCH',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: ObjectSerializer.serialize(body, \"any\")\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V2beta2HorizontalPodAutoscaler\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * read the specified HorizontalPodAutoscaler\n * @param name name of the HorizontalPodAutoscaler\n * @param namespace object name and auth scope, such as for teams and projects\n * @param pretty If 'true', then the output is pretty printed.\n * @param exact Should the export be exact. Exact export maintains cluster-specific fields like 'Namespace'.\n * @param _export Should this value be exported. Export strips fields that a user can not specify.\n * @param {*} [options] Override http request options.\n */\n readNamespacedHorizontalPodAutoscaler(name, namespace, pretty, exact, _export, options = {}) {\n const localVarPath = this.basePath + '/apis/autoscaling/v2beta2/namespaces/{namespace}/horizontalpodautoscalers/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling readNamespacedHorizontalPodAutoscaler.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling readNamespacedHorizontalPodAutoscaler.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (exact !== undefined) {\n localVarQueryParameters['exact'] = ObjectSerializer.serialize(exact, \"boolean\");\n }\n if (_export !== undefined) {\n localVarQueryParameters['export'] = ObjectSerializer.serialize(_export, \"boolean\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V2beta2HorizontalPodAutoscaler\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * read status of the specified HorizontalPodAutoscaler\n * @param name name of the HorizontalPodAutoscaler\n * @param namespace object name and auth scope, such as for teams and projects\n * @param pretty If 'true', then the output is pretty printed.\n * @param {*} [options] Override http request options.\n */\n readNamespacedHorizontalPodAutoscalerStatus(name, namespace, pretty, options = {}) {\n const localVarPath = this.basePath + '/apis/autoscaling/v2beta2/namespaces/{namespace}/horizontalpodautoscalers/{name}/status'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling readNamespacedHorizontalPodAutoscalerStatus.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling readNamespacedHorizontalPodAutoscalerStatus.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V2beta2HorizontalPodAutoscaler\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * replace the specified HorizontalPodAutoscaler\n * @param name name of the HorizontalPodAutoscaler\n * @param namespace object name and auth scope, such as for teams and projects\n * @param body\n * @param pretty If 'true', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param {*} [options] Override http request options.\n */\n replaceNamespacedHorizontalPodAutoscaler(name, namespace, body, pretty, dryRun, options = {}) {\n const localVarPath = this.basePath + '/apis/autoscaling/v2beta2/namespaces/{namespace}/horizontalpodautoscalers/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling replaceNamespacedHorizontalPodAutoscaler.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling replaceNamespacedHorizontalPodAutoscaler.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling replaceNamespacedHorizontalPodAutoscaler.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'PUT',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: ObjectSerializer.serialize(body, \"V2beta2HorizontalPodAutoscaler\")\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V2beta2HorizontalPodAutoscaler\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * replace status of the specified HorizontalPodAutoscaler\n * @param name name of the HorizontalPodAutoscaler\n * @param namespace object name and auth scope, such as for teams and projects\n * @param body\n * @param pretty If 'true', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param {*} [options] Override http request options.\n */\n replaceNamespacedHorizontalPodAutoscalerStatus(name, namespace, body, pretty, dryRun, options = {}) {\n const localVarPath = this.basePath + '/apis/autoscaling/v2beta2/namespaces/{namespace}/horizontalpodautoscalers/{name}/status'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling replaceNamespacedHorizontalPodAutoscalerStatus.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling replaceNamespacedHorizontalPodAutoscalerStatus.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling replaceNamespacedHorizontalPodAutoscalerStatus.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'PUT',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: ObjectSerializer.serialize(body, \"V2beta2HorizontalPodAutoscaler\")\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V2beta2HorizontalPodAutoscaler\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n}\nexports.AutoscalingV2beta2Api = AutoscalingV2beta2Api;\nvar BatchApiApiKeys;\n(function (BatchApiApiKeys) {\n BatchApiApiKeys[BatchApiApiKeys[\"BearerToken\"] = 0] = \"BearerToken\";\n})(BatchApiApiKeys = exports.BatchApiApiKeys || (exports.BatchApiApiKeys = {}));\nclass BatchApi {\n constructor(basePathOrUsername, password, basePath) {\n this._basePath = defaultBasePath;\n this.defaultHeaders = {};\n this._useQuerystring = false;\n this.authentications = {\n 'default': new VoidAuth(),\n 'BearerToken': new ApiKeyAuth('header', 'authorization'),\n };\n if (password) {\n if (basePath) {\n this.basePath = basePath;\n }\n }\n else {\n if (basePathOrUsername) {\n this.basePath = basePathOrUsername;\n }\n }\n }\n set useQuerystring(value) {\n this._useQuerystring = value;\n }\n set basePath(basePath) {\n this._basePath = basePath;\n }\n get basePath() {\n return this._basePath;\n }\n setDefaultAuthentication(auth) {\n this.authentications.default = auth;\n }\n setApiKey(key, value) {\n this.authentications[BatchApiApiKeys[key]].apiKey = value;\n }\n /**\n * get information of a group\n * @param {*} [options] Override http request options.\n */\n getAPIGroup(options = {}) {\n const localVarPath = this.basePath + '/apis/batch/';\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1APIGroup\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n}\nexports.BatchApi = BatchApi;\nvar BatchV1ApiApiKeys;\n(function (BatchV1ApiApiKeys) {\n BatchV1ApiApiKeys[BatchV1ApiApiKeys[\"BearerToken\"] = 0] = \"BearerToken\";\n})(BatchV1ApiApiKeys = exports.BatchV1ApiApiKeys || (exports.BatchV1ApiApiKeys = {}));\nclass BatchV1Api {\n constructor(basePathOrUsername, password, basePath) {\n this._basePath = defaultBasePath;\n this.defaultHeaders = {};\n this._useQuerystring = false;\n this.authentications = {\n 'default': new VoidAuth(),\n 'BearerToken': new ApiKeyAuth('header', 'authorization'),\n };\n if (password) {\n if (basePath) {\n this.basePath = basePath;\n }\n }\n else {\n if (basePathOrUsername) {\n this.basePath = basePathOrUsername;\n }\n }\n }\n set useQuerystring(value) {\n this._useQuerystring = value;\n }\n set basePath(basePath) {\n this._basePath = basePath;\n }\n get basePath() {\n return this._basePath;\n }\n setDefaultAuthentication(auth) {\n this.authentications.default = auth;\n }\n setApiKey(key, value) {\n this.authentications[BatchV1ApiApiKeys[key]].apiKey = value;\n }\n /**\n * create a Job\n * @param namespace object name and auth scope, such as for teams and projects\n * @param body\n * @param includeUninitialized If true, partially initialized resources are included in the response.\n * @param pretty If 'true', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param {*} [options] Override http request options.\n */\n createNamespacedJob(namespace, body, includeUninitialized, pretty, dryRun, options = {}) {\n const localVarPath = this.basePath + '/apis/batch/v1/namespaces/{namespace}/jobs'\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling createNamespacedJob.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling createNamespacedJob.');\n }\n if (includeUninitialized !== undefined) {\n localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, \"boolean\");\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'POST',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: ObjectSerializer.serialize(body, \"V1Job\")\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1Job\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * delete collection of Job\n * @param namespace object name and auth scope, such as for teams and projects\n * @param includeUninitialized If true, partially initialized resources are included in the response.\n * @param pretty If 'true', then the output is pretty printed.\n * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \\"next key\\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.\n * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything.\n * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything.\n * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.\n * @param resourceVersion When specified with a watch call, shows changes that occur after that particular version of a resource. Defaults to changes from the beginning of history. When specified for list: - if unset, then the result is returned from remote storage based on quorum-read flag; - if it's 0, then we simply return what we currently have in cache, no guarantee; - if set to non zero, then the result is at least as fresh as given rv.\n * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.\n * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.\n * @param {*} [options] Override http request options.\n */\n deleteCollectionNamespacedJob(namespace, includeUninitialized, pretty, _continue, fieldSelector, labelSelector, limit, resourceVersion, timeoutSeconds, watch, options = {}) {\n const localVarPath = this.basePath + '/apis/batch/v1/namespaces/{namespace}/jobs'\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling deleteCollectionNamespacedJob.');\n }\n if (includeUninitialized !== undefined) {\n localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, \"boolean\");\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (_continue !== undefined) {\n localVarQueryParameters['continue'] = ObjectSerializer.serialize(_continue, \"string\");\n }\n if (fieldSelector !== undefined) {\n localVarQueryParameters['fieldSelector'] = ObjectSerializer.serialize(fieldSelector, \"string\");\n }\n if (labelSelector !== undefined) {\n localVarQueryParameters['labelSelector'] = ObjectSerializer.serialize(labelSelector, \"string\");\n }\n if (limit !== undefined) {\n localVarQueryParameters['limit'] = ObjectSerializer.serialize(limit, \"number\");\n }\n if (resourceVersion !== undefined) {\n localVarQueryParameters['resourceVersion'] = ObjectSerializer.serialize(resourceVersion, \"string\");\n }\n if (timeoutSeconds !== undefined) {\n localVarQueryParameters['timeoutSeconds'] = ObjectSerializer.serialize(timeoutSeconds, \"number\");\n }\n if (watch !== undefined) {\n localVarQueryParameters['watch'] = ObjectSerializer.serialize(watch, \"boolean\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'DELETE',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1Status\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * delete a Job\n * @param name name of the Job\n * @param namespace object name and auth scope, such as for teams and projects\n * @param pretty If 'true', then the output is pretty printed.\n * @param body\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param gracePeriodSeconds The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately.\n * @param orphanDependents Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \\"orphan\\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both.\n * @param propagationPolicy Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground.\n * @param {*} [options] Override http request options.\n */\n deleteNamespacedJob(name, namespace, pretty, body, dryRun, gracePeriodSeconds, orphanDependents, propagationPolicy, options = {}) {\n const localVarPath = this.basePath + '/apis/batch/v1/namespaces/{namespace}/jobs/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling deleteNamespacedJob.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling deleteNamespacedJob.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, \"string\");\n }\n if (gracePeriodSeconds !== undefined) {\n localVarQueryParameters['gracePeriodSeconds'] = ObjectSerializer.serialize(gracePeriodSeconds, \"number\");\n }\n if (orphanDependents !== undefined) {\n localVarQueryParameters['orphanDependents'] = ObjectSerializer.serialize(orphanDependents, \"boolean\");\n }\n if (propagationPolicy !== undefined) {\n localVarQueryParameters['propagationPolicy'] = ObjectSerializer.serialize(propagationPolicy, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'DELETE',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: ObjectSerializer.serialize(body, \"V1DeleteOptions\")\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1Status\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * get available resources\n * @param {*} [options] Override http request options.\n */\n getAPIResources(options = {}) {\n const localVarPath = this.basePath + '/apis/batch/v1/';\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1APIResourceList\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * list or watch objects of kind Job\n * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \\"next key\\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.\n * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything.\n * @param includeUninitialized If true, partially initialized resources are included in the response.\n * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything.\n * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.\n * @param pretty If 'true', then the output is pretty printed.\n * @param resourceVersion When specified with a watch call, shows changes that occur after that particular version of a resource. Defaults to changes from the beginning of history. When specified for list: - if unset, then the result is returned from remote storage based on quorum-read flag; - if it's 0, then we simply return what we currently have in cache, no guarantee; - if set to non zero, then the result is at least as fresh as given rv.\n * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.\n * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.\n * @param {*} [options] Override http request options.\n */\n listJobForAllNamespaces(_continue, fieldSelector, includeUninitialized, labelSelector, limit, pretty, resourceVersion, timeoutSeconds, watch, options = {}) {\n const localVarPath = this.basePath + '/apis/batch/v1/jobs';\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n if (_continue !== undefined) {\n localVarQueryParameters['continue'] = ObjectSerializer.serialize(_continue, \"string\");\n }\n if (fieldSelector !== undefined) {\n localVarQueryParameters['fieldSelector'] = ObjectSerializer.serialize(fieldSelector, \"string\");\n }\n if (includeUninitialized !== undefined) {\n localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, \"boolean\");\n }\n if (labelSelector !== undefined) {\n localVarQueryParameters['labelSelector'] = ObjectSerializer.serialize(labelSelector, \"string\");\n }\n if (limit !== undefined) {\n localVarQueryParameters['limit'] = ObjectSerializer.serialize(limit, \"number\");\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (resourceVersion !== undefined) {\n localVarQueryParameters['resourceVersion'] = ObjectSerializer.serialize(resourceVersion, \"string\");\n }\n if (timeoutSeconds !== undefined) {\n localVarQueryParameters['timeoutSeconds'] = ObjectSerializer.serialize(timeoutSeconds, \"number\");\n }\n if (watch !== undefined) {\n localVarQueryParameters['watch'] = ObjectSerializer.serialize(watch, \"boolean\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1JobList\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * list or watch objects of kind Job\n * @param namespace object name and auth scope, such as for teams and projects\n * @param includeUninitialized If true, partially initialized resources are included in the response.\n * @param pretty If 'true', then the output is pretty printed.\n * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \\"next key\\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.\n * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything.\n * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything.\n * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.\n * @param resourceVersion When specified with a watch call, shows changes that occur after that particular version of a resource. Defaults to changes from the beginning of history. When specified for list: - if unset, then the result is returned from remote storage based on quorum-read flag; - if it's 0, then we simply return what we currently have in cache, no guarantee; - if set to non zero, then the result is at least as fresh as given rv.\n * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.\n * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.\n * @param {*} [options] Override http request options.\n */\n listNamespacedJob(namespace, includeUninitialized, pretty, _continue, fieldSelector, labelSelector, limit, resourceVersion, timeoutSeconds, watch, options = {}) {\n const localVarPath = this.basePath + '/apis/batch/v1/namespaces/{namespace}/jobs'\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling listNamespacedJob.');\n }\n if (includeUninitialized !== undefined) {\n localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, \"boolean\");\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (_continue !== undefined) {\n localVarQueryParameters['continue'] = ObjectSerializer.serialize(_continue, \"string\");\n }\n if (fieldSelector !== undefined) {\n localVarQueryParameters['fieldSelector'] = ObjectSerializer.serialize(fieldSelector, \"string\");\n }\n if (labelSelector !== undefined) {\n localVarQueryParameters['labelSelector'] = ObjectSerializer.serialize(labelSelector, \"string\");\n }\n if (limit !== undefined) {\n localVarQueryParameters['limit'] = ObjectSerializer.serialize(limit, \"number\");\n }\n if (resourceVersion !== undefined) {\n localVarQueryParameters['resourceVersion'] = ObjectSerializer.serialize(resourceVersion, \"string\");\n }\n if (timeoutSeconds !== undefined) {\n localVarQueryParameters['timeoutSeconds'] = ObjectSerializer.serialize(timeoutSeconds, \"number\");\n }\n if (watch !== undefined) {\n localVarQueryParameters['watch'] = ObjectSerializer.serialize(watch, \"boolean\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1JobList\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * partially update the specified Job\n * @param name name of the Job\n * @param namespace object name and auth scope, such as for teams and projects\n * @param body\n * @param pretty If 'true', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param {*} [options] Override http request options.\n */\n patchNamespacedJob(name, namespace, body, pretty, dryRun, options = {}) {\n const localVarPath = this.basePath + '/apis/batch/v1/namespaces/{namespace}/jobs/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling patchNamespacedJob.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling patchNamespacedJob.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling patchNamespacedJob.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'PATCH',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: ObjectSerializer.serialize(body, \"any\")\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1Job\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * partially update status of the specified Job\n * @param name name of the Job\n * @param namespace object name and auth scope, such as for teams and projects\n * @param body\n * @param pretty If 'true', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param {*} [options] Override http request options.\n */\n patchNamespacedJobStatus(name, namespace, body, pretty, dryRun, options = {}) {\n const localVarPath = this.basePath + '/apis/batch/v1/namespaces/{namespace}/jobs/{name}/status'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling patchNamespacedJobStatus.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling patchNamespacedJobStatus.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling patchNamespacedJobStatus.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'PATCH',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: ObjectSerializer.serialize(body, \"any\")\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1Job\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * read the specified Job\n * @param name name of the Job\n * @param namespace object name and auth scope, such as for teams and projects\n * @param pretty If 'true', then the output is pretty printed.\n * @param exact Should the export be exact. Exact export maintains cluster-specific fields like 'Namespace'.\n * @param _export Should this value be exported. Export strips fields that a user can not specify.\n * @param {*} [options] Override http request options.\n */\n readNamespacedJob(name, namespace, pretty, exact, _export, options = {}) {\n const localVarPath = this.basePath + '/apis/batch/v1/namespaces/{namespace}/jobs/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling readNamespacedJob.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling readNamespacedJob.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (exact !== undefined) {\n localVarQueryParameters['exact'] = ObjectSerializer.serialize(exact, \"boolean\");\n }\n if (_export !== undefined) {\n localVarQueryParameters['export'] = ObjectSerializer.serialize(_export, \"boolean\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1Job\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * read status of the specified Job\n * @param name name of the Job\n * @param namespace object name and auth scope, such as for teams and projects\n * @param pretty If 'true', then the output is pretty printed.\n * @param {*} [options] Override http request options.\n */\n readNamespacedJobStatus(name, namespace, pretty, options = {}) {\n const localVarPath = this.basePath + '/apis/batch/v1/namespaces/{namespace}/jobs/{name}/status'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling readNamespacedJobStatus.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling readNamespacedJobStatus.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1Job\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * replace the specified Job\n * @param name name of the Job\n * @param namespace object name and auth scope, such as for teams and projects\n * @param body\n * @param pretty If 'true', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param {*} [options] Override http request options.\n */\n replaceNamespacedJob(name, namespace, body, pretty, dryRun, options = {}) {\n const localVarPath = this.basePath + '/apis/batch/v1/namespaces/{namespace}/jobs/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling replaceNamespacedJob.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling replaceNamespacedJob.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling replaceNamespacedJob.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'PUT',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: ObjectSerializer.serialize(body, \"V1Job\")\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1Job\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * replace status of the specified Job\n * @param name name of the Job\n * @param namespace object name and auth scope, such as for teams and projects\n * @param body\n * @param pretty If 'true', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param {*} [options] Override http request options.\n */\n replaceNamespacedJobStatus(name, namespace, body, pretty, dryRun, options = {}) {\n const localVarPath = this.basePath + '/apis/batch/v1/namespaces/{namespace}/jobs/{name}/status'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling replaceNamespacedJobStatus.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling replaceNamespacedJobStatus.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling replaceNamespacedJobStatus.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'PUT',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: ObjectSerializer.serialize(body, \"V1Job\")\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1Job\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n}\nexports.BatchV1Api = BatchV1Api;\nvar BatchV1beta1ApiApiKeys;\n(function (BatchV1beta1ApiApiKeys) {\n BatchV1beta1ApiApiKeys[BatchV1beta1ApiApiKeys[\"BearerToken\"] = 0] = \"BearerToken\";\n})(BatchV1beta1ApiApiKeys = exports.BatchV1beta1ApiApiKeys || (exports.BatchV1beta1ApiApiKeys = {}));\nclass BatchV1beta1Api {\n constructor(basePathOrUsername, password, basePath) {\n this._basePath = defaultBasePath;\n this.defaultHeaders = {};\n this._useQuerystring = false;\n this.authentications = {\n 'default': new VoidAuth(),\n 'BearerToken': new ApiKeyAuth('header', 'authorization'),\n };\n if (password) {\n if (basePath) {\n this.basePath = basePath;\n }\n }\n else {\n if (basePathOrUsername) {\n this.basePath = basePathOrUsername;\n }\n }\n }\n set useQuerystring(value) {\n this._useQuerystring = value;\n }\n set basePath(basePath) {\n this._basePath = basePath;\n }\n get basePath() {\n return this._basePath;\n }\n setDefaultAuthentication(auth) {\n this.authentications.default = auth;\n }\n setApiKey(key, value) {\n this.authentications[BatchV1beta1ApiApiKeys[key]].apiKey = value;\n }\n /**\n * create a CronJob\n * @param namespace object name and auth scope, such as for teams and projects\n * @param body\n * @param includeUninitialized If true, partially initialized resources are included in the response.\n * @param pretty If 'true', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param {*} [options] Override http request options.\n */\n createNamespacedCronJob(namespace, body, includeUninitialized, pretty, dryRun, options = {}) {\n const localVarPath = this.basePath + '/apis/batch/v1beta1/namespaces/{namespace}/cronjobs'\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling createNamespacedCronJob.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling createNamespacedCronJob.');\n }\n if (includeUninitialized !== undefined) {\n localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, \"boolean\");\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'POST',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: ObjectSerializer.serialize(body, \"V1beta1CronJob\")\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1beta1CronJob\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * delete collection of CronJob\n * @param namespace object name and auth scope, such as for teams and projects\n * @param includeUninitialized If true, partially initialized resources are included in the response.\n * @param pretty If 'true', then the output is pretty printed.\n * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \\"next key\\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.\n * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything.\n * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything.\n * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.\n * @param resourceVersion When specified with a watch call, shows changes that occur after that particular version of a resource. Defaults to changes from the beginning of history. When specified for list: - if unset, then the result is returned from remote storage based on quorum-read flag; - if it's 0, then we simply return what we currently have in cache, no guarantee; - if set to non zero, then the result is at least as fresh as given rv.\n * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.\n * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.\n * @param {*} [options] Override http request options.\n */\n deleteCollectionNamespacedCronJob(namespace, includeUninitialized, pretty, _continue, fieldSelector, labelSelector, limit, resourceVersion, timeoutSeconds, watch, options = {}) {\n const localVarPath = this.basePath + '/apis/batch/v1beta1/namespaces/{namespace}/cronjobs'\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling deleteCollectionNamespacedCronJob.');\n }\n if (includeUninitialized !== undefined) {\n localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, \"boolean\");\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (_continue !== undefined) {\n localVarQueryParameters['continue'] = ObjectSerializer.serialize(_continue, \"string\");\n }\n if (fieldSelector !== undefined) {\n localVarQueryParameters['fieldSelector'] = ObjectSerializer.serialize(fieldSelector, \"string\");\n }\n if (labelSelector !== undefined) {\n localVarQueryParameters['labelSelector'] = ObjectSerializer.serialize(labelSelector, \"string\");\n }\n if (limit !== undefined) {\n localVarQueryParameters['limit'] = ObjectSerializer.serialize(limit, \"number\");\n }\n if (resourceVersion !== undefined) {\n localVarQueryParameters['resourceVersion'] = ObjectSerializer.serialize(resourceVersion, \"string\");\n }\n if (timeoutSeconds !== undefined) {\n localVarQueryParameters['timeoutSeconds'] = ObjectSerializer.serialize(timeoutSeconds, \"number\");\n }\n if (watch !== undefined) {\n localVarQueryParameters['watch'] = ObjectSerializer.serialize(watch, \"boolean\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'DELETE',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1Status\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * delete a CronJob\n * @param name name of the CronJob\n * @param namespace object name and auth scope, such as for teams and projects\n * @param pretty If 'true', then the output is pretty printed.\n * @param body\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param gracePeriodSeconds The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately.\n * @param orphanDependents Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \\"orphan\\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both.\n * @param propagationPolicy Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground.\n * @param {*} [options] Override http request options.\n */\n deleteNamespacedCronJob(name, namespace, pretty, body, dryRun, gracePeriodSeconds, orphanDependents, propagationPolicy, options = {}) {\n const localVarPath = this.basePath + '/apis/batch/v1beta1/namespaces/{namespace}/cronjobs/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling deleteNamespacedCronJob.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling deleteNamespacedCronJob.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, \"string\");\n }\n if (gracePeriodSeconds !== undefined) {\n localVarQueryParameters['gracePeriodSeconds'] = ObjectSerializer.serialize(gracePeriodSeconds, \"number\");\n }\n if (orphanDependents !== undefined) {\n localVarQueryParameters['orphanDependents'] = ObjectSerializer.serialize(orphanDependents, \"boolean\");\n }\n if (propagationPolicy !== undefined) {\n localVarQueryParameters['propagationPolicy'] = ObjectSerializer.serialize(propagationPolicy, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'DELETE',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: ObjectSerializer.serialize(body, \"V1DeleteOptions\")\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1Status\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * get available resources\n * @param {*} [options] Override http request options.\n */\n getAPIResources(options = {}) {\n const localVarPath = this.basePath + '/apis/batch/v1beta1/';\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1APIResourceList\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * list or watch objects of kind CronJob\n * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \\"next key\\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.\n * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything.\n * @param includeUninitialized If true, partially initialized resources are included in the response.\n * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything.\n * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.\n * @param pretty If 'true', then the output is pretty printed.\n * @param resourceVersion When specified with a watch call, shows changes that occur after that particular version of a resource. Defaults to changes from the beginning of history. When specified for list: - if unset, then the result is returned from remote storage based on quorum-read flag; - if it's 0, then we simply return what we currently have in cache, no guarantee; - if set to non zero, then the result is at least as fresh as given rv.\n * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.\n * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.\n * @param {*} [options] Override http request options.\n */\n listCronJobForAllNamespaces(_continue, fieldSelector, includeUninitialized, labelSelector, limit, pretty, resourceVersion, timeoutSeconds, watch, options = {}) {\n const localVarPath = this.basePath + '/apis/batch/v1beta1/cronjobs';\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n if (_continue !== undefined) {\n localVarQueryParameters['continue'] = ObjectSerializer.serialize(_continue, \"string\");\n }\n if (fieldSelector !== undefined) {\n localVarQueryParameters['fieldSelector'] = ObjectSerializer.serialize(fieldSelector, \"string\");\n }\n if (includeUninitialized !== undefined) {\n localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, \"boolean\");\n }\n if (labelSelector !== undefined) {\n localVarQueryParameters['labelSelector'] = ObjectSerializer.serialize(labelSelector, \"string\");\n }\n if (limit !== undefined) {\n localVarQueryParameters['limit'] = ObjectSerializer.serialize(limit, \"number\");\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (resourceVersion !== undefined) {\n localVarQueryParameters['resourceVersion'] = ObjectSerializer.serialize(resourceVersion, \"string\");\n }\n if (timeoutSeconds !== undefined) {\n localVarQueryParameters['timeoutSeconds'] = ObjectSerializer.serialize(timeoutSeconds, \"number\");\n }\n if (watch !== undefined) {\n localVarQueryParameters['watch'] = ObjectSerializer.serialize(watch, \"boolean\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1beta1CronJobList\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * list or watch objects of kind CronJob\n * @param namespace object name and auth scope, such as for teams and projects\n * @param includeUninitialized If true, partially initialized resources are included in the response.\n * @param pretty If 'true', then the output is pretty printed.\n * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \\"next key\\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.\n * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything.\n * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything.\n * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.\n * @param resourceVersion When specified with a watch call, shows changes that occur after that particular version of a resource. Defaults to changes from the beginning of history. When specified for list: - if unset, then the result is returned from remote storage based on quorum-read flag; - if it's 0, then we simply return what we currently have in cache, no guarantee; - if set to non zero, then the result is at least as fresh as given rv.\n * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.\n * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.\n * @param {*} [options] Override http request options.\n */\n listNamespacedCronJob(namespace, includeUninitialized, pretty, _continue, fieldSelector, labelSelector, limit, resourceVersion, timeoutSeconds, watch, options = {}) {\n const localVarPath = this.basePath + '/apis/batch/v1beta1/namespaces/{namespace}/cronjobs'\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling listNamespacedCronJob.');\n }\n if (includeUninitialized !== undefined) {\n localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, \"boolean\");\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (_continue !== undefined) {\n localVarQueryParameters['continue'] = ObjectSerializer.serialize(_continue, \"string\");\n }\n if (fieldSelector !== undefined) {\n localVarQueryParameters['fieldSelector'] = ObjectSerializer.serialize(fieldSelector, \"string\");\n }\n if (labelSelector !== undefined) {\n localVarQueryParameters['labelSelector'] = ObjectSerializer.serialize(labelSelector, \"string\");\n }\n if (limit !== undefined) {\n localVarQueryParameters['limit'] = ObjectSerializer.serialize(limit, \"number\");\n }\n if (resourceVersion !== undefined) {\n localVarQueryParameters['resourceVersion'] = ObjectSerializer.serialize(resourceVersion, \"string\");\n }\n if (timeoutSeconds !== undefined) {\n localVarQueryParameters['timeoutSeconds'] = ObjectSerializer.serialize(timeoutSeconds, \"number\");\n }\n if (watch !== undefined) {\n localVarQueryParameters['watch'] = ObjectSerializer.serialize(watch, \"boolean\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1beta1CronJobList\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * partially update the specified CronJob\n * @param name name of the CronJob\n * @param namespace object name and auth scope, such as for teams and projects\n * @param body\n * @param pretty If 'true', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param {*} [options] Override http request options.\n */\n patchNamespacedCronJob(name, namespace, body, pretty, dryRun, options = {}) {\n const localVarPath = this.basePath + '/apis/batch/v1beta1/namespaces/{namespace}/cronjobs/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling patchNamespacedCronJob.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling patchNamespacedCronJob.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling patchNamespacedCronJob.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'PATCH',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: ObjectSerializer.serialize(body, \"any\")\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1beta1CronJob\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * partially update status of the specified CronJob\n * @param name name of the CronJob\n * @param namespace object name and auth scope, such as for teams and projects\n * @param body\n * @param pretty If 'true', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param {*} [options] Override http request options.\n */\n patchNamespacedCronJobStatus(name, namespace, body, pretty, dryRun, options = {}) {\n const localVarPath = this.basePath + '/apis/batch/v1beta1/namespaces/{namespace}/cronjobs/{name}/status'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling patchNamespacedCronJobStatus.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling patchNamespacedCronJobStatus.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling patchNamespacedCronJobStatus.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'PATCH',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: ObjectSerializer.serialize(body, \"any\")\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1beta1CronJob\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * read the specified CronJob\n * @param name name of the CronJob\n * @param namespace object name and auth scope, such as for teams and projects\n * @param pretty If 'true', then the output is pretty printed.\n * @param exact Should the export be exact. Exact export maintains cluster-specific fields like 'Namespace'.\n * @param _export Should this value be exported. Export strips fields that a user can not specify.\n * @param {*} [options] Override http request options.\n */\n readNamespacedCronJob(name, namespace, pretty, exact, _export, options = {}) {\n const localVarPath = this.basePath + '/apis/batch/v1beta1/namespaces/{namespace}/cronjobs/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling readNamespacedCronJob.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling readNamespacedCronJob.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (exact !== undefined) {\n localVarQueryParameters['exact'] = ObjectSerializer.serialize(exact, \"boolean\");\n }\n if (_export !== undefined) {\n localVarQueryParameters['export'] = ObjectSerializer.serialize(_export, \"boolean\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1beta1CronJob\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * read status of the specified CronJob\n * @param name name of the CronJob\n * @param namespace object name and auth scope, such as for teams and projects\n * @param pretty If 'true', then the output is pretty printed.\n * @param {*} [options] Override http request options.\n */\n readNamespacedCronJobStatus(name, namespace, pretty, options = {}) {\n const localVarPath = this.basePath + '/apis/batch/v1beta1/namespaces/{namespace}/cronjobs/{name}/status'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling readNamespacedCronJobStatus.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling readNamespacedCronJobStatus.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1beta1CronJob\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * replace the specified CronJob\n * @param name name of the CronJob\n * @param namespace object name and auth scope, such as for teams and projects\n * @param body\n * @param pretty If 'true', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param {*} [options] Override http request options.\n */\n replaceNamespacedCronJob(name, namespace, body, pretty, dryRun, options = {}) {\n const localVarPath = this.basePath + '/apis/batch/v1beta1/namespaces/{namespace}/cronjobs/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling replaceNamespacedCronJob.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling replaceNamespacedCronJob.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling replaceNamespacedCronJob.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'PUT',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: ObjectSerializer.serialize(body, \"V1beta1CronJob\")\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1beta1CronJob\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * replace status of the specified CronJob\n * @param name name of the CronJob\n * @param namespace object name and auth scope, such as for teams and projects\n * @param body\n * @param pretty If 'true', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param {*} [options] Override http request options.\n */\n replaceNamespacedCronJobStatus(name, namespace, body, pretty, dryRun, options = {}) {\n const localVarPath = this.basePath + '/apis/batch/v1beta1/namespaces/{namespace}/cronjobs/{name}/status'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling replaceNamespacedCronJobStatus.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling replaceNamespacedCronJobStatus.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling replaceNamespacedCronJobStatus.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'PUT',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: ObjectSerializer.serialize(body, \"V1beta1CronJob\")\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1beta1CronJob\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n}\nexports.BatchV1beta1Api = BatchV1beta1Api;\nvar BatchV2alpha1ApiApiKeys;\n(function (BatchV2alpha1ApiApiKeys) {\n BatchV2alpha1ApiApiKeys[BatchV2alpha1ApiApiKeys[\"BearerToken\"] = 0] = \"BearerToken\";\n})(BatchV2alpha1ApiApiKeys = exports.BatchV2alpha1ApiApiKeys || (exports.BatchV2alpha1ApiApiKeys = {}));\nclass BatchV2alpha1Api {\n constructor(basePathOrUsername, password, basePath) {\n this._basePath = defaultBasePath;\n this.defaultHeaders = {};\n this._useQuerystring = false;\n this.authentications = {\n 'default': new VoidAuth(),\n 'BearerToken': new ApiKeyAuth('header', 'authorization'),\n };\n if (password) {\n if (basePath) {\n this.basePath = basePath;\n }\n }\n else {\n if (basePathOrUsername) {\n this.basePath = basePathOrUsername;\n }\n }\n }\n set useQuerystring(value) {\n this._useQuerystring = value;\n }\n set basePath(basePath) {\n this._basePath = basePath;\n }\n get basePath() {\n return this._basePath;\n }\n setDefaultAuthentication(auth) {\n this.authentications.default = auth;\n }\n setApiKey(key, value) {\n this.authentications[BatchV2alpha1ApiApiKeys[key]].apiKey = value;\n }\n /**\n * create a CronJob\n * @param namespace object name and auth scope, such as for teams and projects\n * @param body\n * @param includeUninitialized If true, partially initialized resources are included in the response.\n * @param pretty If 'true', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param {*} [options] Override http request options.\n */\n createNamespacedCronJob(namespace, body, includeUninitialized, pretty, dryRun, options = {}) {\n const localVarPath = this.basePath + '/apis/batch/v2alpha1/namespaces/{namespace}/cronjobs'\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling createNamespacedCronJob.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling createNamespacedCronJob.');\n }\n if (includeUninitialized !== undefined) {\n localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, \"boolean\");\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'POST',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: ObjectSerializer.serialize(body, \"V2alpha1CronJob\")\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V2alpha1CronJob\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * delete collection of CronJob\n * @param namespace object name and auth scope, such as for teams and projects\n * @param includeUninitialized If true, partially initialized resources are included in the response.\n * @param pretty If 'true', then the output is pretty printed.\n * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \\"next key\\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.\n * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything.\n * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything.\n * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.\n * @param resourceVersion When specified with a watch call, shows changes that occur after that particular version of a resource. Defaults to changes from the beginning of history. When specified for list: - if unset, then the result is returned from remote storage based on quorum-read flag; - if it's 0, then we simply return what we currently have in cache, no guarantee; - if set to non zero, then the result is at least as fresh as given rv.\n * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.\n * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.\n * @param {*} [options] Override http request options.\n */\n deleteCollectionNamespacedCronJob(namespace, includeUninitialized, pretty, _continue, fieldSelector, labelSelector, limit, resourceVersion, timeoutSeconds, watch, options = {}) {\n const localVarPath = this.basePath + '/apis/batch/v2alpha1/namespaces/{namespace}/cronjobs'\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling deleteCollectionNamespacedCronJob.');\n }\n if (includeUninitialized !== undefined) {\n localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, \"boolean\");\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (_continue !== undefined) {\n localVarQueryParameters['continue'] = ObjectSerializer.serialize(_continue, \"string\");\n }\n if (fieldSelector !== undefined) {\n localVarQueryParameters['fieldSelector'] = ObjectSerializer.serialize(fieldSelector, \"string\");\n }\n if (labelSelector !== undefined) {\n localVarQueryParameters['labelSelector'] = ObjectSerializer.serialize(labelSelector, \"string\");\n }\n if (limit !== undefined) {\n localVarQueryParameters['limit'] = ObjectSerializer.serialize(limit, \"number\");\n }\n if (resourceVersion !== undefined) {\n localVarQueryParameters['resourceVersion'] = ObjectSerializer.serialize(resourceVersion, \"string\");\n }\n if (timeoutSeconds !== undefined) {\n localVarQueryParameters['timeoutSeconds'] = ObjectSerializer.serialize(timeoutSeconds, \"number\");\n }\n if (watch !== undefined) {\n localVarQueryParameters['watch'] = ObjectSerializer.serialize(watch, \"boolean\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'DELETE',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1Status\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * delete a CronJob\n * @param name name of the CronJob\n * @param namespace object name and auth scope, such as for teams and projects\n * @param pretty If 'true', then the output is pretty printed.\n * @param body\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param gracePeriodSeconds The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately.\n * @param orphanDependents Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \\"orphan\\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both.\n * @param propagationPolicy Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground.\n * @param {*} [options] Override http request options.\n */\n deleteNamespacedCronJob(name, namespace, pretty, body, dryRun, gracePeriodSeconds, orphanDependents, propagationPolicy, options = {}) {\n const localVarPath = this.basePath + '/apis/batch/v2alpha1/namespaces/{namespace}/cronjobs/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling deleteNamespacedCronJob.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling deleteNamespacedCronJob.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, \"string\");\n }\n if (gracePeriodSeconds !== undefined) {\n localVarQueryParameters['gracePeriodSeconds'] = ObjectSerializer.serialize(gracePeriodSeconds, \"number\");\n }\n if (orphanDependents !== undefined) {\n localVarQueryParameters['orphanDependents'] = ObjectSerializer.serialize(orphanDependents, \"boolean\");\n }\n if (propagationPolicy !== undefined) {\n localVarQueryParameters['propagationPolicy'] = ObjectSerializer.serialize(propagationPolicy, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'DELETE',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: ObjectSerializer.serialize(body, \"V1DeleteOptions\")\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1Status\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * get available resources\n * @param {*} [options] Override http request options.\n */\n getAPIResources(options = {}) {\n const localVarPath = this.basePath + '/apis/batch/v2alpha1/';\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1APIResourceList\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * list or watch objects of kind CronJob\n * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \\"next key\\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.\n * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything.\n * @param includeUninitialized If true, partially initialized resources are included in the response.\n * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything.\n * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.\n * @param pretty If 'true', then the output is pretty printed.\n * @param resourceVersion When specified with a watch call, shows changes that occur after that particular version of a resource. Defaults to changes from the beginning of history. When specified for list: - if unset, then the result is returned from remote storage based on quorum-read flag; - if it's 0, then we simply return what we currently have in cache, no guarantee; - if set to non zero, then the result is at least as fresh as given rv.\n * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.\n * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.\n * @param {*} [options] Override http request options.\n */\n listCronJobForAllNamespaces(_continue, fieldSelector, includeUninitialized, labelSelector, limit, pretty, resourceVersion, timeoutSeconds, watch, options = {}) {\n const localVarPath = this.basePath + '/apis/batch/v2alpha1/cronjobs';\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n if (_continue !== undefined) {\n localVarQueryParameters['continue'] = ObjectSerializer.serialize(_continue, \"string\");\n }\n if (fieldSelector !== undefined) {\n localVarQueryParameters['fieldSelector'] = ObjectSerializer.serialize(fieldSelector, \"string\");\n }\n if (includeUninitialized !== undefined) {\n localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, \"boolean\");\n }\n if (labelSelector !== undefined) {\n localVarQueryParameters['labelSelector'] = ObjectSerializer.serialize(labelSelector, \"string\");\n }\n if (limit !== undefined) {\n localVarQueryParameters['limit'] = ObjectSerializer.serialize(limit, \"number\");\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (resourceVersion !== undefined) {\n localVarQueryParameters['resourceVersion'] = ObjectSerializer.serialize(resourceVersion, \"string\");\n }\n if (timeoutSeconds !== undefined) {\n localVarQueryParameters['timeoutSeconds'] = ObjectSerializer.serialize(timeoutSeconds, \"number\");\n }\n if (watch !== undefined) {\n localVarQueryParameters['watch'] = ObjectSerializer.serialize(watch, \"boolean\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V2alpha1CronJobList\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * list or watch objects of kind CronJob\n * @param namespace object name and auth scope, such as for teams and projects\n * @param includeUninitialized If true, partially initialized resources are included in the response.\n * @param pretty If 'true', then the output is pretty printed.\n * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \\"next key\\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.\n * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything.\n * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything.\n * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.\n * @param resourceVersion When specified with a watch call, shows changes that occur after that particular version of a resource. Defaults to changes from the beginning of history. When specified for list: - if unset, then the result is returned from remote storage based on quorum-read flag; - if it's 0, then we simply return what we currently have in cache, no guarantee; - if set to non zero, then the result is at least as fresh as given rv.\n * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.\n * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.\n * @param {*} [options] Override http request options.\n */\n listNamespacedCronJob(namespace, includeUninitialized, pretty, _continue, fieldSelector, labelSelector, limit, resourceVersion, timeoutSeconds, watch, options = {}) {\n const localVarPath = this.basePath + '/apis/batch/v2alpha1/namespaces/{namespace}/cronjobs'\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling listNamespacedCronJob.');\n }\n if (includeUninitialized !== undefined) {\n localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, \"boolean\");\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (_continue !== undefined) {\n localVarQueryParameters['continue'] = ObjectSerializer.serialize(_continue, \"string\");\n }\n if (fieldSelector !== undefined) {\n localVarQueryParameters['fieldSelector'] = ObjectSerializer.serialize(fieldSelector, \"string\");\n }\n if (labelSelector !== undefined) {\n localVarQueryParameters['labelSelector'] = ObjectSerializer.serialize(labelSelector, \"string\");\n }\n if (limit !== undefined) {\n localVarQueryParameters['limit'] = ObjectSerializer.serialize(limit, \"number\");\n }\n if (resourceVersion !== undefined) {\n localVarQueryParameters['resourceVersion'] = ObjectSerializer.serialize(resourceVersion, \"string\");\n }\n if (timeoutSeconds !== undefined) {\n localVarQueryParameters['timeoutSeconds'] = ObjectSerializer.serialize(timeoutSeconds, \"number\");\n }\n if (watch !== undefined) {\n localVarQueryParameters['watch'] = ObjectSerializer.serialize(watch, \"boolean\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V2alpha1CronJobList\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * partially update the specified CronJob\n * @param name name of the CronJob\n * @param namespace object name and auth scope, such as for teams and projects\n * @param body\n * @param pretty If 'true', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param {*} [options] Override http request options.\n */\n patchNamespacedCronJob(name, namespace, body, pretty, dryRun, options = {}) {\n const localVarPath = this.basePath + '/apis/batch/v2alpha1/namespaces/{namespace}/cronjobs/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling patchNamespacedCronJob.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling patchNamespacedCronJob.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling patchNamespacedCronJob.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'PATCH',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: ObjectSerializer.serialize(body, \"any\")\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V2alpha1CronJob\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * partially update status of the specified CronJob\n * @param name name of the CronJob\n * @param namespace object name and auth scope, such as for teams and projects\n * @param body\n * @param pretty If 'true', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param {*} [options] Override http request options.\n */\n patchNamespacedCronJobStatus(name, namespace, body, pretty, dryRun, options = {}) {\n const localVarPath = this.basePath + '/apis/batch/v2alpha1/namespaces/{namespace}/cronjobs/{name}/status'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling patchNamespacedCronJobStatus.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling patchNamespacedCronJobStatus.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling patchNamespacedCronJobStatus.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'PATCH',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: ObjectSerializer.serialize(body, \"any\")\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V2alpha1CronJob\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * read the specified CronJob\n * @param name name of the CronJob\n * @param namespace object name and auth scope, such as for teams and projects\n * @param pretty If 'true', then the output is pretty printed.\n * @param exact Should the export be exact. Exact export maintains cluster-specific fields like 'Namespace'.\n * @param _export Should this value be exported. Export strips fields that a user can not specify.\n * @param {*} [options] Override http request options.\n */\n readNamespacedCronJob(name, namespace, pretty, exact, _export, options = {}) {\n const localVarPath = this.basePath + '/apis/batch/v2alpha1/namespaces/{namespace}/cronjobs/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling readNamespacedCronJob.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling readNamespacedCronJob.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (exact !== undefined) {\n localVarQueryParameters['exact'] = ObjectSerializer.serialize(exact, \"boolean\");\n }\n if (_export !== undefined) {\n localVarQueryParameters['export'] = ObjectSerializer.serialize(_export, \"boolean\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V2alpha1CronJob\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * read status of the specified CronJob\n * @param name name of the CronJob\n * @param namespace object name and auth scope, such as for teams and projects\n * @param pretty If 'true', then the output is pretty printed.\n * @param {*} [options] Override http request options.\n */\n readNamespacedCronJobStatus(name, namespace, pretty, options = {}) {\n const localVarPath = this.basePath + '/apis/batch/v2alpha1/namespaces/{namespace}/cronjobs/{name}/status'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling readNamespacedCronJobStatus.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling readNamespacedCronJobStatus.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V2alpha1CronJob\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * replace the specified CronJob\n * @param name name of the CronJob\n * @param namespace object name and auth scope, such as for teams and projects\n * @param body\n * @param pretty If 'true', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param {*} [options] Override http request options.\n */\n replaceNamespacedCronJob(name, namespace, body, pretty, dryRun, options = {}) {\n const localVarPath = this.basePath + '/apis/batch/v2alpha1/namespaces/{namespace}/cronjobs/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling replaceNamespacedCronJob.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling replaceNamespacedCronJob.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling replaceNamespacedCronJob.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'PUT',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: ObjectSerializer.serialize(body, \"V2alpha1CronJob\")\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V2alpha1CronJob\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * replace status of the specified CronJob\n * @param name name of the CronJob\n * @param namespace object name and auth scope, such as for teams and projects\n * @param body\n * @param pretty If 'true', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param {*} [options] Override http request options.\n */\n replaceNamespacedCronJobStatus(name, namespace, body, pretty, dryRun, options = {}) {\n const localVarPath = this.basePath + '/apis/batch/v2alpha1/namespaces/{namespace}/cronjobs/{name}/status'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling replaceNamespacedCronJobStatus.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling replaceNamespacedCronJobStatus.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling replaceNamespacedCronJobStatus.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'PUT',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: ObjectSerializer.serialize(body, \"V2alpha1CronJob\")\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V2alpha1CronJob\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n}\nexports.BatchV2alpha1Api = BatchV2alpha1Api;\nvar CertificatesApiApiKeys;\n(function (CertificatesApiApiKeys) {\n CertificatesApiApiKeys[CertificatesApiApiKeys[\"BearerToken\"] = 0] = \"BearerToken\";\n})(CertificatesApiApiKeys = exports.CertificatesApiApiKeys || (exports.CertificatesApiApiKeys = {}));\nclass CertificatesApi {\n constructor(basePathOrUsername, password, basePath) {\n this._basePath = defaultBasePath;\n this.defaultHeaders = {};\n this._useQuerystring = false;\n this.authentications = {\n 'default': new VoidAuth(),\n 'BearerToken': new ApiKeyAuth('header', 'authorization'),\n };\n if (password) {\n if (basePath) {\n this.basePath = basePath;\n }\n }\n else {\n if (basePathOrUsername) {\n this.basePath = basePathOrUsername;\n }\n }\n }\n set useQuerystring(value) {\n this._useQuerystring = value;\n }\n set basePath(basePath) {\n this._basePath = basePath;\n }\n get basePath() {\n return this._basePath;\n }\n setDefaultAuthentication(auth) {\n this.authentications.default = auth;\n }\n setApiKey(key, value) {\n this.authentications[CertificatesApiApiKeys[key]].apiKey = value;\n }\n /**\n * get information of a group\n * @param {*} [options] Override http request options.\n */\n getAPIGroup(options = {}) {\n const localVarPath = this.basePath + '/apis/certificates.k8s.io/';\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1APIGroup\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n}\nexports.CertificatesApi = CertificatesApi;\nvar CertificatesV1beta1ApiApiKeys;\n(function (CertificatesV1beta1ApiApiKeys) {\n CertificatesV1beta1ApiApiKeys[CertificatesV1beta1ApiApiKeys[\"BearerToken\"] = 0] = \"BearerToken\";\n})(CertificatesV1beta1ApiApiKeys = exports.CertificatesV1beta1ApiApiKeys || (exports.CertificatesV1beta1ApiApiKeys = {}));\nclass CertificatesV1beta1Api {\n constructor(basePathOrUsername, password, basePath) {\n this._basePath = defaultBasePath;\n this.defaultHeaders = {};\n this._useQuerystring = false;\n this.authentications = {\n 'default': new VoidAuth(),\n 'BearerToken': new ApiKeyAuth('header', 'authorization'),\n };\n if (password) {\n if (basePath) {\n this.basePath = basePath;\n }\n }\n else {\n if (basePathOrUsername) {\n this.basePath = basePathOrUsername;\n }\n }\n }\n set useQuerystring(value) {\n this._useQuerystring = value;\n }\n set basePath(basePath) {\n this._basePath = basePath;\n }\n get basePath() {\n return this._basePath;\n }\n setDefaultAuthentication(auth) {\n this.authentications.default = auth;\n }\n setApiKey(key, value) {\n this.authentications[CertificatesV1beta1ApiApiKeys[key]].apiKey = value;\n }\n /**\n * create a CertificateSigningRequest\n * @param body\n * @param includeUninitialized If true, partially initialized resources are included in the response.\n * @param pretty If 'true', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param {*} [options] Override http request options.\n */\n createCertificateSigningRequest(body, includeUninitialized, pretty, dryRun, options = {}) {\n const localVarPath = this.basePath + '/apis/certificates.k8s.io/v1beta1/certificatesigningrequests';\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling createCertificateSigningRequest.');\n }\n if (includeUninitialized !== undefined) {\n localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, \"boolean\");\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'POST',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: ObjectSerializer.serialize(body, \"V1beta1CertificateSigningRequest\")\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1beta1CertificateSigningRequest\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * delete a CertificateSigningRequest\n * @param name name of the CertificateSigningRequest\n * @param pretty If 'true', then the output is pretty printed.\n * @param body\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param gracePeriodSeconds The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately.\n * @param orphanDependents Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \\"orphan\\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both.\n * @param propagationPolicy Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground.\n * @param {*} [options] Override http request options.\n */\n deleteCertificateSigningRequest(name, pretty, body, dryRun, gracePeriodSeconds, orphanDependents, propagationPolicy, options = {}) {\n const localVarPath = this.basePath + '/apis/certificates.k8s.io/v1beta1/certificatesigningrequests/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling deleteCertificateSigningRequest.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, \"string\");\n }\n if (gracePeriodSeconds !== undefined) {\n localVarQueryParameters['gracePeriodSeconds'] = ObjectSerializer.serialize(gracePeriodSeconds, \"number\");\n }\n if (orphanDependents !== undefined) {\n localVarQueryParameters['orphanDependents'] = ObjectSerializer.serialize(orphanDependents, \"boolean\");\n }\n if (propagationPolicy !== undefined) {\n localVarQueryParameters['propagationPolicy'] = ObjectSerializer.serialize(propagationPolicy, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'DELETE',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: ObjectSerializer.serialize(body, \"V1DeleteOptions\")\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1Status\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * delete collection of CertificateSigningRequest\n * @param includeUninitialized If true, partially initialized resources are included in the response.\n * @param pretty If 'true', then the output is pretty printed.\n * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \\"next key\\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.\n * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything.\n * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything.\n * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.\n * @param resourceVersion When specified with a watch call, shows changes that occur after that particular version of a resource. Defaults to changes from the beginning of history. When specified for list: - if unset, then the result is returned from remote storage based on quorum-read flag; - if it's 0, then we simply return what we currently have in cache, no guarantee; - if set to non zero, then the result is at least as fresh as given rv.\n * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.\n * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.\n * @param {*} [options] Override http request options.\n */\n deleteCollectionCertificateSigningRequest(includeUninitialized, pretty, _continue, fieldSelector, labelSelector, limit, resourceVersion, timeoutSeconds, watch, options = {}) {\n const localVarPath = this.basePath + '/apis/certificates.k8s.io/v1beta1/certificatesigningrequests';\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n if (includeUninitialized !== undefined) {\n localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, \"boolean\");\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (_continue !== undefined) {\n localVarQueryParameters['continue'] = ObjectSerializer.serialize(_continue, \"string\");\n }\n if (fieldSelector !== undefined) {\n localVarQueryParameters['fieldSelector'] = ObjectSerializer.serialize(fieldSelector, \"string\");\n }\n if (labelSelector !== undefined) {\n localVarQueryParameters['labelSelector'] = ObjectSerializer.serialize(labelSelector, \"string\");\n }\n if (limit !== undefined) {\n localVarQueryParameters['limit'] = ObjectSerializer.serialize(limit, \"number\");\n }\n if (resourceVersion !== undefined) {\n localVarQueryParameters['resourceVersion'] = ObjectSerializer.serialize(resourceVersion, \"string\");\n }\n if (timeoutSeconds !== undefined) {\n localVarQueryParameters['timeoutSeconds'] = ObjectSerializer.serialize(timeoutSeconds, \"number\");\n }\n if (watch !== undefined) {\n localVarQueryParameters['watch'] = ObjectSerializer.serialize(watch, \"boolean\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'DELETE',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1Status\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * get available resources\n * @param {*} [options] Override http request options.\n */\n getAPIResources(options = {}) {\n const localVarPath = this.basePath + '/apis/certificates.k8s.io/v1beta1/';\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1APIResourceList\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * list or watch objects of kind CertificateSigningRequest\n * @param includeUninitialized If true, partially initialized resources are included in the response.\n * @param pretty If 'true', then the output is pretty printed.\n * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \\"next key\\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.\n * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything.\n * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything.\n * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.\n * @param resourceVersion When specified with a watch call, shows changes that occur after that particular version of a resource. Defaults to changes from the beginning of history. When specified for list: - if unset, then the result is returned from remote storage based on quorum-read flag; - if it's 0, then we simply return what we currently have in cache, no guarantee; - if set to non zero, then the result is at least as fresh as given rv.\n * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.\n * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.\n * @param {*} [options] Override http request options.\n */\n listCertificateSigningRequest(includeUninitialized, pretty, _continue, fieldSelector, labelSelector, limit, resourceVersion, timeoutSeconds, watch, options = {}) {\n const localVarPath = this.basePath + '/apis/certificates.k8s.io/v1beta1/certificatesigningrequests';\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n if (includeUninitialized !== undefined) {\n localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, \"boolean\");\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (_continue !== undefined) {\n localVarQueryParameters['continue'] = ObjectSerializer.serialize(_continue, \"string\");\n }\n if (fieldSelector !== undefined) {\n localVarQueryParameters['fieldSelector'] = ObjectSerializer.serialize(fieldSelector, \"string\");\n }\n if (labelSelector !== undefined) {\n localVarQueryParameters['labelSelector'] = ObjectSerializer.serialize(labelSelector, \"string\");\n }\n if (limit !== undefined) {\n localVarQueryParameters['limit'] = ObjectSerializer.serialize(limit, \"number\");\n }\n if (resourceVersion !== undefined) {\n localVarQueryParameters['resourceVersion'] = ObjectSerializer.serialize(resourceVersion, \"string\");\n }\n if (timeoutSeconds !== undefined) {\n localVarQueryParameters['timeoutSeconds'] = ObjectSerializer.serialize(timeoutSeconds, \"number\");\n }\n if (watch !== undefined) {\n localVarQueryParameters['watch'] = ObjectSerializer.serialize(watch, \"boolean\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1beta1CertificateSigningRequestList\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * partially update the specified CertificateSigningRequest\n * @param name name of the CertificateSigningRequest\n * @param body\n * @param pretty If 'true', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param {*} [options] Override http request options.\n */\n patchCertificateSigningRequest(name, body, pretty, dryRun, options = {}) {\n const localVarPath = this.basePath + '/apis/certificates.k8s.io/v1beta1/certificatesigningrequests/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling patchCertificateSigningRequest.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling patchCertificateSigningRequest.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'PATCH',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: ObjectSerializer.serialize(body, \"any\")\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1beta1CertificateSigningRequest\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * partially update status of the specified CertificateSigningRequest\n * @param name name of the CertificateSigningRequest\n * @param body\n * @param pretty If 'true', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param {*} [options] Override http request options.\n */\n patchCertificateSigningRequestStatus(name, body, pretty, dryRun, options = {}) {\n const localVarPath = this.basePath + '/apis/certificates.k8s.io/v1beta1/certificatesigningrequests/{name}/status'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling patchCertificateSigningRequestStatus.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling patchCertificateSigningRequestStatus.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'PATCH',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: ObjectSerializer.serialize(body, \"any\")\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1beta1CertificateSigningRequest\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * read the specified CertificateSigningRequest\n * @param name name of the CertificateSigningRequest\n * @param pretty If 'true', then the output is pretty printed.\n * @param exact Should the export be exact. Exact export maintains cluster-specific fields like 'Namespace'.\n * @param _export Should this value be exported. Export strips fields that a user can not specify.\n * @param {*} [options] Override http request options.\n */\n readCertificateSigningRequest(name, pretty, exact, _export, options = {}) {\n const localVarPath = this.basePath + '/apis/certificates.k8s.io/v1beta1/certificatesigningrequests/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling readCertificateSigningRequest.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (exact !== undefined) {\n localVarQueryParameters['exact'] = ObjectSerializer.serialize(exact, \"boolean\");\n }\n if (_export !== undefined) {\n localVarQueryParameters['export'] = ObjectSerializer.serialize(_export, \"boolean\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1beta1CertificateSigningRequest\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * read status of the specified CertificateSigningRequest\n * @param name name of the CertificateSigningRequest\n * @param pretty If 'true', then the output is pretty printed.\n * @param {*} [options] Override http request options.\n */\n readCertificateSigningRequestStatus(name, pretty, options = {}) {\n const localVarPath = this.basePath + '/apis/certificates.k8s.io/v1beta1/certificatesigningrequests/{name}/status'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling readCertificateSigningRequestStatus.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1beta1CertificateSigningRequest\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * replace the specified CertificateSigningRequest\n * @param name name of the CertificateSigningRequest\n * @param body\n * @param pretty If 'true', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param {*} [options] Override http request options.\n */\n replaceCertificateSigningRequest(name, body, pretty, dryRun, options = {}) {\n const localVarPath = this.basePath + '/apis/certificates.k8s.io/v1beta1/certificatesigningrequests/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling replaceCertificateSigningRequest.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling replaceCertificateSigningRequest.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'PUT',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: ObjectSerializer.serialize(body, \"V1beta1CertificateSigningRequest\")\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1beta1CertificateSigningRequest\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * replace approval of the specified CertificateSigningRequest\n * @param name name of the CertificateSigningRequest\n * @param body\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param pretty If 'true', then the output is pretty printed.\n * @param {*} [options] Override http request options.\n */\n replaceCertificateSigningRequestApproval(name, body, dryRun, pretty, options = {}) {\n const localVarPath = this.basePath + '/apis/certificates.k8s.io/v1beta1/certificatesigningrequests/{name}/approval'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling replaceCertificateSigningRequestApproval.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling replaceCertificateSigningRequestApproval.');\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, \"string\");\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'PUT',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: ObjectSerializer.serialize(body, \"V1beta1CertificateSigningRequest\")\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1beta1CertificateSigningRequest\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * replace status of the specified CertificateSigningRequest\n * @param name name of the CertificateSigningRequest\n * @param body\n * @param pretty If 'true', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param {*} [options] Override http request options.\n */\n replaceCertificateSigningRequestStatus(name, body, pretty, dryRun, options = {}) {\n const localVarPath = this.basePath + '/apis/certificates.k8s.io/v1beta1/certificatesigningrequests/{name}/status'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling replaceCertificateSigningRequestStatus.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling replaceCertificateSigningRequestStatus.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'PUT',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: ObjectSerializer.serialize(body, \"V1beta1CertificateSigningRequest\")\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1beta1CertificateSigningRequest\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n}\nexports.CertificatesV1beta1Api = CertificatesV1beta1Api;\nvar CoordinationApiApiKeys;\n(function (CoordinationApiApiKeys) {\n CoordinationApiApiKeys[CoordinationApiApiKeys[\"BearerToken\"] = 0] = \"BearerToken\";\n})(CoordinationApiApiKeys = exports.CoordinationApiApiKeys || (exports.CoordinationApiApiKeys = {}));\nclass CoordinationApi {\n constructor(basePathOrUsername, password, basePath) {\n this._basePath = defaultBasePath;\n this.defaultHeaders = {};\n this._useQuerystring = false;\n this.authentications = {\n 'default': new VoidAuth(),\n 'BearerToken': new ApiKeyAuth('header', 'authorization'),\n };\n if (password) {\n if (basePath) {\n this.basePath = basePath;\n }\n }\n else {\n if (basePathOrUsername) {\n this.basePath = basePathOrUsername;\n }\n }\n }\n set useQuerystring(value) {\n this._useQuerystring = value;\n }\n set basePath(basePath) {\n this._basePath = basePath;\n }\n get basePath() {\n return this._basePath;\n }\n setDefaultAuthentication(auth) {\n this.authentications.default = auth;\n }\n setApiKey(key, value) {\n this.authentications[CoordinationApiApiKeys[key]].apiKey = value;\n }\n /**\n * get information of a group\n * @param {*} [options] Override http request options.\n */\n getAPIGroup(options = {}) {\n const localVarPath = this.basePath + '/apis/coordination.k8s.io/';\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1APIGroup\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n}\nexports.CoordinationApi = CoordinationApi;\nvar CoordinationV1beta1ApiApiKeys;\n(function (CoordinationV1beta1ApiApiKeys) {\n CoordinationV1beta1ApiApiKeys[CoordinationV1beta1ApiApiKeys[\"BearerToken\"] = 0] = \"BearerToken\";\n})(CoordinationV1beta1ApiApiKeys = exports.CoordinationV1beta1ApiApiKeys || (exports.CoordinationV1beta1ApiApiKeys = {}));\nclass CoordinationV1beta1Api {\n constructor(basePathOrUsername, password, basePath) {\n this._basePath = defaultBasePath;\n this.defaultHeaders = {};\n this._useQuerystring = false;\n this.authentications = {\n 'default': new VoidAuth(),\n 'BearerToken': new ApiKeyAuth('header', 'authorization'),\n };\n if (password) {\n if (basePath) {\n this.basePath = basePath;\n }\n }\n else {\n if (basePathOrUsername) {\n this.basePath = basePathOrUsername;\n }\n }\n }\n set useQuerystring(value) {\n this._useQuerystring = value;\n }\n set basePath(basePath) {\n this._basePath = basePath;\n }\n get basePath() {\n return this._basePath;\n }\n setDefaultAuthentication(auth) {\n this.authentications.default = auth;\n }\n setApiKey(key, value) {\n this.authentications[CoordinationV1beta1ApiApiKeys[key]].apiKey = value;\n }\n /**\n * create a Lease\n * @param namespace object name and auth scope, such as for teams and projects\n * @param body\n * @param includeUninitialized If true, partially initialized resources are included in the response.\n * @param pretty If 'true', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param {*} [options] Override http request options.\n */\n createNamespacedLease(namespace, body, includeUninitialized, pretty, dryRun, options = {}) {\n const localVarPath = this.basePath + '/apis/coordination.k8s.io/v1beta1/namespaces/{namespace}/leases'\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling createNamespacedLease.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling createNamespacedLease.');\n }\n if (includeUninitialized !== undefined) {\n localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, \"boolean\");\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'POST',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: ObjectSerializer.serialize(body, \"V1beta1Lease\")\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1beta1Lease\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * delete collection of Lease\n * @param namespace object name and auth scope, such as for teams and projects\n * @param includeUninitialized If true, partially initialized resources are included in the response.\n * @param pretty If 'true', then the output is pretty printed.\n * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \\"next key\\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.\n * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything.\n * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything.\n * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.\n * @param resourceVersion When specified with a watch call, shows changes that occur after that particular version of a resource. Defaults to changes from the beginning of history. When specified for list: - if unset, then the result is returned from remote storage based on quorum-read flag; - if it's 0, then we simply return what we currently have in cache, no guarantee; - if set to non zero, then the result is at least as fresh as given rv.\n * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.\n * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.\n * @param {*} [options] Override http request options.\n */\n deleteCollectionNamespacedLease(namespace, includeUninitialized, pretty, _continue, fieldSelector, labelSelector, limit, resourceVersion, timeoutSeconds, watch, options = {}) {\n const localVarPath = this.basePath + '/apis/coordination.k8s.io/v1beta1/namespaces/{namespace}/leases'\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling deleteCollectionNamespacedLease.');\n }\n if (includeUninitialized !== undefined) {\n localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, \"boolean\");\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (_continue !== undefined) {\n localVarQueryParameters['continue'] = ObjectSerializer.serialize(_continue, \"string\");\n }\n if (fieldSelector !== undefined) {\n localVarQueryParameters['fieldSelector'] = ObjectSerializer.serialize(fieldSelector, \"string\");\n }\n if (labelSelector !== undefined) {\n localVarQueryParameters['labelSelector'] = ObjectSerializer.serialize(labelSelector, \"string\");\n }\n if (limit !== undefined) {\n localVarQueryParameters['limit'] = ObjectSerializer.serialize(limit, \"number\");\n }\n if (resourceVersion !== undefined) {\n localVarQueryParameters['resourceVersion'] = ObjectSerializer.serialize(resourceVersion, \"string\");\n }\n if (timeoutSeconds !== undefined) {\n localVarQueryParameters['timeoutSeconds'] = ObjectSerializer.serialize(timeoutSeconds, \"number\");\n }\n if (watch !== undefined) {\n localVarQueryParameters['watch'] = ObjectSerializer.serialize(watch, \"boolean\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'DELETE',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1Status\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * delete a Lease\n * @param name name of the Lease\n * @param namespace object name and auth scope, such as for teams and projects\n * @param pretty If 'true', then the output is pretty printed.\n * @param body\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param gracePeriodSeconds The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately.\n * @param orphanDependents Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \\"orphan\\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both.\n * @param propagationPolicy Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground.\n * @param {*} [options] Override http request options.\n */\n deleteNamespacedLease(name, namespace, pretty, body, dryRun, gracePeriodSeconds, orphanDependents, propagationPolicy, options = {}) {\n const localVarPath = this.basePath + '/apis/coordination.k8s.io/v1beta1/namespaces/{namespace}/leases/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling deleteNamespacedLease.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling deleteNamespacedLease.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, \"string\");\n }\n if (gracePeriodSeconds !== undefined) {\n localVarQueryParameters['gracePeriodSeconds'] = ObjectSerializer.serialize(gracePeriodSeconds, \"number\");\n }\n if (orphanDependents !== undefined) {\n localVarQueryParameters['orphanDependents'] = ObjectSerializer.serialize(orphanDependents, \"boolean\");\n }\n if (propagationPolicy !== undefined) {\n localVarQueryParameters['propagationPolicy'] = ObjectSerializer.serialize(propagationPolicy, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'DELETE',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: ObjectSerializer.serialize(body, \"V1DeleteOptions\")\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1Status\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * get available resources\n * @param {*} [options] Override http request options.\n */\n getAPIResources(options = {}) {\n const localVarPath = this.basePath + '/apis/coordination.k8s.io/v1beta1/';\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1APIResourceList\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * list or watch objects of kind Lease\n * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \\"next key\\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.\n * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything.\n * @param includeUninitialized If true, partially initialized resources are included in the response.\n * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything.\n * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.\n * @param pretty If 'true', then the output is pretty printed.\n * @param resourceVersion When specified with a watch call, shows changes that occur after that particular version of a resource. Defaults to changes from the beginning of history. When specified for list: - if unset, then the result is returned from remote storage based on quorum-read flag; - if it's 0, then we simply return what we currently have in cache, no guarantee; - if set to non zero, then the result is at least as fresh as given rv.\n * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.\n * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.\n * @param {*} [options] Override http request options.\n */\n listLeaseForAllNamespaces(_continue, fieldSelector, includeUninitialized, labelSelector, limit, pretty, resourceVersion, timeoutSeconds, watch, options = {}) {\n const localVarPath = this.basePath + '/apis/coordination.k8s.io/v1beta1/leases';\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n if (_continue !== undefined) {\n localVarQueryParameters['continue'] = ObjectSerializer.serialize(_continue, \"string\");\n }\n if (fieldSelector !== undefined) {\n localVarQueryParameters['fieldSelector'] = ObjectSerializer.serialize(fieldSelector, \"string\");\n }\n if (includeUninitialized !== undefined) {\n localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, \"boolean\");\n }\n if (labelSelector !== undefined) {\n localVarQueryParameters['labelSelector'] = ObjectSerializer.serialize(labelSelector, \"string\");\n }\n if (limit !== undefined) {\n localVarQueryParameters['limit'] = ObjectSerializer.serialize(limit, \"number\");\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (resourceVersion !== undefined) {\n localVarQueryParameters['resourceVersion'] = ObjectSerializer.serialize(resourceVersion, \"string\");\n }\n if (timeoutSeconds !== undefined) {\n localVarQueryParameters['timeoutSeconds'] = ObjectSerializer.serialize(timeoutSeconds, \"number\");\n }\n if (watch !== undefined) {\n localVarQueryParameters['watch'] = ObjectSerializer.serialize(watch, \"boolean\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1beta1LeaseList\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * list or watch objects of kind Lease\n * @param namespace object name and auth scope, such as for teams and projects\n * @param includeUninitialized If true, partially initialized resources are included in the response.\n * @param pretty If 'true', then the output is pretty printed.\n * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \\"next key\\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.\n * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything.\n * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything.\n * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.\n * @param resourceVersion When specified with a watch call, shows changes that occur after that particular version of a resource. Defaults to changes from the beginning of history. When specified for list: - if unset, then the result is returned from remote storage based on quorum-read flag; - if it's 0, then we simply return what we currently have in cache, no guarantee; - if set to non zero, then the result is at least as fresh as given rv.\n * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.\n * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.\n * @param {*} [options] Override http request options.\n */\n listNamespacedLease(namespace, includeUninitialized, pretty, _continue, fieldSelector, labelSelector, limit, resourceVersion, timeoutSeconds, watch, options = {}) {\n const localVarPath = this.basePath + '/apis/coordination.k8s.io/v1beta1/namespaces/{namespace}/leases'\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling listNamespacedLease.');\n }\n if (includeUninitialized !== undefined) {\n localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, \"boolean\");\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (_continue !== undefined) {\n localVarQueryParameters['continue'] = ObjectSerializer.serialize(_continue, \"string\");\n }\n if (fieldSelector !== undefined) {\n localVarQueryParameters['fieldSelector'] = ObjectSerializer.serialize(fieldSelector, \"string\");\n }\n if (labelSelector !== undefined) {\n localVarQueryParameters['labelSelector'] = ObjectSerializer.serialize(labelSelector, \"string\");\n }\n if (limit !== undefined) {\n localVarQueryParameters['limit'] = ObjectSerializer.serialize(limit, \"number\");\n }\n if (resourceVersion !== undefined) {\n localVarQueryParameters['resourceVersion'] = ObjectSerializer.serialize(resourceVersion, \"string\");\n }\n if (timeoutSeconds !== undefined) {\n localVarQueryParameters['timeoutSeconds'] = ObjectSerializer.serialize(timeoutSeconds, \"number\");\n }\n if (watch !== undefined) {\n localVarQueryParameters['watch'] = ObjectSerializer.serialize(watch, \"boolean\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1beta1LeaseList\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * partially update the specified Lease\n * @param name name of the Lease\n * @param namespace object name and auth scope, such as for teams and projects\n * @param body\n * @param pretty If 'true', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param {*} [options] Override http request options.\n */\n patchNamespacedLease(name, namespace, body, pretty, dryRun, options = {}) {\n const localVarPath = this.basePath + '/apis/coordination.k8s.io/v1beta1/namespaces/{namespace}/leases/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling patchNamespacedLease.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling patchNamespacedLease.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling patchNamespacedLease.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'PATCH',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: ObjectSerializer.serialize(body, \"any\")\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1beta1Lease\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * read the specified Lease\n * @param name name of the Lease\n * @param namespace object name and auth scope, such as for teams and projects\n * @param pretty If 'true', then the output is pretty printed.\n * @param exact Should the export be exact. Exact export maintains cluster-specific fields like 'Namespace'.\n * @param _export Should this value be exported. Export strips fields that a user can not specify.\n * @param {*} [options] Override http request options.\n */\n readNamespacedLease(name, namespace, pretty, exact, _export, options = {}) {\n const localVarPath = this.basePath + '/apis/coordination.k8s.io/v1beta1/namespaces/{namespace}/leases/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling readNamespacedLease.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling readNamespacedLease.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (exact !== undefined) {\n localVarQueryParameters['exact'] = ObjectSerializer.serialize(exact, \"boolean\");\n }\n if (_export !== undefined) {\n localVarQueryParameters['export'] = ObjectSerializer.serialize(_export, \"boolean\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1beta1Lease\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * replace the specified Lease\n * @param name name of the Lease\n * @param namespace object name and auth scope, such as for teams and projects\n * @param body\n * @param pretty If 'true', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param {*} [options] Override http request options.\n */\n replaceNamespacedLease(name, namespace, body, pretty, dryRun, options = {}) {\n const localVarPath = this.basePath + '/apis/coordination.k8s.io/v1beta1/namespaces/{namespace}/leases/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling replaceNamespacedLease.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling replaceNamespacedLease.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling replaceNamespacedLease.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'PUT',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: ObjectSerializer.serialize(body, \"V1beta1Lease\")\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1beta1Lease\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n}\nexports.CoordinationV1beta1Api = CoordinationV1beta1Api;\nvar CoreApiApiKeys;\n(function (CoreApiApiKeys) {\n CoreApiApiKeys[CoreApiApiKeys[\"BearerToken\"] = 0] = \"BearerToken\";\n})(CoreApiApiKeys = exports.CoreApiApiKeys || (exports.CoreApiApiKeys = {}));\nclass CoreApi {\n constructor(basePathOrUsername, password, basePath) {\n this._basePath = defaultBasePath;\n this.defaultHeaders = {};\n this._useQuerystring = false;\n this.authentications = {\n 'default': new VoidAuth(),\n 'BearerToken': new ApiKeyAuth('header', 'authorization'),\n };\n if (password) {\n if (basePath) {\n this.basePath = basePath;\n }\n }\n else {\n if (basePathOrUsername) {\n this.basePath = basePathOrUsername;\n }\n }\n }\n set useQuerystring(value) {\n this._useQuerystring = value;\n }\n set basePath(basePath) {\n this._basePath = basePath;\n }\n get basePath() {\n return this._basePath;\n }\n setDefaultAuthentication(auth) {\n this.authentications.default = auth;\n }\n setApiKey(key, value) {\n this.authentications[CoreApiApiKeys[key]].apiKey = value;\n }\n /**\n * get available API versions\n * @param {*} [options] Override http request options.\n */\n getAPIVersions(options = {}) {\n const localVarPath = this.basePath + '/api/';\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1APIVersions\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n}\nexports.CoreApi = CoreApi;\nvar CoreV1ApiApiKeys;\n(function (CoreV1ApiApiKeys) {\n CoreV1ApiApiKeys[CoreV1ApiApiKeys[\"BearerToken\"] = 0] = \"BearerToken\";\n})(CoreV1ApiApiKeys = exports.CoreV1ApiApiKeys || (exports.CoreV1ApiApiKeys = {}));\nclass CoreV1Api {\n constructor(basePathOrUsername, password, basePath) {\n this._basePath = defaultBasePath;\n this.defaultHeaders = {};\n this._useQuerystring = false;\n this.authentications = {\n 'default': new VoidAuth(),\n 'BearerToken': new ApiKeyAuth('header', 'authorization'),\n };\n if (password) {\n if (basePath) {\n this.basePath = basePath;\n }\n }\n else {\n if (basePathOrUsername) {\n this.basePath = basePathOrUsername;\n }\n }\n }\n set useQuerystring(value) {\n this._useQuerystring = value;\n }\n set basePath(basePath) {\n this._basePath = basePath;\n }\n get basePath() {\n return this._basePath;\n }\n setDefaultAuthentication(auth) {\n this.authentications.default = auth;\n }\n setApiKey(key, value) {\n this.authentications[CoreV1ApiApiKeys[key]].apiKey = value;\n }\n /**\n * connect DELETE requests to proxy of Pod\n * @param name name of the PodProxyOptions\n * @param namespace object name and auth scope, such as for teams and projects\n * @param path Path is the URL path to use for the current proxy request to pod.\n * @param {*} [options] Override http request options.\n */\n connectDeleteNamespacedPodProxy(name, namespace, path, options = {}) {\n const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/pods/{name}/proxy'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling connectDeleteNamespacedPodProxy.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling connectDeleteNamespacedPodProxy.');\n }\n if (path !== undefined) {\n localVarQueryParameters['path'] = ObjectSerializer.serialize(path, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'DELETE',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"string\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * connect DELETE requests to proxy of Pod\n * @param name name of the PodProxyOptions\n * @param namespace object name and auth scope, such as for teams and projects\n * @param path path to the resource\n * @param path2 Path is the URL path to use for the current proxy request to pod.\n * @param {*} [options] Override http request options.\n */\n connectDeleteNamespacedPodProxyWithPath(name, namespace, path, path2, options = {}) {\n const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/pods/{name}/proxy/{path}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)))\n .replace('{' + 'path' + '}', encodeURIComponent(String(path)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling connectDeleteNamespacedPodProxyWithPath.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling connectDeleteNamespacedPodProxyWithPath.');\n }\n // verify required parameter 'path' is not null or undefined\n if (path === null || path === undefined) {\n throw new Error('Required parameter path was null or undefined when calling connectDeleteNamespacedPodProxyWithPath.');\n }\n if (path2 !== undefined) {\n localVarQueryParameters['path'] = ObjectSerializer.serialize(path2, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'DELETE',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"string\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * connect DELETE requests to proxy of Service\n * @param name name of the ServiceProxyOptions\n * @param namespace object name and auth scope, such as for teams and projects\n * @param path Path is the part of URLs that include service endpoints, suffixes, and parameters to use for the current proxy request to service. For example, the whole request URL is http://localhost/api/v1/namespaces/kube-system/services/elasticsearch-logging/_search?q=user:kimchy. Path is _search?q=user:kimchy.\n * @param {*} [options] Override http request options.\n */\n connectDeleteNamespacedServiceProxy(name, namespace, path, options = {}) {\n const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/services/{name}/proxy'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling connectDeleteNamespacedServiceProxy.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling connectDeleteNamespacedServiceProxy.');\n }\n if (path !== undefined) {\n localVarQueryParameters['path'] = ObjectSerializer.serialize(path, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'DELETE',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"string\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * connect DELETE requests to proxy of Service\n * @param name name of the ServiceProxyOptions\n * @param namespace object name and auth scope, such as for teams and projects\n * @param path path to the resource\n * @param path2 Path is the part of URLs that include service endpoints, suffixes, and parameters to use for the current proxy request to service. For example, the whole request URL is http://localhost/api/v1/namespaces/kube-system/services/elasticsearch-logging/_search?q=user:kimchy. Path is _search?q=user:kimchy.\n * @param {*} [options] Override http request options.\n */\n connectDeleteNamespacedServiceProxyWithPath(name, namespace, path, path2, options = {}) {\n const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/services/{name}/proxy/{path}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)))\n .replace('{' + 'path' + '}', encodeURIComponent(String(path)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling connectDeleteNamespacedServiceProxyWithPath.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling connectDeleteNamespacedServiceProxyWithPath.');\n }\n // verify required parameter 'path' is not null or undefined\n if (path === null || path === undefined) {\n throw new Error('Required parameter path was null or undefined when calling connectDeleteNamespacedServiceProxyWithPath.');\n }\n if (path2 !== undefined) {\n localVarQueryParameters['path'] = ObjectSerializer.serialize(path2, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'DELETE',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"string\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * connect DELETE requests to proxy of Node\n * @param name name of the NodeProxyOptions\n * @param path Path is the URL path to use for the current proxy request to node.\n * @param {*} [options] Override http request options.\n */\n connectDeleteNodeProxy(name, path, options = {}) {\n const localVarPath = this.basePath + '/api/v1/nodes/{name}/proxy'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling connectDeleteNodeProxy.');\n }\n if (path !== undefined) {\n localVarQueryParameters['path'] = ObjectSerializer.serialize(path, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'DELETE',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"string\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * connect DELETE requests to proxy of Node\n * @param name name of the NodeProxyOptions\n * @param path path to the resource\n * @param path2 Path is the URL path to use for the current proxy request to node.\n * @param {*} [options] Override http request options.\n */\n connectDeleteNodeProxyWithPath(name, path, path2, options = {}) {\n const localVarPath = this.basePath + '/api/v1/nodes/{name}/proxy/{path}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'path' + '}', encodeURIComponent(String(path)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling connectDeleteNodeProxyWithPath.');\n }\n // verify required parameter 'path' is not null or undefined\n if (path === null || path === undefined) {\n throw new Error('Required parameter path was null or undefined when calling connectDeleteNodeProxyWithPath.');\n }\n if (path2 !== undefined) {\n localVarQueryParameters['path'] = ObjectSerializer.serialize(path2, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'DELETE',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"string\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * connect GET requests to attach of Pod\n * @param name name of the PodAttachOptions\n * @param namespace object name and auth scope, such as for teams and projects\n * @param container The container in which to execute the command. Defaults to only container if there is only one container in the pod.\n * @param stderr Stderr if true indicates that stderr is to be redirected for the attach call. Defaults to true.\n * @param stdin Stdin if true, redirects the standard input stream of the pod for this call. Defaults to false.\n * @param stdout Stdout if true indicates that stdout is to be redirected for the attach call. Defaults to true.\n * @param tty TTY if true indicates that a tty will be allocated for the attach call. This is passed through the container runtime so the tty is allocated on the worker node by the container runtime. Defaults to false.\n * @param {*} [options] Override http request options.\n */\n connectGetNamespacedPodAttach(name, namespace, container, stderr, stdin, stdout, tty, options = {}) {\n const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/pods/{name}/attach'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling connectGetNamespacedPodAttach.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling connectGetNamespacedPodAttach.');\n }\n if (container !== undefined) {\n localVarQueryParameters['container'] = ObjectSerializer.serialize(container, \"string\");\n }\n if (stderr !== undefined) {\n localVarQueryParameters['stderr'] = ObjectSerializer.serialize(stderr, \"boolean\");\n }\n if (stdin !== undefined) {\n localVarQueryParameters['stdin'] = ObjectSerializer.serialize(stdin, \"boolean\");\n }\n if (stdout !== undefined) {\n localVarQueryParameters['stdout'] = ObjectSerializer.serialize(stdout, \"boolean\");\n }\n if (tty !== undefined) {\n localVarQueryParameters['tty'] = ObjectSerializer.serialize(tty, \"boolean\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"string\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * connect GET requests to exec of Pod\n * @param name name of the PodExecOptions\n * @param namespace object name and auth scope, such as for teams and projects\n * @param command Command is the remote command to execute. argv array. Not executed within a shell.\n * @param container Container in which to execute the command. Defaults to only container if there is only one container in the pod.\n * @param stderr Redirect the standard error stream of the pod for this call. Defaults to true.\n * @param stdin Redirect the standard input stream of the pod for this call. Defaults to false.\n * @param stdout Redirect the standard output stream of the pod for this call. Defaults to true.\n * @param tty TTY if true indicates that a tty will be allocated for the exec call. Defaults to false.\n * @param {*} [options] Override http request options.\n */\n connectGetNamespacedPodExec(name, namespace, command, container, stderr, stdin, stdout, tty, options = {}) {\n const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/pods/{name}/exec'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling connectGetNamespacedPodExec.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling connectGetNamespacedPodExec.');\n }\n if (command !== undefined) {\n localVarQueryParameters['command'] = ObjectSerializer.serialize(command, \"string\");\n }\n if (container !== undefined) {\n localVarQueryParameters['container'] = ObjectSerializer.serialize(container, \"string\");\n }\n if (stderr !== undefined) {\n localVarQueryParameters['stderr'] = ObjectSerializer.serialize(stderr, \"boolean\");\n }\n if (stdin !== undefined) {\n localVarQueryParameters['stdin'] = ObjectSerializer.serialize(stdin, \"boolean\");\n }\n if (stdout !== undefined) {\n localVarQueryParameters['stdout'] = ObjectSerializer.serialize(stdout, \"boolean\");\n }\n if (tty !== undefined) {\n localVarQueryParameters['tty'] = ObjectSerializer.serialize(tty, \"boolean\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"string\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * connect GET requests to portforward of Pod\n * @param name name of the PodPortForwardOptions\n * @param namespace object name and auth scope, such as for teams and projects\n * @param ports List of ports to forward Required when using WebSockets\n * @param {*} [options] Override http request options.\n */\n connectGetNamespacedPodPortforward(name, namespace, ports, options = {}) {\n const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/pods/{name}/portforward'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling connectGetNamespacedPodPortforward.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling connectGetNamespacedPodPortforward.');\n }\n if (ports !== undefined) {\n localVarQueryParameters['ports'] = ObjectSerializer.serialize(ports, \"number\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"string\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * connect GET requests to proxy of Pod\n * @param name name of the PodProxyOptions\n * @param namespace object name and auth scope, such as for teams and projects\n * @param path Path is the URL path to use for the current proxy request to pod.\n * @param {*} [options] Override http request options.\n */\n connectGetNamespacedPodProxy(name, namespace, path, options = {}) {\n const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/pods/{name}/proxy'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling connectGetNamespacedPodProxy.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling connectGetNamespacedPodProxy.');\n }\n if (path !== undefined) {\n localVarQueryParameters['path'] = ObjectSerializer.serialize(path, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"string\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * connect GET requests to proxy of Pod\n * @param name name of the PodProxyOptions\n * @param namespace object name and auth scope, such as for teams and projects\n * @param path path to the resource\n * @param path2 Path is the URL path to use for the current proxy request to pod.\n * @param {*} [options] Override http request options.\n */\n connectGetNamespacedPodProxyWithPath(name, namespace, path, path2, options = {}) {\n const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/pods/{name}/proxy/{path}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)))\n .replace('{' + 'path' + '}', encodeURIComponent(String(path)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling connectGetNamespacedPodProxyWithPath.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling connectGetNamespacedPodProxyWithPath.');\n }\n // verify required parameter 'path' is not null or undefined\n if (path === null || path === undefined) {\n throw new Error('Required parameter path was null or undefined when calling connectGetNamespacedPodProxyWithPath.');\n }\n if (path2 !== undefined) {\n localVarQueryParameters['path'] = ObjectSerializer.serialize(path2, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"string\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * connect GET requests to proxy of Service\n * @param name name of the ServiceProxyOptions\n * @param namespace object name and auth scope, such as for teams and projects\n * @param path Path is the part of URLs that include service endpoints, suffixes, and parameters to use for the current proxy request to service. For example, the whole request URL is http://localhost/api/v1/namespaces/kube-system/services/elasticsearch-logging/_search?q=user:kimchy. Path is _search?q=user:kimchy.\n * @param {*} [options] Override http request options.\n */\n connectGetNamespacedServiceProxy(name, namespace, path, options = {}) {\n const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/services/{name}/proxy'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling connectGetNamespacedServiceProxy.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling connectGetNamespacedServiceProxy.');\n }\n if (path !== undefined) {\n localVarQueryParameters['path'] = ObjectSerializer.serialize(path, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"string\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * connect GET requests to proxy of Service\n * @param name name of the ServiceProxyOptions\n * @param namespace object name and auth scope, such as for teams and projects\n * @param path path to the resource\n * @param path2 Path is the part of URLs that include service endpoints, suffixes, and parameters to use for the current proxy request to service. For example, the whole request URL is http://localhost/api/v1/namespaces/kube-system/services/elasticsearch-logging/_search?q=user:kimchy. Path is _search?q=user:kimchy.\n * @param {*} [options] Override http request options.\n */\n connectGetNamespacedServiceProxyWithPath(name, namespace, path, path2, options = {}) {\n const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/services/{name}/proxy/{path}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)))\n .replace('{' + 'path' + '}', encodeURIComponent(String(path)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling connectGetNamespacedServiceProxyWithPath.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling connectGetNamespacedServiceProxyWithPath.');\n }\n // verify required parameter 'path' is not null or undefined\n if (path === null || path === undefined) {\n throw new Error('Required parameter path was null or undefined when calling connectGetNamespacedServiceProxyWithPath.');\n }\n if (path2 !== undefined) {\n localVarQueryParameters['path'] = ObjectSerializer.serialize(path2, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"string\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * connect GET requests to proxy of Node\n * @param name name of the NodeProxyOptions\n * @param path Path is the URL path to use for the current proxy request to node.\n * @param {*} [options] Override http request options.\n */\n connectGetNodeProxy(name, path, options = {}) {\n const localVarPath = this.basePath + '/api/v1/nodes/{name}/proxy'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling connectGetNodeProxy.');\n }\n if (path !== undefined) {\n localVarQueryParameters['path'] = ObjectSerializer.serialize(path, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"string\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * connect GET requests to proxy of Node\n * @param name name of the NodeProxyOptions\n * @param path path to the resource\n * @param path2 Path is the URL path to use for the current proxy request to node.\n * @param {*} [options] Override http request options.\n */\n connectGetNodeProxyWithPath(name, path, path2, options = {}) {\n const localVarPath = this.basePath + '/api/v1/nodes/{name}/proxy/{path}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'path' + '}', encodeURIComponent(String(path)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling connectGetNodeProxyWithPath.');\n }\n // verify required parameter 'path' is not null or undefined\n if (path === null || path === undefined) {\n throw new Error('Required parameter path was null or undefined when calling connectGetNodeProxyWithPath.');\n }\n if (path2 !== undefined) {\n localVarQueryParameters['path'] = ObjectSerializer.serialize(path2, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"string\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * connect HEAD requests to proxy of Pod\n * @param name name of the PodProxyOptions\n * @param namespace object name and auth scope, such as for teams and projects\n * @param path Path is the URL path to use for the current proxy request to pod.\n * @param {*} [options] Override http request options.\n */\n connectHeadNamespacedPodProxy(name, namespace, path, options = {}) {\n const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/pods/{name}/proxy'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling connectHeadNamespacedPodProxy.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling connectHeadNamespacedPodProxy.');\n }\n if (path !== undefined) {\n localVarQueryParameters['path'] = ObjectSerializer.serialize(path, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'HEAD',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"string\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * connect HEAD requests to proxy of Pod\n * @param name name of the PodProxyOptions\n * @param namespace object name and auth scope, such as for teams and projects\n * @param path path to the resource\n * @param path2 Path is the URL path to use for the current proxy request to pod.\n * @param {*} [options] Override http request options.\n */\n connectHeadNamespacedPodProxyWithPath(name, namespace, path, path2, options = {}) {\n const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/pods/{name}/proxy/{path}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)))\n .replace('{' + 'path' + '}', encodeURIComponent(String(path)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling connectHeadNamespacedPodProxyWithPath.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling connectHeadNamespacedPodProxyWithPath.');\n }\n // verify required parameter 'path' is not null or undefined\n if (path === null || path === undefined) {\n throw new Error('Required parameter path was null or undefined when calling connectHeadNamespacedPodProxyWithPath.');\n }\n if (path2 !== undefined) {\n localVarQueryParameters['path'] = ObjectSerializer.serialize(path2, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'HEAD',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"string\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * connect HEAD requests to proxy of Service\n * @param name name of the ServiceProxyOptions\n * @param namespace object name and auth scope, such as for teams and projects\n * @param path Path is the part of URLs that include service endpoints, suffixes, and parameters to use for the current proxy request to service. For example, the whole request URL is http://localhost/api/v1/namespaces/kube-system/services/elasticsearch-logging/_search?q=user:kimchy. Path is _search?q=user:kimchy.\n * @param {*} [options] Override http request options.\n */\n connectHeadNamespacedServiceProxy(name, namespace, path, options = {}) {\n const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/services/{name}/proxy'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling connectHeadNamespacedServiceProxy.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling connectHeadNamespacedServiceProxy.');\n }\n if (path !== undefined) {\n localVarQueryParameters['path'] = ObjectSerializer.serialize(path, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'HEAD',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"string\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * connect HEAD requests to proxy of Service\n * @param name name of the ServiceProxyOptions\n * @param namespace object name and auth scope, such as for teams and projects\n * @param path path to the resource\n * @param path2 Path is the part of URLs that include service endpoints, suffixes, and parameters to use for the current proxy request to service. For example, the whole request URL is http://localhost/api/v1/namespaces/kube-system/services/elasticsearch-logging/_search?q=user:kimchy. Path is _search?q=user:kimchy.\n * @param {*} [options] Override http request options.\n */\n connectHeadNamespacedServiceProxyWithPath(name, namespace, path, path2, options = {}) {\n const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/services/{name}/proxy/{path}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)))\n .replace('{' + 'path' + '}', encodeURIComponent(String(path)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling connectHeadNamespacedServiceProxyWithPath.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling connectHeadNamespacedServiceProxyWithPath.');\n }\n // verify required parameter 'path' is not null or undefined\n if (path === null || path === undefined) {\n throw new Error('Required parameter path was null or undefined when calling connectHeadNamespacedServiceProxyWithPath.');\n }\n if (path2 !== undefined) {\n localVarQueryParameters['path'] = ObjectSerializer.serialize(path2, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'HEAD',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"string\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * connect HEAD requests to proxy of Node\n * @param name name of the NodeProxyOptions\n * @param path Path is the URL path to use for the current proxy request to node.\n * @param {*} [options] Override http request options.\n */\n connectHeadNodeProxy(name, path, options = {}) {\n const localVarPath = this.basePath + '/api/v1/nodes/{name}/proxy'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling connectHeadNodeProxy.');\n }\n if (path !== undefined) {\n localVarQueryParameters['path'] = ObjectSerializer.serialize(path, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'HEAD',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"string\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * connect HEAD requests to proxy of Node\n * @param name name of the NodeProxyOptions\n * @param path path to the resource\n * @param path2 Path is the URL path to use for the current proxy request to node.\n * @param {*} [options] Override http request options.\n */\n connectHeadNodeProxyWithPath(name, path, path2, options = {}) {\n const localVarPath = this.basePath + '/api/v1/nodes/{name}/proxy/{path}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'path' + '}', encodeURIComponent(String(path)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling connectHeadNodeProxyWithPath.');\n }\n // verify required parameter 'path' is not null or undefined\n if (path === null || path === undefined) {\n throw new Error('Required parameter path was null or undefined when calling connectHeadNodeProxyWithPath.');\n }\n if (path2 !== undefined) {\n localVarQueryParameters['path'] = ObjectSerializer.serialize(path2, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'HEAD',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"string\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * connect OPTIONS requests to proxy of Pod\n * @param name name of the PodProxyOptions\n * @param namespace object name and auth scope, such as for teams and projects\n * @param path Path is the URL path to use for the current proxy request to pod.\n * @param {*} [options] Override http request options.\n */\n connectOptionsNamespacedPodProxy(name, namespace, path, options = {}) {\n const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/pods/{name}/proxy'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling connectOptionsNamespacedPodProxy.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling connectOptionsNamespacedPodProxy.');\n }\n if (path !== undefined) {\n localVarQueryParameters['path'] = ObjectSerializer.serialize(path, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'OPTIONS',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"string\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * connect OPTIONS requests to proxy of Pod\n * @param name name of the PodProxyOptions\n * @param namespace object name and auth scope, such as for teams and projects\n * @param path path to the resource\n * @param path2 Path is the URL path to use for the current proxy request to pod.\n * @param {*} [options] Override http request options.\n */\n connectOptionsNamespacedPodProxyWithPath(name, namespace, path, path2, options = {}) {\n const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/pods/{name}/proxy/{path}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)))\n .replace('{' + 'path' + '}', encodeURIComponent(String(path)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling connectOptionsNamespacedPodProxyWithPath.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling connectOptionsNamespacedPodProxyWithPath.');\n }\n // verify required parameter 'path' is not null or undefined\n if (path === null || path === undefined) {\n throw new Error('Required parameter path was null or undefined when calling connectOptionsNamespacedPodProxyWithPath.');\n }\n if (path2 !== undefined) {\n localVarQueryParameters['path'] = ObjectSerializer.serialize(path2, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'OPTIONS',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"string\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * connect OPTIONS requests to proxy of Service\n * @param name name of the ServiceProxyOptions\n * @param namespace object name and auth scope, such as for teams and projects\n * @param path Path is the part of URLs that include service endpoints, suffixes, and parameters to use for the current proxy request to service. For example, the whole request URL is http://localhost/api/v1/namespaces/kube-system/services/elasticsearch-logging/_search?q=user:kimchy. Path is _search?q=user:kimchy.\n * @param {*} [options] Override http request options.\n */\n connectOptionsNamespacedServiceProxy(name, namespace, path, options = {}) {\n const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/services/{name}/proxy'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling connectOptionsNamespacedServiceProxy.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling connectOptionsNamespacedServiceProxy.');\n }\n if (path !== undefined) {\n localVarQueryParameters['path'] = ObjectSerializer.serialize(path, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'OPTIONS',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"string\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * connect OPTIONS requests to proxy of Service\n * @param name name of the ServiceProxyOptions\n * @param namespace object name and auth scope, such as for teams and projects\n * @param path path to the resource\n * @param path2 Path is the part of URLs that include service endpoints, suffixes, and parameters to use for the current proxy request to service. For example, the whole request URL is http://localhost/api/v1/namespaces/kube-system/services/elasticsearch-logging/_search?q=user:kimchy. Path is _search?q=user:kimchy.\n * @param {*} [options] Override http request options.\n */\n connectOptionsNamespacedServiceProxyWithPath(name, namespace, path, path2, options = {}) {\n const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/services/{name}/proxy/{path}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)))\n .replace('{' + 'path' + '}', encodeURIComponent(String(path)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling connectOptionsNamespacedServiceProxyWithPath.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling connectOptionsNamespacedServiceProxyWithPath.');\n }\n // verify required parameter 'path' is not null or undefined\n if (path === null || path === undefined) {\n throw new Error('Required parameter path was null or undefined when calling connectOptionsNamespacedServiceProxyWithPath.');\n }\n if (path2 !== undefined) {\n localVarQueryParameters['path'] = ObjectSerializer.serialize(path2, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'OPTIONS',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"string\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * connect OPTIONS requests to proxy of Node\n * @param name name of the NodeProxyOptions\n * @param path Path is the URL path to use for the current proxy request to node.\n * @param {*} [options] Override http request options.\n */\n connectOptionsNodeProxy(name, path, options = {}) {\n const localVarPath = this.basePath + '/api/v1/nodes/{name}/proxy'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling connectOptionsNodeProxy.');\n }\n if (path !== undefined) {\n localVarQueryParameters['path'] = ObjectSerializer.serialize(path, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'OPTIONS',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"string\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * connect OPTIONS requests to proxy of Node\n * @param name name of the NodeProxyOptions\n * @param path path to the resource\n * @param path2 Path is the URL path to use for the current proxy request to node.\n * @param {*} [options] Override http request options.\n */\n connectOptionsNodeProxyWithPath(name, path, path2, options = {}) {\n const localVarPath = this.basePath + '/api/v1/nodes/{name}/proxy/{path}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'path' + '}', encodeURIComponent(String(path)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling connectOptionsNodeProxyWithPath.');\n }\n // verify required parameter 'path' is not null or undefined\n if (path === null || path === undefined) {\n throw new Error('Required parameter path was null or undefined when calling connectOptionsNodeProxyWithPath.');\n }\n if (path2 !== undefined) {\n localVarQueryParameters['path'] = ObjectSerializer.serialize(path2, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'OPTIONS',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"string\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * connect PATCH requests to proxy of Pod\n * @param name name of the PodProxyOptions\n * @param namespace object name and auth scope, such as for teams and projects\n * @param path Path is the URL path to use for the current proxy request to pod.\n * @param {*} [options] Override http request options.\n */\n connectPatchNamespacedPodProxy(name, namespace, path, options = {}) {\n const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/pods/{name}/proxy'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling connectPatchNamespacedPodProxy.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling connectPatchNamespacedPodProxy.');\n }\n if (path !== undefined) {\n localVarQueryParameters['path'] = ObjectSerializer.serialize(path, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'PATCH',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"string\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * connect PATCH requests to proxy of Pod\n * @param name name of the PodProxyOptions\n * @param namespace object name and auth scope, such as for teams and projects\n * @param path path to the resource\n * @param path2 Path is the URL path to use for the current proxy request to pod.\n * @param {*} [options] Override http request options.\n */\n connectPatchNamespacedPodProxyWithPath(name, namespace, path, path2, options = {}) {\n const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/pods/{name}/proxy/{path}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)))\n .replace('{' + 'path' + '}', encodeURIComponent(String(path)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling connectPatchNamespacedPodProxyWithPath.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling connectPatchNamespacedPodProxyWithPath.');\n }\n // verify required parameter 'path' is not null or undefined\n if (path === null || path === undefined) {\n throw new Error('Required parameter path was null or undefined when calling connectPatchNamespacedPodProxyWithPath.');\n }\n if (path2 !== undefined) {\n localVarQueryParameters['path'] = ObjectSerializer.serialize(path2, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'PATCH',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"string\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * connect PATCH requests to proxy of Service\n * @param name name of the ServiceProxyOptions\n * @param namespace object name and auth scope, such as for teams and projects\n * @param path Path is the part of URLs that include service endpoints, suffixes, and parameters to use for the current proxy request to service. For example, the whole request URL is http://localhost/api/v1/namespaces/kube-system/services/elasticsearch-logging/_search?q=user:kimchy. Path is _search?q=user:kimchy.\n * @param {*} [options] Override http request options.\n */\n connectPatchNamespacedServiceProxy(name, namespace, path, options = {}) {\n const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/services/{name}/proxy'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling connectPatchNamespacedServiceProxy.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling connectPatchNamespacedServiceProxy.');\n }\n if (path !== undefined) {\n localVarQueryParameters['path'] = ObjectSerializer.serialize(path, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'PATCH',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"string\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * connect PATCH requests to proxy of Service\n * @param name name of the ServiceProxyOptions\n * @param namespace object name and auth scope, such as for teams and projects\n * @param path path to the resource\n * @param path2 Path is the part of URLs that include service endpoints, suffixes, and parameters to use for the current proxy request to service. For example, the whole request URL is http://localhost/api/v1/namespaces/kube-system/services/elasticsearch-logging/_search?q=user:kimchy. Path is _search?q=user:kimchy.\n * @param {*} [options] Override http request options.\n */\n connectPatchNamespacedServiceProxyWithPath(name, namespace, path, path2, options = {}) {\n const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/services/{name}/proxy/{path}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)))\n .replace('{' + 'path' + '}', encodeURIComponent(String(path)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling connectPatchNamespacedServiceProxyWithPath.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling connectPatchNamespacedServiceProxyWithPath.');\n }\n // verify required parameter 'path' is not null or undefined\n if (path === null || path === undefined) {\n throw new Error('Required parameter path was null or undefined when calling connectPatchNamespacedServiceProxyWithPath.');\n }\n if (path2 !== undefined) {\n localVarQueryParameters['path'] = ObjectSerializer.serialize(path2, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'PATCH',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"string\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * connect PATCH requests to proxy of Node\n * @param name name of the NodeProxyOptions\n * @param path Path is the URL path to use for the current proxy request to node.\n * @param {*} [options] Override http request options.\n */\n connectPatchNodeProxy(name, path, options = {}) {\n const localVarPath = this.basePath + '/api/v1/nodes/{name}/proxy'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling connectPatchNodeProxy.');\n }\n if (path !== undefined) {\n localVarQueryParameters['path'] = ObjectSerializer.serialize(path, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'PATCH',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"string\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * connect PATCH requests to proxy of Node\n * @param name name of the NodeProxyOptions\n * @param path path to the resource\n * @param path2 Path is the URL path to use for the current proxy request to node.\n * @param {*} [options] Override http request options.\n */\n connectPatchNodeProxyWithPath(name, path, path2, options = {}) {\n const localVarPath = this.basePath + '/api/v1/nodes/{name}/proxy/{path}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'path' + '}', encodeURIComponent(String(path)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling connectPatchNodeProxyWithPath.');\n }\n // verify required parameter 'path' is not null or undefined\n if (path === null || path === undefined) {\n throw new Error('Required parameter path was null or undefined when calling connectPatchNodeProxyWithPath.');\n }\n if (path2 !== undefined) {\n localVarQueryParameters['path'] = ObjectSerializer.serialize(path2, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'PATCH',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"string\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * connect POST requests to attach of Pod\n * @param name name of the PodAttachOptions\n * @param namespace object name and auth scope, such as for teams and projects\n * @param container The container in which to execute the command. Defaults to only container if there is only one container in the pod.\n * @param stderr Stderr if true indicates that stderr is to be redirected for the attach call. Defaults to true.\n * @param stdin Stdin if true, redirects the standard input stream of the pod for this call. Defaults to false.\n * @param stdout Stdout if true indicates that stdout is to be redirected for the attach call. Defaults to true.\n * @param tty TTY if true indicates that a tty will be allocated for the attach call. This is passed through the container runtime so the tty is allocated on the worker node by the container runtime. Defaults to false.\n * @param {*} [options] Override http request options.\n */\n connectPostNamespacedPodAttach(name, namespace, container, stderr, stdin, stdout, tty, options = {}) {\n const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/pods/{name}/attach'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling connectPostNamespacedPodAttach.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling connectPostNamespacedPodAttach.');\n }\n if (container !== undefined) {\n localVarQueryParameters['container'] = ObjectSerializer.serialize(container, \"string\");\n }\n if (stderr !== undefined) {\n localVarQueryParameters['stderr'] = ObjectSerializer.serialize(stderr, \"boolean\");\n }\n if (stdin !== undefined) {\n localVarQueryParameters['stdin'] = ObjectSerializer.serialize(stdin, \"boolean\");\n }\n if (stdout !== undefined) {\n localVarQueryParameters['stdout'] = ObjectSerializer.serialize(stdout, \"boolean\");\n }\n if (tty !== undefined) {\n localVarQueryParameters['tty'] = ObjectSerializer.serialize(tty, \"boolean\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'POST',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"string\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * connect POST requests to exec of Pod\n * @param name name of the PodExecOptions\n * @param namespace object name and auth scope, such as for teams and projects\n * @param command Command is the remote command to execute. argv array. Not executed within a shell.\n * @param container Container in which to execute the command. Defaults to only container if there is only one container in the pod.\n * @param stderr Redirect the standard error stream of the pod for this call. Defaults to true.\n * @param stdin Redirect the standard input stream of the pod for this call. Defaults to false.\n * @param stdout Redirect the standard output stream of the pod for this call. Defaults to true.\n * @param tty TTY if true indicates that a tty will be allocated for the exec call. Defaults to false.\n * @param {*} [options] Override http request options.\n */\n connectPostNamespacedPodExec(name, namespace, command, container, stderr, stdin, stdout, tty, options = {}) {\n const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/pods/{name}/exec'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling connectPostNamespacedPodExec.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling connectPostNamespacedPodExec.');\n }\n if (command !== undefined) {\n localVarQueryParameters['command'] = ObjectSerializer.serialize(command, \"string\");\n }\n if (container !== undefined) {\n localVarQueryParameters['container'] = ObjectSerializer.serialize(container, \"string\");\n }\n if (stderr !== undefined) {\n localVarQueryParameters['stderr'] = ObjectSerializer.serialize(stderr, \"boolean\");\n }\n if (stdin !== undefined) {\n localVarQueryParameters['stdin'] = ObjectSerializer.serialize(stdin, \"boolean\");\n }\n if (stdout !== undefined) {\n localVarQueryParameters['stdout'] = ObjectSerializer.serialize(stdout, \"boolean\");\n }\n if (tty !== undefined) {\n localVarQueryParameters['tty'] = ObjectSerializer.serialize(tty, \"boolean\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'POST',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"string\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * connect POST requests to portforward of Pod\n * @param name name of the PodPortForwardOptions\n * @param namespace object name and auth scope, such as for teams and projects\n * @param ports List of ports to forward Required when using WebSockets\n * @param {*} [options] Override http request options.\n */\n connectPostNamespacedPodPortforward(name, namespace, ports, options = {}) {\n const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/pods/{name}/portforward'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling connectPostNamespacedPodPortforward.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling connectPostNamespacedPodPortforward.');\n }\n if (ports !== undefined) {\n localVarQueryParameters['ports'] = ObjectSerializer.serialize(ports, \"number\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'POST',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"string\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * connect POST requests to proxy of Pod\n * @param name name of the PodProxyOptions\n * @param namespace object name and auth scope, such as for teams and projects\n * @param path Path is the URL path to use for the current proxy request to pod.\n * @param {*} [options] Override http request options.\n */\n connectPostNamespacedPodProxy(name, namespace, path, options = {}) {\n const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/pods/{name}/proxy'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling connectPostNamespacedPodProxy.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling connectPostNamespacedPodProxy.');\n }\n if (path !== undefined) {\n localVarQueryParameters['path'] = ObjectSerializer.serialize(path, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'POST',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"string\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * connect POST requests to proxy of Pod\n * @param name name of the PodProxyOptions\n * @param namespace object name and auth scope, such as for teams and projects\n * @param path path to the resource\n * @param path2 Path is the URL path to use for the current proxy request to pod.\n * @param {*} [options] Override http request options.\n */\n connectPostNamespacedPodProxyWithPath(name, namespace, path, path2, options = {}) {\n const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/pods/{name}/proxy/{path}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)))\n .replace('{' + 'path' + '}', encodeURIComponent(String(path)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling connectPostNamespacedPodProxyWithPath.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling connectPostNamespacedPodProxyWithPath.');\n }\n // verify required parameter 'path' is not null or undefined\n if (path === null || path === undefined) {\n throw new Error('Required parameter path was null or undefined when calling connectPostNamespacedPodProxyWithPath.');\n }\n if (path2 !== undefined) {\n localVarQueryParameters['path'] = ObjectSerializer.serialize(path2, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'POST',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"string\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * connect POST requests to proxy of Service\n * @param name name of the ServiceProxyOptions\n * @param namespace object name and auth scope, such as for teams and projects\n * @param path Path is the part of URLs that include service endpoints, suffixes, and parameters to use for the current proxy request to service. For example, the whole request URL is http://localhost/api/v1/namespaces/kube-system/services/elasticsearch-logging/_search?q=user:kimchy. Path is _search?q=user:kimchy.\n * @param {*} [options] Override http request options.\n */\n connectPostNamespacedServiceProxy(name, namespace, path, options = {}) {\n const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/services/{name}/proxy'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling connectPostNamespacedServiceProxy.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling connectPostNamespacedServiceProxy.');\n }\n if (path !== undefined) {\n localVarQueryParameters['path'] = ObjectSerializer.serialize(path, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'POST',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"string\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * connect POST requests to proxy of Service\n * @param name name of the ServiceProxyOptions\n * @param namespace object name and auth scope, such as for teams and projects\n * @param path path to the resource\n * @param path2 Path is the part of URLs that include service endpoints, suffixes, and parameters to use for the current proxy request to service. For example, the whole request URL is http://localhost/api/v1/namespaces/kube-system/services/elasticsearch-logging/_search?q=user:kimchy. Path is _search?q=user:kimchy.\n * @param {*} [options] Override http request options.\n */\n connectPostNamespacedServiceProxyWithPath(name, namespace, path, path2, options = {}) {\n const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/services/{name}/proxy/{path}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)))\n .replace('{' + 'path' + '}', encodeURIComponent(String(path)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling connectPostNamespacedServiceProxyWithPath.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling connectPostNamespacedServiceProxyWithPath.');\n }\n // verify required parameter 'path' is not null or undefined\n if (path === null || path === undefined) {\n throw new Error('Required parameter path was null or undefined when calling connectPostNamespacedServiceProxyWithPath.');\n }\n if (path2 !== undefined) {\n localVarQueryParameters['path'] = ObjectSerializer.serialize(path2, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'POST',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"string\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * connect POST requests to proxy of Node\n * @param name name of the NodeProxyOptions\n * @param path Path is the URL path to use for the current proxy request to node.\n * @param {*} [options] Override http request options.\n */\n connectPostNodeProxy(name, path, options = {}) {\n const localVarPath = this.basePath + '/api/v1/nodes/{name}/proxy'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling connectPostNodeProxy.');\n }\n if (path !== undefined) {\n localVarQueryParameters['path'] = ObjectSerializer.serialize(path, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'POST',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"string\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * connect POST requests to proxy of Node\n * @param name name of the NodeProxyOptions\n * @param path path to the resource\n * @param path2 Path is the URL path to use for the current proxy request to node.\n * @param {*} [options] Override http request options.\n */\n connectPostNodeProxyWithPath(name, path, path2, options = {}) {\n const localVarPath = this.basePath + '/api/v1/nodes/{name}/proxy/{path}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'path' + '}', encodeURIComponent(String(path)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling connectPostNodeProxyWithPath.');\n }\n // verify required parameter 'path' is not null or undefined\n if (path === null || path === undefined) {\n throw new Error('Required parameter path was null or undefined when calling connectPostNodeProxyWithPath.');\n }\n if (path2 !== undefined) {\n localVarQueryParameters['path'] = ObjectSerializer.serialize(path2, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'POST',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"string\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * connect PUT requests to proxy of Pod\n * @param name name of the PodProxyOptions\n * @param namespace object name and auth scope, such as for teams and projects\n * @param path Path is the URL path to use for the current proxy request to pod.\n * @param {*} [options] Override http request options.\n */\n connectPutNamespacedPodProxy(name, namespace, path, options = {}) {\n const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/pods/{name}/proxy'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling connectPutNamespacedPodProxy.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling connectPutNamespacedPodProxy.');\n }\n if (path !== undefined) {\n localVarQueryParameters['path'] = ObjectSerializer.serialize(path, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'PUT',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"string\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * connect PUT requests to proxy of Pod\n * @param name name of the PodProxyOptions\n * @param namespace object name and auth scope, such as for teams and projects\n * @param path path to the resource\n * @param path2 Path is the URL path to use for the current proxy request to pod.\n * @param {*} [options] Override http request options.\n */\n connectPutNamespacedPodProxyWithPath(name, namespace, path, path2, options = {}) {\n const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/pods/{name}/proxy/{path}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)))\n .replace('{' + 'path' + '}', encodeURIComponent(String(path)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling connectPutNamespacedPodProxyWithPath.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling connectPutNamespacedPodProxyWithPath.');\n }\n // verify required parameter 'path' is not null or undefined\n if (path === null || path === undefined) {\n throw new Error('Required parameter path was null or undefined when calling connectPutNamespacedPodProxyWithPath.');\n }\n if (path2 !== undefined) {\n localVarQueryParameters['path'] = ObjectSerializer.serialize(path2, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'PUT',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"string\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * connect PUT requests to proxy of Service\n * @param name name of the ServiceProxyOptions\n * @param namespace object name and auth scope, such as for teams and projects\n * @param path Path is the part of URLs that include service endpoints, suffixes, and parameters to use for the current proxy request to service. For example, the whole request URL is http://localhost/api/v1/namespaces/kube-system/services/elasticsearch-logging/_search?q=user:kimchy. Path is _search?q=user:kimchy.\n * @param {*} [options] Override http request options.\n */\n connectPutNamespacedServiceProxy(name, namespace, path, options = {}) {\n const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/services/{name}/proxy'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling connectPutNamespacedServiceProxy.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling connectPutNamespacedServiceProxy.');\n }\n if (path !== undefined) {\n localVarQueryParameters['path'] = ObjectSerializer.serialize(path, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'PUT',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"string\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * connect PUT requests to proxy of Service\n * @param name name of the ServiceProxyOptions\n * @param namespace object name and auth scope, such as for teams and projects\n * @param path path to the resource\n * @param path2 Path is the part of URLs that include service endpoints, suffixes, and parameters to use for the current proxy request to service. For example, the whole request URL is http://localhost/api/v1/namespaces/kube-system/services/elasticsearch-logging/_search?q=user:kimchy. Path is _search?q=user:kimchy.\n * @param {*} [options] Override http request options.\n */\n connectPutNamespacedServiceProxyWithPath(name, namespace, path, path2, options = {}) {\n const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/services/{name}/proxy/{path}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)))\n .replace('{' + 'path' + '}', encodeURIComponent(String(path)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling connectPutNamespacedServiceProxyWithPath.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling connectPutNamespacedServiceProxyWithPath.');\n }\n // verify required parameter 'path' is not null or undefined\n if (path === null || path === undefined) {\n throw new Error('Required parameter path was null or undefined when calling connectPutNamespacedServiceProxyWithPath.');\n }\n if (path2 !== undefined) {\n localVarQueryParameters['path'] = ObjectSerializer.serialize(path2, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'PUT',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"string\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * connect PUT requests to proxy of Node\n * @param name name of the NodeProxyOptions\n * @param path Path is the URL path to use for the current proxy request to node.\n * @param {*} [options] Override http request options.\n */\n connectPutNodeProxy(name, path, options = {}) {\n const localVarPath = this.basePath + '/api/v1/nodes/{name}/proxy'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling connectPutNodeProxy.');\n }\n if (path !== undefined) {\n localVarQueryParameters['path'] = ObjectSerializer.serialize(path, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'PUT',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"string\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * connect PUT requests to proxy of Node\n * @param name name of the NodeProxyOptions\n * @param path path to the resource\n * @param path2 Path is the URL path to use for the current proxy request to node.\n * @param {*} [options] Override http request options.\n */\n connectPutNodeProxyWithPath(name, path, path2, options = {}) {\n const localVarPath = this.basePath + '/api/v1/nodes/{name}/proxy/{path}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'path' + '}', encodeURIComponent(String(path)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling connectPutNodeProxyWithPath.');\n }\n // verify required parameter 'path' is not null or undefined\n if (path === null || path === undefined) {\n throw new Error('Required parameter path was null or undefined when calling connectPutNodeProxyWithPath.');\n }\n if (path2 !== undefined) {\n localVarQueryParameters['path'] = ObjectSerializer.serialize(path2, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'PUT',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"string\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * create a Namespace\n * @param body\n * @param includeUninitialized If IncludeUninitialized is specified, the object may be returned without completing initialization.\n * @param pretty If 'true', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param {*} [options] Override http request options.\n */\n createNamespace(body, includeUninitialized, pretty, dryRun, options = {}) {\n const localVarPath = this.basePath + '/api/v1/namespaces';\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling createNamespace.');\n }\n if (includeUninitialized !== undefined) {\n localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, \"boolean\");\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'POST',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: ObjectSerializer.serialize(body, \"V1Namespace\")\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1Namespace\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * create a Binding\n * @param namespace object name and auth scope, such as for teams and projects\n * @param body\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param includeUninitialized If IncludeUninitialized is specified, the object may be returned without completing initialization.\n * @param pretty If 'true', then the output is pretty printed.\n * @param {*} [options] Override http request options.\n */\n createNamespacedBinding(namespace, body, dryRun, includeUninitialized, pretty, options = {}) {\n const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/bindings'\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling createNamespacedBinding.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling createNamespacedBinding.');\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, \"string\");\n }\n if (includeUninitialized !== undefined) {\n localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, \"boolean\");\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'POST',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: ObjectSerializer.serialize(body, \"V1Binding\")\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1Binding\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * create a ConfigMap\n * @param namespace object name and auth scope, such as for teams and projects\n * @param body\n * @param includeUninitialized If true, partially initialized resources are included in the response.\n * @param pretty If 'true', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param {*} [options] Override http request options.\n */\n createNamespacedConfigMap(namespace, body, includeUninitialized, pretty, dryRun, options = {}) {\n const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/configmaps'\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling createNamespacedConfigMap.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling createNamespacedConfigMap.');\n }\n if (includeUninitialized !== undefined) {\n localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, \"boolean\");\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'POST',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: ObjectSerializer.serialize(body, \"V1ConfigMap\")\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1ConfigMap\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * create Endpoints\n * @param namespace object name and auth scope, such as for teams and projects\n * @param body\n * @param includeUninitialized If true, partially initialized resources are included in the response.\n * @param pretty If 'true', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param {*} [options] Override http request options.\n */\n createNamespacedEndpoints(namespace, body, includeUninitialized, pretty, dryRun, options = {}) {\n const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/endpoints'\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling createNamespacedEndpoints.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling createNamespacedEndpoints.');\n }\n if (includeUninitialized !== undefined) {\n localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, \"boolean\");\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'POST',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: ObjectSerializer.serialize(body, \"V1Endpoints\")\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1Endpoints\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * create an Event\n * @param namespace object name and auth scope, such as for teams and projects\n * @param body\n * @param includeUninitialized If true, partially initialized resources are included in the response.\n * @param pretty If 'true', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param {*} [options] Override http request options.\n */\n createNamespacedEvent(namespace, body, includeUninitialized, pretty, dryRun, options = {}) {\n const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/events'\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling createNamespacedEvent.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling createNamespacedEvent.');\n }\n if (includeUninitialized !== undefined) {\n localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, \"boolean\");\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'POST',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: ObjectSerializer.serialize(body, \"V1Event\")\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1Event\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * create a LimitRange\n * @param namespace object name and auth scope, such as for teams and projects\n * @param body\n * @param includeUninitialized If true, partially initialized resources are included in the response.\n * @param pretty If 'true', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param {*} [options] Override http request options.\n */\n createNamespacedLimitRange(namespace, body, includeUninitialized, pretty, dryRun, options = {}) {\n const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/limitranges'\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling createNamespacedLimitRange.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling createNamespacedLimitRange.');\n }\n if (includeUninitialized !== undefined) {\n localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, \"boolean\");\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'POST',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: ObjectSerializer.serialize(body, \"V1LimitRange\")\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1LimitRange\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * create a PersistentVolumeClaim\n * @param namespace object name and auth scope, such as for teams and projects\n * @param body\n * @param includeUninitialized If true, partially initialized resources are included in the response.\n * @param pretty If 'true', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param {*} [options] Override http request options.\n */\n createNamespacedPersistentVolumeClaim(namespace, body, includeUninitialized, pretty, dryRun, options = {}) {\n const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/persistentvolumeclaims'\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling createNamespacedPersistentVolumeClaim.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling createNamespacedPersistentVolumeClaim.');\n }\n if (includeUninitialized !== undefined) {\n localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, \"boolean\");\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'POST',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: ObjectSerializer.serialize(body, \"V1PersistentVolumeClaim\")\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1PersistentVolumeClaim\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * create a Pod\n * @param namespace object name and auth scope, such as for teams and projects\n * @param body\n * @param includeUninitialized If true, partially initialized resources are included in the response.\n * @param pretty If 'true', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param {*} [options] Override http request options.\n */\n createNamespacedPod(namespace, body, includeUninitialized, pretty, dryRun, options = {}) {\n const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/pods'\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling createNamespacedPod.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling createNamespacedPod.');\n }\n if (includeUninitialized !== undefined) {\n localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, \"boolean\");\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'POST',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: ObjectSerializer.serialize(body, \"V1Pod\")\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1Pod\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * create binding of a Pod\n * @param name name of the Binding\n * @param namespace object name and auth scope, such as for teams and projects\n * @param body\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param includeUninitialized If IncludeUninitialized is specified, the object may be returned without completing initialization.\n * @param pretty If 'true', then the output is pretty printed.\n * @param {*} [options] Override http request options.\n */\n createNamespacedPodBinding(name, namespace, body, dryRun, includeUninitialized, pretty, options = {}) {\n const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/pods/{name}/binding'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling createNamespacedPodBinding.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling createNamespacedPodBinding.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling createNamespacedPodBinding.');\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, \"string\");\n }\n if (includeUninitialized !== undefined) {\n localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, \"boolean\");\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'POST',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: ObjectSerializer.serialize(body, \"V1Binding\")\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1Binding\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * create eviction of a Pod\n * @param name name of the Eviction\n * @param namespace object name and auth scope, such as for teams and projects\n * @param body\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param includeUninitialized If IncludeUninitialized is specified, the object may be returned without completing initialization.\n * @param pretty If 'true', then the output is pretty printed.\n * @param {*} [options] Override http request options.\n */\n createNamespacedPodEviction(name, namespace, body, dryRun, includeUninitialized, pretty, options = {}) {\n const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/pods/{name}/eviction'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling createNamespacedPodEviction.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling createNamespacedPodEviction.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling createNamespacedPodEviction.');\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, \"string\");\n }\n if (includeUninitialized !== undefined) {\n localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, \"boolean\");\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'POST',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: ObjectSerializer.serialize(body, \"V1beta1Eviction\")\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1beta1Eviction\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * create a PodTemplate\n * @param namespace object name and auth scope, such as for teams and projects\n * @param body\n * @param includeUninitialized If true, partially initialized resources are included in the response.\n * @param pretty If 'true', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param {*} [options] Override http request options.\n */\n createNamespacedPodTemplate(namespace, body, includeUninitialized, pretty, dryRun, options = {}) {\n const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/podtemplates'\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling createNamespacedPodTemplate.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling createNamespacedPodTemplate.');\n }\n if (includeUninitialized !== undefined) {\n localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, \"boolean\");\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'POST',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: ObjectSerializer.serialize(body, \"V1PodTemplate\")\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1PodTemplate\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * create a ReplicationController\n * @param namespace object name and auth scope, such as for teams and projects\n * @param body\n * @param includeUninitialized If true, partially initialized resources are included in the response.\n * @param pretty If 'true', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param {*} [options] Override http request options.\n */\n createNamespacedReplicationController(namespace, body, includeUninitialized, pretty, dryRun, options = {}) {\n const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/replicationcontrollers'\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling createNamespacedReplicationController.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling createNamespacedReplicationController.');\n }\n if (includeUninitialized !== undefined) {\n localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, \"boolean\");\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'POST',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: ObjectSerializer.serialize(body, \"V1ReplicationController\")\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1ReplicationController\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * create a ResourceQuota\n * @param namespace object name and auth scope, such as for teams and projects\n * @param body\n * @param includeUninitialized If true, partially initialized resources are included in the response.\n * @param pretty If 'true', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param {*} [options] Override http request options.\n */\n createNamespacedResourceQuota(namespace, body, includeUninitialized, pretty, dryRun, options = {}) {\n const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/resourcequotas'\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling createNamespacedResourceQuota.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling createNamespacedResourceQuota.');\n }\n if (includeUninitialized !== undefined) {\n localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, \"boolean\");\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'POST',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: ObjectSerializer.serialize(body, \"V1ResourceQuota\")\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1ResourceQuota\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * create a Secret\n * @param namespace object name and auth scope, such as for teams and projects\n * @param body\n * @param includeUninitialized If true, partially initialized resources are included in the response.\n * @param pretty If 'true', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param {*} [options] Override http request options.\n */\n createNamespacedSecret(namespace, body, includeUninitialized, pretty, dryRun, options = {}) {\n const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/secrets'\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling createNamespacedSecret.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling createNamespacedSecret.');\n }\n if (includeUninitialized !== undefined) {\n localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, \"boolean\");\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'POST',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: ObjectSerializer.serialize(body, \"V1Secret\")\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1Secret\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * create a Service\n * @param namespace object name and auth scope, such as for teams and projects\n * @param body\n * @param includeUninitialized If IncludeUninitialized is specified, the object may be returned without completing initialization.\n * @param pretty If 'true', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param {*} [options] Override http request options.\n */\n createNamespacedService(namespace, body, includeUninitialized, pretty, dryRun, options = {}) {\n const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/services'\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling createNamespacedService.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling createNamespacedService.');\n }\n if (includeUninitialized !== undefined) {\n localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, \"boolean\");\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'POST',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: ObjectSerializer.serialize(body, \"V1Service\")\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1Service\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * create a ServiceAccount\n * @param namespace object name and auth scope, such as for teams and projects\n * @param body\n * @param includeUninitialized If true, partially initialized resources are included in the response.\n * @param pretty If 'true', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param {*} [options] Override http request options.\n */\n createNamespacedServiceAccount(namespace, body, includeUninitialized, pretty, dryRun, options = {}) {\n const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/serviceaccounts'\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling createNamespacedServiceAccount.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling createNamespacedServiceAccount.');\n }\n if (includeUninitialized !== undefined) {\n localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, \"boolean\");\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'POST',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: ObjectSerializer.serialize(body, \"V1ServiceAccount\")\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1ServiceAccount\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * create a Node\n * @param body\n * @param includeUninitialized If true, partially initialized resources are included in the response.\n * @param pretty If 'true', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param {*} [options] Override http request options.\n */\n createNode(body, includeUninitialized, pretty, dryRun, options = {}) {\n const localVarPath = this.basePath + '/api/v1/nodes';\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling createNode.');\n }\n if (includeUninitialized !== undefined) {\n localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, \"boolean\");\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'POST',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: ObjectSerializer.serialize(body, \"V1Node\")\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1Node\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * create a PersistentVolume\n * @param body\n * @param includeUninitialized If true, partially initialized resources are included in the response.\n * @param pretty If 'true', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param {*} [options] Override http request options.\n */\n createPersistentVolume(body, includeUninitialized, pretty, dryRun, options = {}) {\n const localVarPath = this.basePath + '/api/v1/persistentvolumes';\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling createPersistentVolume.');\n }\n if (includeUninitialized !== undefined) {\n localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, \"boolean\");\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'POST',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: ObjectSerializer.serialize(body, \"V1PersistentVolume\")\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1PersistentVolume\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * delete collection of ConfigMap\n * @param namespace object name and auth scope, such as for teams and projects\n * @param includeUninitialized If true, partially initialized resources are included in the response.\n * @param pretty If 'true', then the output is pretty printed.\n * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \\"next key\\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.\n * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything.\n * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything.\n * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.\n * @param resourceVersion When specified with a watch call, shows changes that occur after that particular version of a resource. Defaults to changes from the beginning of history. When specified for list: - if unset, then the result is returned from remote storage based on quorum-read flag; - if it's 0, then we simply return what we currently have in cache, no guarantee; - if set to non zero, then the result is at least as fresh as given rv.\n * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.\n * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.\n * @param {*} [options] Override http request options.\n */\n deleteCollectionNamespacedConfigMap(namespace, includeUninitialized, pretty, _continue, fieldSelector, labelSelector, limit, resourceVersion, timeoutSeconds, watch, options = {}) {\n const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/configmaps'\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling deleteCollectionNamespacedConfigMap.');\n }\n if (includeUninitialized !== undefined) {\n localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, \"boolean\");\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (_continue !== undefined) {\n localVarQueryParameters['continue'] = ObjectSerializer.serialize(_continue, \"string\");\n }\n if (fieldSelector !== undefined) {\n localVarQueryParameters['fieldSelector'] = ObjectSerializer.serialize(fieldSelector, \"string\");\n }\n if (labelSelector !== undefined) {\n localVarQueryParameters['labelSelector'] = ObjectSerializer.serialize(labelSelector, \"string\");\n }\n if (limit !== undefined) {\n localVarQueryParameters['limit'] = ObjectSerializer.serialize(limit, \"number\");\n }\n if (resourceVersion !== undefined) {\n localVarQueryParameters['resourceVersion'] = ObjectSerializer.serialize(resourceVersion, \"string\");\n }\n if (timeoutSeconds !== undefined) {\n localVarQueryParameters['timeoutSeconds'] = ObjectSerializer.serialize(timeoutSeconds, \"number\");\n }\n if (watch !== undefined) {\n localVarQueryParameters['watch'] = ObjectSerializer.serialize(watch, \"boolean\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'DELETE',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1Status\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * delete collection of Endpoints\n * @param namespace object name and auth scope, such as for teams and projects\n * @param includeUninitialized If true, partially initialized resources are included in the response.\n * @param pretty If 'true', then the output is pretty printed.\n * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \\"next key\\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.\n * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything.\n * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything.\n * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.\n * @param resourceVersion When specified with a watch call, shows changes that occur after that particular version of a resource. Defaults to changes from the beginning of history. When specified for list: - if unset, then the result is returned from remote storage based on quorum-read flag; - if it's 0, then we simply return what we currently have in cache, no guarantee; - if set to non zero, then the result is at least as fresh as given rv.\n * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.\n * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.\n * @param {*} [options] Override http request options.\n */\n deleteCollectionNamespacedEndpoints(namespace, includeUninitialized, pretty, _continue, fieldSelector, labelSelector, limit, resourceVersion, timeoutSeconds, watch, options = {}) {\n const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/endpoints'\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling deleteCollectionNamespacedEndpoints.');\n }\n if (includeUninitialized !== undefined) {\n localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, \"boolean\");\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (_continue !== undefined) {\n localVarQueryParameters['continue'] = ObjectSerializer.serialize(_continue, \"string\");\n }\n if (fieldSelector !== undefined) {\n localVarQueryParameters['fieldSelector'] = ObjectSerializer.serialize(fieldSelector, \"string\");\n }\n if (labelSelector !== undefined) {\n localVarQueryParameters['labelSelector'] = ObjectSerializer.serialize(labelSelector, \"string\");\n }\n if (limit !== undefined) {\n localVarQueryParameters['limit'] = ObjectSerializer.serialize(limit, \"number\");\n }\n if (resourceVersion !== undefined) {\n localVarQueryParameters['resourceVersion'] = ObjectSerializer.serialize(resourceVersion, \"string\");\n }\n if (timeoutSeconds !== undefined) {\n localVarQueryParameters['timeoutSeconds'] = ObjectSerializer.serialize(timeoutSeconds, \"number\");\n }\n if (watch !== undefined) {\n localVarQueryParameters['watch'] = ObjectSerializer.serialize(watch, \"boolean\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'DELETE',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1Status\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * delete collection of Event\n * @param namespace object name and auth scope, such as for teams and projects\n * @param includeUninitialized If true, partially initialized resources are included in the response.\n * @param pretty If 'true', then the output is pretty printed.\n * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \\"next key\\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.\n * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything.\n * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything.\n * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.\n * @param resourceVersion When specified with a watch call, shows changes that occur after that particular version of a resource. Defaults to changes from the beginning of history. When specified for list: - if unset, then the result is returned from remote storage based on quorum-read flag; - if it's 0, then we simply return what we currently have in cache, no guarantee; - if set to non zero, then the result is at least as fresh as given rv.\n * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.\n * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.\n * @param {*} [options] Override http request options.\n */\n deleteCollectionNamespacedEvent(namespace, includeUninitialized, pretty, _continue, fieldSelector, labelSelector, limit, resourceVersion, timeoutSeconds, watch, options = {}) {\n const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/events'\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling deleteCollectionNamespacedEvent.');\n }\n if (includeUninitialized !== undefined) {\n localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, \"boolean\");\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (_continue !== undefined) {\n localVarQueryParameters['continue'] = ObjectSerializer.serialize(_continue, \"string\");\n }\n if (fieldSelector !== undefined) {\n localVarQueryParameters['fieldSelector'] = ObjectSerializer.serialize(fieldSelector, \"string\");\n }\n if (labelSelector !== undefined) {\n localVarQueryParameters['labelSelector'] = ObjectSerializer.serialize(labelSelector, \"string\");\n }\n if (limit !== undefined) {\n localVarQueryParameters['limit'] = ObjectSerializer.serialize(limit, \"number\");\n }\n if (resourceVersion !== undefined) {\n localVarQueryParameters['resourceVersion'] = ObjectSerializer.serialize(resourceVersion, \"string\");\n }\n if (timeoutSeconds !== undefined) {\n localVarQueryParameters['timeoutSeconds'] = ObjectSerializer.serialize(timeoutSeconds, \"number\");\n }\n if (watch !== undefined) {\n localVarQueryParameters['watch'] = ObjectSerializer.serialize(watch, \"boolean\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'DELETE',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1Status\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * delete collection of LimitRange\n * @param namespace object name and auth scope, such as for teams and projects\n * @param includeUninitialized If true, partially initialized resources are included in the response.\n * @param pretty If 'true', then the output is pretty printed.\n * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \\"next key\\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.\n * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything.\n * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything.\n * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.\n * @param resourceVersion When specified with a watch call, shows changes that occur after that particular version of a resource. Defaults to changes from the beginning of history. When specified for list: - if unset, then the result is returned from remote storage based on quorum-read flag; - if it's 0, then we simply return what we currently have in cache, no guarantee; - if set to non zero, then the result is at least as fresh as given rv.\n * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.\n * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.\n * @param {*} [options] Override http request options.\n */\n deleteCollectionNamespacedLimitRange(namespace, includeUninitialized, pretty, _continue, fieldSelector, labelSelector, limit, resourceVersion, timeoutSeconds, watch, options = {}) {\n const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/limitranges'\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling deleteCollectionNamespacedLimitRange.');\n }\n if (includeUninitialized !== undefined) {\n localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, \"boolean\");\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (_continue !== undefined) {\n localVarQueryParameters['continue'] = ObjectSerializer.serialize(_continue, \"string\");\n }\n if (fieldSelector !== undefined) {\n localVarQueryParameters['fieldSelector'] = ObjectSerializer.serialize(fieldSelector, \"string\");\n }\n if (labelSelector !== undefined) {\n localVarQueryParameters['labelSelector'] = ObjectSerializer.serialize(labelSelector, \"string\");\n }\n if (limit !== undefined) {\n localVarQueryParameters['limit'] = ObjectSerializer.serialize(limit, \"number\");\n }\n if (resourceVersion !== undefined) {\n localVarQueryParameters['resourceVersion'] = ObjectSerializer.serialize(resourceVersion, \"string\");\n }\n if (timeoutSeconds !== undefined) {\n localVarQueryParameters['timeoutSeconds'] = ObjectSerializer.serialize(timeoutSeconds, \"number\");\n }\n if (watch !== undefined) {\n localVarQueryParameters['watch'] = ObjectSerializer.serialize(watch, \"boolean\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'DELETE',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1Status\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * delete collection of PersistentVolumeClaim\n * @param namespace object name and auth scope, such as for teams and projects\n * @param includeUninitialized If true, partially initialized resources are included in the response.\n * @param pretty If 'true', then the output is pretty printed.\n * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \\"next key\\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.\n * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything.\n * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything.\n * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.\n * @param resourceVersion When specified with a watch call, shows changes that occur after that particular version of a resource. Defaults to changes from the beginning of history. When specified for list: - if unset, then the result is returned from remote storage based on quorum-read flag; - if it's 0, then we simply return what we currently have in cache, no guarantee; - if set to non zero, then the result is at least as fresh as given rv.\n * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.\n * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.\n * @param {*} [options] Override http request options.\n */\n deleteCollectionNamespacedPersistentVolumeClaim(namespace, includeUninitialized, pretty, _continue, fieldSelector, labelSelector, limit, resourceVersion, timeoutSeconds, watch, options = {}) {\n const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/persistentvolumeclaims'\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling deleteCollectionNamespacedPersistentVolumeClaim.');\n }\n if (includeUninitialized !== undefined) {\n localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, \"boolean\");\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (_continue !== undefined) {\n localVarQueryParameters['continue'] = ObjectSerializer.serialize(_continue, \"string\");\n }\n if (fieldSelector !== undefined) {\n localVarQueryParameters['fieldSelector'] = ObjectSerializer.serialize(fieldSelector, \"string\");\n }\n if (labelSelector !== undefined) {\n localVarQueryParameters['labelSelector'] = ObjectSerializer.serialize(labelSelector, \"string\");\n }\n if (limit !== undefined) {\n localVarQueryParameters['limit'] = ObjectSerializer.serialize(limit, \"number\");\n }\n if (resourceVersion !== undefined) {\n localVarQueryParameters['resourceVersion'] = ObjectSerializer.serialize(resourceVersion, \"string\");\n }\n if (timeoutSeconds !== undefined) {\n localVarQueryParameters['timeoutSeconds'] = ObjectSerializer.serialize(timeoutSeconds, \"number\");\n }\n if (watch !== undefined) {\n localVarQueryParameters['watch'] = ObjectSerializer.serialize(watch, \"boolean\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'DELETE',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1Status\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * delete collection of Pod\n * @param namespace object name and auth scope, such as for teams and projects\n * @param includeUninitialized If true, partially initialized resources are included in the response.\n * @param pretty If 'true', then the output is pretty printed.\n * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \\"next key\\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.\n * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything.\n * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything.\n * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.\n * @param resourceVersion When specified with a watch call, shows changes that occur after that particular version of a resource. Defaults to changes from the beginning of history. When specified for list: - if unset, then the result is returned from remote storage based on quorum-read flag; - if it's 0, then we simply return what we currently have in cache, no guarantee; - if set to non zero, then the result is at least as fresh as given rv.\n * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.\n * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.\n * @param {*} [options] Override http request options.\n */\n deleteCollectionNamespacedPod(namespace, includeUninitialized, pretty, _continue, fieldSelector, labelSelector, limit, resourceVersion, timeoutSeconds, watch, options = {}) {\n const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/pods'\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling deleteCollectionNamespacedPod.');\n }\n if (includeUninitialized !== undefined) {\n localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, \"boolean\");\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (_continue !== undefined) {\n localVarQueryParameters['continue'] = ObjectSerializer.serialize(_continue, \"string\");\n }\n if (fieldSelector !== undefined) {\n localVarQueryParameters['fieldSelector'] = ObjectSerializer.serialize(fieldSelector, \"string\");\n }\n if (labelSelector !== undefined) {\n localVarQueryParameters['labelSelector'] = ObjectSerializer.serialize(labelSelector, \"string\");\n }\n if (limit !== undefined) {\n localVarQueryParameters['limit'] = ObjectSerializer.serialize(limit, \"number\");\n }\n if (resourceVersion !== undefined) {\n localVarQueryParameters['resourceVersion'] = ObjectSerializer.serialize(resourceVersion, \"string\");\n }\n if (timeoutSeconds !== undefined) {\n localVarQueryParameters['timeoutSeconds'] = ObjectSerializer.serialize(timeoutSeconds, \"number\");\n }\n if (watch !== undefined) {\n localVarQueryParameters['watch'] = ObjectSerializer.serialize(watch, \"boolean\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'DELETE',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1Status\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * delete collection of PodTemplate\n * @param namespace object name and auth scope, such as for teams and projects\n * @param includeUninitialized If true, partially initialized resources are included in the response.\n * @param pretty If 'true', then the output is pretty printed.\n * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \\"next key\\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.\n * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything.\n * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything.\n * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.\n * @param resourceVersion When specified with a watch call, shows changes that occur after that particular version of a resource. Defaults to changes from the beginning of history. When specified for list: - if unset, then the result is returned from remote storage based on quorum-read flag; - if it's 0, then we simply return what we currently have in cache, no guarantee; - if set to non zero, then the result is at least as fresh as given rv.\n * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.\n * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.\n * @param {*} [options] Override http request options.\n */\n deleteCollectionNamespacedPodTemplate(namespace, includeUninitialized, pretty, _continue, fieldSelector, labelSelector, limit, resourceVersion, timeoutSeconds, watch, options = {}) {\n const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/podtemplates'\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling deleteCollectionNamespacedPodTemplate.');\n }\n if (includeUninitialized !== undefined) {\n localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, \"boolean\");\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (_continue !== undefined) {\n localVarQueryParameters['continue'] = ObjectSerializer.serialize(_continue, \"string\");\n }\n if (fieldSelector !== undefined) {\n localVarQueryParameters['fieldSelector'] = ObjectSerializer.serialize(fieldSelector, \"string\");\n }\n if (labelSelector !== undefined) {\n localVarQueryParameters['labelSelector'] = ObjectSerializer.serialize(labelSelector, \"string\");\n }\n if (limit !== undefined) {\n localVarQueryParameters['limit'] = ObjectSerializer.serialize(limit, \"number\");\n }\n if (resourceVersion !== undefined) {\n localVarQueryParameters['resourceVersion'] = ObjectSerializer.serialize(resourceVersion, \"string\");\n }\n if (timeoutSeconds !== undefined) {\n localVarQueryParameters['timeoutSeconds'] = ObjectSerializer.serialize(timeoutSeconds, \"number\");\n }\n if (watch !== undefined) {\n localVarQueryParameters['watch'] = ObjectSerializer.serialize(watch, \"boolean\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'DELETE',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1Status\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * delete collection of ReplicationController\n * @param namespace object name and auth scope, such as for teams and projects\n * @param includeUninitialized If true, partially initialized resources are included in the response.\n * @param pretty If 'true', then the output is pretty printed.\n * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \\"next key\\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.\n * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything.\n * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything.\n * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.\n * @param resourceVersion When specified with a watch call, shows changes that occur after that particular version of a resource. Defaults to changes from the beginning of history. When specified for list: - if unset, then the result is returned from remote storage based on quorum-read flag; - if it's 0, then we simply return what we currently have in cache, no guarantee; - if set to non zero, then the result is at least as fresh as given rv.\n * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.\n * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.\n * @param {*} [options] Override http request options.\n */\n deleteCollectionNamespacedReplicationController(namespace, includeUninitialized, pretty, _continue, fieldSelector, labelSelector, limit, resourceVersion, timeoutSeconds, watch, options = {}) {\n const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/replicationcontrollers'\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling deleteCollectionNamespacedReplicationController.');\n }\n if (includeUninitialized !== undefined) {\n localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, \"boolean\");\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (_continue !== undefined) {\n localVarQueryParameters['continue'] = ObjectSerializer.serialize(_continue, \"string\");\n }\n if (fieldSelector !== undefined) {\n localVarQueryParameters['fieldSelector'] = ObjectSerializer.serialize(fieldSelector, \"string\");\n }\n if (labelSelector !== undefined) {\n localVarQueryParameters['labelSelector'] = ObjectSerializer.serialize(labelSelector, \"string\");\n }\n if (limit !== undefined) {\n localVarQueryParameters['limit'] = ObjectSerializer.serialize(limit, \"number\");\n }\n if (resourceVersion !== undefined) {\n localVarQueryParameters['resourceVersion'] = ObjectSerializer.serialize(resourceVersion, \"string\");\n }\n if (timeoutSeconds !== undefined) {\n localVarQueryParameters['timeoutSeconds'] = ObjectSerializer.serialize(timeoutSeconds, \"number\");\n }\n if (watch !== undefined) {\n localVarQueryParameters['watch'] = ObjectSerializer.serialize(watch, \"boolean\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'DELETE',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1Status\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * delete collection of ResourceQuota\n * @param namespace object name and auth scope, such as for teams and projects\n * @param includeUninitialized If true, partially initialized resources are included in the response.\n * @param pretty If 'true', then the output is pretty printed.\n * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \\"next key\\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.\n * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything.\n * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything.\n * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.\n * @param resourceVersion When specified with a watch call, shows changes that occur after that particular version of a resource. Defaults to changes from the beginning of history. When specified for list: - if unset, then the result is returned from remote storage based on quorum-read flag; - if it's 0, then we simply return what we currently have in cache, no guarantee; - if set to non zero, then the result is at least as fresh as given rv.\n * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.\n * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.\n * @param {*} [options] Override http request options.\n */\n deleteCollectionNamespacedResourceQuota(namespace, includeUninitialized, pretty, _continue, fieldSelector, labelSelector, limit, resourceVersion, timeoutSeconds, watch, options = {}) {\n const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/resourcequotas'\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling deleteCollectionNamespacedResourceQuota.');\n }\n if (includeUninitialized !== undefined) {\n localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, \"boolean\");\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (_continue !== undefined) {\n localVarQueryParameters['continue'] = ObjectSerializer.serialize(_continue, \"string\");\n }\n if (fieldSelector !== undefined) {\n localVarQueryParameters['fieldSelector'] = ObjectSerializer.serialize(fieldSelector, \"string\");\n }\n if (labelSelector !== undefined) {\n localVarQueryParameters['labelSelector'] = ObjectSerializer.serialize(labelSelector, \"string\");\n }\n if (limit !== undefined) {\n localVarQueryParameters['limit'] = ObjectSerializer.serialize(limit, \"number\");\n }\n if (resourceVersion !== undefined) {\n localVarQueryParameters['resourceVersion'] = ObjectSerializer.serialize(resourceVersion, \"string\");\n }\n if (timeoutSeconds !== undefined) {\n localVarQueryParameters['timeoutSeconds'] = ObjectSerializer.serialize(timeoutSeconds, \"number\");\n }\n if (watch !== undefined) {\n localVarQueryParameters['watch'] = ObjectSerializer.serialize(watch, \"boolean\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'DELETE',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1Status\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * delete collection of Secret\n * @param namespace object name and auth scope, such as for teams and projects\n * @param includeUninitialized If true, partially initialized resources are included in the response.\n * @param pretty If 'true', then the output is pretty printed.\n * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \\"next key\\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.\n * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything.\n * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything.\n * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.\n * @param resourceVersion When specified with a watch call, shows changes that occur after that particular version of a resource. Defaults to changes from the beginning of history. When specified for list: - if unset, then the result is returned from remote storage based on quorum-read flag; - if it's 0, then we simply return what we currently have in cache, no guarantee; - if set to non zero, then the result is at least as fresh as given rv.\n * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.\n * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.\n * @param {*} [options] Override http request options.\n */\n deleteCollectionNamespacedSecret(namespace, includeUninitialized, pretty, _continue, fieldSelector, labelSelector, limit, resourceVersion, timeoutSeconds, watch, options = {}) {\n const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/secrets'\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling deleteCollectionNamespacedSecret.');\n }\n if (includeUninitialized !== undefined) {\n localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, \"boolean\");\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (_continue !== undefined) {\n localVarQueryParameters['continue'] = ObjectSerializer.serialize(_continue, \"string\");\n }\n if (fieldSelector !== undefined) {\n localVarQueryParameters['fieldSelector'] = ObjectSerializer.serialize(fieldSelector, \"string\");\n }\n if (labelSelector !== undefined) {\n localVarQueryParameters['labelSelector'] = ObjectSerializer.serialize(labelSelector, \"string\");\n }\n if (limit !== undefined) {\n localVarQueryParameters['limit'] = ObjectSerializer.serialize(limit, \"number\");\n }\n if (resourceVersion !== undefined) {\n localVarQueryParameters['resourceVersion'] = ObjectSerializer.serialize(resourceVersion, \"string\");\n }\n if (timeoutSeconds !== undefined) {\n localVarQueryParameters['timeoutSeconds'] = ObjectSerializer.serialize(timeoutSeconds, \"number\");\n }\n if (watch !== undefined) {\n localVarQueryParameters['watch'] = ObjectSerializer.serialize(watch, \"boolean\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'DELETE',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1Status\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * delete collection of ServiceAccount\n * @param namespace object name and auth scope, such as for teams and projects\n * @param includeUninitialized If true, partially initialized resources are included in the response.\n * @param pretty If 'true', then the output is pretty printed.\n * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \\"next key\\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.\n * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything.\n * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything.\n * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.\n * @param resourceVersion When specified with a watch call, shows changes that occur after that particular version of a resource. Defaults to changes from the beginning of history. When specified for list: - if unset, then the result is returned from remote storage based on quorum-read flag; - if it's 0, then we simply return what we currently have in cache, no guarantee; - if set to non zero, then the result is at least as fresh as given rv.\n * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.\n * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.\n * @param {*} [options] Override http request options.\n */\n deleteCollectionNamespacedServiceAccount(namespace, includeUninitialized, pretty, _continue, fieldSelector, labelSelector, limit, resourceVersion, timeoutSeconds, watch, options = {}) {\n const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/serviceaccounts'\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling deleteCollectionNamespacedServiceAccount.');\n }\n if (includeUninitialized !== undefined) {\n localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, \"boolean\");\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (_continue !== undefined) {\n localVarQueryParameters['continue'] = ObjectSerializer.serialize(_continue, \"string\");\n }\n if (fieldSelector !== undefined) {\n localVarQueryParameters['fieldSelector'] = ObjectSerializer.serialize(fieldSelector, \"string\");\n }\n if (labelSelector !== undefined) {\n localVarQueryParameters['labelSelector'] = ObjectSerializer.serialize(labelSelector, \"string\");\n }\n if (limit !== undefined) {\n localVarQueryParameters['limit'] = ObjectSerializer.serialize(limit, \"number\");\n }\n if (resourceVersion !== undefined) {\n localVarQueryParameters['resourceVersion'] = ObjectSerializer.serialize(resourceVersion, \"string\");\n }\n if (timeoutSeconds !== undefined) {\n localVarQueryParameters['timeoutSeconds'] = ObjectSerializer.serialize(timeoutSeconds, \"number\");\n }\n if (watch !== undefined) {\n localVarQueryParameters['watch'] = ObjectSerializer.serialize(watch, \"boolean\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'DELETE',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1Status\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * delete collection of Node\n * @param includeUninitialized If true, partially initialized resources are included in the response.\n * @param pretty If 'true', then the output is pretty printed.\n * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \\"next key\\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.\n * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything.\n * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything.\n * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.\n * @param resourceVersion When specified with a watch call, shows changes that occur after that particular version of a resource. Defaults to changes from the beginning of history. When specified for list: - if unset, then the result is returned from remote storage based on quorum-read flag; - if it's 0, then we simply return what we currently have in cache, no guarantee; - if set to non zero, then the result is at least as fresh as given rv.\n * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.\n * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.\n * @param {*} [options] Override http request options.\n */\n deleteCollectionNode(includeUninitialized, pretty, _continue, fieldSelector, labelSelector, limit, resourceVersion, timeoutSeconds, watch, options = {}) {\n const localVarPath = this.basePath + '/api/v1/nodes';\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n if (includeUninitialized !== undefined) {\n localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, \"boolean\");\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (_continue !== undefined) {\n localVarQueryParameters['continue'] = ObjectSerializer.serialize(_continue, \"string\");\n }\n if (fieldSelector !== undefined) {\n localVarQueryParameters['fieldSelector'] = ObjectSerializer.serialize(fieldSelector, \"string\");\n }\n if (labelSelector !== undefined) {\n localVarQueryParameters['labelSelector'] = ObjectSerializer.serialize(labelSelector, \"string\");\n }\n if (limit !== undefined) {\n localVarQueryParameters['limit'] = ObjectSerializer.serialize(limit, \"number\");\n }\n if (resourceVersion !== undefined) {\n localVarQueryParameters['resourceVersion'] = ObjectSerializer.serialize(resourceVersion, \"string\");\n }\n if (timeoutSeconds !== undefined) {\n localVarQueryParameters['timeoutSeconds'] = ObjectSerializer.serialize(timeoutSeconds, \"number\");\n }\n if (watch !== undefined) {\n localVarQueryParameters['watch'] = ObjectSerializer.serialize(watch, \"boolean\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'DELETE',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1Status\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * delete collection of PersistentVolume\n * @param includeUninitialized If true, partially initialized resources are included in the response.\n * @param pretty If 'true', then the output is pretty printed.\n * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \\"next key\\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.\n * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything.\n * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything.\n * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.\n * @param resourceVersion When specified with a watch call, shows changes that occur after that particular version of a resource. Defaults to changes from the beginning of history. When specified for list: - if unset, then the result is returned from remote storage based on quorum-read flag; - if it's 0, then we simply return what we currently have in cache, no guarantee; - if set to non zero, then the result is at least as fresh as given rv.\n * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.\n * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.\n * @param {*} [options] Override http request options.\n */\n deleteCollectionPersistentVolume(includeUninitialized, pretty, _continue, fieldSelector, labelSelector, limit, resourceVersion, timeoutSeconds, watch, options = {}) {\n const localVarPath = this.basePath + '/api/v1/persistentvolumes';\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n if (includeUninitialized !== undefined) {\n localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, \"boolean\");\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (_continue !== undefined) {\n localVarQueryParameters['continue'] = ObjectSerializer.serialize(_continue, \"string\");\n }\n if (fieldSelector !== undefined) {\n localVarQueryParameters['fieldSelector'] = ObjectSerializer.serialize(fieldSelector, \"string\");\n }\n if (labelSelector !== undefined) {\n localVarQueryParameters['labelSelector'] = ObjectSerializer.serialize(labelSelector, \"string\");\n }\n if (limit !== undefined) {\n localVarQueryParameters['limit'] = ObjectSerializer.serialize(limit, \"number\");\n }\n if (resourceVersion !== undefined) {\n localVarQueryParameters['resourceVersion'] = ObjectSerializer.serialize(resourceVersion, \"string\");\n }\n if (timeoutSeconds !== undefined) {\n localVarQueryParameters['timeoutSeconds'] = ObjectSerializer.serialize(timeoutSeconds, \"number\");\n }\n if (watch !== undefined) {\n localVarQueryParameters['watch'] = ObjectSerializer.serialize(watch, \"boolean\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'DELETE',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1Status\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * delete a Namespace\n * @param name name of the Namespace\n * @param pretty If 'true', then the output is pretty printed.\n * @param body\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param gracePeriodSeconds The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately.\n * @param orphanDependents Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \\"orphan\\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both.\n * @param propagationPolicy Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground.\n * @param {*} [options] Override http request options.\n */\n deleteNamespace(name, pretty, body, dryRun, gracePeriodSeconds, orphanDependents, propagationPolicy, options = {}) {\n const localVarPath = this.basePath + '/api/v1/namespaces/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling deleteNamespace.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, \"string\");\n }\n if (gracePeriodSeconds !== undefined) {\n localVarQueryParameters['gracePeriodSeconds'] = ObjectSerializer.serialize(gracePeriodSeconds, \"number\");\n }\n if (orphanDependents !== undefined) {\n localVarQueryParameters['orphanDependents'] = ObjectSerializer.serialize(orphanDependents, \"boolean\");\n }\n if (propagationPolicy !== undefined) {\n localVarQueryParameters['propagationPolicy'] = ObjectSerializer.serialize(propagationPolicy, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'DELETE',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: ObjectSerializer.serialize(body, \"V1DeleteOptions\")\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1Status\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * delete a ConfigMap\n * @param name name of the ConfigMap\n * @param namespace object name and auth scope, such as for teams and projects\n * @param pretty If 'true', then the output is pretty printed.\n * @param body\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param gracePeriodSeconds The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately.\n * @param orphanDependents Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \\"orphan\\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both.\n * @param propagationPolicy Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground.\n * @param {*} [options] Override http request options.\n */\n deleteNamespacedConfigMap(name, namespace, pretty, body, dryRun, gracePeriodSeconds, orphanDependents, propagationPolicy, options = {}) {\n const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/configmaps/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling deleteNamespacedConfigMap.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling deleteNamespacedConfigMap.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, \"string\");\n }\n if (gracePeriodSeconds !== undefined) {\n localVarQueryParameters['gracePeriodSeconds'] = ObjectSerializer.serialize(gracePeriodSeconds, \"number\");\n }\n if (orphanDependents !== undefined) {\n localVarQueryParameters['orphanDependents'] = ObjectSerializer.serialize(orphanDependents, \"boolean\");\n }\n if (propagationPolicy !== undefined) {\n localVarQueryParameters['propagationPolicy'] = ObjectSerializer.serialize(propagationPolicy, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'DELETE',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: ObjectSerializer.serialize(body, \"V1DeleteOptions\")\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1Status\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * delete Endpoints\n * @param name name of the Endpoints\n * @param namespace object name and auth scope, such as for teams and projects\n * @param pretty If 'true', then the output is pretty printed.\n * @param body\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param gracePeriodSeconds The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately.\n * @param orphanDependents Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \\"orphan\\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both.\n * @param propagationPolicy Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground.\n * @param {*} [options] Override http request options.\n */\n deleteNamespacedEndpoints(name, namespace, pretty, body, dryRun, gracePeriodSeconds, orphanDependents, propagationPolicy, options = {}) {\n const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/endpoints/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling deleteNamespacedEndpoints.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling deleteNamespacedEndpoints.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, \"string\");\n }\n if (gracePeriodSeconds !== undefined) {\n localVarQueryParameters['gracePeriodSeconds'] = ObjectSerializer.serialize(gracePeriodSeconds, \"number\");\n }\n if (orphanDependents !== undefined) {\n localVarQueryParameters['orphanDependents'] = ObjectSerializer.serialize(orphanDependents, \"boolean\");\n }\n if (propagationPolicy !== undefined) {\n localVarQueryParameters['propagationPolicy'] = ObjectSerializer.serialize(propagationPolicy, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'DELETE',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: ObjectSerializer.serialize(body, \"V1DeleteOptions\")\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1Status\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * delete an Event\n * @param name name of the Event\n * @param namespace object name and auth scope, such as for teams and projects\n * @param pretty If 'true', then the output is pretty printed.\n * @param body\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param gracePeriodSeconds The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately.\n * @param orphanDependents Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \\"orphan\\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both.\n * @param propagationPolicy Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground.\n * @param {*} [options] Override http request options.\n */\n deleteNamespacedEvent(name, namespace, pretty, body, dryRun, gracePeriodSeconds, orphanDependents, propagationPolicy, options = {}) {\n const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/events/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling deleteNamespacedEvent.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling deleteNamespacedEvent.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, \"string\");\n }\n if (gracePeriodSeconds !== undefined) {\n localVarQueryParameters['gracePeriodSeconds'] = ObjectSerializer.serialize(gracePeriodSeconds, \"number\");\n }\n if (orphanDependents !== undefined) {\n localVarQueryParameters['orphanDependents'] = ObjectSerializer.serialize(orphanDependents, \"boolean\");\n }\n if (propagationPolicy !== undefined) {\n localVarQueryParameters['propagationPolicy'] = ObjectSerializer.serialize(propagationPolicy, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'DELETE',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: ObjectSerializer.serialize(body, \"V1DeleteOptions\")\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1Status\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * delete a LimitRange\n * @param name name of the LimitRange\n * @param namespace object name and auth scope, such as for teams and projects\n * @param pretty If 'true', then the output is pretty printed.\n * @param body\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param gracePeriodSeconds The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately.\n * @param orphanDependents Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \\"orphan\\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both.\n * @param propagationPolicy Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground.\n * @param {*} [options] Override http request options.\n */\n deleteNamespacedLimitRange(name, namespace, pretty, body, dryRun, gracePeriodSeconds, orphanDependents, propagationPolicy, options = {}) {\n const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/limitranges/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling deleteNamespacedLimitRange.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling deleteNamespacedLimitRange.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, \"string\");\n }\n if (gracePeriodSeconds !== undefined) {\n localVarQueryParameters['gracePeriodSeconds'] = ObjectSerializer.serialize(gracePeriodSeconds, \"number\");\n }\n if (orphanDependents !== undefined) {\n localVarQueryParameters['orphanDependents'] = ObjectSerializer.serialize(orphanDependents, \"boolean\");\n }\n if (propagationPolicy !== undefined) {\n localVarQueryParameters['propagationPolicy'] = ObjectSerializer.serialize(propagationPolicy, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'DELETE',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: ObjectSerializer.serialize(body, \"V1DeleteOptions\")\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1Status\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * delete a PersistentVolumeClaim\n * @param name name of the PersistentVolumeClaim\n * @param namespace object name and auth scope, such as for teams and projects\n * @param pretty If 'true', then the output is pretty printed.\n * @param body\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param gracePeriodSeconds The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately.\n * @param orphanDependents Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \\"orphan\\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both.\n * @param propagationPolicy Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground.\n * @param {*} [options] Override http request options.\n */\n deleteNamespacedPersistentVolumeClaim(name, namespace, pretty, body, dryRun, gracePeriodSeconds, orphanDependents, propagationPolicy, options = {}) {\n const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/persistentvolumeclaims/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling deleteNamespacedPersistentVolumeClaim.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling deleteNamespacedPersistentVolumeClaim.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, \"string\");\n }\n if (gracePeriodSeconds !== undefined) {\n localVarQueryParameters['gracePeriodSeconds'] = ObjectSerializer.serialize(gracePeriodSeconds, \"number\");\n }\n if (orphanDependents !== undefined) {\n localVarQueryParameters['orphanDependents'] = ObjectSerializer.serialize(orphanDependents, \"boolean\");\n }\n if (propagationPolicy !== undefined) {\n localVarQueryParameters['propagationPolicy'] = ObjectSerializer.serialize(propagationPolicy, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'DELETE',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: ObjectSerializer.serialize(body, \"V1DeleteOptions\")\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1Status\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * delete a Pod\n * @param name name of the Pod\n * @param namespace object name and auth scope, such as for teams and projects\n * @param pretty If 'true', then the output is pretty printed.\n * @param body\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param gracePeriodSeconds The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately.\n * @param orphanDependents Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \\"orphan\\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both.\n * @param propagationPolicy Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground.\n * @param {*} [options] Override http request options.\n */\n deleteNamespacedPod(name, namespace, pretty, body, dryRun, gracePeriodSeconds, orphanDependents, propagationPolicy, options = {}) {\n const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/pods/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling deleteNamespacedPod.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling deleteNamespacedPod.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, \"string\");\n }\n if (gracePeriodSeconds !== undefined) {\n localVarQueryParameters['gracePeriodSeconds'] = ObjectSerializer.serialize(gracePeriodSeconds, \"number\");\n }\n if (orphanDependents !== undefined) {\n localVarQueryParameters['orphanDependents'] = ObjectSerializer.serialize(orphanDependents, \"boolean\");\n }\n if (propagationPolicy !== undefined) {\n localVarQueryParameters['propagationPolicy'] = ObjectSerializer.serialize(propagationPolicy, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'DELETE',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: ObjectSerializer.serialize(body, \"V1DeleteOptions\")\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1Status\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * delete a PodTemplate\n * @param name name of the PodTemplate\n * @param namespace object name and auth scope, such as for teams and projects\n * @param pretty If 'true', then the output is pretty printed.\n * @param body\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param gracePeriodSeconds The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately.\n * @param orphanDependents Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \\"orphan\\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both.\n * @param propagationPolicy Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground.\n * @param {*} [options] Override http request options.\n */\n deleteNamespacedPodTemplate(name, namespace, pretty, body, dryRun, gracePeriodSeconds, orphanDependents, propagationPolicy, options = {}) {\n const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/podtemplates/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling deleteNamespacedPodTemplate.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling deleteNamespacedPodTemplate.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, \"string\");\n }\n if (gracePeriodSeconds !== undefined) {\n localVarQueryParameters['gracePeriodSeconds'] = ObjectSerializer.serialize(gracePeriodSeconds, \"number\");\n }\n if (orphanDependents !== undefined) {\n localVarQueryParameters['orphanDependents'] = ObjectSerializer.serialize(orphanDependents, \"boolean\");\n }\n if (propagationPolicy !== undefined) {\n localVarQueryParameters['propagationPolicy'] = ObjectSerializer.serialize(propagationPolicy, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'DELETE',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: ObjectSerializer.serialize(body, \"V1DeleteOptions\")\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1Status\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * delete a ReplicationController\n * @param name name of the ReplicationController\n * @param namespace object name and auth scope, such as for teams and projects\n * @param pretty If 'true', then the output is pretty printed.\n * @param body\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param gracePeriodSeconds The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately.\n * @param orphanDependents Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \\"orphan\\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both.\n * @param propagationPolicy Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground.\n * @param {*} [options] Override http request options.\n */\n deleteNamespacedReplicationController(name, namespace, pretty, body, dryRun, gracePeriodSeconds, orphanDependents, propagationPolicy, options = {}) {\n const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/replicationcontrollers/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling deleteNamespacedReplicationController.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling deleteNamespacedReplicationController.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, \"string\");\n }\n if (gracePeriodSeconds !== undefined) {\n localVarQueryParameters['gracePeriodSeconds'] = ObjectSerializer.serialize(gracePeriodSeconds, \"number\");\n }\n if (orphanDependents !== undefined) {\n localVarQueryParameters['orphanDependents'] = ObjectSerializer.serialize(orphanDependents, \"boolean\");\n }\n if (propagationPolicy !== undefined) {\n localVarQueryParameters['propagationPolicy'] = ObjectSerializer.serialize(propagationPolicy, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'DELETE',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: ObjectSerializer.serialize(body, \"V1DeleteOptions\")\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1Status\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * delete a ResourceQuota\n * @param name name of the ResourceQuota\n * @param namespace object name and auth scope, such as for teams and projects\n * @param pretty If 'true', then the output is pretty printed.\n * @param body\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param gracePeriodSeconds The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately.\n * @param orphanDependents Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \\"orphan\\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both.\n * @param propagationPolicy Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground.\n * @param {*} [options] Override http request options.\n */\n deleteNamespacedResourceQuota(name, namespace, pretty, body, dryRun, gracePeriodSeconds, orphanDependents, propagationPolicy, options = {}) {\n const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/resourcequotas/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling deleteNamespacedResourceQuota.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling deleteNamespacedResourceQuota.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, \"string\");\n }\n if (gracePeriodSeconds !== undefined) {\n localVarQueryParameters['gracePeriodSeconds'] = ObjectSerializer.serialize(gracePeriodSeconds, \"number\");\n }\n if (orphanDependents !== undefined) {\n localVarQueryParameters['orphanDependents'] = ObjectSerializer.serialize(orphanDependents, \"boolean\");\n }\n if (propagationPolicy !== undefined) {\n localVarQueryParameters['propagationPolicy'] = ObjectSerializer.serialize(propagationPolicy, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'DELETE',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: ObjectSerializer.serialize(body, \"V1DeleteOptions\")\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1Status\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * delete a Secret\n * @param name name of the Secret\n * @param namespace object name and auth scope, such as for teams and projects\n * @param pretty If 'true', then the output is pretty printed.\n * @param body\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param gracePeriodSeconds The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately.\n * @param orphanDependents Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \\"orphan\\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both.\n * @param propagationPolicy Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground.\n * @param {*} [options] Override http request options.\n */\n deleteNamespacedSecret(name, namespace, pretty, body, dryRun, gracePeriodSeconds, orphanDependents, propagationPolicy, options = {}) {\n const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/secrets/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling deleteNamespacedSecret.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling deleteNamespacedSecret.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, \"string\");\n }\n if (gracePeriodSeconds !== undefined) {\n localVarQueryParameters['gracePeriodSeconds'] = ObjectSerializer.serialize(gracePeriodSeconds, \"number\");\n }\n if (orphanDependents !== undefined) {\n localVarQueryParameters['orphanDependents'] = ObjectSerializer.serialize(orphanDependents, \"boolean\");\n }\n if (propagationPolicy !== undefined) {\n localVarQueryParameters['propagationPolicy'] = ObjectSerializer.serialize(propagationPolicy, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'DELETE',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: ObjectSerializer.serialize(body, \"V1DeleteOptions\")\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1Status\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * delete a Service\n * @param name name of the Service\n * @param namespace object name and auth scope, such as for teams and projects\n * @param pretty If 'true', then the output is pretty printed.\n * @param body\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param gracePeriodSeconds The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately.\n * @param orphanDependents Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \\"orphan\\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both.\n * @param propagationPolicy Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground.\n * @param {*} [options] Override http request options.\n */\n deleteNamespacedService(name, namespace, pretty, body, dryRun, gracePeriodSeconds, orphanDependents, propagationPolicy, options = {}) {\n const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/services/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling deleteNamespacedService.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling deleteNamespacedService.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, \"string\");\n }\n if (gracePeriodSeconds !== undefined) {\n localVarQueryParameters['gracePeriodSeconds'] = ObjectSerializer.serialize(gracePeriodSeconds, \"number\");\n }\n if (orphanDependents !== undefined) {\n localVarQueryParameters['orphanDependents'] = ObjectSerializer.serialize(orphanDependents, \"boolean\");\n }\n if (propagationPolicy !== undefined) {\n localVarQueryParameters['propagationPolicy'] = ObjectSerializer.serialize(propagationPolicy, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'DELETE',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: ObjectSerializer.serialize(body, \"V1DeleteOptions\")\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1Status\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * delete a ServiceAccount\n * @param name name of the ServiceAccount\n * @param namespace object name and auth scope, such as for teams and projects\n * @param pretty If 'true', then the output is pretty printed.\n * @param body\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param gracePeriodSeconds The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately.\n * @param orphanDependents Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \\"orphan\\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both.\n * @param propagationPolicy Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground.\n * @param {*} [options] Override http request options.\n */\n deleteNamespacedServiceAccount(name, namespace, pretty, body, dryRun, gracePeriodSeconds, orphanDependents, propagationPolicy, options = {}) {\n const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/serviceaccounts/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling deleteNamespacedServiceAccount.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling deleteNamespacedServiceAccount.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, \"string\");\n }\n if (gracePeriodSeconds !== undefined) {\n localVarQueryParameters['gracePeriodSeconds'] = ObjectSerializer.serialize(gracePeriodSeconds, \"number\");\n }\n if (orphanDependents !== undefined) {\n localVarQueryParameters['orphanDependents'] = ObjectSerializer.serialize(orphanDependents, \"boolean\");\n }\n if (propagationPolicy !== undefined) {\n localVarQueryParameters['propagationPolicy'] = ObjectSerializer.serialize(propagationPolicy, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'DELETE',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: ObjectSerializer.serialize(body, \"V1DeleteOptions\")\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1Status\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * delete a Node\n * @param name name of the Node\n * @param pretty If 'true', then the output is pretty printed.\n * @param body\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param gracePeriodSeconds The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately.\n * @param orphanDependents Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \\"orphan\\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both.\n * @param propagationPolicy Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground.\n * @param {*} [options] Override http request options.\n */\n deleteNode(name, pretty, body, dryRun, gracePeriodSeconds, orphanDependents, propagationPolicy, options = {}) {\n const localVarPath = this.basePath + '/api/v1/nodes/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling deleteNode.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, \"string\");\n }\n if (gracePeriodSeconds !== undefined) {\n localVarQueryParameters['gracePeriodSeconds'] = ObjectSerializer.serialize(gracePeriodSeconds, \"number\");\n }\n if (orphanDependents !== undefined) {\n localVarQueryParameters['orphanDependents'] = ObjectSerializer.serialize(orphanDependents, \"boolean\");\n }\n if (propagationPolicy !== undefined) {\n localVarQueryParameters['propagationPolicy'] = ObjectSerializer.serialize(propagationPolicy, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'DELETE',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: ObjectSerializer.serialize(body, \"V1DeleteOptions\")\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1Status\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * delete a PersistentVolume\n * @param name name of the PersistentVolume\n * @param pretty If 'true', then the output is pretty printed.\n * @param body\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param gracePeriodSeconds The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately.\n * @param orphanDependents Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \\"orphan\\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both.\n * @param propagationPolicy Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground.\n * @param {*} [options] Override http request options.\n */\n deletePersistentVolume(name, pretty, body, dryRun, gracePeriodSeconds, orphanDependents, propagationPolicy, options = {}) {\n const localVarPath = this.basePath + '/api/v1/persistentvolumes/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling deletePersistentVolume.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, \"string\");\n }\n if (gracePeriodSeconds !== undefined) {\n localVarQueryParameters['gracePeriodSeconds'] = ObjectSerializer.serialize(gracePeriodSeconds, \"number\");\n }\n if (orphanDependents !== undefined) {\n localVarQueryParameters['orphanDependents'] = ObjectSerializer.serialize(orphanDependents, \"boolean\");\n }\n if (propagationPolicy !== undefined) {\n localVarQueryParameters['propagationPolicy'] = ObjectSerializer.serialize(propagationPolicy, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'DELETE',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: ObjectSerializer.serialize(body, \"V1DeleteOptions\")\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1Status\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * get available resources\n * @param {*} [options] Override http request options.\n */\n getAPIResources(options = {}) {\n const localVarPath = this.basePath + '/api/v1/';\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1APIResourceList\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * list objects of kind ComponentStatus\n * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \\"next key\\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.\n * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything.\n * @param includeUninitialized If true, partially initialized resources are included in the response.\n * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything.\n * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.\n * @param pretty If 'true', then the output is pretty printed.\n * @param resourceVersion When specified with a watch call, shows changes that occur after that particular version of a resource. Defaults to changes from the beginning of history. When specified for list: - if unset, then the result is returned from remote storage based on quorum-read flag; - if it's 0, then we simply return what we currently have in cache, no guarantee; - if set to non zero, then the result is at least as fresh as given rv.\n * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.\n * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.\n * @param {*} [options] Override http request options.\n */\n listComponentStatus(_continue, fieldSelector, includeUninitialized, labelSelector, limit, pretty, resourceVersion, timeoutSeconds, watch, options = {}) {\n const localVarPath = this.basePath + '/api/v1/componentstatuses';\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n if (_continue !== undefined) {\n localVarQueryParameters['continue'] = ObjectSerializer.serialize(_continue, \"string\");\n }\n if (fieldSelector !== undefined) {\n localVarQueryParameters['fieldSelector'] = ObjectSerializer.serialize(fieldSelector, \"string\");\n }\n if (includeUninitialized !== undefined) {\n localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, \"boolean\");\n }\n if (labelSelector !== undefined) {\n localVarQueryParameters['labelSelector'] = ObjectSerializer.serialize(labelSelector, \"string\");\n }\n if (limit !== undefined) {\n localVarQueryParameters['limit'] = ObjectSerializer.serialize(limit, \"number\");\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (resourceVersion !== undefined) {\n localVarQueryParameters['resourceVersion'] = ObjectSerializer.serialize(resourceVersion, \"string\");\n }\n if (timeoutSeconds !== undefined) {\n localVarQueryParameters['timeoutSeconds'] = ObjectSerializer.serialize(timeoutSeconds, \"number\");\n }\n if (watch !== undefined) {\n localVarQueryParameters['watch'] = ObjectSerializer.serialize(watch, \"boolean\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1ComponentStatusList\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * list or watch objects of kind ConfigMap\n * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \\"next key\\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.\n * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything.\n * @param includeUninitialized If true, partially initialized resources are included in the response.\n * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything.\n * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.\n * @param pretty If 'true', then the output is pretty printed.\n * @param resourceVersion When specified with a watch call, shows changes that occur after that particular version of a resource. Defaults to changes from the beginning of history. When specified for list: - if unset, then the result is returned from remote storage based on quorum-read flag; - if it's 0, then we simply return what we currently have in cache, no guarantee; - if set to non zero, then the result is at least as fresh as given rv.\n * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.\n * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.\n * @param {*} [options] Override http request options.\n */\n listConfigMapForAllNamespaces(_continue, fieldSelector, includeUninitialized, labelSelector, limit, pretty, resourceVersion, timeoutSeconds, watch, options = {}) {\n const localVarPath = this.basePath + '/api/v1/configmaps';\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n if (_continue !== undefined) {\n localVarQueryParameters['continue'] = ObjectSerializer.serialize(_continue, \"string\");\n }\n if (fieldSelector !== undefined) {\n localVarQueryParameters['fieldSelector'] = ObjectSerializer.serialize(fieldSelector, \"string\");\n }\n if (includeUninitialized !== undefined) {\n localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, \"boolean\");\n }\n if (labelSelector !== undefined) {\n localVarQueryParameters['labelSelector'] = ObjectSerializer.serialize(labelSelector, \"string\");\n }\n if (limit !== undefined) {\n localVarQueryParameters['limit'] = ObjectSerializer.serialize(limit, \"number\");\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (resourceVersion !== undefined) {\n localVarQueryParameters['resourceVersion'] = ObjectSerializer.serialize(resourceVersion, \"string\");\n }\n if (timeoutSeconds !== undefined) {\n localVarQueryParameters['timeoutSeconds'] = ObjectSerializer.serialize(timeoutSeconds, \"number\");\n }\n if (watch !== undefined) {\n localVarQueryParameters['watch'] = ObjectSerializer.serialize(watch, \"boolean\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1ConfigMapList\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * list or watch objects of kind Endpoints\n * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \\"next key\\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.\n * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything.\n * @param includeUninitialized If true, partially initialized resources are included in the response.\n * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything.\n * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.\n * @param pretty If 'true', then the output is pretty printed.\n * @param resourceVersion When specified with a watch call, shows changes that occur after that particular version of a resource. Defaults to changes from the beginning of history. When specified for list: - if unset, then the result is returned from remote storage based on quorum-read flag; - if it's 0, then we simply return what we currently have in cache, no guarantee; - if set to non zero, then the result is at least as fresh as given rv.\n * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.\n * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.\n * @param {*} [options] Override http request options.\n */\n listEndpointsForAllNamespaces(_continue, fieldSelector, includeUninitialized, labelSelector, limit, pretty, resourceVersion, timeoutSeconds, watch, options = {}) {\n const localVarPath = this.basePath + '/api/v1/endpoints';\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n if (_continue !== undefined) {\n localVarQueryParameters['continue'] = ObjectSerializer.serialize(_continue, \"string\");\n }\n if (fieldSelector !== undefined) {\n localVarQueryParameters['fieldSelector'] = ObjectSerializer.serialize(fieldSelector, \"string\");\n }\n if (includeUninitialized !== undefined) {\n localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, \"boolean\");\n }\n if (labelSelector !== undefined) {\n localVarQueryParameters['labelSelector'] = ObjectSerializer.serialize(labelSelector, \"string\");\n }\n if (limit !== undefined) {\n localVarQueryParameters['limit'] = ObjectSerializer.serialize(limit, \"number\");\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (resourceVersion !== undefined) {\n localVarQueryParameters['resourceVersion'] = ObjectSerializer.serialize(resourceVersion, \"string\");\n }\n if (timeoutSeconds !== undefined) {\n localVarQueryParameters['timeoutSeconds'] = ObjectSerializer.serialize(timeoutSeconds, \"number\");\n }\n if (watch !== undefined) {\n localVarQueryParameters['watch'] = ObjectSerializer.serialize(watch, \"boolean\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1EndpointsList\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * list or watch objects of kind Event\n * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \\"next key\\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.\n * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything.\n * @param includeUninitialized If true, partially initialized resources are included in the response.\n * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything.\n * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.\n * @param pretty If 'true', then the output is pretty printed.\n * @param resourceVersion When specified with a watch call, shows changes that occur after that particular version of a resource. Defaults to changes from the beginning of history. When specified for list: - if unset, then the result is returned from remote storage based on quorum-read flag; - if it's 0, then we simply return what we currently have in cache, no guarantee; - if set to non zero, then the result is at least as fresh as given rv.\n * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.\n * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.\n * @param {*} [options] Override http request options.\n */\n listEventForAllNamespaces(_continue, fieldSelector, includeUninitialized, labelSelector, limit, pretty, resourceVersion, timeoutSeconds, watch, options = {}) {\n const localVarPath = this.basePath + '/api/v1/events';\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n if (_continue !== undefined) {\n localVarQueryParameters['continue'] = ObjectSerializer.serialize(_continue, \"string\");\n }\n if (fieldSelector !== undefined) {\n localVarQueryParameters['fieldSelector'] = ObjectSerializer.serialize(fieldSelector, \"string\");\n }\n if (includeUninitialized !== undefined) {\n localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, \"boolean\");\n }\n if (labelSelector !== undefined) {\n localVarQueryParameters['labelSelector'] = ObjectSerializer.serialize(labelSelector, \"string\");\n }\n if (limit !== undefined) {\n localVarQueryParameters['limit'] = ObjectSerializer.serialize(limit, \"number\");\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (resourceVersion !== undefined) {\n localVarQueryParameters['resourceVersion'] = ObjectSerializer.serialize(resourceVersion, \"string\");\n }\n if (timeoutSeconds !== undefined) {\n localVarQueryParameters['timeoutSeconds'] = ObjectSerializer.serialize(timeoutSeconds, \"number\");\n }\n if (watch !== undefined) {\n localVarQueryParameters['watch'] = ObjectSerializer.serialize(watch, \"boolean\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1EventList\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * list or watch objects of kind LimitRange\n * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \\"next key\\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.\n * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything.\n * @param includeUninitialized If true, partially initialized resources are included in the response.\n * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything.\n * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.\n * @param pretty If 'true', then the output is pretty printed.\n * @param resourceVersion When specified with a watch call, shows changes that occur after that particular version of a resource. Defaults to changes from the beginning of history. When specified for list: - if unset, then the result is returned from remote storage based on quorum-read flag; - if it's 0, then we simply return what we currently have in cache, no guarantee; - if set to non zero, then the result is at least as fresh as given rv.\n * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.\n * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.\n * @param {*} [options] Override http request options.\n */\n listLimitRangeForAllNamespaces(_continue, fieldSelector, includeUninitialized, labelSelector, limit, pretty, resourceVersion, timeoutSeconds, watch, options = {}) {\n const localVarPath = this.basePath + '/api/v1/limitranges';\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n if (_continue !== undefined) {\n localVarQueryParameters['continue'] = ObjectSerializer.serialize(_continue, \"string\");\n }\n if (fieldSelector !== undefined) {\n localVarQueryParameters['fieldSelector'] = ObjectSerializer.serialize(fieldSelector, \"string\");\n }\n if (includeUninitialized !== undefined) {\n localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, \"boolean\");\n }\n if (labelSelector !== undefined) {\n localVarQueryParameters['labelSelector'] = ObjectSerializer.serialize(labelSelector, \"string\");\n }\n if (limit !== undefined) {\n localVarQueryParameters['limit'] = ObjectSerializer.serialize(limit, \"number\");\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (resourceVersion !== undefined) {\n localVarQueryParameters['resourceVersion'] = ObjectSerializer.serialize(resourceVersion, \"string\");\n }\n if (timeoutSeconds !== undefined) {\n localVarQueryParameters['timeoutSeconds'] = ObjectSerializer.serialize(timeoutSeconds, \"number\");\n }\n if (watch !== undefined) {\n localVarQueryParameters['watch'] = ObjectSerializer.serialize(watch, \"boolean\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1LimitRangeList\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * list or watch objects of kind Namespace\n * @param includeUninitialized If IncludeUninitialized is specified, the object may be returned without completing initialization.\n * @param pretty If 'true', then the output is pretty printed.\n * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \\"next key\\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.\n * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything.\n * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything.\n * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.\n * @param resourceVersion When specified with a watch call, shows changes that occur after that particular version of a resource. Defaults to changes from the beginning of history. When specified for list: - if unset, then the result is returned from remote storage based on quorum-read flag; - if it's 0, then we simply return what we currently have in cache, no guarantee; - if set to non zero, then the result is at least as fresh as given rv.\n * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.\n * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.\n * @param {*} [options] Override http request options.\n */\n listNamespace(includeUninitialized, pretty, _continue, fieldSelector, labelSelector, limit, resourceVersion, timeoutSeconds, watch, options = {}) {\n const localVarPath = this.basePath + '/api/v1/namespaces';\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n if (includeUninitialized !== undefined) {\n localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, \"boolean\");\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (_continue !== undefined) {\n localVarQueryParameters['continue'] = ObjectSerializer.serialize(_continue, \"string\");\n }\n if (fieldSelector !== undefined) {\n localVarQueryParameters['fieldSelector'] = ObjectSerializer.serialize(fieldSelector, \"string\");\n }\n if (labelSelector !== undefined) {\n localVarQueryParameters['labelSelector'] = ObjectSerializer.serialize(labelSelector, \"string\");\n }\n if (limit !== undefined) {\n localVarQueryParameters['limit'] = ObjectSerializer.serialize(limit, \"number\");\n }\n if (resourceVersion !== undefined) {\n localVarQueryParameters['resourceVersion'] = ObjectSerializer.serialize(resourceVersion, \"string\");\n }\n if (timeoutSeconds !== undefined) {\n localVarQueryParameters['timeoutSeconds'] = ObjectSerializer.serialize(timeoutSeconds, \"number\");\n }\n if (watch !== undefined) {\n localVarQueryParameters['watch'] = ObjectSerializer.serialize(watch, \"boolean\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1NamespaceList\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * list or watch objects of kind ConfigMap\n * @param namespace object name and auth scope, such as for teams and projects\n * @param includeUninitialized If true, partially initialized resources are included in the response.\n * @param pretty If 'true', then the output is pretty printed.\n * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \\"next key\\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.\n * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything.\n * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything.\n * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.\n * @param resourceVersion When specified with a watch call, shows changes that occur after that particular version of a resource. Defaults to changes from the beginning of history. When specified for list: - if unset, then the result is returned from remote storage based on quorum-read flag; - if it's 0, then we simply return what we currently have in cache, no guarantee; - if set to non zero, then the result is at least as fresh as given rv.\n * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.\n * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.\n * @param {*} [options] Override http request options.\n */\n listNamespacedConfigMap(namespace, includeUninitialized, pretty, _continue, fieldSelector, labelSelector, limit, resourceVersion, timeoutSeconds, watch, options = {}) {\n const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/configmaps'\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling listNamespacedConfigMap.');\n }\n if (includeUninitialized !== undefined) {\n localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, \"boolean\");\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (_continue !== undefined) {\n localVarQueryParameters['continue'] = ObjectSerializer.serialize(_continue, \"string\");\n }\n if (fieldSelector !== undefined) {\n localVarQueryParameters['fieldSelector'] = ObjectSerializer.serialize(fieldSelector, \"string\");\n }\n if (labelSelector !== undefined) {\n localVarQueryParameters['labelSelector'] = ObjectSerializer.serialize(labelSelector, \"string\");\n }\n if (limit !== undefined) {\n localVarQueryParameters['limit'] = ObjectSerializer.serialize(limit, \"number\");\n }\n if (resourceVersion !== undefined) {\n localVarQueryParameters['resourceVersion'] = ObjectSerializer.serialize(resourceVersion, \"string\");\n }\n if (timeoutSeconds !== undefined) {\n localVarQueryParameters['timeoutSeconds'] = ObjectSerializer.serialize(timeoutSeconds, \"number\");\n }\n if (watch !== undefined) {\n localVarQueryParameters['watch'] = ObjectSerializer.serialize(watch, \"boolean\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1ConfigMapList\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * list or watch objects of kind Endpoints\n * @param namespace object name and auth scope, such as for teams and projects\n * @param includeUninitialized If true, partially initialized resources are included in the response.\n * @param pretty If 'true', then the output is pretty printed.\n * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \\"next key\\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.\n * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything.\n * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything.\n * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.\n * @param resourceVersion When specified with a watch call, shows changes that occur after that particular version of a resource. Defaults to changes from the beginning of history. When specified for list: - if unset, then the result is returned from remote storage based on quorum-read flag; - if it's 0, then we simply return what we currently have in cache, no guarantee; - if set to non zero, then the result is at least as fresh as given rv.\n * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.\n * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.\n * @param {*} [options] Override http request options.\n */\n listNamespacedEndpoints(namespace, includeUninitialized, pretty, _continue, fieldSelector, labelSelector, limit, resourceVersion, timeoutSeconds, watch, options = {}) {\n const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/endpoints'\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling listNamespacedEndpoints.');\n }\n if (includeUninitialized !== undefined) {\n localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, \"boolean\");\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (_continue !== undefined) {\n localVarQueryParameters['continue'] = ObjectSerializer.serialize(_continue, \"string\");\n }\n if (fieldSelector !== undefined) {\n localVarQueryParameters['fieldSelector'] = ObjectSerializer.serialize(fieldSelector, \"string\");\n }\n if (labelSelector !== undefined) {\n localVarQueryParameters['labelSelector'] = ObjectSerializer.serialize(labelSelector, \"string\");\n }\n if (limit !== undefined) {\n localVarQueryParameters['limit'] = ObjectSerializer.serialize(limit, \"number\");\n }\n if (resourceVersion !== undefined) {\n localVarQueryParameters['resourceVersion'] = ObjectSerializer.serialize(resourceVersion, \"string\");\n }\n if (timeoutSeconds !== undefined) {\n localVarQueryParameters['timeoutSeconds'] = ObjectSerializer.serialize(timeoutSeconds, \"number\");\n }\n if (watch !== undefined) {\n localVarQueryParameters['watch'] = ObjectSerializer.serialize(watch, \"boolean\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1EndpointsList\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * list or watch objects of kind Event\n * @param namespace object name and auth scope, such as for teams and projects\n * @param includeUninitialized If true, partially initialized resources are included in the response.\n * @param pretty If 'true', then the output is pretty printed.\n * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \\"next key\\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.\n * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything.\n * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything.\n * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.\n * @param resourceVersion When specified with a watch call, shows changes that occur after that particular version of a resource. Defaults to changes from the beginning of history. When specified for list: - if unset, then the result is returned from remote storage based on quorum-read flag; - if it's 0, then we simply return what we currently have in cache, no guarantee; - if set to non zero, then the result is at least as fresh as given rv.\n * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.\n * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.\n * @param {*} [options] Override http request options.\n */\n listNamespacedEvent(namespace, includeUninitialized, pretty, _continue, fieldSelector, labelSelector, limit, resourceVersion, timeoutSeconds, watch, options = {}) {\n const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/events'\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling listNamespacedEvent.');\n }\n if (includeUninitialized !== undefined) {\n localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, \"boolean\");\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (_continue !== undefined) {\n localVarQueryParameters['continue'] = ObjectSerializer.serialize(_continue, \"string\");\n }\n if (fieldSelector !== undefined) {\n localVarQueryParameters['fieldSelector'] = ObjectSerializer.serialize(fieldSelector, \"string\");\n }\n if (labelSelector !== undefined) {\n localVarQueryParameters['labelSelector'] = ObjectSerializer.serialize(labelSelector, \"string\");\n }\n if (limit !== undefined) {\n localVarQueryParameters['limit'] = ObjectSerializer.serialize(limit, \"number\");\n }\n if (resourceVersion !== undefined) {\n localVarQueryParameters['resourceVersion'] = ObjectSerializer.serialize(resourceVersion, \"string\");\n }\n if (timeoutSeconds !== undefined) {\n localVarQueryParameters['timeoutSeconds'] = ObjectSerializer.serialize(timeoutSeconds, \"number\");\n }\n if (watch !== undefined) {\n localVarQueryParameters['watch'] = ObjectSerializer.serialize(watch, \"boolean\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1EventList\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * list or watch objects of kind LimitRange\n * @param namespace object name and auth scope, such as for teams and projects\n * @param includeUninitialized If true, partially initialized resources are included in the response.\n * @param pretty If 'true', then the output is pretty printed.\n * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \\"next key\\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.\n * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything.\n * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything.\n * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.\n * @param resourceVersion When specified with a watch call, shows changes that occur after that particular version of a resource. Defaults to changes from the beginning of history. When specified for list: - if unset, then the result is returned from remote storage based on quorum-read flag; - if it's 0, then we simply return what we currently have in cache, no guarantee; - if set to non zero, then the result is at least as fresh as given rv.\n * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.\n * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.\n * @param {*} [options] Override http request options.\n */\n listNamespacedLimitRange(namespace, includeUninitialized, pretty, _continue, fieldSelector, labelSelector, limit, resourceVersion, timeoutSeconds, watch, options = {}) {\n const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/limitranges'\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling listNamespacedLimitRange.');\n }\n if (includeUninitialized !== undefined) {\n localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, \"boolean\");\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (_continue !== undefined) {\n localVarQueryParameters['continue'] = ObjectSerializer.serialize(_continue, \"string\");\n }\n if (fieldSelector !== undefined) {\n localVarQueryParameters['fieldSelector'] = ObjectSerializer.serialize(fieldSelector, \"string\");\n }\n if (labelSelector !== undefined) {\n localVarQueryParameters['labelSelector'] = ObjectSerializer.serialize(labelSelector, \"string\");\n }\n if (limit !== undefined) {\n localVarQueryParameters['limit'] = ObjectSerializer.serialize(limit, \"number\");\n }\n if (resourceVersion !== undefined) {\n localVarQueryParameters['resourceVersion'] = ObjectSerializer.serialize(resourceVersion, \"string\");\n }\n if (timeoutSeconds !== undefined) {\n localVarQueryParameters['timeoutSeconds'] = ObjectSerializer.serialize(timeoutSeconds, \"number\");\n }\n if (watch !== undefined) {\n localVarQueryParameters['watch'] = ObjectSerializer.serialize(watch, \"boolean\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1LimitRangeList\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * list or watch objects of kind PersistentVolumeClaim\n * @param namespace object name and auth scope, such as for teams and projects\n * @param includeUninitialized If true, partially initialized resources are included in the response.\n * @param pretty If 'true', then the output is pretty printed.\n * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \\"next key\\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.\n * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything.\n * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything.\n * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.\n * @param resourceVersion When specified with a watch call, shows changes that occur after that particular version of a resource. Defaults to changes from the beginning of history. When specified for list: - if unset, then the result is returned from remote storage based on quorum-read flag; - if it's 0, then we simply return what we currently have in cache, no guarantee; - if set to non zero, then the result is at least as fresh as given rv.\n * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.\n * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.\n * @param {*} [options] Override http request options.\n */\n listNamespacedPersistentVolumeClaim(namespace, includeUninitialized, pretty, _continue, fieldSelector, labelSelector, limit, resourceVersion, timeoutSeconds, watch, options = {}) {\n const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/persistentvolumeclaims'\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling listNamespacedPersistentVolumeClaim.');\n }\n if (includeUninitialized !== undefined) {\n localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, \"boolean\");\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (_continue !== undefined) {\n localVarQueryParameters['continue'] = ObjectSerializer.serialize(_continue, \"string\");\n }\n if (fieldSelector !== undefined) {\n localVarQueryParameters['fieldSelector'] = ObjectSerializer.serialize(fieldSelector, \"string\");\n }\n if (labelSelector !== undefined) {\n localVarQueryParameters['labelSelector'] = ObjectSerializer.serialize(labelSelector, \"string\");\n }\n if (limit !== undefined) {\n localVarQueryParameters['limit'] = ObjectSerializer.serialize(limit, \"number\");\n }\n if (resourceVersion !== undefined) {\n localVarQueryParameters['resourceVersion'] = ObjectSerializer.serialize(resourceVersion, \"string\");\n }\n if (timeoutSeconds !== undefined) {\n localVarQueryParameters['timeoutSeconds'] = ObjectSerializer.serialize(timeoutSeconds, \"number\");\n }\n if (watch !== undefined) {\n localVarQueryParameters['watch'] = ObjectSerializer.serialize(watch, \"boolean\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1PersistentVolumeClaimList\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * list or watch objects of kind Pod\n * @param namespace object name and auth scope, such as for teams and projects\n * @param includeUninitialized If true, partially initialized resources are included in the response.\n * @param pretty If 'true', then the output is pretty printed.\n * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \\"next key\\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.\n * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything.\n * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything.\n * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.\n * @param resourceVersion When specified with a watch call, shows changes that occur after that particular version of a resource. Defaults to changes from the beginning of history. When specified for list: - if unset, then the result is returned from remote storage based on quorum-read flag; - if it's 0, then we simply return what we currently have in cache, no guarantee; - if set to non zero, then the result is at least as fresh as given rv.\n * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.\n * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.\n * @param {*} [options] Override http request options.\n */\n listNamespacedPod(namespace, includeUninitialized, pretty, _continue, fieldSelector, labelSelector, limit, resourceVersion, timeoutSeconds, watch, options = {}) {\n const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/pods'\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling listNamespacedPod.');\n }\n if (includeUninitialized !== undefined) {\n localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, \"boolean\");\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (_continue !== undefined) {\n localVarQueryParameters['continue'] = ObjectSerializer.serialize(_continue, \"string\");\n }\n if (fieldSelector !== undefined) {\n localVarQueryParameters['fieldSelector'] = ObjectSerializer.serialize(fieldSelector, \"string\");\n }\n if (labelSelector !== undefined) {\n localVarQueryParameters['labelSelector'] = ObjectSerializer.serialize(labelSelector, \"string\");\n }\n if (limit !== undefined) {\n localVarQueryParameters['limit'] = ObjectSerializer.serialize(limit, \"number\");\n }\n if (resourceVersion !== undefined) {\n localVarQueryParameters['resourceVersion'] = ObjectSerializer.serialize(resourceVersion, \"string\");\n }\n if (timeoutSeconds !== undefined) {\n localVarQueryParameters['timeoutSeconds'] = ObjectSerializer.serialize(timeoutSeconds, \"number\");\n }\n if (watch !== undefined) {\n localVarQueryParameters['watch'] = ObjectSerializer.serialize(watch, \"boolean\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1PodList\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * list or watch objects of kind PodTemplate\n * @param namespace object name and auth scope, such as for teams and projects\n * @param includeUninitialized If true, partially initialized resources are included in the response.\n * @param pretty If 'true', then the output is pretty printed.\n * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \\"next key\\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.\n * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything.\n * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything.\n * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.\n * @param resourceVersion When specified with a watch call, shows changes that occur after that particular version of a resource. Defaults to changes from the beginning of history. When specified for list: - if unset, then the result is returned from remote storage based on quorum-read flag; - if it's 0, then we simply return what we currently have in cache, no guarantee; - if set to non zero, then the result is at least as fresh as given rv.\n * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.\n * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.\n * @param {*} [options] Override http request options.\n */\n listNamespacedPodTemplate(namespace, includeUninitialized, pretty, _continue, fieldSelector, labelSelector, limit, resourceVersion, timeoutSeconds, watch, options = {}) {\n const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/podtemplates'\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling listNamespacedPodTemplate.');\n }\n if (includeUninitialized !== undefined) {\n localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, \"boolean\");\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (_continue !== undefined) {\n localVarQueryParameters['continue'] = ObjectSerializer.serialize(_continue, \"string\");\n }\n if (fieldSelector !== undefined) {\n localVarQueryParameters['fieldSelector'] = ObjectSerializer.serialize(fieldSelector, \"string\");\n }\n if (labelSelector !== undefined) {\n localVarQueryParameters['labelSelector'] = ObjectSerializer.serialize(labelSelector, \"string\");\n }\n if (limit !== undefined) {\n localVarQueryParameters['limit'] = ObjectSerializer.serialize(limit, \"number\");\n }\n if (resourceVersion !== undefined) {\n localVarQueryParameters['resourceVersion'] = ObjectSerializer.serialize(resourceVersion, \"string\");\n }\n if (timeoutSeconds !== undefined) {\n localVarQueryParameters['timeoutSeconds'] = ObjectSerializer.serialize(timeoutSeconds, \"number\");\n }\n if (watch !== undefined) {\n localVarQueryParameters['watch'] = ObjectSerializer.serialize(watch, \"boolean\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1PodTemplateList\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * list or watch objects of kind ReplicationController\n * @param namespace object name and auth scope, such as for teams and projects\n * @param includeUninitialized If true, partially initialized resources are included in the response.\n * @param pretty If 'true', then the output is pretty printed.\n * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \\"next key\\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.\n * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything.\n * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything.\n * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.\n * @param resourceVersion When specified with a watch call, shows changes that occur after that particular version of a resource. Defaults to changes from the beginning of history. When specified for list: - if unset, then the result is returned from remote storage based on quorum-read flag; - if it's 0, then we simply return what we currently have in cache, no guarantee; - if set to non zero, then the result is at least as fresh as given rv.\n * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.\n * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.\n * @param {*} [options] Override http request options.\n */\n listNamespacedReplicationController(namespace, includeUninitialized, pretty, _continue, fieldSelector, labelSelector, limit, resourceVersion, timeoutSeconds, watch, options = {}) {\n const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/replicationcontrollers'\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling listNamespacedReplicationController.');\n }\n if (includeUninitialized !== undefined) {\n localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, \"boolean\");\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (_continue !== undefined) {\n localVarQueryParameters['continue'] = ObjectSerializer.serialize(_continue, \"string\");\n }\n if (fieldSelector !== undefined) {\n localVarQueryParameters['fieldSelector'] = ObjectSerializer.serialize(fieldSelector, \"string\");\n }\n if (labelSelector !== undefined) {\n localVarQueryParameters['labelSelector'] = ObjectSerializer.serialize(labelSelector, \"string\");\n }\n if (limit !== undefined) {\n localVarQueryParameters['limit'] = ObjectSerializer.serialize(limit, \"number\");\n }\n if (resourceVersion !== undefined) {\n localVarQueryParameters['resourceVersion'] = ObjectSerializer.serialize(resourceVersion, \"string\");\n }\n if (timeoutSeconds !== undefined) {\n localVarQueryParameters['timeoutSeconds'] = ObjectSerializer.serialize(timeoutSeconds, \"number\");\n }\n if (watch !== undefined) {\n localVarQueryParameters['watch'] = ObjectSerializer.serialize(watch, \"boolean\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1ReplicationControllerList\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * list or watch objects of kind ResourceQuota\n * @param namespace object name and auth scope, such as for teams and projects\n * @param includeUninitialized If true, partially initialized resources are included in the response.\n * @param pretty If 'true', then the output is pretty printed.\n * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \\"next key\\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.\n * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything.\n * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything.\n * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.\n * @param resourceVersion When specified with a watch call, shows changes that occur after that particular version of a resource. Defaults to changes from the beginning of history. When specified for list: - if unset, then the result is returned from remote storage based on quorum-read flag; - if it's 0, then we simply return what we currently have in cache, no guarantee; - if set to non zero, then the result is at least as fresh as given rv.\n * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.\n * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.\n * @param {*} [options] Override http request options.\n */\n listNamespacedResourceQuota(namespace, includeUninitialized, pretty, _continue, fieldSelector, labelSelector, limit, resourceVersion, timeoutSeconds, watch, options = {}) {\n const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/resourcequotas'\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling listNamespacedResourceQuota.');\n }\n if (includeUninitialized !== undefined) {\n localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, \"boolean\");\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (_continue !== undefined) {\n localVarQueryParameters['continue'] = ObjectSerializer.serialize(_continue, \"string\");\n }\n if (fieldSelector !== undefined) {\n localVarQueryParameters['fieldSelector'] = ObjectSerializer.serialize(fieldSelector, \"string\");\n }\n if (labelSelector !== undefined) {\n localVarQueryParameters['labelSelector'] = ObjectSerializer.serialize(labelSelector, \"string\");\n }\n if (limit !== undefined) {\n localVarQueryParameters['limit'] = ObjectSerializer.serialize(limit, \"number\");\n }\n if (resourceVersion !== undefined) {\n localVarQueryParameters['resourceVersion'] = ObjectSerializer.serialize(resourceVersion, \"string\");\n }\n if (timeoutSeconds !== undefined) {\n localVarQueryParameters['timeoutSeconds'] = ObjectSerializer.serialize(timeoutSeconds, \"number\");\n }\n if (watch !== undefined) {\n localVarQueryParameters['watch'] = ObjectSerializer.serialize(watch, \"boolean\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1ResourceQuotaList\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * list or watch objects of kind Secret\n * @param namespace object name and auth scope, such as for teams and projects\n * @param includeUninitialized If true, partially initialized resources are included in the response.\n * @param pretty If 'true', then the output is pretty printed.\n * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \\"next key\\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.\n * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything.\n * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything.\n * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.\n * @param resourceVersion When specified with a watch call, shows changes that occur after that particular version of a resource. Defaults to changes from the beginning of history. When specified for list: - if unset, then the result is returned from remote storage based on quorum-read flag; - if it's 0, then we simply return what we currently have in cache, no guarantee; - if set to non zero, then the result is at least as fresh as given rv.\n * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.\n * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.\n * @param {*} [options] Override http request options.\n */\n listNamespacedSecret(namespace, includeUninitialized, pretty, _continue, fieldSelector, labelSelector, limit, resourceVersion, timeoutSeconds, watch, options = {}) {\n const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/secrets'\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling listNamespacedSecret.');\n }\n if (includeUninitialized !== undefined) {\n localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, \"boolean\");\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (_continue !== undefined) {\n localVarQueryParameters['continue'] = ObjectSerializer.serialize(_continue, \"string\");\n }\n if (fieldSelector !== undefined) {\n localVarQueryParameters['fieldSelector'] = ObjectSerializer.serialize(fieldSelector, \"string\");\n }\n if (labelSelector !== undefined) {\n localVarQueryParameters['labelSelector'] = ObjectSerializer.serialize(labelSelector, \"string\");\n }\n if (limit !== undefined) {\n localVarQueryParameters['limit'] = ObjectSerializer.serialize(limit, \"number\");\n }\n if (resourceVersion !== undefined) {\n localVarQueryParameters['resourceVersion'] = ObjectSerializer.serialize(resourceVersion, \"string\");\n }\n if (timeoutSeconds !== undefined) {\n localVarQueryParameters['timeoutSeconds'] = ObjectSerializer.serialize(timeoutSeconds, \"number\");\n }\n if (watch !== undefined) {\n localVarQueryParameters['watch'] = ObjectSerializer.serialize(watch, \"boolean\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1SecretList\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * list or watch objects of kind Service\n * @param namespace object name and auth scope, such as for teams and projects\n * @param includeUninitialized If IncludeUninitialized is specified, the object may be returned without completing initialization.\n * @param pretty If 'true', then the output is pretty printed.\n * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \\"next key\\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.\n * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything.\n * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything.\n * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.\n * @param resourceVersion When specified with a watch call, shows changes that occur after that particular version of a resource. Defaults to changes from the beginning of history. When specified for list: - if unset, then the result is returned from remote storage based on quorum-read flag; - if it's 0, then we simply return what we currently have in cache, no guarantee; - if set to non zero, then the result is at least as fresh as given rv.\n * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.\n * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.\n * @param {*} [options] Override http request options.\n */\n listNamespacedService(namespace, includeUninitialized, pretty, _continue, fieldSelector, labelSelector, limit, resourceVersion, timeoutSeconds, watch, options = {}) {\n const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/services'\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling listNamespacedService.');\n }\n if (includeUninitialized !== undefined) {\n localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, \"boolean\");\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (_continue !== undefined) {\n localVarQueryParameters['continue'] = ObjectSerializer.serialize(_continue, \"string\");\n }\n if (fieldSelector !== undefined) {\n localVarQueryParameters['fieldSelector'] = ObjectSerializer.serialize(fieldSelector, \"string\");\n }\n if (labelSelector !== undefined) {\n localVarQueryParameters['labelSelector'] = ObjectSerializer.serialize(labelSelector, \"string\");\n }\n if (limit !== undefined) {\n localVarQueryParameters['limit'] = ObjectSerializer.serialize(limit, \"number\");\n }\n if (resourceVersion !== undefined) {\n localVarQueryParameters['resourceVersion'] = ObjectSerializer.serialize(resourceVersion, \"string\");\n }\n if (timeoutSeconds !== undefined) {\n localVarQueryParameters['timeoutSeconds'] = ObjectSerializer.serialize(timeoutSeconds, \"number\");\n }\n if (watch !== undefined) {\n localVarQueryParameters['watch'] = ObjectSerializer.serialize(watch, \"boolean\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1ServiceList\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * list or watch objects of kind ServiceAccount\n * @param namespace object name and auth scope, such as for teams and projects\n * @param includeUninitialized If true, partially initialized resources are included in the response.\n * @param pretty If 'true', then the output is pretty printed.\n * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \\"next key\\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.\n * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything.\n * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything.\n * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.\n * @param resourceVersion When specified with a watch call, shows changes that occur after that particular version of a resource. Defaults to changes from the beginning of history. When specified for list: - if unset, then the result is returned from remote storage based on quorum-read flag; - if it's 0, then we simply return what we currently have in cache, no guarantee; - if set to non zero, then the result is at least as fresh as given rv.\n * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.\n * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.\n * @param {*} [options] Override http request options.\n */\n listNamespacedServiceAccount(namespace, includeUninitialized, pretty, _continue, fieldSelector, labelSelector, limit, resourceVersion, timeoutSeconds, watch, options = {}) {\n const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/serviceaccounts'\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling listNamespacedServiceAccount.');\n }\n if (includeUninitialized !== undefined) {\n localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, \"boolean\");\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (_continue !== undefined) {\n localVarQueryParameters['continue'] = ObjectSerializer.serialize(_continue, \"string\");\n }\n if (fieldSelector !== undefined) {\n localVarQueryParameters['fieldSelector'] = ObjectSerializer.serialize(fieldSelector, \"string\");\n }\n if (labelSelector !== undefined) {\n localVarQueryParameters['labelSelector'] = ObjectSerializer.serialize(labelSelector, \"string\");\n }\n if (limit !== undefined) {\n localVarQueryParameters['limit'] = ObjectSerializer.serialize(limit, \"number\");\n }\n if (resourceVersion !== undefined) {\n localVarQueryParameters['resourceVersion'] = ObjectSerializer.serialize(resourceVersion, \"string\");\n }\n if (timeoutSeconds !== undefined) {\n localVarQueryParameters['timeoutSeconds'] = ObjectSerializer.serialize(timeoutSeconds, \"number\");\n }\n if (watch !== undefined) {\n localVarQueryParameters['watch'] = ObjectSerializer.serialize(watch, \"boolean\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1ServiceAccountList\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * list or watch objects of kind Node\n * @param includeUninitialized If true, partially initialized resources are included in the response.\n * @param pretty If 'true', then the output is pretty printed.\n * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \\"next key\\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.\n * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything.\n * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything.\n * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.\n * @param resourceVersion When specified with a watch call, shows changes that occur after that particular version of a resource. Defaults to changes from the beginning of history. When specified for list: - if unset, then the result is returned from remote storage based on quorum-read flag; - if it's 0, then we simply return what we currently have in cache, no guarantee; - if set to non zero, then the result is at least as fresh as given rv.\n * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.\n * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.\n * @param {*} [options] Override http request options.\n */\n listNode(includeUninitialized, pretty, _continue, fieldSelector, labelSelector, limit, resourceVersion, timeoutSeconds, watch, options = {}) {\n const localVarPath = this.basePath + '/api/v1/nodes';\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n if (includeUninitialized !== undefined) {\n localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, \"boolean\");\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (_continue !== undefined) {\n localVarQueryParameters['continue'] = ObjectSerializer.serialize(_continue, \"string\");\n }\n if (fieldSelector !== undefined) {\n localVarQueryParameters['fieldSelector'] = ObjectSerializer.serialize(fieldSelector, \"string\");\n }\n if (labelSelector !== undefined) {\n localVarQueryParameters['labelSelector'] = ObjectSerializer.serialize(labelSelector, \"string\");\n }\n if (limit !== undefined) {\n localVarQueryParameters['limit'] = ObjectSerializer.serialize(limit, \"number\");\n }\n if (resourceVersion !== undefined) {\n localVarQueryParameters['resourceVersion'] = ObjectSerializer.serialize(resourceVersion, \"string\");\n }\n if (timeoutSeconds !== undefined) {\n localVarQueryParameters['timeoutSeconds'] = ObjectSerializer.serialize(timeoutSeconds, \"number\");\n }\n if (watch !== undefined) {\n localVarQueryParameters['watch'] = ObjectSerializer.serialize(watch, \"boolean\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1NodeList\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * list or watch objects of kind PersistentVolume\n * @param includeUninitialized If true, partially initialized resources are included in the response.\n * @param pretty If 'true', then the output is pretty printed.\n * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \\"next key\\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.\n * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything.\n * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything.\n * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.\n * @param resourceVersion When specified with a watch call, shows changes that occur after that particular version of a resource. Defaults to changes from the beginning of history. When specified for list: - if unset, then the result is returned from remote storage based on quorum-read flag; - if it's 0, then we simply return what we currently have in cache, no guarantee; - if set to non zero, then the result is at least as fresh as given rv.\n * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.\n * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.\n * @param {*} [options] Override http request options.\n */\n listPersistentVolume(includeUninitialized, pretty, _continue, fieldSelector, labelSelector, limit, resourceVersion, timeoutSeconds, watch, options = {}) {\n const localVarPath = this.basePath + '/api/v1/persistentvolumes';\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n if (includeUninitialized !== undefined) {\n localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, \"boolean\");\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (_continue !== undefined) {\n localVarQueryParameters['continue'] = ObjectSerializer.serialize(_continue, \"string\");\n }\n if (fieldSelector !== undefined) {\n localVarQueryParameters['fieldSelector'] = ObjectSerializer.serialize(fieldSelector, \"string\");\n }\n if (labelSelector !== undefined) {\n localVarQueryParameters['labelSelector'] = ObjectSerializer.serialize(labelSelector, \"string\");\n }\n if (limit !== undefined) {\n localVarQueryParameters['limit'] = ObjectSerializer.serialize(limit, \"number\");\n }\n if (resourceVersion !== undefined) {\n localVarQueryParameters['resourceVersion'] = ObjectSerializer.serialize(resourceVersion, \"string\");\n }\n if (timeoutSeconds !== undefined) {\n localVarQueryParameters['timeoutSeconds'] = ObjectSerializer.serialize(timeoutSeconds, \"number\");\n }\n if (watch !== undefined) {\n localVarQueryParameters['watch'] = ObjectSerializer.serialize(watch, \"boolean\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1PersistentVolumeList\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * list or watch objects of kind PersistentVolumeClaim\n * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \\"next key\\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.\n * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything.\n * @param includeUninitialized If true, partially initialized resources are included in the response.\n * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything.\n * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.\n * @param pretty If 'true', then the output is pretty printed.\n * @param resourceVersion When specified with a watch call, shows changes that occur after that particular version of a resource. Defaults to changes from the beginning of history. When specified for list: - if unset, then the result is returned from remote storage based on quorum-read flag; - if it's 0, then we simply return what we currently have in cache, no guarantee; - if set to non zero, then the result is at least as fresh as given rv.\n * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.\n * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.\n * @param {*} [options] Override http request options.\n */\n listPersistentVolumeClaimForAllNamespaces(_continue, fieldSelector, includeUninitialized, labelSelector, limit, pretty, resourceVersion, timeoutSeconds, watch, options = {}) {\n const localVarPath = this.basePath + '/api/v1/persistentvolumeclaims';\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n if (_continue !== undefined) {\n localVarQueryParameters['continue'] = ObjectSerializer.serialize(_continue, \"string\");\n }\n if (fieldSelector !== undefined) {\n localVarQueryParameters['fieldSelector'] = ObjectSerializer.serialize(fieldSelector, \"string\");\n }\n if (includeUninitialized !== undefined) {\n localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, \"boolean\");\n }\n if (labelSelector !== undefined) {\n localVarQueryParameters['labelSelector'] = ObjectSerializer.serialize(labelSelector, \"string\");\n }\n if (limit !== undefined) {\n localVarQueryParameters['limit'] = ObjectSerializer.serialize(limit, \"number\");\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (resourceVersion !== undefined) {\n localVarQueryParameters['resourceVersion'] = ObjectSerializer.serialize(resourceVersion, \"string\");\n }\n if (timeoutSeconds !== undefined) {\n localVarQueryParameters['timeoutSeconds'] = ObjectSerializer.serialize(timeoutSeconds, \"number\");\n }\n if (watch !== undefined) {\n localVarQueryParameters['watch'] = ObjectSerializer.serialize(watch, \"boolean\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1PersistentVolumeClaimList\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * list or watch objects of kind Pod\n * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \\"next key\\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.\n * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything.\n * @param includeUninitialized If true, partially initialized resources are included in the response.\n * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything.\n * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.\n * @param pretty If 'true', then the output is pretty printed.\n * @param resourceVersion When specified with a watch call, shows changes that occur after that particular version of a resource. Defaults to changes from the beginning of history. When specified for list: - if unset, then the result is returned from remote storage based on quorum-read flag; - if it's 0, then we simply return what we currently have in cache, no guarantee; - if set to non zero, then the result is at least as fresh as given rv.\n * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.\n * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.\n * @param {*} [options] Override http request options.\n */\n listPodForAllNamespaces(_continue, fieldSelector, includeUninitialized, labelSelector, limit, pretty, resourceVersion, timeoutSeconds, watch, options = {}) {\n const localVarPath = this.basePath + '/api/v1/pods';\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n if (_continue !== undefined) {\n localVarQueryParameters['continue'] = ObjectSerializer.serialize(_continue, \"string\");\n }\n if (fieldSelector !== undefined) {\n localVarQueryParameters['fieldSelector'] = ObjectSerializer.serialize(fieldSelector, \"string\");\n }\n if (includeUninitialized !== undefined) {\n localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, \"boolean\");\n }\n if (labelSelector !== undefined) {\n localVarQueryParameters['labelSelector'] = ObjectSerializer.serialize(labelSelector, \"string\");\n }\n if (limit !== undefined) {\n localVarQueryParameters['limit'] = ObjectSerializer.serialize(limit, \"number\");\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (resourceVersion !== undefined) {\n localVarQueryParameters['resourceVersion'] = ObjectSerializer.serialize(resourceVersion, \"string\");\n }\n if (timeoutSeconds !== undefined) {\n localVarQueryParameters['timeoutSeconds'] = ObjectSerializer.serialize(timeoutSeconds, \"number\");\n }\n if (watch !== undefined) {\n localVarQueryParameters['watch'] = ObjectSerializer.serialize(watch, \"boolean\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1PodList\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * list or watch objects of kind PodTemplate\n * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \\"next key\\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.\n * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything.\n * @param includeUninitialized If true, partially initialized resources are included in the response.\n * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything.\n * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.\n * @param pretty If 'true', then the output is pretty printed.\n * @param resourceVersion When specified with a watch call, shows changes that occur after that particular version of a resource. Defaults to changes from the beginning of history. When specified for list: - if unset, then the result is returned from remote storage based on quorum-read flag; - if it's 0, then we simply return what we currently have in cache, no guarantee; - if set to non zero, then the result is at least as fresh as given rv.\n * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.\n * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.\n * @param {*} [options] Override http request options.\n */\n listPodTemplateForAllNamespaces(_continue, fieldSelector, includeUninitialized, labelSelector, limit, pretty, resourceVersion, timeoutSeconds, watch, options = {}) {\n const localVarPath = this.basePath + '/api/v1/podtemplates';\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n if (_continue !== undefined) {\n localVarQueryParameters['continue'] = ObjectSerializer.serialize(_continue, \"string\");\n }\n if (fieldSelector !== undefined) {\n localVarQueryParameters['fieldSelector'] = ObjectSerializer.serialize(fieldSelector, \"string\");\n }\n if (includeUninitialized !== undefined) {\n localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, \"boolean\");\n }\n if (labelSelector !== undefined) {\n localVarQueryParameters['labelSelector'] = ObjectSerializer.serialize(labelSelector, \"string\");\n }\n if (limit !== undefined) {\n localVarQueryParameters['limit'] = ObjectSerializer.serialize(limit, \"number\");\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (resourceVersion !== undefined) {\n localVarQueryParameters['resourceVersion'] = ObjectSerializer.serialize(resourceVersion, \"string\");\n }\n if (timeoutSeconds !== undefined) {\n localVarQueryParameters['timeoutSeconds'] = ObjectSerializer.serialize(timeoutSeconds, \"number\");\n }\n if (watch !== undefined) {\n localVarQueryParameters['watch'] = ObjectSerializer.serialize(watch, \"boolean\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1PodTemplateList\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * list or watch objects of kind ReplicationController\n * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \\"next key\\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.\n * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything.\n * @param includeUninitialized If true, partially initialized resources are included in the response.\n * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything.\n * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.\n * @param pretty If 'true', then the output is pretty printed.\n * @param resourceVersion When specified with a watch call, shows changes that occur after that particular version of a resource. Defaults to changes from the beginning of history. When specified for list: - if unset, then the result is returned from remote storage based on quorum-read flag; - if it's 0, then we simply return what we currently have in cache, no guarantee; - if set to non zero, then the result is at least as fresh as given rv.\n * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.\n * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.\n * @param {*} [options] Override http request options.\n */\n listReplicationControllerForAllNamespaces(_continue, fieldSelector, includeUninitialized, labelSelector, limit, pretty, resourceVersion, timeoutSeconds, watch, options = {}) {\n const localVarPath = this.basePath + '/api/v1/replicationcontrollers';\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n if (_continue !== undefined) {\n localVarQueryParameters['continue'] = ObjectSerializer.serialize(_continue, \"string\");\n }\n if (fieldSelector !== undefined) {\n localVarQueryParameters['fieldSelector'] = ObjectSerializer.serialize(fieldSelector, \"string\");\n }\n if (includeUninitialized !== undefined) {\n localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, \"boolean\");\n }\n if (labelSelector !== undefined) {\n localVarQueryParameters['labelSelector'] = ObjectSerializer.serialize(labelSelector, \"string\");\n }\n if (limit !== undefined) {\n localVarQueryParameters['limit'] = ObjectSerializer.serialize(limit, \"number\");\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (resourceVersion !== undefined) {\n localVarQueryParameters['resourceVersion'] = ObjectSerializer.serialize(resourceVersion, \"string\");\n }\n if (timeoutSeconds !== undefined) {\n localVarQueryParameters['timeoutSeconds'] = ObjectSerializer.serialize(timeoutSeconds, \"number\");\n }\n if (watch !== undefined) {\n localVarQueryParameters['watch'] = ObjectSerializer.serialize(watch, \"boolean\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1ReplicationControllerList\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * list or watch objects of kind ResourceQuota\n * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \\"next key\\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.\n * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything.\n * @param includeUninitialized If true, partially initialized resources are included in the response.\n * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything.\n * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.\n * @param pretty If 'true', then the output is pretty printed.\n * @param resourceVersion When specified with a watch call, shows changes that occur after that particular version of a resource. Defaults to changes from the beginning of history. When specified for list: - if unset, then the result is returned from remote storage based on quorum-read flag; - if it's 0, then we simply return what we currently have in cache, no guarantee; - if set to non zero, then the result is at least as fresh as given rv.\n * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.\n * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.\n * @param {*} [options] Override http request options.\n */\n listResourceQuotaForAllNamespaces(_continue, fieldSelector, includeUninitialized, labelSelector, limit, pretty, resourceVersion, timeoutSeconds, watch, options = {}) {\n const localVarPath = this.basePath + '/api/v1/resourcequotas';\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n if (_continue !== undefined) {\n localVarQueryParameters['continue'] = ObjectSerializer.serialize(_continue, \"string\");\n }\n if (fieldSelector !== undefined) {\n localVarQueryParameters['fieldSelector'] = ObjectSerializer.serialize(fieldSelector, \"string\");\n }\n if (includeUninitialized !== undefined) {\n localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, \"boolean\");\n }\n if (labelSelector !== undefined) {\n localVarQueryParameters['labelSelector'] = ObjectSerializer.serialize(labelSelector, \"string\");\n }\n if (limit !== undefined) {\n localVarQueryParameters['limit'] = ObjectSerializer.serialize(limit, \"number\");\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (resourceVersion !== undefined) {\n localVarQueryParameters['resourceVersion'] = ObjectSerializer.serialize(resourceVersion, \"string\");\n }\n if (timeoutSeconds !== undefined) {\n localVarQueryParameters['timeoutSeconds'] = ObjectSerializer.serialize(timeoutSeconds, \"number\");\n }\n if (watch !== undefined) {\n localVarQueryParameters['watch'] = ObjectSerializer.serialize(watch, \"boolean\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1ResourceQuotaList\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * list or watch objects of kind Secret\n * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \\"next key\\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.\n * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything.\n * @param includeUninitialized If true, partially initialized resources are included in the response.\n * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything.\n * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.\n * @param pretty If 'true', then the output is pretty printed.\n * @param resourceVersion When specified with a watch call, shows changes that occur after that particular version of a resource. Defaults to changes from the beginning of history. When specified for list: - if unset, then the result is returned from remote storage based on quorum-read flag; - if it's 0, then we simply return what we currently have in cache, no guarantee; - if set to non zero, then the result is at least as fresh as given rv.\n * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.\n * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.\n * @param {*} [options] Override http request options.\n */\n listSecretForAllNamespaces(_continue, fieldSelector, includeUninitialized, labelSelector, limit, pretty, resourceVersion, timeoutSeconds, watch, options = {}) {\n const localVarPath = this.basePath + '/api/v1/secrets';\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n if (_continue !== undefined) {\n localVarQueryParameters['continue'] = ObjectSerializer.serialize(_continue, \"string\");\n }\n if (fieldSelector !== undefined) {\n localVarQueryParameters['fieldSelector'] = ObjectSerializer.serialize(fieldSelector, \"string\");\n }\n if (includeUninitialized !== undefined) {\n localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, \"boolean\");\n }\n if (labelSelector !== undefined) {\n localVarQueryParameters['labelSelector'] = ObjectSerializer.serialize(labelSelector, \"string\");\n }\n if (limit !== undefined) {\n localVarQueryParameters['limit'] = ObjectSerializer.serialize(limit, \"number\");\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (resourceVersion !== undefined) {\n localVarQueryParameters['resourceVersion'] = ObjectSerializer.serialize(resourceVersion, \"string\");\n }\n if (timeoutSeconds !== undefined) {\n localVarQueryParameters['timeoutSeconds'] = ObjectSerializer.serialize(timeoutSeconds, \"number\");\n }\n if (watch !== undefined) {\n localVarQueryParameters['watch'] = ObjectSerializer.serialize(watch, \"boolean\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1SecretList\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * list or watch objects of kind ServiceAccount\n * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \\"next key\\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.\n * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything.\n * @param includeUninitialized If true, partially initialized resources are included in the response.\n * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything.\n * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.\n * @param pretty If 'true', then the output is pretty printed.\n * @param resourceVersion When specified with a watch call, shows changes that occur after that particular version of a resource. Defaults to changes from the beginning of history. When specified for list: - if unset, then the result is returned from remote storage based on quorum-read flag; - if it's 0, then we simply return what we currently have in cache, no guarantee; - if set to non zero, then the result is at least as fresh as given rv.\n * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.\n * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.\n * @param {*} [options] Override http request options.\n */\n listServiceAccountForAllNamespaces(_continue, fieldSelector, includeUninitialized, labelSelector, limit, pretty, resourceVersion, timeoutSeconds, watch, options = {}) {\n const localVarPath = this.basePath + '/api/v1/serviceaccounts';\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n if (_continue !== undefined) {\n localVarQueryParameters['continue'] = ObjectSerializer.serialize(_continue, \"string\");\n }\n if (fieldSelector !== undefined) {\n localVarQueryParameters['fieldSelector'] = ObjectSerializer.serialize(fieldSelector, \"string\");\n }\n if (includeUninitialized !== undefined) {\n localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, \"boolean\");\n }\n if (labelSelector !== undefined) {\n localVarQueryParameters['labelSelector'] = ObjectSerializer.serialize(labelSelector, \"string\");\n }\n if (limit !== undefined) {\n localVarQueryParameters['limit'] = ObjectSerializer.serialize(limit, \"number\");\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (resourceVersion !== undefined) {\n localVarQueryParameters['resourceVersion'] = ObjectSerializer.serialize(resourceVersion, \"string\");\n }\n if (timeoutSeconds !== undefined) {\n localVarQueryParameters['timeoutSeconds'] = ObjectSerializer.serialize(timeoutSeconds, \"number\");\n }\n if (watch !== undefined) {\n localVarQueryParameters['watch'] = ObjectSerializer.serialize(watch, \"boolean\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1ServiceAccountList\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * list or watch objects of kind Service\n * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \\"next key\\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.\n * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything.\n * @param includeUninitialized If true, partially initialized resources are included in the response.\n * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything.\n * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.\n * @param pretty If 'true', then the output is pretty printed.\n * @param resourceVersion When specified with a watch call, shows changes that occur after that particular version of a resource. Defaults to changes from the beginning of history. When specified for list: - if unset, then the result is returned from remote storage based on quorum-read flag; - if it's 0, then we simply return what we currently have in cache, no guarantee; - if set to non zero, then the result is at least as fresh as given rv.\n * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.\n * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.\n * @param {*} [options] Override http request options.\n */\n listServiceForAllNamespaces(_continue, fieldSelector, includeUninitialized, labelSelector, limit, pretty, resourceVersion, timeoutSeconds, watch, options = {}) {\n const localVarPath = this.basePath + '/api/v1/services';\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n if (_continue !== undefined) {\n localVarQueryParameters['continue'] = ObjectSerializer.serialize(_continue, \"string\");\n }\n if (fieldSelector !== undefined) {\n localVarQueryParameters['fieldSelector'] = ObjectSerializer.serialize(fieldSelector, \"string\");\n }\n if (includeUninitialized !== undefined) {\n localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, \"boolean\");\n }\n if (labelSelector !== undefined) {\n localVarQueryParameters['labelSelector'] = ObjectSerializer.serialize(labelSelector, \"string\");\n }\n if (limit !== undefined) {\n localVarQueryParameters['limit'] = ObjectSerializer.serialize(limit, \"number\");\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (resourceVersion !== undefined) {\n localVarQueryParameters['resourceVersion'] = ObjectSerializer.serialize(resourceVersion, \"string\");\n }\n if (timeoutSeconds !== undefined) {\n localVarQueryParameters['timeoutSeconds'] = ObjectSerializer.serialize(timeoutSeconds, \"number\");\n }\n if (watch !== undefined) {\n localVarQueryParameters['watch'] = ObjectSerializer.serialize(watch, \"boolean\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1ServiceList\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * partially update the specified Namespace\n * @param name name of the Namespace\n * @param body\n * @param pretty If 'true', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param {*} [options] Override http request options.\n */\n patchNamespace(name, body, pretty, dryRun, options = {}) {\n const localVarPath = this.basePath + '/api/v1/namespaces/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling patchNamespace.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling patchNamespace.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'PATCH',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: ObjectSerializer.serialize(body, \"any\")\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1Namespace\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * partially update status of the specified Namespace\n * @param name name of the Namespace\n * @param body\n * @param pretty If 'true', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param {*} [options] Override http request options.\n */\n patchNamespaceStatus(name, body, pretty, dryRun, options = {}) {\n const localVarPath = this.basePath + '/api/v1/namespaces/{name}/status'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling patchNamespaceStatus.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling patchNamespaceStatus.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'PATCH',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: ObjectSerializer.serialize(body, \"any\")\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1Namespace\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * partially update the specified ConfigMap\n * @param name name of the ConfigMap\n * @param namespace object name and auth scope, such as for teams and projects\n * @param body\n * @param pretty If 'true', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param {*} [options] Override http request options.\n */\n patchNamespacedConfigMap(name, namespace, body, pretty, dryRun, options = {}) {\n const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/configmaps/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling patchNamespacedConfigMap.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling patchNamespacedConfigMap.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling patchNamespacedConfigMap.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'PATCH',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: ObjectSerializer.serialize(body, \"any\")\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1ConfigMap\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * partially update the specified Endpoints\n * @param name name of the Endpoints\n * @param namespace object name and auth scope, such as for teams and projects\n * @param body\n * @param pretty If 'true', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param {*} [options] Override http request options.\n */\n patchNamespacedEndpoints(name, namespace, body, pretty, dryRun, options = {}) {\n const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/endpoints/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling patchNamespacedEndpoints.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling patchNamespacedEndpoints.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling patchNamespacedEndpoints.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'PATCH',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: ObjectSerializer.serialize(body, \"any\")\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1Endpoints\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * partially update the specified Event\n * @param name name of the Event\n * @param namespace object name and auth scope, such as for teams and projects\n * @param body\n * @param pretty If 'true', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param {*} [options] Override http request options.\n */\n patchNamespacedEvent(name, namespace, body, pretty, dryRun, options = {}) {\n const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/events/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling patchNamespacedEvent.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling patchNamespacedEvent.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling patchNamespacedEvent.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'PATCH',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: ObjectSerializer.serialize(body, \"any\")\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1Event\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * partially update the specified LimitRange\n * @param name name of the LimitRange\n * @param namespace object name and auth scope, such as for teams and projects\n * @param body\n * @param pretty If 'true', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param {*} [options] Override http request options.\n */\n patchNamespacedLimitRange(name, namespace, body, pretty, dryRun, options = {}) {\n const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/limitranges/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling patchNamespacedLimitRange.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling patchNamespacedLimitRange.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling patchNamespacedLimitRange.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'PATCH',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: ObjectSerializer.serialize(body, \"any\")\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1LimitRange\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * partially update the specified PersistentVolumeClaim\n * @param name name of the PersistentVolumeClaim\n * @param namespace object name and auth scope, such as for teams and projects\n * @param body\n * @param pretty If 'true', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param {*} [options] Override http request options.\n */\n patchNamespacedPersistentVolumeClaim(name, namespace, body, pretty, dryRun, options = {}) {\n const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/persistentvolumeclaims/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling patchNamespacedPersistentVolumeClaim.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling patchNamespacedPersistentVolumeClaim.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling patchNamespacedPersistentVolumeClaim.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'PATCH',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: ObjectSerializer.serialize(body, \"any\")\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1PersistentVolumeClaim\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * partially update status of the specified PersistentVolumeClaim\n * @param name name of the PersistentVolumeClaim\n * @param namespace object name and auth scope, such as for teams and projects\n * @param body\n * @param pretty If 'true', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param {*} [options] Override http request options.\n */\n patchNamespacedPersistentVolumeClaimStatus(name, namespace, body, pretty, dryRun, options = {}) {\n const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/persistentvolumeclaims/{name}/status'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling patchNamespacedPersistentVolumeClaimStatus.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling patchNamespacedPersistentVolumeClaimStatus.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling patchNamespacedPersistentVolumeClaimStatus.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'PATCH',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: ObjectSerializer.serialize(body, \"any\")\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1PersistentVolumeClaim\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * partially update the specified Pod\n * @param name name of the Pod\n * @param namespace object name and auth scope, such as for teams and projects\n * @param body\n * @param pretty If 'true', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param {*} [options] Override http request options.\n */\n patchNamespacedPod(name, namespace, body, pretty, dryRun, options = {}) {\n const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/pods/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling patchNamespacedPod.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling patchNamespacedPod.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling patchNamespacedPod.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'PATCH',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: ObjectSerializer.serialize(body, \"any\")\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1Pod\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * partially update status of the specified Pod\n * @param name name of the Pod\n * @param namespace object name and auth scope, such as for teams and projects\n * @param body\n * @param pretty If 'true', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param {*} [options] Override http request options.\n */\n patchNamespacedPodStatus(name, namespace, body, pretty, dryRun, options = {}) {\n const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/pods/{name}/status'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling patchNamespacedPodStatus.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling patchNamespacedPodStatus.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling patchNamespacedPodStatus.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'PATCH',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: ObjectSerializer.serialize(body, \"any\")\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1Pod\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * partially update the specified PodTemplate\n * @param name name of the PodTemplate\n * @param namespace object name and auth scope, such as for teams and projects\n * @param body\n * @param pretty If 'true', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param {*} [options] Override http request options.\n */\n patchNamespacedPodTemplate(name, namespace, body, pretty, dryRun, options = {}) {\n const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/podtemplates/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling patchNamespacedPodTemplate.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling patchNamespacedPodTemplate.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling patchNamespacedPodTemplate.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'PATCH',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: ObjectSerializer.serialize(body, \"any\")\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1PodTemplate\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * partially update the specified ReplicationController\n * @param name name of the ReplicationController\n * @param namespace object name and auth scope, such as for teams and projects\n * @param body\n * @param pretty If 'true', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param {*} [options] Override http request options.\n */\n patchNamespacedReplicationController(name, namespace, body, pretty, dryRun, options = {}) {\n const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/replicationcontrollers/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling patchNamespacedReplicationController.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling patchNamespacedReplicationController.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling patchNamespacedReplicationController.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'PATCH',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: ObjectSerializer.serialize(body, \"any\")\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1ReplicationController\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * partially update scale of the specified ReplicationController\n * @param name name of the Scale\n * @param namespace object name and auth scope, such as for teams and projects\n * @param body\n * @param pretty If 'true', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param {*} [options] Override http request options.\n */\n patchNamespacedReplicationControllerScale(name, namespace, body, pretty, dryRun, options = {}) {\n const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/replicationcontrollers/{name}/scale'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling patchNamespacedReplicationControllerScale.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling patchNamespacedReplicationControllerScale.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling patchNamespacedReplicationControllerScale.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'PATCH',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: ObjectSerializer.serialize(body, \"any\")\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1Scale\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * partially update status of the specified ReplicationController\n * @param name name of the ReplicationController\n * @param namespace object name and auth scope, such as for teams and projects\n * @param body\n * @param pretty If 'true', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param {*} [options] Override http request options.\n */\n patchNamespacedReplicationControllerStatus(name, namespace, body, pretty, dryRun, options = {}) {\n const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/replicationcontrollers/{name}/status'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling patchNamespacedReplicationControllerStatus.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling patchNamespacedReplicationControllerStatus.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling patchNamespacedReplicationControllerStatus.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'PATCH',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: ObjectSerializer.serialize(body, \"any\")\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1ReplicationController\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * partially update the specified ResourceQuota\n * @param name name of the ResourceQuota\n * @param namespace object name and auth scope, such as for teams and projects\n * @param body\n * @param pretty If 'true', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param {*} [options] Override http request options.\n */\n patchNamespacedResourceQuota(name, namespace, body, pretty, dryRun, options = {}) {\n const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/resourcequotas/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling patchNamespacedResourceQuota.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling patchNamespacedResourceQuota.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling patchNamespacedResourceQuota.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'PATCH',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: ObjectSerializer.serialize(body, \"any\")\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1ResourceQuota\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * partially update status of the specified ResourceQuota\n * @param name name of the ResourceQuota\n * @param namespace object name and auth scope, such as for teams and projects\n * @param body\n * @param pretty If 'true', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param {*} [options] Override http request options.\n */\n patchNamespacedResourceQuotaStatus(name, namespace, body, pretty, dryRun, options = {}) {\n const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/resourcequotas/{name}/status'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling patchNamespacedResourceQuotaStatus.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling patchNamespacedResourceQuotaStatus.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling patchNamespacedResourceQuotaStatus.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'PATCH',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: ObjectSerializer.serialize(body, \"any\")\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1ResourceQuota\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * partially update the specified Secret\n * @param name name of the Secret\n * @param namespace object name and auth scope, such as for teams and projects\n * @param body\n * @param pretty If 'true', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param {*} [options] Override http request options.\n */\n patchNamespacedSecret(name, namespace, body, pretty, dryRun, options = {}) {\n const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/secrets/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling patchNamespacedSecret.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling patchNamespacedSecret.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling patchNamespacedSecret.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'PATCH',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: ObjectSerializer.serialize(body, \"any\")\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1Secret\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * partially update the specified Service\n * @param name name of the Service\n * @param namespace object name and auth scope, such as for teams and projects\n * @param body\n * @param pretty If 'true', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param {*} [options] Override http request options.\n */\n patchNamespacedService(name, namespace, body, pretty, dryRun, options = {}) {\n const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/services/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling patchNamespacedService.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling patchNamespacedService.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling patchNamespacedService.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'PATCH',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: ObjectSerializer.serialize(body, \"any\")\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1Service\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * partially update the specified ServiceAccount\n * @param name name of the ServiceAccount\n * @param namespace object name and auth scope, such as for teams and projects\n * @param body\n * @param pretty If 'true', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param {*} [options] Override http request options.\n */\n patchNamespacedServiceAccount(name, namespace, body, pretty, dryRun, options = {}) {\n const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/serviceaccounts/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling patchNamespacedServiceAccount.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling patchNamespacedServiceAccount.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling patchNamespacedServiceAccount.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'PATCH',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: ObjectSerializer.serialize(body, \"any\")\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1ServiceAccount\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * partially update status of the specified Service\n * @param name name of the Service\n * @param namespace object name and auth scope, such as for teams and projects\n * @param body\n * @param pretty If 'true', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param {*} [options] Override http request options.\n */\n patchNamespacedServiceStatus(name, namespace, body, pretty, dryRun, options = {}) {\n const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/services/{name}/status'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling patchNamespacedServiceStatus.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling patchNamespacedServiceStatus.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling patchNamespacedServiceStatus.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'PATCH',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: ObjectSerializer.serialize(body, \"any\")\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1Service\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * partially update the specified Node\n * @param name name of the Node\n * @param body\n * @param pretty If 'true', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param {*} [options] Override http request options.\n */\n patchNode(name, body, pretty, dryRun, options = {}) {\n const localVarPath = this.basePath + '/api/v1/nodes/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling patchNode.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling patchNode.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'PATCH',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: ObjectSerializer.serialize(body, \"any\")\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1Node\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * partially update status of the specified Node\n * @param name name of the Node\n * @param body\n * @param pretty If 'true', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param {*} [options] Override http request options.\n */\n patchNodeStatus(name, body, pretty, dryRun, options = {}) {\n const localVarPath = this.basePath + '/api/v1/nodes/{name}/status'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling patchNodeStatus.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling patchNodeStatus.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'PATCH',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: ObjectSerializer.serialize(body, \"any\")\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1Node\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * partially update the specified PersistentVolume\n * @param name name of the PersistentVolume\n * @param body\n * @param pretty If 'true', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param {*} [options] Override http request options.\n */\n patchPersistentVolume(name, body, pretty, dryRun, options = {}) {\n const localVarPath = this.basePath + '/api/v1/persistentvolumes/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling patchPersistentVolume.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling patchPersistentVolume.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'PATCH',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: ObjectSerializer.serialize(body, \"any\")\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1PersistentVolume\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * partially update status of the specified PersistentVolume\n * @param name name of the PersistentVolume\n * @param body\n * @param pretty If 'true', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param {*} [options] Override http request options.\n */\n patchPersistentVolumeStatus(name, body, pretty, dryRun, options = {}) {\n const localVarPath = this.basePath + '/api/v1/persistentvolumes/{name}/status'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling patchPersistentVolumeStatus.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling patchPersistentVolumeStatus.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'PATCH',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: ObjectSerializer.serialize(body, \"any\")\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1PersistentVolume\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * read the specified ComponentStatus\n * @param name name of the ComponentStatus\n * @param pretty If 'true', then the output is pretty printed.\n * @param {*} [options] Override http request options.\n */\n readComponentStatus(name, pretty, options = {}) {\n const localVarPath = this.basePath + '/api/v1/componentstatuses/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling readComponentStatus.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1ComponentStatus\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * read the specified Namespace\n * @param name name of the Namespace\n * @param pretty If 'true', then the output is pretty printed.\n * @param exact Should the export be exact. Exact export maintains cluster-specific fields like 'Namespace'.\n * @param _export Should this value be exported. Export strips fields that a user can not specify.\n * @param {*} [options] Override http request options.\n */\n readNamespace(name, pretty, exact, _export, options = {}) {\n const localVarPath = this.basePath + '/api/v1/namespaces/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling readNamespace.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (exact !== undefined) {\n localVarQueryParameters['exact'] = ObjectSerializer.serialize(exact, \"boolean\");\n }\n if (_export !== undefined) {\n localVarQueryParameters['export'] = ObjectSerializer.serialize(_export, \"boolean\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1Namespace\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * read status of the specified Namespace\n * @param name name of the Namespace\n * @param pretty If 'true', then the output is pretty printed.\n * @param {*} [options] Override http request options.\n */\n readNamespaceStatus(name, pretty, options = {}) {\n const localVarPath = this.basePath + '/api/v1/namespaces/{name}/status'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling readNamespaceStatus.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1Namespace\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * read the specified ConfigMap\n * @param name name of the ConfigMap\n * @param namespace object name and auth scope, such as for teams and projects\n * @param pretty If 'true', then the output is pretty printed.\n * @param exact Should the export be exact. Exact export maintains cluster-specific fields like 'Namespace'.\n * @param _export Should this value be exported. Export strips fields that a user can not specify.\n * @param {*} [options] Override http request options.\n */\n readNamespacedConfigMap(name, namespace, pretty, exact, _export, options = {}) {\n const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/configmaps/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling readNamespacedConfigMap.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling readNamespacedConfigMap.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (exact !== undefined) {\n localVarQueryParameters['exact'] = ObjectSerializer.serialize(exact, \"boolean\");\n }\n if (_export !== undefined) {\n localVarQueryParameters['export'] = ObjectSerializer.serialize(_export, \"boolean\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1ConfigMap\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * read the specified Endpoints\n * @param name name of the Endpoints\n * @param namespace object name and auth scope, such as for teams and projects\n * @param pretty If 'true', then the output is pretty printed.\n * @param exact Should the export be exact. Exact export maintains cluster-specific fields like 'Namespace'.\n * @param _export Should this value be exported. Export strips fields that a user can not specify.\n * @param {*} [options] Override http request options.\n */\n readNamespacedEndpoints(name, namespace, pretty, exact, _export, options = {}) {\n const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/endpoints/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling readNamespacedEndpoints.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling readNamespacedEndpoints.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (exact !== undefined) {\n localVarQueryParameters['exact'] = ObjectSerializer.serialize(exact, \"boolean\");\n }\n if (_export !== undefined) {\n localVarQueryParameters['export'] = ObjectSerializer.serialize(_export, \"boolean\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1Endpoints\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * read the specified Event\n * @param name name of the Event\n * @param namespace object name and auth scope, such as for teams and projects\n * @param pretty If 'true', then the output is pretty printed.\n * @param exact Should the export be exact. Exact export maintains cluster-specific fields like 'Namespace'.\n * @param _export Should this value be exported. Export strips fields that a user can not specify.\n * @param {*} [options] Override http request options.\n */\n readNamespacedEvent(name, namespace, pretty, exact, _export, options = {}) {\n const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/events/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling readNamespacedEvent.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling readNamespacedEvent.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (exact !== undefined) {\n localVarQueryParameters['exact'] = ObjectSerializer.serialize(exact, \"boolean\");\n }\n if (_export !== undefined) {\n localVarQueryParameters['export'] = ObjectSerializer.serialize(_export, \"boolean\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1Event\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * read the specified LimitRange\n * @param name name of the LimitRange\n * @param namespace object name and auth scope, such as for teams and projects\n * @param pretty If 'true', then the output is pretty printed.\n * @param exact Should the export be exact. Exact export maintains cluster-specific fields like 'Namespace'.\n * @param _export Should this value be exported. Export strips fields that a user can not specify.\n * @param {*} [options] Override http request options.\n */\n readNamespacedLimitRange(name, namespace, pretty, exact, _export, options = {}) {\n const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/limitranges/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling readNamespacedLimitRange.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling readNamespacedLimitRange.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (exact !== undefined) {\n localVarQueryParameters['exact'] = ObjectSerializer.serialize(exact, \"boolean\");\n }\n if (_export !== undefined) {\n localVarQueryParameters['export'] = ObjectSerializer.serialize(_export, \"boolean\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1LimitRange\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * read the specified PersistentVolumeClaim\n * @param name name of the PersistentVolumeClaim\n * @param namespace object name and auth scope, such as for teams and projects\n * @param pretty If 'true', then the output is pretty printed.\n * @param exact Should the export be exact. Exact export maintains cluster-specific fields like 'Namespace'.\n * @param _export Should this value be exported. Export strips fields that a user can not specify.\n * @param {*} [options] Override http request options.\n */\n readNamespacedPersistentVolumeClaim(name, namespace, pretty, exact, _export, options = {}) {\n const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/persistentvolumeclaims/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling readNamespacedPersistentVolumeClaim.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling readNamespacedPersistentVolumeClaim.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (exact !== undefined) {\n localVarQueryParameters['exact'] = ObjectSerializer.serialize(exact, \"boolean\");\n }\n if (_export !== undefined) {\n localVarQueryParameters['export'] = ObjectSerializer.serialize(_export, \"boolean\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1PersistentVolumeClaim\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * read status of the specified PersistentVolumeClaim\n * @param name name of the PersistentVolumeClaim\n * @param namespace object name and auth scope, such as for teams and projects\n * @param pretty If 'true', then the output is pretty printed.\n * @param {*} [options] Override http request options.\n */\n readNamespacedPersistentVolumeClaimStatus(name, namespace, pretty, options = {}) {\n const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/persistentvolumeclaims/{name}/status'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling readNamespacedPersistentVolumeClaimStatus.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling readNamespacedPersistentVolumeClaimStatus.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1PersistentVolumeClaim\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * read the specified Pod\n * @param name name of the Pod\n * @param namespace object name and auth scope, such as for teams and projects\n * @param pretty If 'true', then the output is pretty printed.\n * @param exact Should the export be exact. Exact export maintains cluster-specific fields like 'Namespace'.\n * @param _export Should this value be exported. Export strips fields that a user can not specify.\n * @param {*} [options] Override http request options.\n */\n readNamespacedPod(name, namespace, pretty, exact, _export, options = {}) {\n const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/pods/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling readNamespacedPod.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling readNamespacedPod.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (exact !== undefined) {\n localVarQueryParameters['exact'] = ObjectSerializer.serialize(exact, \"boolean\");\n }\n if (_export !== undefined) {\n localVarQueryParameters['export'] = ObjectSerializer.serialize(_export, \"boolean\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1Pod\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * read log of the specified Pod\n * @param name name of the Pod\n * @param namespace object name and auth scope, such as for teams and projects\n * @param container The container for which to stream logs. Defaults to only container if there is one container in the pod.\n * @param follow Follow the log stream of the pod. Defaults to false.\n * @param limitBytes If set, the number of bytes to read from the server before terminating the log output. This may not display a complete final line of logging, and may return slightly more or slightly less than the specified limit.\n * @param pretty If 'true', then the output is pretty printed.\n * @param previous Return previous terminated container logs. Defaults to false.\n * @param sinceSeconds A relative time in seconds before the current time from which to show logs. If this value precedes the time a pod was started, only logs since the pod start will be returned. If this value is in the future, no logs will be returned. Only one of sinceSeconds or sinceTime may be specified.\n * @param tailLines If set, the number of lines from the end of the logs to show. If not specified, logs are shown from the creation of the container or sinceSeconds or sinceTime\n * @param timestamps If true, add an RFC3339 or RFC3339Nano timestamp at the beginning of every line of log output. Defaults to false.\n * @param {*} [options] Override http request options.\n */\n readNamespacedPodLog(name, namespace, container, follow, limitBytes, pretty, previous, sinceSeconds, tailLines, timestamps, options = {}) {\n const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/pods/{name}/log'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling readNamespacedPodLog.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling readNamespacedPodLog.');\n }\n if (container !== undefined) {\n localVarQueryParameters['container'] = ObjectSerializer.serialize(container, \"string\");\n }\n if (follow !== undefined) {\n localVarQueryParameters['follow'] = ObjectSerializer.serialize(follow, \"boolean\");\n }\n if (limitBytes !== undefined) {\n localVarQueryParameters['limitBytes'] = ObjectSerializer.serialize(limitBytes, \"number\");\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (previous !== undefined) {\n localVarQueryParameters['previous'] = ObjectSerializer.serialize(previous, \"boolean\");\n }\n if (sinceSeconds !== undefined) {\n localVarQueryParameters['sinceSeconds'] = ObjectSerializer.serialize(sinceSeconds, \"number\");\n }\n if (tailLines !== undefined) {\n localVarQueryParameters['tailLines'] = ObjectSerializer.serialize(tailLines, \"number\");\n }\n if (timestamps !== undefined) {\n localVarQueryParameters['timestamps'] = ObjectSerializer.serialize(timestamps, \"boolean\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"string\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * read status of the specified Pod\n * @param name name of the Pod\n * @param namespace object name and auth scope, such as for teams and projects\n * @param pretty If 'true', then the output is pretty printed.\n * @param {*} [options] Override http request options.\n */\n readNamespacedPodStatus(name, namespace, pretty, options = {}) {\n const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/pods/{name}/status'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling readNamespacedPodStatus.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling readNamespacedPodStatus.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1Pod\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * read the specified PodTemplate\n * @param name name of the PodTemplate\n * @param namespace object name and auth scope, such as for teams and projects\n * @param pretty If 'true', then the output is pretty printed.\n * @param exact Should the export be exact. Exact export maintains cluster-specific fields like 'Namespace'.\n * @param _export Should this value be exported. Export strips fields that a user can not specify.\n * @param {*} [options] Override http request options.\n */\n readNamespacedPodTemplate(name, namespace, pretty, exact, _export, options = {}) {\n const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/podtemplates/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling readNamespacedPodTemplate.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling readNamespacedPodTemplate.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (exact !== undefined) {\n localVarQueryParameters['exact'] = ObjectSerializer.serialize(exact, \"boolean\");\n }\n if (_export !== undefined) {\n localVarQueryParameters['export'] = ObjectSerializer.serialize(_export, \"boolean\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1PodTemplate\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * read the specified ReplicationController\n * @param name name of the ReplicationController\n * @param namespace object name and auth scope, such as for teams and projects\n * @param pretty If 'true', then the output is pretty printed.\n * @param exact Should the export be exact. Exact export maintains cluster-specific fields like 'Namespace'.\n * @param _export Should this value be exported. Export strips fields that a user can not specify.\n * @param {*} [options] Override http request options.\n */\n readNamespacedReplicationController(name, namespace, pretty, exact, _export, options = {}) {\n const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/replicationcontrollers/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling readNamespacedReplicationController.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling readNamespacedReplicationController.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (exact !== undefined) {\n localVarQueryParameters['exact'] = ObjectSerializer.serialize(exact, \"boolean\");\n }\n if (_export !== undefined) {\n localVarQueryParameters['export'] = ObjectSerializer.serialize(_export, \"boolean\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1ReplicationController\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * read scale of the specified ReplicationController\n * @param name name of the Scale\n * @param namespace object name and auth scope, such as for teams and projects\n * @param pretty If 'true', then the output is pretty printed.\n * @param {*} [options] Override http request options.\n */\n readNamespacedReplicationControllerScale(name, namespace, pretty, options = {}) {\n const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/replicationcontrollers/{name}/scale'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling readNamespacedReplicationControllerScale.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling readNamespacedReplicationControllerScale.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1Scale\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * read status of the specified ReplicationController\n * @param name name of the ReplicationController\n * @param namespace object name and auth scope, such as for teams and projects\n * @param pretty If 'true', then the output is pretty printed.\n * @param {*} [options] Override http request options.\n */\n readNamespacedReplicationControllerStatus(name, namespace, pretty, options = {}) {\n const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/replicationcontrollers/{name}/status'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling readNamespacedReplicationControllerStatus.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling readNamespacedReplicationControllerStatus.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1ReplicationController\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * read the specified ResourceQuota\n * @param name name of the ResourceQuota\n * @param namespace object name and auth scope, such as for teams and projects\n * @param pretty If 'true', then the output is pretty printed.\n * @param exact Should the export be exact. Exact export maintains cluster-specific fields like 'Namespace'.\n * @param _export Should this value be exported. Export strips fields that a user can not specify.\n * @param {*} [options] Override http request options.\n */\n readNamespacedResourceQuota(name, namespace, pretty, exact, _export, options = {}) {\n const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/resourcequotas/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling readNamespacedResourceQuota.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling readNamespacedResourceQuota.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (exact !== undefined) {\n localVarQueryParameters['exact'] = ObjectSerializer.serialize(exact, \"boolean\");\n }\n if (_export !== undefined) {\n localVarQueryParameters['export'] = ObjectSerializer.serialize(_export, \"boolean\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1ResourceQuota\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * read status of the specified ResourceQuota\n * @param name name of the ResourceQuota\n * @param namespace object name and auth scope, such as for teams and projects\n * @param pretty If 'true', then the output is pretty printed.\n * @param {*} [options] Override http request options.\n */\n readNamespacedResourceQuotaStatus(name, namespace, pretty, options = {}) {\n const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/resourcequotas/{name}/status'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling readNamespacedResourceQuotaStatus.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling readNamespacedResourceQuotaStatus.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1ResourceQuota\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * read the specified Secret\n * @param name name of the Secret\n * @param namespace object name and auth scope, such as for teams and projects\n * @param pretty If 'true', then the output is pretty printed.\n * @param exact Should the export be exact. Exact export maintains cluster-specific fields like 'Namespace'.\n * @param _export Should this value be exported. Export strips fields that a user can not specify.\n * @param {*} [options] Override http request options.\n */\n readNamespacedSecret(name, namespace, pretty, exact, _export, options = {}) {\n const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/secrets/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling readNamespacedSecret.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling readNamespacedSecret.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (exact !== undefined) {\n localVarQueryParameters['exact'] = ObjectSerializer.serialize(exact, \"boolean\");\n }\n if (_export !== undefined) {\n localVarQueryParameters['export'] = ObjectSerializer.serialize(_export, \"boolean\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1Secret\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * read the specified Service\n * @param name name of the Service\n * @param namespace object name and auth scope, such as for teams and projects\n * @param pretty If 'true', then the output is pretty printed.\n * @param exact Should the export be exact. Exact export maintains cluster-specific fields like 'Namespace'.\n * @param _export Should this value be exported. Export strips fields that a user can not specify.\n * @param {*} [options] Override http request options.\n */\n readNamespacedService(name, namespace, pretty, exact, _export, options = {}) {\n const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/services/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling readNamespacedService.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling readNamespacedService.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (exact !== undefined) {\n localVarQueryParameters['exact'] = ObjectSerializer.serialize(exact, \"boolean\");\n }\n if (_export !== undefined) {\n localVarQueryParameters['export'] = ObjectSerializer.serialize(_export, \"boolean\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1Service\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * read the specified ServiceAccount\n * @param name name of the ServiceAccount\n * @param namespace object name and auth scope, such as for teams and projects\n * @param pretty If 'true', then the output is pretty printed.\n * @param exact Should the export be exact. Exact export maintains cluster-specific fields like 'Namespace'.\n * @param _export Should this value be exported. Export strips fields that a user can not specify.\n * @param {*} [options] Override http request options.\n */\n readNamespacedServiceAccount(name, namespace, pretty, exact, _export, options = {}) {\n const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/serviceaccounts/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling readNamespacedServiceAccount.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling readNamespacedServiceAccount.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (exact !== undefined) {\n localVarQueryParameters['exact'] = ObjectSerializer.serialize(exact, \"boolean\");\n }\n if (_export !== undefined) {\n localVarQueryParameters['export'] = ObjectSerializer.serialize(_export, \"boolean\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1ServiceAccount\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * read status of the specified Service\n * @param name name of the Service\n * @param namespace object name and auth scope, such as for teams and projects\n * @param pretty If 'true', then the output is pretty printed.\n * @param {*} [options] Override http request options.\n */\n readNamespacedServiceStatus(name, namespace, pretty, options = {}) {\n const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/services/{name}/status'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling readNamespacedServiceStatus.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling readNamespacedServiceStatus.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1Service\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * read the specified Node\n * @param name name of the Node\n * @param pretty If 'true', then the output is pretty printed.\n * @param exact Should the export be exact. Exact export maintains cluster-specific fields like 'Namespace'.\n * @param _export Should this value be exported. Export strips fields that a user can not specify.\n * @param {*} [options] Override http request options.\n */\n readNode(name, pretty, exact, _export, options = {}) {\n const localVarPath = this.basePath + '/api/v1/nodes/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling readNode.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (exact !== undefined) {\n localVarQueryParameters['exact'] = ObjectSerializer.serialize(exact, \"boolean\");\n }\n if (_export !== undefined) {\n localVarQueryParameters['export'] = ObjectSerializer.serialize(_export, \"boolean\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1Node\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * read status of the specified Node\n * @param name name of the Node\n * @param pretty If 'true', then the output is pretty printed.\n * @param {*} [options] Override http request options.\n */\n readNodeStatus(name, pretty, options = {}) {\n const localVarPath = this.basePath + '/api/v1/nodes/{name}/status'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling readNodeStatus.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1Node\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * read the specified PersistentVolume\n * @param name name of the PersistentVolume\n * @param pretty If 'true', then the output is pretty printed.\n * @param exact Should the export be exact. Exact export maintains cluster-specific fields like 'Namespace'.\n * @param _export Should this value be exported. Export strips fields that a user can not specify.\n * @param {*} [options] Override http request options.\n */\n readPersistentVolume(name, pretty, exact, _export, options = {}) {\n const localVarPath = this.basePath + '/api/v1/persistentvolumes/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling readPersistentVolume.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (exact !== undefined) {\n localVarQueryParameters['exact'] = ObjectSerializer.serialize(exact, \"boolean\");\n }\n if (_export !== undefined) {\n localVarQueryParameters['export'] = ObjectSerializer.serialize(_export, \"boolean\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1PersistentVolume\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * read status of the specified PersistentVolume\n * @param name name of the PersistentVolume\n * @param pretty If 'true', then the output is pretty printed.\n * @param {*} [options] Override http request options.\n */\n readPersistentVolumeStatus(name, pretty, options = {}) {\n const localVarPath = this.basePath + '/api/v1/persistentvolumes/{name}/status'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling readPersistentVolumeStatus.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1PersistentVolume\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * replace the specified Namespace\n * @param name name of the Namespace\n * @param body\n * @param pretty If 'true', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param {*} [options] Override http request options.\n */\n replaceNamespace(name, body, pretty, dryRun, options = {}) {\n const localVarPath = this.basePath + '/api/v1/namespaces/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling replaceNamespace.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling replaceNamespace.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'PUT',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: ObjectSerializer.serialize(body, \"V1Namespace\")\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1Namespace\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * replace finalize of the specified Namespace\n * @param name name of the Namespace\n * @param body\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param pretty If 'true', then the output is pretty printed.\n * @param {*} [options] Override http request options.\n */\n replaceNamespaceFinalize(name, body, dryRun, pretty, options = {}) {\n const localVarPath = this.basePath + '/api/v1/namespaces/{name}/finalize'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling replaceNamespaceFinalize.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling replaceNamespaceFinalize.');\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, \"string\");\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'PUT',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: ObjectSerializer.serialize(body, \"V1Namespace\")\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1Namespace\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * replace status of the specified Namespace\n * @param name name of the Namespace\n * @param body\n * @param pretty If 'true', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param {*} [options] Override http request options.\n */\n replaceNamespaceStatus(name, body, pretty, dryRun, options = {}) {\n const localVarPath = this.basePath + '/api/v1/namespaces/{name}/status'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling replaceNamespaceStatus.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling replaceNamespaceStatus.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'PUT',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: ObjectSerializer.serialize(body, \"V1Namespace\")\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1Namespace\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * replace the specified ConfigMap\n * @param name name of the ConfigMap\n * @param namespace object name and auth scope, such as for teams and projects\n * @param body\n * @param pretty If 'true', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param {*} [options] Override http request options.\n */\n replaceNamespacedConfigMap(name, namespace, body, pretty, dryRun, options = {}) {\n const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/configmaps/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling replaceNamespacedConfigMap.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling replaceNamespacedConfigMap.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling replaceNamespacedConfigMap.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'PUT',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: ObjectSerializer.serialize(body, \"V1ConfigMap\")\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1ConfigMap\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * replace the specified Endpoints\n * @param name name of the Endpoints\n * @param namespace object name and auth scope, such as for teams and projects\n * @param body\n * @param pretty If 'true', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param {*} [options] Override http request options.\n */\n replaceNamespacedEndpoints(name, namespace, body, pretty, dryRun, options = {}) {\n const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/endpoints/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling replaceNamespacedEndpoints.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling replaceNamespacedEndpoints.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling replaceNamespacedEndpoints.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'PUT',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: ObjectSerializer.serialize(body, \"V1Endpoints\")\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1Endpoints\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * replace the specified Event\n * @param name name of the Event\n * @param namespace object name and auth scope, such as for teams and projects\n * @param body\n * @param pretty If 'true', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param {*} [options] Override http request options.\n */\n replaceNamespacedEvent(name, namespace, body, pretty, dryRun, options = {}) {\n const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/events/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling replaceNamespacedEvent.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling replaceNamespacedEvent.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling replaceNamespacedEvent.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'PUT',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: ObjectSerializer.serialize(body, \"V1Event\")\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1Event\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * replace the specified LimitRange\n * @param name name of the LimitRange\n * @param namespace object name and auth scope, such as for teams and projects\n * @param body\n * @param pretty If 'true', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param {*} [options] Override http request options.\n */\n replaceNamespacedLimitRange(name, namespace, body, pretty, dryRun, options = {}) {\n const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/limitranges/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling replaceNamespacedLimitRange.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling replaceNamespacedLimitRange.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling replaceNamespacedLimitRange.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'PUT',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: ObjectSerializer.serialize(body, \"V1LimitRange\")\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1LimitRange\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * replace the specified PersistentVolumeClaim\n * @param name name of the PersistentVolumeClaim\n * @param namespace object name and auth scope, such as for teams and projects\n * @param body\n * @param pretty If 'true', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param {*} [options] Override http request options.\n */\n replaceNamespacedPersistentVolumeClaim(name, namespace, body, pretty, dryRun, options = {}) {\n const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/persistentvolumeclaims/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling replaceNamespacedPersistentVolumeClaim.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling replaceNamespacedPersistentVolumeClaim.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling replaceNamespacedPersistentVolumeClaim.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'PUT',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: ObjectSerializer.serialize(body, \"V1PersistentVolumeClaim\")\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1PersistentVolumeClaim\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * replace status of the specified PersistentVolumeClaim\n * @param name name of the PersistentVolumeClaim\n * @param namespace object name and auth scope, such as for teams and projects\n * @param body\n * @param pretty If 'true', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param {*} [options] Override http request options.\n */\n replaceNamespacedPersistentVolumeClaimStatus(name, namespace, body, pretty, dryRun, options = {}) {\n const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/persistentvolumeclaims/{name}/status'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling replaceNamespacedPersistentVolumeClaimStatus.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling replaceNamespacedPersistentVolumeClaimStatus.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling replaceNamespacedPersistentVolumeClaimStatus.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'PUT',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: ObjectSerializer.serialize(body, \"V1PersistentVolumeClaim\")\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1PersistentVolumeClaim\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * replace the specified Pod\n * @param name name of the Pod\n * @param namespace object name and auth scope, such as for teams and projects\n * @param body\n * @param pretty If 'true', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param {*} [options] Override http request options.\n */\n replaceNamespacedPod(name, namespace, body, pretty, dryRun, options = {}) {\n const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/pods/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling replaceNamespacedPod.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling replaceNamespacedPod.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling replaceNamespacedPod.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'PUT',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: ObjectSerializer.serialize(body, \"V1Pod\")\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1Pod\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * replace status of the specified Pod\n * @param name name of the Pod\n * @param namespace object name and auth scope, such as for teams and projects\n * @param body\n * @param pretty If 'true', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param {*} [options] Override http request options.\n */\n replaceNamespacedPodStatus(name, namespace, body, pretty, dryRun, options = {}) {\n const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/pods/{name}/status'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling replaceNamespacedPodStatus.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling replaceNamespacedPodStatus.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling replaceNamespacedPodStatus.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'PUT',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: ObjectSerializer.serialize(body, \"V1Pod\")\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1Pod\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * replace the specified PodTemplate\n * @param name name of the PodTemplate\n * @param namespace object name and auth scope, such as for teams and projects\n * @param body\n * @param pretty If 'true', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param {*} [options] Override http request options.\n */\n replaceNamespacedPodTemplate(name, namespace, body, pretty, dryRun, options = {}) {\n const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/podtemplates/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling replaceNamespacedPodTemplate.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling replaceNamespacedPodTemplate.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling replaceNamespacedPodTemplate.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'PUT',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: ObjectSerializer.serialize(body, \"V1PodTemplate\")\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1PodTemplate\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * replace the specified ReplicationController\n * @param name name of the ReplicationController\n * @param namespace object name and auth scope, such as for teams and projects\n * @param body\n * @param pretty If 'true', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param {*} [options] Override http request options.\n */\n replaceNamespacedReplicationController(name, namespace, body, pretty, dryRun, options = {}) {\n const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/replicationcontrollers/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling replaceNamespacedReplicationController.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling replaceNamespacedReplicationController.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling replaceNamespacedReplicationController.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'PUT',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: ObjectSerializer.serialize(body, \"V1ReplicationController\")\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1ReplicationController\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * replace scale of the specified ReplicationController\n * @param name name of the Scale\n * @param namespace object name and auth scope, such as for teams and projects\n * @param body\n * @param pretty If 'true', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param {*} [options] Override http request options.\n */\n replaceNamespacedReplicationControllerScale(name, namespace, body, pretty, dryRun, options = {}) {\n const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/replicationcontrollers/{name}/scale'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling replaceNamespacedReplicationControllerScale.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling replaceNamespacedReplicationControllerScale.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling replaceNamespacedReplicationControllerScale.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'PUT',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: ObjectSerializer.serialize(body, \"V1Scale\")\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1Scale\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * replace status of the specified ReplicationController\n * @param name name of the ReplicationController\n * @param namespace object name and auth scope, such as for teams and projects\n * @param body\n * @param pretty If 'true', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param {*} [options] Override http request options.\n */\n replaceNamespacedReplicationControllerStatus(name, namespace, body, pretty, dryRun, options = {}) {\n const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/replicationcontrollers/{name}/status'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling replaceNamespacedReplicationControllerStatus.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling replaceNamespacedReplicationControllerStatus.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling replaceNamespacedReplicationControllerStatus.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'PUT',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: ObjectSerializer.serialize(body, \"V1ReplicationController\")\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1ReplicationController\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * replace the specified ResourceQuota\n * @param name name of the ResourceQuota\n * @param namespace object name and auth scope, such as for teams and projects\n * @param body\n * @param pretty If 'true', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param {*} [options] Override http request options.\n */\n replaceNamespacedResourceQuota(name, namespace, body, pretty, dryRun, options = {}) {\n const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/resourcequotas/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling replaceNamespacedResourceQuota.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling replaceNamespacedResourceQuota.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling replaceNamespacedResourceQuota.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'PUT',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: ObjectSerializer.serialize(body, \"V1ResourceQuota\")\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1ResourceQuota\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * replace status of the specified ResourceQuota\n * @param name name of the ResourceQuota\n * @param namespace object name and auth scope, such as for teams and projects\n * @param body\n * @param pretty If 'true', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param {*} [options] Override http request options.\n */\n replaceNamespacedResourceQuotaStatus(name, namespace, body, pretty, dryRun, options = {}) {\n const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/resourcequotas/{name}/status'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling replaceNamespacedResourceQuotaStatus.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling replaceNamespacedResourceQuotaStatus.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling replaceNamespacedResourceQuotaStatus.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'PUT',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: ObjectSerializer.serialize(body, \"V1ResourceQuota\")\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1ResourceQuota\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * replace the specified Secret\n * @param name name of the Secret\n * @param namespace object name and auth scope, such as for teams and projects\n * @param body\n * @param pretty If 'true', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param {*} [options] Override http request options.\n */\n replaceNamespacedSecret(name, namespace, body, pretty, dryRun, options = {}) {\n const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/secrets/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling replaceNamespacedSecret.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling replaceNamespacedSecret.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling replaceNamespacedSecret.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'PUT',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: ObjectSerializer.serialize(body, \"V1Secret\")\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1Secret\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * replace the specified Service\n * @param name name of the Service\n * @param namespace object name and auth scope, such as for teams and projects\n * @param body\n * @param pretty If 'true', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param {*} [options] Override http request options.\n */\n replaceNamespacedService(name, namespace, body, pretty, dryRun, options = {}) {\n const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/services/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling replaceNamespacedService.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling replaceNamespacedService.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling replaceNamespacedService.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'PUT',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: ObjectSerializer.serialize(body, \"V1Service\")\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1Service\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * replace the specified ServiceAccount\n * @param name name of the ServiceAccount\n * @param namespace object name and auth scope, such as for teams and projects\n * @param body\n * @param pretty If 'true', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param {*} [options] Override http request options.\n */\n replaceNamespacedServiceAccount(name, namespace, body, pretty, dryRun, options = {}) {\n const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/serviceaccounts/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling replaceNamespacedServiceAccount.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling replaceNamespacedServiceAccount.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling replaceNamespacedServiceAccount.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'PUT',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: ObjectSerializer.serialize(body, \"V1ServiceAccount\")\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1ServiceAccount\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * replace status of the specified Service\n * @param name name of the Service\n * @param namespace object name and auth scope, such as for teams and projects\n * @param body\n * @param pretty If 'true', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param {*} [options] Override http request options.\n */\n replaceNamespacedServiceStatus(name, namespace, body, pretty, dryRun, options = {}) {\n const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/services/{name}/status'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling replaceNamespacedServiceStatus.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling replaceNamespacedServiceStatus.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling replaceNamespacedServiceStatus.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'PUT',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: ObjectSerializer.serialize(body, \"V1Service\")\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1Service\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * replace the specified Node\n * @param name name of the Node\n * @param body\n * @param pretty If 'true', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param {*} [options] Override http request options.\n */\n replaceNode(name, body, pretty, dryRun, options = {}) {\n const localVarPath = this.basePath + '/api/v1/nodes/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling replaceNode.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling replaceNode.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'PUT',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: ObjectSerializer.serialize(body, \"V1Node\")\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1Node\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * replace status of the specified Node\n * @param name name of the Node\n * @param body\n * @param pretty If 'true', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param {*} [options] Override http request options.\n */\n replaceNodeStatus(name, body, pretty, dryRun, options = {}) {\n const localVarPath = this.basePath + '/api/v1/nodes/{name}/status'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling replaceNodeStatus.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling replaceNodeStatus.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'PUT',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: ObjectSerializer.serialize(body, \"V1Node\")\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1Node\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * replace the specified PersistentVolume\n * @param name name of the PersistentVolume\n * @param body\n * @param pretty If 'true', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param {*} [options] Override http request options.\n */\n replacePersistentVolume(name, body, pretty, dryRun, options = {}) {\n const localVarPath = this.basePath + '/api/v1/persistentvolumes/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling replacePersistentVolume.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling replacePersistentVolume.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'PUT',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: ObjectSerializer.serialize(body, \"V1PersistentVolume\")\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1PersistentVolume\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * replace status of the specified PersistentVolume\n * @param name name of the PersistentVolume\n * @param body\n * @param pretty If 'true', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param {*} [options] Override http request options.\n */\n replacePersistentVolumeStatus(name, body, pretty, dryRun, options = {}) {\n const localVarPath = this.basePath + '/api/v1/persistentvolumes/{name}/status'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling replacePersistentVolumeStatus.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling replacePersistentVolumeStatus.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'PUT',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: ObjectSerializer.serialize(body, \"V1PersistentVolume\")\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1PersistentVolume\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n}\nexports.CoreV1Api = CoreV1Api;\nvar CustomObjectsApiApiKeys;\n(function (CustomObjectsApiApiKeys) {\n CustomObjectsApiApiKeys[CustomObjectsApiApiKeys[\"BearerToken\"] = 0] = \"BearerToken\";\n})(CustomObjectsApiApiKeys = exports.CustomObjectsApiApiKeys || (exports.CustomObjectsApiApiKeys = {}));\nclass CustomObjectsApi {\n constructor(basePathOrUsername, password, basePath) {\n this._basePath = defaultBasePath;\n this.defaultHeaders = {};\n this._useQuerystring = false;\n this.authentications = {\n 'default': new VoidAuth(),\n 'BearerToken': new ApiKeyAuth('header', 'authorization'),\n };\n if (password) {\n if (basePath) {\n this.basePath = basePath;\n }\n }\n else {\n if (basePathOrUsername) {\n this.basePath = basePathOrUsername;\n }\n }\n }\n set useQuerystring(value) {\n this._useQuerystring = value;\n }\n set basePath(basePath) {\n this._basePath = basePath;\n }\n get basePath() {\n return this._basePath;\n }\n setDefaultAuthentication(auth) {\n this.authentications.default = auth;\n }\n setApiKey(key, value) {\n this.authentications[CustomObjectsApiApiKeys[key]].apiKey = value;\n }\n /**\n * Creates a cluster scoped Custom object\n * @param group The custom resource's group name\n * @param version The custom resource's version\n * @param plural The custom resource's plural name. For TPRs this would be lowercase plural kind.\n * @param body The JSON schema of the Resource to create.\n * @param pretty If 'true', then the output is pretty printed.\n * @param {*} [options] Override http request options.\n */\n createClusterCustomObject(group, version, plural, body, pretty, options = {}) {\n const localVarPath = this.basePath + '/apis/{group}/{version}/{plural}'\n .replace('{' + 'group' + '}', encodeURIComponent(String(group)))\n .replace('{' + 'version' + '}', encodeURIComponent(String(version)))\n .replace('{' + 'plural' + '}', encodeURIComponent(String(plural)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'group' is not null or undefined\n if (group === null || group === undefined) {\n throw new Error('Required parameter group was null or undefined when calling createClusterCustomObject.');\n }\n // verify required parameter 'version' is not null or undefined\n if (version === null || version === undefined) {\n throw new Error('Required parameter version was null or undefined when calling createClusterCustomObject.');\n }\n // verify required parameter 'plural' is not null or undefined\n if (plural === null || plural === undefined) {\n throw new Error('Required parameter plural was null or undefined when calling createClusterCustomObject.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling createClusterCustomObject.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'POST',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: ObjectSerializer.serialize(body, \"any\")\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"any\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * Creates a namespace scoped Custom object\n * @param group The custom resource's group name\n * @param version The custom resource's version\n * @param namespace The custom resource's namespace\n * @param plural The custom resource's plural name. For TPRs this would be lowercase plural kind.\n * @param body The JSON schema of the Resource to create.\n * @param pretty If 'true', then the output is pretty printed.\n * @param {*} [options] Override http request options.\n */\n createNamespacedCustomObject(group, version, namespace, plural, body, pretty, options = {}) {\n const localVarPath = this.basePath + '/apis/{group}/{version}/namespaces/{namespace}/{plural}'\n .replace('{' + 'group' + '}', encodeURIComponent(String(group)))\n .replace('{' + 'version' + '}', encodeURIComponent(String(version)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)))\n .replace('{' + 'plural' + '}', encodeURIComponent(String(plural)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'group' is not null or undefined\n if (group === null || group === undefined) {\n throw new Error('Required parameter group was null or undefined when calling createNamespacedCustomObject.');\n }\n // verify required parameter 'version' is not null or undefined\n if (version === null || version === undefined) {\n throw new Error('Required parameter version was null or undefined when calling createNamespacedCustomObject.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling createNamespacedCustomObject.');\n }\n // verify required parameter 'plural' is not null or undefined\n if (plural === null || plural === undefined) {\n throw new Error('Required parameter plural was null or undefined when calling createNamespacedCustomObject.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling createNamespacedCustomObject.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'POST',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: ObjectSerializer.serialize(body, \"any\")\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"any\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * Deletes the specified cluster scoped custom object\n * @param group the custom resource's group\n * @param version the custom resource's version\n * @param plural the custom object's plural name. For TPRs this would be lowercase plural kind.\n * @param name the custom object's name\n * @param body\n * @param gracePeriodSeconds The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately.\n * @param orphanDependents Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \\"orphan\\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both.\n * @param propagationPolicy Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy.\n * @param {*} [options] Override http request options.\n */\n deleteClusterCustomObject(group, version, plural, name, body, gracePeriodSeconds, orphanDependents, propagationPolicy, options = {}) {\n const localVarPath = this.basePath + '/apis/{group}/{version}/{plural}/{name}'\n .replace('{' + 'group' + '}', encodeURIComponent(String(group)))\n .replace('{' + 'version' + '}', encodeURIComponent(String(version)))\n .replace('{' + 'plural' + '}', encodeURIComponent(String(plural)))\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'group' is not null or undefined\n if (group === null || group === undefined) {\n throw new Error('Required parameter group was null or undefined when calling deleteClusterCustomObject.');\n }\n // verify required parameter 'version' is not null or undefined\n if (version === null || version === undefined) {\n throw new Error('Required parameter version was null or undefined when calling deleteClusterCustomObject.');\n }\n // verify required parameter 'plural' is not null or undefined\n if (plural === null || plural === undefined) {\n throw new Error('Required parameter plural was null or undefined when calling deleteClusterCustomObject.');\n }\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling deleteClusterCustomObject.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling deleteClusterCustomObject.');\n }\n if (gracePeriodSeconds !== undefined) {\n localVarQueryParameters['gracePeriodSeconds'] = ObjectSerializer.serialize(gracePeriodSeconds, \"number\");\n }\n if (orphanDependents !== undefined) {\n localVarQueryParameters['orphanDependents'] = ObjectSerializer.serialize(orphanDependents, \"boolean\");\n }\n if (propagationPolicy !== undefined) {\n localVarQueryParameters['propagationPolicy'] = ObjectSerializer.serialize(propagationPolicy, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'DELETE',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: ObjectSerializer.serialize(body, \"V1DeleteOptions\")\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"any\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * Deletes the specified namespace scoped custom object\n * @param group the custom resource's group\n * @param version the custom resource's version\n * @param namespace The custom resource's namespace\n * @param plural the custom resource's plural name. For TPRs this would be lowercase plural kind.\n * @param name the custom object's name\n * @param body\n * @param gracePeriodSeconds The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately.\n * @param orphanDependents Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \\"orphan\\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both.\n * @param propagationPolicy Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy.\n * @param {*} [options] Override http request options.\n */\n deleteNamespacedCustomObject(group, version, namespace, plural, name, body, gracePeriodSeconds, orphanDependents, propagationPolicy, options = {}) {\n const localVarPath = this.basePath + '/apis/{group}/{version}/namespaces/{namespace}/{plural}/{name}'\n .replace('{' + 'group' + '}', encodeURIComponent(String(group)))\n .replace('{' + 'version' + '}', encodeURIComponent(String(version)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)))\n .replace('{' + 'plural' + '}', encodeURIComponent(String(plural)))\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'group' is not null or undefined\n if (group === null || group === undefined) {\n throw new Error('Required parameter group was null or undefined when calling deleteNamespacedCustomObject.');\n }\n // verify required parameter 'version' is not null or undefined\n if (version === null || version === undefined) {\n throw new Error('Required parameter version was null or undefined when calling deleteNamespacedCustomObject.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling deleteNamespacedCustomObject.');\n }\n // verify required parameter 'plural' is not null or undefined\n if (plural === null || plural === undefined) {\n throw new Error('Required parameter plural was null or undefined when calling deleteNamespacedCustomObject.');\n }\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling deleteNamespacedCustomObject.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling deleteNamespacedCustomObject.');\n }\n if (gracePeriodSeconds !== undefined) {\n localVarQueryParameters['gracePeriodSeconds'] = ObjectSerializer.serialize(gracePeriodSeconds, \"number\");\n }\n if (orphanDependents !== undefined) {\n localVarQueryParameters['orphanDependents'] = ObjectSerializer.serialize(orphanDependents, \"boolean\");\n }\n if (propagationPolicy !== undefined) {\n localVarQueryParameters['propagationPolicy'] = ObjectSerializer.serialize(propagationPolicy, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'DELETE',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: ObjectSerializer.serialize(body, \"V1DeleteOptions\")\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"any\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * Returns a cluster scoped custom object\n * @param group the custom resource's group\n * @param version the custom resource's version\n * @param plural the custom object's plural name. For TPRs this would be lowercase plural kind.\n * @param name the custom object's name\n * @param {*} [options] Override http request options.\n */\n getClusterCustomObject(group, version, plural, name, options = {}) {\n const localVarPath = this.basePath + '/apis/{group}/{version}/{plural}/{name}'\n .replace('{' + 'group' + '}', encodeURIComponent(String(group)))\n .replace('{' + 'version' + '}', encodeURIComponent(String(version)))\n .replace('{' + 'plural' + '}', encodeURIComponent(String(plural)))\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'group' is not null or undefined\n if (group === null || group === undefined) {\n throw new Error('Required parameter group was null or undefined when calling getClusterCustomObject.');\n }\n // verify required parameter 'version' is not null or undefined\n if (version === null || version === undefined) {\n throw new Error('Required parameter version was null or undefined when calling getClusterCustomObject.');\n }\n // verify required parameter 'plural' is not null or undefined\n if (plural === null || plural === undefined) {\n throw new Error('Required parameter plural was null or undefined when calling getClusterCustomObject.');\n }\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling getClusterCustomObject.');\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"any\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * read scale of the specified custom object\n * @param group the custom resource's group\n * @param version the custom resource's version\n * @param plural the custom resource's plural name. For TPRs this would be lowercase plural kind.\n * @param name the custom object's name\n * @param {*} [options] Override http request options.\n */\n getClusterCustomObjectScale(group, version, plural, name, options = {}) {\n const localVarPath = this.basePath + '/apis/{group}/{version}/{plural}/{name}/scale'\n .replace('{' + 'group' + '}', encodeURIComponent(String(group)))\n .replace('{' + 'version' + '}', encodeURIComponent(String(version)))\n .replace('{' + 'plural' + '}', encodeURIComponent(String(plural)))\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'group' is not null or undefined\n if (group === null || group === undefined) {\n throw new Error('Required parameter group was null or undefined when calling getClusterCustomObjectScale.');\n }\n // verify required parameter 'version' is not null or undefined\n if (version === null || version === undefined) {\n throw new Error('Required parameter version was null or undefined when calling getClusterCustomObjectScale.');\n }\n // verify required parameter 'plural' is not null or undefined\n if (plural === null || plural === undefined) {\n throw new Error('Required parameter plural was null or undefined when calling getClusterCustomObjectScale.');\n }\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling getClusterCustomObjectScale.');\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"any\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * read status of the specified cluster scoped custom object\n * @param group the custom resource's group\n * @param version the custom resource's version\n * @param plural the custom resource's plural name. For TPRs this would be lowercase plural kind.\n * @param name the custom object's name\n * @param {*} [options] Override http request options.\n */\n getClusterCustomObjectStatus(group, version, plural, name, options = {}) {\n const localVarPath = this.basePath + '/apis/{group}/{version}/{plural}/{name}/status'\n .replace('{' + 'group' + '}', encodeURIComponent(String(group)))\n .replace('{' + 'version' + '}', encodeURIComponent(String(version)))\n .replace('{' + 'plural' + '}', encodeURIComponent(String(plural)))\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'group' is not null or undefined\n if (group === null || group === undefined) {\n throw new Error('Required parameter group was null or undefined when calling getClusterCustomObjectStatus.');\n }\n // verify required parameter 'version' is not null or undefined\n if (version === null || version === undefined) {\n throw new Error('Required parameter version was null or undefined when calling getClusterCustomObjectStatus.');\n }\n // verify required parameter 'plural' is not null or undefined\n if (plural === null || plural === undefined) {\n throw new Error('Required parameter plural was null or undefined when calling getClusterCustomObjectStatus.');\n }\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling getClusterCustomObjectStatus.');\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"any\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * Returns a namespace scoped custom object\n * @param group the custom resource's group\n * @param version the custom resource's version\n * @param namespace The custom resource's namespace\n * @param plural the custom resource's plural name. For TPRs this would be lowercase plural kind.\n * @param name the custom object's name\n * @param {*} [options] Override http request options.\n */\n getNamespacedCustomObject(group, version, namespace, plural, name, options = {}) {\n const localVarPath = this.basePath + '/apis/{group}/{version}/namespaces/{namespace}/{plural}/{name}'\n .replace('{' + 'group' + '}', encodeURIComponent(String(group)))\n .replace('{' + 'version' + '}', encodeURIComponent(String(version)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)))\n .replace('{' + 'plural' + '}', encodeURIComponent(String(plural)))\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'group' is not null or undefined\n if (group === null || group === undefined) {\n throw new Error('Required parameter group was null or undefined when calling getNamespacedCustomObject.');\n }\n // verify required parameter 'version' is not null or undefined\n if (version === null || version === undefined) {\n throw new Error('Required parameter version was null or undefined when calling getNamespacedCustomObject.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling getNamespacedCustomObject.');\n }\n // verify required parameter 'plural' is not null or undefined\n if (plural === null || plural === undefined) {\n throw new Error('Required parameter plural was null or undefined when calling getNamespacedCustomObject.');\n }\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling getNamespacedCustomObject.');\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"any\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * read scale of the specified namespace scoped custom object\n * @param group the custom resource's group\n * @param version the custom resource's version\n * @param namespace The custom resource's namespace\n * @param plural the custom resource's plural name. For TPRs this would be lowercase plural kind.\n * @param name the custom object's name\n * @param {*} [options] Override http request options.\n */\n getNamespacedCustomObjectScale(group, version, namespace, plural, name, options = {}) {\n const localVarPath = this.basePath + '/apis/{group}/{version}/namespaces/{namespace}/{plural}/{name}/scale'\n .replace('{' + 'group' + '}', encodeURIComponent(String(group)))\n .replace('{' + 'version' + '}', encodeURIComponent(String(version)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)))\n .replace('{' + 'plural' + '}', encodeURIComponent(String(plural)))\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'group' is not null or undefined\n if (group === null || group === undefined) {\n throw new Error('Required parameter group was null or undefined when calling getNamespacedCustomObjectScale.');\n }\n // verify required parameter 'version' is not null or undefined\n if (version === null || version === undefined) {\n throw new Error('Required parameter version was null or undefined when calling getNamespacedCustomObjectScale.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling getNamespacedCustomObjectScale.');\n }\n // verify required parameter 'plural' is not null or undefined\n if (plural === null || plural === undefined) {\n throw new Error('Required parameter plural was null or undefined when calling getNamespacedCustomObjectScale.');\n }\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling getNamespacedCustomObjectScale.');\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"any\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * read status of the specified namespace scoped custom object\n * @param group the custom resource's group\n * @param version the custom resource's version\n * @param namespace The custom resource's namespace\n * @param plural the custom resource's plural name. For TPRs this would be lowercase plural kind.\n * @param name the custom object's name\n * @param {*} [options] Override http request options.\n */\n getNamespacedCustomObjectStatus(group, version, namespace, plural, name, options = {}) {\n const localVarPath = this.basePath + '/apis/{group}/{version}/namespaces/{namespace}/{plural}/{name}/status'\n .replace('{' + 'group' + '}', encodeURIComponent(String(group)))\n .replace('{' + 'version' + '}', encodeURIComponent(String(version)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)))\n .replace('{' + 'plural' + '}', encodeURIComponent(String(plural)))\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'group' is not null or undefined\n if (group === null || group === undefined) {\n throw new Error('Required parameter group was null or undefined when calling getNamespacedCustomObjectStatus.');\n }\n // verify required parameter 'version' is not null or undefined\n if (version === null || version === undefined) {\n throw new Error('Required parameter version was null or undefined when calling getNamespacedCustomObjectStatus.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling getNamespacedCustomObjectStatus.');\n }\n // verify required parameter 'plural' is not null or undefined\n if (plural === null || plural === undefined) {\n throw new Error('Required parameter plural was null or undefined when calling getNamespacedCustomObjectStatus.');\n }\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling getNamespacedCustomObjectStatus.');\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"any\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * list or watch cluster scoped custom objects\n * @param group The custom resource's group name\n * @param version The custom resource's version\n * @param plural The custom resource's plural name. For TPRs this would be lowercase plural kind.\n * @param pretty If 'true', then the output is pretty printed.\n * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything.\n * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything.\n * @param resourceVersion When specified with a watch call, shows changes that occur after that particular version of a resource. Defaults to changes from the beginning of history. When specified for list: - if unset, then the result is returned from remote storage based on quorum-read flag; - if it's 0, then we simply return what we currently have in cache, no guarantee; - if set to non zero, then the result is at least as fresh as given rv.\n * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.\n * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications.\n * @param {*} [options] Override http request options.\n */\n listClusterCustomObject(group, version, plural, pretty, fieldSelector, labelSelector, resourceVersion, timeoutSeconds, watch, options = {}) {\n const localVarPath = this.basePath + '/apis/{group}/{version}/{plural}'\n .replace('{' + 'group' + '}', encodeURIComponent(String(group)))\n .replace('{' + 'version' + '}', encodeURIComponent(String(version)))\n .replace('{' + 'plural' + '}', encodeURIComponent(String(plural)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'group' is not null or undefined\n if (group === null || group === undefined) {\n throw new Error('Required parameter group was null or undefined when calling listClusterCustomObject.');\n }\n // verify required parameter 'version' is not null or undefined\n if (version === null || version === undefined) {\n throw new Error('Required parameter version was null or undefined when calling listClusterCustomObject.');\n }\n // verify required parameter 'plural' is not null or undefined\n if (plural === null || plural === undefined) {\n throw new Error('Required parameter plural was null or undefined when calling listClusterCustomObject.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (fieldSelector !== undefined) {\n localVarQueryParameters['fieldSelector'] = ObjectSerializer.serialize(fieldSelector, \"string\");\n }\n if (labelSelector !== undefined) {\n localVarQueryParameters['labelSelector'] = ObjectSerializer.serialize(labelSelector, \"string\");\n }\n if (resourceVersion !== undefined) {\n localVarQueryParameters['resourceVersion'] = ObjectSerializer.serialize(resourceVersion, \"string\");\n }\n if (timeoutSeconds !== undefined) {\n localVarQueryParameters['timeoutSeconds'] = ObjectSerializer.serialize(timeoutSeconds, \"number\");\n }\n if (watch !== undefined) {\n localVarQueryParameters['watch'] = ObjectSerializer.serialize(watch, \"boolean\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"any\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * list or watch namespace scoped custom objects\n * @param group The custom resource's group name\n * @param version The custom resource's version\n * @param namespace The custom resource's namespace\n * @param plural The custom resource's plural name. For TPRs this would be lowercase plural kind.\n * @param pretty If 'true', then the output is pretty printed.\n * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything.\n * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything.\n * @param resourceVersion When specified with a watch call, shows changes that occur after that particular version of a resource. Defaults to changes from the beginning of history. When specified for list: - if unset, then the result is returned from remote storage based on quorum-read flag; - if it's 0, then we simply return what we currently have in cache, no guarantee; - if set to non zero, then the result is at least as fresh as given rv.\n * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.\n * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications.\n * @param {*} [options] Override http request options.\n */\n listNamespacedCustomObject(group, version, namespace, plural, pretty, fieldSelector, labelSelector, resourceVersion, timeoutSeconds, watch, options = {}) {\n const localVarPath = this.basePath + '/apis/{group}/{version}/namespaces/{namespace}/{plural}'\n .replace('{' + 'group' + '}', encodeURIComponent(String(group)))\n .replace('{' + 'version' + '}', encodeURIComponent(String(version)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)))\n .replace('{' + 'plural' + '}', encodeURIComponent(String(plural)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'group' is not null or undefined\n if (group === null || group === undefined) {\n throw new Error('Required parameter group was null or undefined when calling listNamespacedCustomObject.');\n }\n // verify required parameter 'version' is not null or undefined\n if (version === null || version === undefined) {\n throw new Error('Required parameter version was null or undefined when calling listNamespacedCustomObject.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling listNamespacedCustomObject.');\n }\n // verify required parameter 'plural' is not null or undefined\n if (plural === null || plural === undefined) {\n throw new Error('Required parameter plural was null or undefined when calling listNamespacedCustomObject.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (fieldSelector !== undefined) {\n localVarQueryParameters['fieldSelector'] = ObjectSerializer.serialize(fieldSelector, \"string\");\n }\n if (labelSelector !== undefined) {\n localVarQueryParameters['labelSelector'] = ObjectSerializer.serialize(labelSelector, \"string\");\n }\n if (resourceVersion !== undefined) {\n localVarQueryParameters['resourceVersion'] = ObjectSerializer.serialize(resourceVersion, \"string\");\n }\n if (timeoutSeconds !== undefined) {\n localVarQueryParameters['timeoutSeconds'] = ObjectSerializer.serialize(timeoutSeconds, \"number\");\n }\n if (watch !== undefined) {\n localVarQueryParameters['watch'] = ObjectSerializer.serialize(watch, \"boolean\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"any\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * patch the specified cluster scoped custom object\n * @param group the custom resource's group\n * @param version the custom resource's version\n * @param plural the custom object's plural name. For TPRs this would be lowercase plural kind.\n * @param name the custom object's name\n * @param body The JSON schema of the Resource to patch.\n * @param {*} [options] Override http request options.\n */\n patchClusterCustomObject(group, version, plural, name, body, options = {}) {\n const localVarPath = this.basePath + '/apis/{group}/{version}/{plural}/{name}'\n .replace('{' + 'group' + '}', encodeURIComponent(String(group)))\n .replace('{' + 'version' + '}', encodeURIComponent(String(version)))\n .replace('{' + 'plural' + '}', encodeURIComponent(String(plural)))\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'group' is not null or undefined\n if (group === null || group === undefined) {\n throw new Error('Required parameter group was null or undefined when calling patchClusterCustomObject.');\n }\n // verify required parameter 'version' is not null or undefined\n if (version === null || version === undefined) {\n throw new Error('Required parameter version was null or undefined when calling patchClusterCustomObject.');\n }\n // verify required parameter 'plural' is not null or undefined\n if (plural === null || plural === undefined) {\n throw new Error('Required parameter plural was null or undefined when calling patchClusterCustomObject.');\n }\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling patchClusterCustomObject.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling patchClusterCustomObject.');\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'PATCH',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: ObjectSerializer.serialize(body, \"any\")\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"any\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * partially update scale of the specified cluster scoped custom object\n * @param group the custom resource's group\n * @param version the custom resource's version\n * @param plural the custom resource's plural name. For TPRs this would be lowercase plural kind.\n * @param name the custom object's name\n * @param body\n * @param {*} [options] Override http request options.\n */\n patchClusterCustomObjectScale(group, version, plural, name, body, options = {}) {\n const localVarPath = this.basePath + '/apis/{group}/{version}/{plural}/{name}/scale'\n .replace('{' + 'group' + '}', encodeURIComponent(String(group)))\n .replace('{' + 'version' + '}', encodeURIComponent(String(version)))\n .replace('{' + 'plural' + '}', encodeURIComponent(String(plural)))\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'group' is not null or undefined\n if (group === null || group === undefined) {\n throw new Error('Required parameter group was null or undefined when calling patchClusterCustomObjectScale.');\n }\n // verify required parameter 'version' is not null or undefined\n if (version === null || version === undefined) {\n throw new Error('Required parameter version was null or undefined when calling patchClusterCustomObjectScale.');\n }\n // verify required parameter 'plural' is not null or undefined\n if (plural === null || plural === undefined) {\n throw new Error('Required parameter plural was null or undefined when calling patchClusterCustomObjectScale.');\n }\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling patchClusterCustomObjectScale.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling patchClusterCustomObjectScale.');\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'PATCH',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: ObjectSerializer.serialize(body, \"any\")\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"any\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * partially update status of the specified cluster scoped custom object\n * @param group the custom resource's group\n * @param version the custom resource's version\n * @param plural the custom resource's plural name. For TPRs this would be lowercase plural kind.\n * @param name the custom object's name\n * @param body\n * @param {*} [options] Override http request options.\n */\n patchClusterCustomObjectStatus(group, version, plural, name, body, options = {}) {\n const localVarPath = this.basePath + '/apis/{group}/{version}/{plural}/{name}/status'\n .replace('{' + 'group' + '}', encodeURIComponent(String(group)))\n .replace('{' + 'version' + '}', encodeURIComponent(String(version)))\n .replace('{' + 'plural' + '}', encodeURIComponent(String(plural)))\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'group' is not null or undefined\n if (group === null || group === undefined) {\n throw new Error('Required parameter group was null or undefined when calling patchClusterCustomObjectStatus.');\n }\n // verify required parameter 'version' is not null or undefined\n if (version === null || version === undefined) {\n throw new Error('Required parameter version was null or undefined when calling patchClusterCustomObjectStatus.');\n }\n // verify required parameter 'plural' is not null or undefined\n if (plural === null || plural === undefined) {\n throw new Error('Required parameter plural was null or undefined when calling patchClusterCustomObjectStatus.');\n }\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling patchClusterCustomObjectStatus.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling patchClusterCustomObjectStatus.');\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'PATCH',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: ObjectSerializer.serialize(body, \"any\")\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"any\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * patch the specified namespace scoped custom object\n * @param group the custom resource's group\n * @param version the custom resource's version\n * @param namespace The custom resource's namespace\n * @param plural the custom resource's plural name. For TPRs this would be lowercase plural kind.\n * @param name the custom object's name\n * @param body The JSON schema of the Resource to patch.\n * @param {*} [options] Override http request options.\n */\n patchNamespacedCustomObject(group, version, namespace, plural, name, body, options = {}) {\n const localVarPath = this.basePath + '/apis/{group}/{version}/namespaces/{namespace}/{plural}/{name}'\n .replace('{' + 'group' + '}', encodeURIComponent(String(group)))\n .replace('{' + 'version' + '}', encodeURIComponent(String(version)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)))\n .replace('{' + 'plural' + '}', encodeURIComponent(String(plural)))\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'group' is not null or undefined\n if (group === null || group === undefined) {\n throw new Error('Required parameter group was null or undefined when calling patchNamespacedCustomObject.');\n }\n // verify required parameter 'version' is not null or undefined\n if (version === null || version === undefined) {\n throw new Error('Required parameter version was null or undefined when calling patchNamespacedCustomObject.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling patchNamespacedCustomObject.');\n }\n // verify required parameter 'plural' is not null or undefined\n if (plural === null || plural === undefined) {\n throw new Error('Required parameter plural was null or undefined when calling patchNamespacedCustomObject.');\n }\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling patchNamespacedCustomObject.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling patchNamespacedCustomObject.');\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'PATCH',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: ObjectSerializer.serialize(body, \"any\")\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"any\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * partially update scale of the specified namespace scoped custom object\n * @param group the custom resource's group\n * @param version the custom resource's version\n * @param namespace The custom resource's namespace\n * @param plural the custom resource's plural name. For TPRs this would be lowercase plural kind.\n * @param name the custom object's name\n * @param body\n * @param {*} [options] Override http request options.\n */\n patchNamespacedCustomObjectScale(group, version, namespace, plural, name, body, options = {}) {\n const localVarPath = this.basePath + '/apis/{group}/{version}/namespaces/{namespace}/{plural}/{name}/scale'\n .replace('{' + 'group' + '}', encodeURIComponent(String(group)))\n .replace('{' + 'version' + '}', encodeURIComponent(String(version)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)))\n .replace('{' + 'plural' + '}', encodeURIComponent(String(plural)))\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'group' is not null or undefined\n if (group === null || group === undefined) {\n throw new Error('Required parameter group was null or undefined when calling patchNamespacedCustomObjectScale.');\n }\n // verify required parameter 'version' is not null or undefined\n if (version === null || version === undefined) {\n throw new Error('Required parameter version was null or undefined when calling patchNamespacedCustomObjectScale.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling patchNamespacedCustomObjectScale.');\n }\n // verify required parameter 'plural' is not null or undefined\n if (plural === null || plural === undefined) {\n throw new Error('Required parameter plural was null or undefined when calling patchNamespacedCustomObjectScale.');\n }\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling patchNamespacedCustomObjectScale.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling patchNamespacedCustomObjectScale.');\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'PATCH',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: ObjectSerializer.serialize(body, \"any\")\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"any\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * partially update status of the specified namespace scoped custom object\n * @param group the custom resource's group\n * @param version the custom resource's version\n * @param namespace The custom resource's namespace\n * @param plural the custom resource's plural name. For TPRs this would be lowercase plural kind.\n * @param name the custom object's name\n * @param body\n * @param {*} [options] Override http request options.\n */\n patchNamespacedCustomObjectStatus(group, version, namespace, plural, name, body, options = {}) {\n const localVarPath = this.basePath + '/apis/{group}/{version}/namespaces/{namespace}/{plural}/{name}/status'\n .replace('{' + 'group' + '}', encodeURIComponent(String(group)))\n .replace('{' + 'version' + '}', encodeURIComponent(String(version)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)))\n .replace('{' + 'plural' + '}', encodeURIComponent(String(plural)))\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'group' is not null or undefined\n if (group === null || group === undefined) {\n throw new Error('Required parameter group was null or undefined when calling patchNamespacedCustomObjectStatus.');\n }\n // verify required parameter 'version' is not null or undefined\n if (version === null || version === undefined) {\n throw new Error('Required parameter version was null or undefined when calling patchNamespacedCustomObjectStatus.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling patchNamespacedCustomObjectStatus.');\n }\n // verify required parameter 'plural' is not null or undefined\n if (plural === null || plural === undefined) {\n throw new Error('Required parameter plural was null or undefined when calling patchNamespacedCustomObjectStatus.');\n }\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling patchNamespacedCustomObjectStatus.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling patchNamespacedCustomObjectStatus.');\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'PATCH',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: ObjectSerializer.serialize(body, \"any\")\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"any\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * replace the specified cluster scoped custom object\n * @param group the custom resource's group\n * @param version the custom resource's version\n * @param plural the custom object's plural name. For TPRs this would be lowercase plural kind.\n * @param name the custom object's name\n * @param body The JSON schema of the Resource to replace.\n * @param {*} [options] Override http request options.\n */\n replaceClusterCustomObject(group, version, plural, name, body, options = {}) {\n const localVarPath = this.basePath + '/apis/{group}/{version}/{plural}/{name}'\n .replace('{' + 'group' + '}', encodeURIComponent(String(group)))\n .replace('{' + 'version' + '}', encodeURIComponent(String(version)))\n .replace('{' + 'plural' + '}', encodeURIComponent(String(plural)))\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'group' is not null or undefined\n if (group === null || group === undefined) {\n throw new Error('Required parameter group was null or undefined when calling replaceClusterCustomObject.');\n }\n // verify required parameter 'version' is not null or undefined\n if (version === null || version === undefined) {\n throw new Error('Required parameter version was null or undefined when calling replaceClusterCustomObject.');\n }\n // verify required parameter 'plural' is not null or undefined\n if (plural === null || plural === undefined) {\n throw new Error('Required parameter plural was null or undefined when calling replaceClusterCustomObject.');\n }\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling replaceClusterCustomObject.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling replaceClusterCustomObject.');\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'PUT',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: ObjectSerializer.serialize(body, \"any\")\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"any\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * replace scale of the specified cluster scoped custom object\n * @param group the custom resource's group\n * @param version the custom resource's version\n * @param plural the custom resource's plural name. For TPRs this would be lowercase plural kind.\n * @param name the custom object's name\n * @param body\n * @param {*} [options] Override http request options.\n */\n replaceClusterCustomObjectScale(group, version, plural, name, body, options = {}) {\n const localVarPath = this.basePath + '/apis/{group}/{version}/{plural}/{name}/scale'\n .replace('{' + 'group' + '}', encodeURIComponent(String(group)))\n .replace('{' + 'version' + '}', encodeURIComponent(String(version)))\n .replace('{' + 'plural' + '}', encodeURIComponent(String(plural)))\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'group' is not null or undefined\n if (group === null || group === undefined) {\n throw new Error('Required parameter group was null or undefined when calling replaceClusterCustomObjectScale.');\n }\n // verify required parameter 'version' is not null or undefined\n if (version === null || version === undefined) {\n throw new Error('Required parameter version was null or undefined when calling replaceClusterCustomObjectScale.');\n }\n // verify required parameter 'plural' is not null or undefined\n if (plural === null || plural === undefined) {\n throw new Error('Required parameter plural was null or undefined when calling replaceClusterCustomObjectScale.');\n }\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling replaceClusterCustomObjectScale.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling replaceClusterCustomObjectScale.');\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'PUT',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: ObjectSerializer.serialize(body, \"any\")\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"any\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * replace status of the cluster scoped specified custom object\n * @param group the custom resource's group\n * @param version the custom resource's version\n * @param plural the custom resource's plural name. For TPRs this would be lowercase plural kind.\n * @param name the custom object's name\n * @param body\n * @param {*} [options] Override http request options.\n */\n replaceClusterCustomObjectStatus(group, version, plural, name, body, options = {}) {\n const localVarPath = this.basePath + '/apis/{group}/{version}/{plural}/{name}/status'\n .replace('{' + 'group' + '}', encodeURIComponent(String(group)))\n .replace('{' + 'version' + '}', encodeURIComponent(String(version)))\n .replace('{' + 'plural' + '}', encodeURIComponent(String(plural)))\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'group' is not null or undefined\n if (group === null || group === undefined) {\n throw new Error('Required parameter group was null or undefined when calling replaceClusterCustomObjectStatus.');\n }\n // verify required parameter 'version' is not null or undefined\n if (version === null || version === undefined) {\n throw new Error('Required parameter version was null or undefined when calling replaceClusterCustomObjectStatus.');\n }\n // verify required parameter 'plural' is not null or undefined\n if (plural === null || plural === undefined) {\n throw new Error('Required parameter plural was null or undefined when calling replaceClusterCustomObjectStatus.');\n }\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling replaceClusterCustomObjectStatus.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling replaceClusterCustomObjectStatus.');\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'PUT',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: ObjectSerializer.serialize(body, \"any\")\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"any\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * replace the specified namespace scoped custom object\n * @param group the custom resource's group\n * @param version the custom resource's version\n * @param namespace The custom resource's namespace\n * @param plural the custom resource's plural name. For TPRs this would be lowercase plural kind.\n * @param name the custom object's name\n * @param body The JSON schema of the Resource to replace.\n * @param {*} [options] Override http request options.\n */\n replaceNamespacedCustomObject(group, version, namespace, plural, name, body, options = {}) {\n const localVarPath = this.basePath + '/apis/{group}/{version}/namespaces/{namespace}/{plural}/{name}'\n .replace('{' + 'group' + '}', encodeURIComponent(String(group)))\n .replace('{' + 'version' + '}', encodeURIComponent(String(version)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)))\n .replace('{' + 'plural' + '}', encodeURIComponent(String(plural)))\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'group' is not null or undefined\n if (group === null || group === undefined) {\n throw new Error('Required parameter group was null or undefined when calling replaceNamespacedCustomObject.');\n }\n // verify required parameter 'version' is not null or undefined\n if (version === null || version === undefined) {\n throw new Error('Required parameter version was null or undefined when calling replaceNamespacedCustomObject.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling replaceNamespacedCustomObject.');\n }\n // verify required parameter 'plural' is not null or undefined\n if (plural === null || plural === undefined) {\n throw new Error('Required parameter plural was null or undefined when calling replaceNamespacedCustomObject.');\n }\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling replaceNamespacedCustomObject.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling replaceNamespacedCustomObject.');\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'PUT',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: ObjectSerializer.serialize(body, \"any\")\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"any\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * replace scale of the specified namespace scoped custom object\n * @param group the custom resource's group\n * @param version the custom resource's version\n * @param namespace The custom resource's namespace\n * @param plural the custom resource's plural name. For TPRs this would be lowercase plural kind.\n * @param name the custom object's name\n * @param body\n * @param {*} [options] Override http request options.\n */\n replaceNamespacedCustomObjectScale(group, version, namespace, plural, name, body, options = {}) {\n const localVarPath = this.basePath + '/apis/{group}/{version}/namespaces/{namespace}/{plural}/{name}/scale'\n .replace('{' + 'group' + '}', encodeURIComponent(String(group)))\n .replace('{' + 'version' + '}', encodeURIComponent(String(version)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)))\n .replace('{' + 'plural' + '}', encodeURIComponent(String(plural)))\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'group' is not null or undefined\n if (group === null || group === undefined) {\n throw new Error('Required parameter group was null or undefined when calling replaceNamespacedCustomObjectScale.');\n }\n // verify required parameter 'version' is not null or undefined\n if (version === null || version === undefined) {\n throw new Error('Required parameter version was null or undefined when calling replaceNamespacedCustomObjectScale.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling replaceNamespacedCustomObjectScale.');\n }\n // verify required parameter 'plural' is not null or undefined\n if (plural === null || plural === undefined) {\n throw new Error('Required parameter plural was null or undefined when calling replaceNamespacedCustomObjectScale.');\n }\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling replaceNamespacedCustomObjectScale.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling replaceNamespacedCustomObjectScale.');\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'PUT',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: ObjectSerializer.serialize(body, \"any\")\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"any\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * replace status of the specified namespace scoped custom object\n * @param group the custom resource's group\n * @param version the custom resource's version\n * @param namespace The custom resource's namespace\n * @param plural the custom resource's plural name. For TPRs this would be lowercase plural kind.\n * @param name the custom object's name\n * @param body\n * @param {*} [options] Override http request options.\n */\n replaceNamespacedCustomObjectStatus(group, version, namespace, plural, name, body, options = {}) {\n const localVarPath = this.basePath + '/apis/{group}/{version}/namespaces/{namespace}/{plural}/{name}/status'\n .replace('{' + 'group' + '}', encodeURIComponent(String(group)))\n .replace('{' + 'version' + '}', encodeURIComponent(String(version)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)))\n .replace('{' + 'plural' + '}', encodeURIComponent(String(plural)))\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'group' is not null or undefined\n if (group === null || group === undefined) {\n throw new Error('Required parameter group was null or undefined when calling replaceNamespacedCustomObjectStatus.');\n }\n // verify required parameter 'version' is not null or undefined\n if (version === null || version === undefined) {\n throw new Error('Required parameter version was null or undefined when calling replaceNamespacedCustomObjectStatus.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling replaceNamespacedCustomObjectStatus.');\n }\n // verify required parameter 'plural' is not null or undefined\n if (plural === null || plural === undefined) {\n throw new Error('Required parameter plural was null or undefined when calling replaceNamespacedCustomObjectStatus.');\n }\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling replaceNamespacedCustomObjectStatus.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling replaceNamespacedCustomObjectStatus.');\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'PUT',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: ObjectSerializer.serialize(body, \"any\")\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"any\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n}\nexports.CustomObjectsApi = CustomObjectsApi;\nvar EventsApiApiKeys;\n(function (EventsApiApiKeys) {\n EventsApiApiKeys[EventsApiApiKeys[\"BearerToken\"] = 0] = \"BearerToken\";\n})(EventsApiApiKeys = exports.EventsApiApiKeys || (exports.EventsApiApiKeys = {}));\nclass EventsApi {\n constructor(basePathOrUsername, password, basePath) {\n this._basePath = defaultBasePath;\n this.defaultHeaders = {};\n this._useQuerystring = false;\n this.authentications = {\n 'default': new VoidAuth(),\n 'BearerToken': new ApiKeyAuth('header', 'authorization'),\n };\n if (password) {\n if (basePath) {\n this.basePath = basePath;\n }\n }\n else {\n if (basePathOrUsername) {\n this.basePath = basePathOrUsername;\n }\n }\n }\n set useQuerystring(value) {\n this._useQuerystring = value;\n }\n set basePath(basePath) {\n this._basePath = basePath;\n }\n get basePath() {\n return this._basePath;\n }\n setDefaultAuthentication(auth) {\n this.authentications.default = auth;\n }\n setApiKey(key, value) {\n this.authentications[EventsApiApiKeys[key]].apiKey = value;\n }\n /**\n * get information of a group\n * @param {*} [options] Override http request options.\n */\n getAPIGroup(options = {}) {\n const localVarPath = this.basePath + '/apis/events.k8s.io/';\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1APIGroup\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n}\nexports.EventsApi = EventsApi;\nvar EventsV1beta1ApiApiKeys;\n(function (EventsV1beta1ApiApiKeys) {\n EventsV1beta1ApiApiKeys[EventsV1beta1ApiApiKeys[\"BearerToken\"] = 0] = \"BearerToken\";\n})(EventsV1beta1ApiApiKeys = exports.EventsV1beta1ApiApiKeys || (exports.EventsV1beta1ApiApiKeys = {}));\nclass EventsV1beta1Api {\n constructor(basePathOrUsername, password, basePath) {\n this._basePath = defaultBasePath;\n this.defaultHeaders = {};\n this._useQuerystring = false;\n this.authentications = {\n 'default': new VoidAuth(),\n 'BearerToken': new ApiKeyAuth('header', 'authorization'),\n };\n if (password) {\n if (basePath) {\n this.basePath = basePath;\n }\n }\n else {\n if (basePathOrUsername) {\n this.basePath = basePathOrUsername;\n }\n }\n }\n set useQuerystring(value) {\n this._useQuerystring = value;\n }\n set basePath(basePath) {\n this._basePath = basePath;\n }\n get basePath() {\n return this._basePath;\n }\n setDefaultAuthentication(auth) {\n this.authentications.default = auth;\n }\n setApiKey(key, value) {\n this.authentications[EventsV1beta1ApiApiKeys[key]].apiKey = value;\n }\n /**\n * create an Event\n * @param namespace object name and auth scope, such as for teams and projects\n * @param body\n * @param includeUninitialized If true, partially initialized resources are included in the response.\n * @param pretty If 'true', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param {*} [options] Override http request options.\n */\n createNamespacedEvent(namespace, body, includeUninitialized, pretty, dryRun, options = {}) {\n const localVarPath = this.basePath + '/apis/events.k8s.io/v1beta1/namespaces/{namespace}/events'\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling createNamespacedEvent.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling createNamespacedEvent.');\n }\n if (includeUninitialized !== undefined) {\n localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, \"boolean\");\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'POST',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: ObjectSerializer.serialize(body, \"V1beta1Event\")\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1beta1Event\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * delete collection of Event\n * @param namespace object name and auth scope, such as for teams and projects\n * @param includeUninitialized If true, partially initialized resources are included in the response.\n * @param pretty If 'true', then the output is pretty printed.\n * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \\"next key\\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.\n * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything.\n * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything.\n * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.\n * @param resourceVersion When specified with a watch call, shows changes that occur after that particular version of a resource. Defaults to changes from the beginning of history. When specified for list: - if unset, then the result is returned from remote storage based on quorum-read flag; - if it's 0, then we simply return what we currently have in cache, no guarantee; - if set to non zero, then the result is at least as fresh as given rv.\n * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.\n * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.\n * @param {*} [options] Override http request options.\n */\n deleteCollectionNamespacedEvent(namespace, includeUninitialized, pretty, _continue, fieldSelector, labelSelector, limit, resourceVersion, timeoutSeconds, watch, options = {}) {\n const localVarPath = this.basePath + '/apis/events.k8s.io/v1beta1/namespaces/{namespace}/events'\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling deleteCollectionNamespacedEvent.');\n }\n if (includeUninitialized !== undefined) {\n localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, \"boolean\");\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (_continue !== undefined) {\n localVarQueryParameters['continue'] = ObjectSerializer.serialize(_continue, \"string\");\n }\n if (fieldSelector !== undefined) {\n localVarQueryParameters['fieldSelector'] = ObjectSerializer.serialize(fieldSelector, \"string\");\n }\n if (labelSelector !== undefined) {\n localVarQueryParameters['labelSelector'] = ObjectSerializer.serialize(labelSelector, \"string\");\n }\n if (limit !== undefined) {\n localVarQueryParameters['limit'] = ObjectSerializer.serialize(limit, \"number\");\n }\n if (resourceVersion !== undefined) {\n localVarQueryParameters['resourceVersion'] = ObjectSerializer.serialize(resourceVersion, \"string\");\n }\n if (timeoutSeconds !== undefined) {\n localVarQueryParameters['timeoutSeconds'] = ObjectSerializer.serialize(timeoutSeconds, \"number\");\n }\n if (watch !== undefined) {\n localVarQueryParameters['watch'] = ObjectSerializer.serialize(watch, \"boolean\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'DELETE',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1Status\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * delete an Event\n * @param name name of the Event\n * @param namespace object name and auth scope, such as for teams and projects\n * @param pretty If 'true', then the output is pretty printed.\n * @param body\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param gracePeriodSeconds The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately.\n * @param orphanDependents Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \\"orphan\\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both.\n * @param propagationPolicy Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground.\n * @param {*} [options] Override http request options.\n */\n deleteNamespacedEvent(name, namespace, pretty, body, dryRun, gracePeriodSeconds, orphanDependents, propagationPolicy, options = {}) {\n const localVarPath = this.basePath + '/apis/events.k8s.io/v1beta1/namespaces/{namespace}/events/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling deleteNamespacedEvent.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling deleteNamespacedEvent.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, \"string\");\n }\n if (gracePeriodSeconds !== undefined) {\n localVarQueryParameters['gracePeriodSeconds'] = ObjectSerializer.serialize(gracePeriodSeconds, \"number\");\n }\n if (orphanDependents !== undefined) {\n localVarQueryParameters['orphanDependents'] = ObjectSerializer.serialize(orphanDependents, \"boolean\");\n }\n if (propagationPolicy !== undefined) {\n localVarQueryParameters['propagationPolicy'] = ObjectSerializer.serialize(propagationPolicy, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'DELETE',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: ObjectSerializer.serialize(body, \"V1DeleteOptions\")\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1Status\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * get available resources\n * @param {*} [options] Override http request options.\n */\n getAPIResources(options = {}) {\n const localVarPath = this.basePath + '/apis/events.k8s.io/v1beta1/';\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1APIResourceList\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * list or watch objects of kind Event\n * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \\"next key\\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.\n * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything.\n * @param includeUninitialized If true, partially initialized resources are included in the response.\n * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything.\n * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.\n * @param pretty If 'true', then the output is pretty printed.\n * @param resourceVersion When specified with a watch call, shows changes that occur after that particular version of a resource. Defaults to changes from the beginning of history. When specified for list: - if unset, then the result is returned from remote storage based on quorum-read flag; - if it's 0, then we simply return what we currently have in cache, no guarantee; - if set to non zero, then the result is at least as fresh as given rv.\n * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.\n * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.\n * @param {*} [options] Override http request options.\n */\n listEventForAllNamespaces(_continue, fieldSelector, includeUninitialized, labelSelector, limit, pretty, resourceVersion, timeoutSeconds, watch, options = {}) {\n const localVarPath = this.basePath + '/apis/events.k8s.io/v1beta1/events';\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n if (_continue !== undefined) {\n localVarQueryParameters['continue'] = ObjectSerializer.serialize(_continue, \"string\");\n }\n if (fieldSelector !== undefined) {\n localVarQueryParameters['fieldSelector'] = ObjectSerializer.serialize(fieldSelector, \"string\");\n }\n if (includeUninitialized !== undefined) {\n localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, \"boolean\");\n }\n if (labelSelector !== undefined) {\n localVarQueryParameters['labelSelector'] = ObjectSerializer.serialize(labelSelector, \"string\");\n }\n if (limit !== undefined) {\n localVarQueryParameters['limit'] = ObjectSerializer.serialize(limit, \"number\");\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (resourceVersion !== undefined) {\n localVarQueryParameters['resourceVersion'] = ObjectSerializer.serialize(resourceVersion, \"string\");\n }\n if (timeoutSeconds !== undefined) {\n localVarQueryParameters['timeoutSeconds'] = ObjectSerializer.serialize(timeoutSeconds, \"number\");\n }\n if (watch !== undefined) {\n localVarQueryParameters['watch'] = ObjectSerializer.serialize(watch, \"boolean\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1beta1EventList\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * list or watch objects of kind Event\n * @param namespace object name and auth scope, such as for teams and projects\n * @param includeUninitialized If true, partially initialized resources are included in the response.\n * @param pretty If 'true', then the output is pretty printed.\n * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \\"next key\\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.\n * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything.\n * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything.\n * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.\n * @param resourceVersion When specified with a watch call, shows changes that occur after that particular version of a resource. Defaults to changes from the beginning of history. When specified for list: - if unset, then the result is returned from remote storage based on quorum-read flag; - if it's 0, then we simply return what we currently have in cache, no guarantee; - if set to non zero, then the result is at least as fresh as given rv.\n * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.\n * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.\n * @param {*} [options] Override http request options.\n */\n listNamespacedEvent(namespace, includeUninitialized, pretty, _continue, fieldSelector, labelSelector, limit, resourceVersion, timeoutSeconds, watch, options = {}) {\n const localVarPath = this.basePath + '/apis/events.k8s.io/v1beta1/namespaces/{namespace}/events'\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling listNamespacedEvent.');\n }\n if (includeUninitialized !== undefined) {\n localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, \"boolean\");\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (_continue !== undefined) {\n localVarQueryParameters['continue'] = ObjectSerializer.serialize(_continue, \"string\");\n }\n if (fieldSelector !== undefined) {\n localVarQueryParameters['fieldSelector'] = ObjectSerializer.serialize(fieldSelector, \"string\");\n }\n if (labelSelector !== undefined) {\n localVarQueryParameters['labelSelector'] = ObjectSerializer.serialize(labelSelector, \"string\");\n }\n if (limit !== undefined) {\n localVarQueryParameters['limit'] = ObjectSerializer.serialize(limit, \"number\");\n }\n if (resourceVersion !== undefined) {\n localVarQueryParameters['resourceVersion'] = ObjectSerializer.serialize(resourceVersion, \"string\");\n }\n if (timeoutSeconds !== undefined) {\n localVarQueryParameters['timeoutSeconds'] = ObjectSerializer.serialize(timeoutSeconds, \"number\");\n }\n if (watch !== undefined) {\n localVarQueryParameters['watch'] = ObjectSerializer.serialize(watch, \"boolean\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1beta1EventList\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * partially update the specified Event\n * @param name name of the Event\n * @param namespace object name and auth scope, such as for teams and projects\n * @param body\n * @param pretty If 'true', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param {*} [options] Override http request options.\n */\n patchNamespacedEvent(name, namespace, body, pretty, dryRun, options = {}) {\n const localVarPath = this.basePath + '/apis/events.k8s.io/v1beta1/namespaces/{namespace}/events/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling patchNamespacedEvent.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling patchNamespacedEvent.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling patchNamespacedEvent.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'PATCH',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: ObjectSerializer.serialize(body, \"any\")\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1beta1Event\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * read the specified Event\n * @param name name of the Event\n * @param namespace object name and auth scope, such as for teams and projects\n * @param pretty If 'true', then the output is pretty printed.\n * @param exact Should the export be exact. Exact export maintains cluster-specific fields like 'Namespace'.\n * @param _export Should this value be exported. Export strips fields that a user can not specify.\n * @param {*} [options] Override http request options.\n */\n readNamespacedEvent(name, namespace, pretty, exact, _export, options = {}) {\n const localVarPath = this.basePath + '/apis/events.k8s.io/v1beta1/namespaces/{namespace}/events/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling readNamespacedEvent.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling readNamespacedEvent.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (exact !== undefined) {\n localVarQueryParameters['exact'] = ObjectSerializer.serialize(exact, \"boolean\");\n }\n if (_export !== undefined) {\n localVarQueryParameters['export'] = ObjectSerializer.serialize(_export, \"boolean\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1beta1Event\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * replace the specified Event\n * @param name name of the Event\n * @param namespace object name and auth scope, such as for teams and projects\n * @param body\n * @param pretty If 'true', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param {*} [options] Override http request options.\n */\n replaceNamespacedEvent(name, namespace, body, pretty, dryRun, options = {}) {\n const localVarPath = this.basePath + '/apis/events.k8s.io/v1beta1/namespaces/{namespace}/events/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling replaceNamespacedEvent.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling replaceNamespacedEvent.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling replaceNamespacedEvent.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'PUT',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: ObjectSerializer.serialize(body, \"V1beta1Event\")\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1beta1Event\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n}\nexports.EventsV1beta1Api = EventsV1beta1Api;\nvar ExtensionsApiApiKeys;\n(function (ExtensionsApiApiKeys) {\n ExtensionsApiApiKeys[ExtensionsApiApiKeys[\"BearerToken\"] = 0] = \"BearerToken\";\n})(ExtensionsApiApiKeys = exports.ExtensionsApiApiKeys || (exports.ExtensionsApiApiKeys = {}));\nclass ExtensionsApi {\n constructor(basePathOrUsername, password, basePath) {\n this._basePath = defaultBasePath;\n this.defaultHeaders = {};\n this._useQuerystring = false;\n this.authentications = {\n 'default': new VoidAuth(),\n 'BearerToken': new ApiKeyAuth('header', 'authorization'),\n };\n if (password) {\n if (basePath) {\n this.basePath = basePath;\n }\n }\n else {\n if (basePathOrUsername) {\n this.basePath = basePathOrUsername;\n }\n }\n }\n set useQuerystring(value) {\n this._useQuerystring = value;\n }\n set basePath(basePath) {\n this._basePath = basePath;\n }\n get basePath() {\n return this._basePath;\n }\n setDefaultAuthentication(auth) {\n this.authentications.default = auth;\n }\n setApiKey(key, value) {\n this.authentications[ExtensionsApiApiKeys[key]].apiKey = value;\n }\n /**\n * get information of a group\n * @param {*} [options] Override http request options.\n */\n getAPIGroup(options = {}) {\n const localVarPath = this.basePath + '/apis/extensions/';\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1APIGroup\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n}\nexports.ExtensionsApi = ExtensionsApi;\nvar ExtensionsV1beta1ApiApiKeys;\n(function (ExtensionsV1beta1ApiApiKeys) {\n ExtensionsV1beta1ApiApiKeys[ExtensionsV1beta1ApiApiKeys[\"BearerToken\"] = 0] = \"BearerToken\";\n})(ExtensionsV1beta1ApiApiKeys = exports.ExtensionsV1beta1ApiApiKeys || (exports.ExtensionsV1beta1ApiApiKeys = {}));\nclass ExtensionsV1beta1Api {\n constructor(basePathOrUsername, password, basePath) {\n this._basePath = defaultBasePath;\n this.defaultHeaders = {};\n this._useQuerystring = false;\n this.authentications = {\n 'default': new VoidAuth(),\n 'BearerToken': new ApiKeyAuth('header', 'authorization'),\n };\n if (password) {\n if (basePath) {\n this.basePath = basePath;\n }\n }\n else {\n if (basePathOrUsername) {\n this.basePath = basePathOrUsername;\n }\n }\n }\n set useQuerystring(value) {\n this._useQuerystring = value;\n }\n set basePath(basePath) {\n this._basePath = basePath;\n }\n get basePath() {\n return this._basePath;\n }\n setDefaultAuthentication(auth) {\n this.authentications.default = auth;\n }\n setApiKey(key, value) {\n this.authentications[ExtensionsV1beta1ApiApiKeys[key]].apiKey = value;\n }\n /**\n * create a DaemonSet\n * @param namespace object name and auth scope, such as for teams and projects\n * @param body\n * @param includeUninitialized If true, partially initialized resources are included in the response.\n * @param pretty If 'true', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param {*} [options] Override http request options.\n */\n createNamespacedDaemonSet(namespace, body, includeUninitialized, pretty, dryRun, options = {}) {\n const localVarPath = this.basePath + '/apis/extensions/v1beta1/namespaces/{namespace}/daemonsets'\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling createNamespacedDaemonSet.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling createNamespacedDaemonSet.');\n }\n if (includeUninitialized !== undefined) {\n localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, \"boolean\");\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'POST',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: ObjectSerializer.serialize(body, \"V1beta1DaemonSet\")\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1beta1DaemonSet\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * create a Deployment\n * @param namespace object name and auth scope, such as for teams and projects\n * @param body\n * @param includeUninitialized If true, partially initialized resources are included in the response.\n * @param pretty If 'true', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param {*} [options] Override http request options.\n */\n createNamespacedDeployment(namespace, body, includeUninitialized, pretty, dryRun, options = {}) {\n const localVarPath = this.basePath + '/apis/extensions/v1beta1/namespaces/{namespace}/deployments'\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling createNamespacedDeployment.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling createNamespacedDeployment.');\n }\n if (includeUninitialized !== undefined) {\n localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, \"boolean\");\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'POST',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: ObjectSerializer.serialize(body, \"ExtensionsV1beta1Deployment\")\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"ExtensionsV1beta1Deployment\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * create rollback of a Deployment\n * @param name name of the DeploymentRollback\n * @param namespace object name and auth scope, such as for teams and projects\n * @param body\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param includeUninitialized If IncludeUninitialized is specified, the object may be returned without completing initialization.\n * @param pretty If 'true', then the output is pretty printed.\n * @param {*} [options] Override http request options.\n */\n createNamespacedDeploymentRollback(name, namespace, body, dryRun, includeUninitialized, pretty, options = {}) {\n const localVarPath = this.basePath + '/apis/extensions/v1beta1/namespaces/{namespace}/deployments/{name}/rollback'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling createNamespacedDeploymentRollback.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling createNamespacedDeploymentRollback.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling createNamespacedDeploymentRollback.');\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, \"string\");\n }\n if (includeUninitialized !== undefined) {\n localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, \"boolean\");\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'POST',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: ObjectSerializer.serialize(body, \"ExtensionsV1beta1DeploymentRollback\")\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1Status\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * create an Ingress\n * @param namespace object name and auth scope, such as for teams and projects\n * @param body\n * @param includeUninitialized If true, partially initialized resources are included in the response.\n * @param pretty If 'true', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param {*} [options] Override http request options.\n */\n createNamespacedIngress(namespace, body, includeUninitialized, pretty, dryRun, options = {}) {\n const localVarPath = this.basePath + '/apis/extensions/v1beta1/namespaces/{namespace}/ingresses'\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling createNamespacedIngress.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling createNamespacedIngress.');\n }\n if (includeUninitialized !== undefined) {\n localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, \"boolean\");\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'POST',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: ObjectSerializer.serialize(body, \"V1beta1Ingress\")\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1beta1Ingress\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * create a NetworkPolicy\n * @param namespace object name and auth scope, such as for teams and projects\n * @param body\n * @param includeUninitialized If true, partially initialized resources are included in the response.\n * @param pretty If 'true', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param {*} [options] Override http request options.\n */\n createNamespacedNetworkPolicy(namespace, body, includeUninitialized, pretty, dryRun, options = {}) {\n const localVarPath = this.basePath + '/apis/extensions/v1beta1/namespaces/{namespace}/networkpolicies'\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling createNamespacedNetworkPolicy.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling createNamespacedNetworkPolicy.');\n }\n if (includeUninitialized !== undefined) {\n localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, \"boolean\");\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'POST',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: ObjectSerializer.serialize(body, \"V1beta1NetworkPolicy\")\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1beta1NetworkPolicy\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * create a ReplicaSet\n * @param namespace object name and auth scope, such as for teams and projects\n * @param body\n * @param includeUninitialized If true, partially initialized resources are included in the response.\n * @param pretty If 'true', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param {*} [options] Override http request options.\n */\n createNamespacedReplicaSet(namespace, body, includeUninitialized, pretty, dryRun, options = {}) {\n const localVarPath = this.basePath + '/apis/extensions/v1beta1/namespaces/{namespace}/replicasets'\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling createNamespacedReplicaSet.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling createNamespacedReplicaSet.');\n }\n if (includeUninitialized !== undefined) {\n localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, \"boolean\");\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'POST',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: ObjectSerializer.serialize(body, \"V1beta1ReplicaSet\")\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1beta1ReplicaSet\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * create a PodSecurityPolicy\n * @param body\n * @param includeUninitialized If true, partially initialized resources are included in the response.\n * @param pretty If 'true', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param {*} [options] Override http request options.\n */\n createPodSecurityPolicy(body, includeUninitialized, pretty, dryRun, options = {}) {\n const localVarPath = this.basePath + '/apis/extensions/v1beta1/podsecuritypolicies';\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling createPodSecurityPolicy.');\n }\n if (includeUninitialized !== undefined) {\n localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, \"boolean\");\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'POST',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: ObjectSerializer.serialize(body, \"ExtensionsV1beta1PodSecurityPolicy\")\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"ExtensionsV1beta1PodSecurityPolicy\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * delete collection of DaemonSet\n * @param namespace object name and auth scope, such as for teams and projects\n * @param includeUninitialized If true, partially initialized resources are included in the response.\n * @param pretty If 'true', then the output is pretty printed.\n * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \\"next key\\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.\n * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything.\n * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything.\n * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.\n * @param resourceVersion When specified with a watch call, shows changes that occur after that particular version of a resource. Defaults to changes from the beginning of history. When specified for list: - if unset, then the result is returned from remote storage based on quorum-read flag; - if it's 0, then we simply return what we currently have in cache, no guarantee; - if set to non zero, then the result is at least as fresh as given rv.\n * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.\n * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.\n * @param {*} [options] Override http request options.\n */\n deleteCollectionNamespacedDaemonSet(namespace, includeUninitialized, pretty, _continue, fieldSelector, labelSelector, limit, resourceVersion, timeoutSeconds, watch, options = {}) {\n const localVarPath = this.basePath + '/apis/extensions/v1beta1/namespaces/{namespace}/daemonsets'\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling deleteCollectionNamespacedDaemonSet.');\n }\n if (includeUninitialized !== undefined) {\n localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, \"boolean\");\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (_continue !== undefined) {\n localVarQueryParameters['continue'] = ObjectSerializer.serialize(_continue, \"string\");\n }\n if (fieldSelector !== undefined) {\n localVarQueryParameters['fieldSelector'] = ObjectSerializer.serialize(fieldSelector, \"string\");\n }\n if (labelSelector !== undefined) {\n localVarQueryParameters['labelSelector'] = ObjectSerializer.serialize(labelSelector, \"string\");\n }\n if (limit !== undefined) {\n localVarQueryParameters['limit'] = ObjectSerializer.serialize(limit, \"number\");\n }\n if (resourceVersion !== undefined) {\n localVarQueryParameters['resourceVersion'] = ObjectSerializer.serialize(resourceVersion, \"string\");\n }\n if (timeoutSeconds !== undefined) {\n localVarQueryParameters['timeoutSeconds'] = ObjectSerializer.serialize(timeoutSeconds, \"number\");\n }\n if (watch !== undefined) {\n localVarQueryParameters['watch'] = ObjectSerializer.serialize(watch, \"boolean\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'DELETE',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1Status\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * delete collection of Deployment\n * @param namespace object name and auth scope, such as for teams and projects\n * @param includeUninitialized If true, partially initialized resources are included in the response.\n * @param pretty If 'true', then the output is pretty printed.\n * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \\"next key\\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.\n * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything.\n * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything.\n * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.\n * @param resourceVersion When specified with a watch call, shows changes that occur after that particular version of a resource. Defaults to changes from the beginning of history. When specified for list: - if unset, then the result is returned from remote storage based on quorum-read flag; - if it's 0, then we simply return what we currently have in cache, no guarantee; - if set to non zero, then the result is at least as fresh as given rv.\n * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.\n * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.\n * @param {*} [options] Override http request options.\n */\n deleteCollectionNamespacedDeployment(namespace, includeUninitialized, pretty, _continue, fieldSelector, labelSelector, limit, resourceVersion, timeoutSeconds, watch, options = {}) {\n const localVarPath = this.basePath + '/apis/extensions/v1beta1/namespaces/{namespace}/deployments'\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling deleteCollectionNamespacedDeployment.');\n }\n if (includeUninitialized !== undefined) {\n localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, \"boolean\");\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (_continue !== undefined) {\n localVarQueryParameters['continue'] = ObjectSerializer.serialize(_continue, \"string\");\n }\n if (fieldSelector !== undefined) {\n localVarQueryParameters['fieldSelector'] = ObjectSerializer.serialize(fieldSelector, \"string\");\n }\n if (labelSelector !== undefined) {\n localVarQueryParameters['labelSelector'] = ObjectSerializer.serialize(labelSelector, \"string\");\n }\n if (limit !== undefined) {\n localVarQueryParameters['limit'] = ObjectSerializer.serialize(limit, \"number\");\n }\n if (resourceVersion !== undefined) {\n localVarQueryParameters['resourceVersion'] = ObjectSerializer.serialize(resourceVersion, \"string\");\n }\n if (timeoutSeconds !== undefined) {\n localVarQueryParameters['timeoutSeconds'] = ObjectSerializer.serialize(timeoutSeconds, \"number\");\n }\n if (watch !== undefined) {\n localVarQueryParameters['watch'] = ObjectSerializer.serialize(watch, \"boolean\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'DELETE',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1Status\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * delete collection of Ingress\n * @param namespace object name and auth scope, such as for teams and projects\n * @param includeUninitialized If true, partially initialized resources are included in the response.\n * @param pretty If 'true', then the output is pretty printed.\n * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \\"next key\\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.\n * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything.\n * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything.\n * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.\n * @param resourceVersion When specified with a watch call, shows changes that occur after that particular version of a resource. Defaults to changes from the beginning of history. When specified for list: - if unset, then the result is returned from remote storage based on quorum-read flag; - if it's 0, then we simply return what we currently have in cache, no guarantee; - if set to non zero, then the result is at least as fresh as given rv.\n * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.\n * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.\n * @param {*} [options] Override http request options.\n */\n deleteCollectionNamespacedIngress(namespace, includeUninitialized, pretty, _continue, fieldSelector, labelSelector, limit, resourceVersion, timeoutSeconds, watch, options = {}) {\n const localVarPath = this.basePath + '/apis/extensions/v1beta1/namespaces/{namespace}/ingresses'\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling deleteCollectionNamespacedIngress.');\n }\n if (includeUninitialized !== undefined) {\n localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, \"boolean\");\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (_continue !== undefined) {\n localVarQueryParameters['continue'] = ObjectSerializer.serialize(_continue, \"string\");\n }\n if (fieldSelector !== undefined) {\n localVarQueryParameters['fieldSelector'] = ObjectSerializer.serialize(fieldSelector, \"string\");\n }\n if (labelSelector !== undefined) {\n localVarQueryParameters['labelSelector'] = ObjectSerializer.serialize(labelSelector, \"string\");\n }\n if (limit !== undefined) {\n localVarQueryParameters['limit'] = ObjectSerializer.serialize(limit, \"number\");\n }\n if (resourceVersion !== undefined) {\n localVarQueryParameters['resourceVersion'] = ObjectSerializer.serialize(resourceVersion, \"string\");\n }\n if (timeoutSeconds !== undefined) {\n localVarQueryParameters['timeoutSeconds'] = ObjectSerializer.serialize(timeoutSeconds, \"number\");\n }\n if (watch !== undefined) {\n localVarQueryParameters['watch'] = ObjectSerializer.serialize(watch, \"boolean\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'DELETE',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1Status\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * delete collection of NetworkPolicy\n * @param namespace object name and auth scope, such as for teams and projects\n * @param includeUninitialized If true, partially initialized resources are included in the response.\n * @param pretty If 'true', then the output is pretty printed.\n * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \\"next key\\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.\n * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything.\n * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything.\n * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.\n * @param resourceVersion When specified with a watch call, shows changes that occur after that particular version of a resource. Defaults to changes from the beginning of history. When specified for list: - if unset, then the result is returned from remote storage based on quorum-read flag; - if it's 0, then we simply return what we currently have in cache, no guarantee; - if set to non zero, then the result is at least as fresh as given rv.\n * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.\n * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.\n * @param {*} [options] Override http request options.\n */\n deleteCollectionNamespacedNetworkPolicy(namespace, includeUninitialized, pretty, _continue, fieldSelector, labelSelector, limit, resourceVersion, timeoutSeconds, watch, options = {}) {\n const localVarPath = this.basePath + '/apis/extensions/v1beta1/namespaces/{namespace}/networkpolicies'\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling deleteCollectionNamespacedNetworkPolicy.');\n }\n if (includeUninitialized !== undefined) {\n localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, \"boolean\");\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (_continue !== undefined) {\n localVarQueryParameters['continue'] = ObjectSerializer.serialize(_continue, \"string\");\n }\n if (fieldSelector !== undefined) {\n localVarQueryParameters['fieldSelector'] = ObjectSerializer.serialize(fieldSelector, \"string\");\n }\n if (labelSelector !== undefined) {\n localVarQueryParameters['labelSelector'] = ObjectSerializer.serialize(labelSelector, \"string\");\n }\n if (limit !== undefined) {\n localVarQueryParameters['limit'] = ObjectSerializer.serialize(limit, \"number\");\n }\n if (resourceVersion !== undefined) {\n localVarQueryParameters['resourceVersion'] = ObjectSerializer.serialize(resourceVersion, \"string\");\n }\n if (timeoutSeconds !== undefined) {\n localVarQueryParameters['timeoutSeconds'] = ObjectSerializer.serialize(timeoutSeconds, \"number\");\n }\n if (watch !== undefined) {\n localVarQueryParameters['watch'] = ObjectSerializer.serialize(watch, \"boolean\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'DELETE',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1Status\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * delete collection of ReplicaSet\n * @param namespace object name and auth scope, such as for teams and projects\n * @param includeUninitialized If true, partially initialized resources are included in the response.\n * @param pretty If 'true', then the output is pretty printed.\n * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \\"next key\\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.\n * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything.\n * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything.\n * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.\n * @param resourceVersion When specified with a watch call, shows changes that occur after that particular version of a resource. Defaults to changes from the beginning of history. When specified for list: - if unset, then the result is returned from remote storage based on quorum-read flag; - if it's 0, then we simply return what we currently have in cache, no guarantee; - if set to non zero, then the result is at least as fresh as given rv.\n * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.\n * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.\n * @param {*} [options] Override http request options.\n */\n deleteCollectionNamespacedReplicaSet(namespace, includeUninitialized, pretty, _continue, fieldSelector, labelSelector, limit, resourceVersion, timeoutSeconds, watch, options = {}) {\n const localVarPath = this.basePath + '/apis/extensions/v1beta1/namespaces/{namespace}/replicasets'\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling deleteCollectionNamespacedReplicaSet.');\n }\n if (includeUninitialized !== undefined) {\n localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, \"boolean\");\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (_continue !== undefined) {\n localVarQueryParameters['continue'] = ObjectSerializer.serialize(_continue, \"string\");\n }\n if (fieldSelector !== undefined) {\n localVarQueryParameters['fieldSelector'] = ObjectSerializer.serialize(fieldSelector, \"string\");\n }\n if (labelSelector !== undefined) {\n localVarQueryParameters['labelSelector'] = ObjectSerializer.serialize(labelSelector, \"string\");\n }\n if (limit !== undefined) {\n localVarQueryParameters['limit'] = ObjectSerializer.serialize(limit, \"number\");\n }\n if (resourceVersion !== undefined) {\n localVarQueryParameters['resourceVersion'] = ObjectSerializer.serialize(resourceVersion, \"string\");\n }\n if (timeoutSeconds !== undefined) {\n localVarQueryParameters['timeoutSeconds'] = ObjectSerializer.serialize(timeoutSeconds, \"number\");\n }\n if (watch !== undefined) {\n localVarQueryParameters['watch'] = ObjectSerializer.serialize(watch, \"boolean\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'DELETE',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1Status\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * delete collection of PodSecurityPolicy\n * @param includeUninitialized If true, partially initialized resources are included in the response.\n * @param pretty If 'true', then the output is pretty printed.\n * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \\"next key\\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.\n * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything.\n * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything.\n * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.\n * @param resourceVersion When specified with a watch call, shows changes that occur after that particular version of a resource. Defaults to changes from the beginning of history. When specified for list: - if unset, then the result is returned from remote storage based on quorum-read flag; - if it's 0, then we simply return what we currently have in cache, no guarantee; - if set to non zero, then the result is at least as fresh as given rv.\n * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.\n * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.\n * @param {*} [options] Override http request options.\n */\n deleteCollectionPodSecurityPolicy(includeUninitialized, pretty, _continue, fieldSelector, labelSelector, limit, resourceVersion, timeoutSeconds, watch, options = {}) {\n const localVarPath = this.basePath + '/apis/extensions/v1beta1/podsecuritypolicies';\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n if (includeUninitialized !== undefined) {\n localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, \"boolean\");\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (_continue !== undefined) {\n localVarQueryParameters['continue'] = ObjectSerializer.serialize(_continue, \"string\");\n }\n if (fieldSelector !== undefined) {\n localVarQueryParameters['fieldSelector'] = ObjectSerializer.serialize(fieldSelector, \"string\");\n }\n if (labelSelector !== undefined) {\n localVarQueryParameters['labelSelector'] = ObjectSerializer.serialize(labelSelector, \"string\");\n }\n if (limit !== undefined) {\n localVarQueryParameters['limit'] = ObjectSerializer.serialize(limit, \"number\");\n }\n if (resourceVersion !== undefined) {\n localVarQueryParameters['resourceVersion'] = ObjectSerializer.serialize(resourceVersion, \"string\");\n }\n if (timeoutSeconds !== undefined) {\n localVarQueryParameters['timeoutSeconds'] = ObjectSerializer.serialize(timeoutSeconds, \"number\");\n }\n if (watch !== undefined) {\n localVarQueryParameters['watch'] = ObjectSerializer.serialize(watch, \"boolean\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'DELETE',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1Status\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * delete a DaemonSet\n * @param name name of the DaemonSet\n * @param namespace object name and auth scope, such as for teams and projects\n * @param pretty If 'true', then the output is pretty printed.\n * @param body\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param gracePeriodSeconds The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately.\n * @param orphanDependents Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \\"orphan\\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both.\n * @param propagationPolicy Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground.\n * @param {*} [options] Override http request options.\n */\n deleteNamespacedDaemonSet(name, namespace, pretty, body, dryRun, gracePeriodSeconds, orphanDependents, propagationPolicy, options = {}) {\n const localVarPath = this.basePath + '/apis/extensions/v1beta1/namespaces/{namespace}/daemonsets/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling deleteNamespacedDaemonSet.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling deleteNamespacedDaemonSet.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, \"string\");\n }\n if (gracePeriodSeconds !== undefined) {\n localVarQueryParameters['gracePeriodSeconds'] = ObjectSerializer.serialize(gracePeriodSeconds, \"number\");\n }\n if (orphanDependents !== undefined) {\n localVarQueryParameters['orphanDependents'] = ObjectSerializer.serialize(orphanDependents, \"boolean\");\n }\n if (propagationPolicy !== undefined) {\n localVarQueryParameters['propagationPolicy'] = ObjectSerializer.serialize(propagationPolicy, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'DELETE',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: ObjectSerializer.serialize(body, \"V1DeleteOptions\")\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1Status\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * delete a Deployment\n * @param name name of the Deployment\n * @param namespace object name and auth scope, such as for teams and projects\n * @param pretty If 'true', then the output is pretty printed.\n * @param body\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param gracePeriodSeconds The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately.\n * @param orphanDependents Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \\"orphan\\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both.\n * @param propagationPolicy Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground.\n * @param {*} [options] Override http request options.\n */\n deleteNamespacedDeployment(name, namespace, pretty, body, dryRun, gracePeriodSeconds, orphanDependents, propagationPolicy, options = {}) {\n const localVarPath = this.basePath + '/apis/extensions/v1beta1/namespaces/{namespace}/deployments/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling deleteNamespacedDeployment.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling deleteNamespacedDeployment.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, \"string\");\n }\n if (gracePeriodSeconds !== undefined) {\n localVarQueryParameters['gracePeriodSeconds'] = ObjectSerializer.serialize(gracePeriodSeconds, \"number\");\n }\n if (orphanDependents !== undefined) {\n localVarQueryParameters['orphanDependents'] = ObjectSerializer.serialize(orphanDependents, \"boolean\");\n }\n if (propagationPolicy !== undefined) {\n localVarQueryParameters['propagationPolicy'] = ObjectSerializer.serialize(propagationPolicy, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'DELETE',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: ObjectSerializer.serialize(body, \"V1DeleteOptions\")\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1Status\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * delete an Ingress\n * @param name name of the Ingress\n * @param namespace object name and auth scope, such as for teams and projects\n * @param pretty If 'true', then the output is pretty printed.\n * @param body\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param gracePeriodSeconds The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately.\n * @param orphanDependents Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \\"orphan\\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both.\n * @param propagationPolicy Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground.\n * @param {*} [options] Override http request options.\n */\n deleteNamespacedIngress(name, namespace, pretty, body, dryRun, gracePeriodSeconds, orphanDependents, propagationPolicy, options = {}) {\n const localVarPath = this.basePath + '/apis/extensions/v1beta1/namespaces/{namespace}/ingresses/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling deleteNamespacedIngress.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling deleteNamespacedIngress.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, \"string\");\n }\n if (gracePeriodSeconds !== undefined) {\n localVarQueryParameters['gracePeriodSeconds'] = ObjectSerializer.serialize(gracePeriodSeconds, \"number\");\n }\n if (orphanDependents !== undefined) {\n localVarQueryParameters['orphanDependents'] = ObjectSerializer.serialize(orphanDependents, \"boolean\");\n }\n if (propagationPolicy !== undefined) {\n localVarQueryParameters['propagationPolicy'] = ObjectSerializer.serialize(propagationPolicy, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'DELETE',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: ObjectSerializer.serialize(body, \"V1DeleteOptions\")\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1Status\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * delete a NetworkPolicy\n * @param name name of the NetworkPolicy\n * @param namespace object name and auth scope, such as for teams and projects\n * @param pretty If 'true', then the output is pretty printed.\n * @param body\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param gracePeriodSeconds The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately.\n * @param orphanDependents Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \\"orphan\\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both.\n * @param propagationPolicy Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground.\n * @param {*} [options] Override http request options.\n */\n deleteNamespacedNetworkPolicy(name, namespace, pretty, body, dryRun, gracePeriodSeconds, orphanDependents, propagationPolicy, options = {}) {\n const localVarPath = this.basePath + '/apis/extensions/v1beta1/namespaces/{namespace}/networkpolicies/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling deleteNamespacedNetworkPolicy.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling deleteNamespacedNetworkPolicy.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, \"string\");\n }\n if (gracePeriodSeconds !== undefined) {\n localVarQueryParameters['gracePeriodSeconds'] = ObjectSerializer.serialize(gracePeriodSeconds, \"number\");\n }\n if (orphanDependents !== undefined) {\n localVarQueryParameters['orphanDependents'] = ObjectSerializer.serialize(orphanDependents, \"boolean\");\n }\n if (propagationPolicy !== undefined) {\n localVarQueryParameters['propagationPolicy'] = ObjectSerializer.serialize(propagationPolicy, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'DELETE',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: ObjectSerializer.serialize(body, \"V1DeleteOptions\")\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1Status\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * delete a ReplicaSet\n * @param name name of the ReplicaSet\n * @param namespace object name and auth scope, such as for teams and projects\n * @param pretty If 'true', then the output is pretty printed.\n * @param body\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param gracePeriodSeconds The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately.\n * @param orphanDependents Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \\"orphan\\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both.\n * @param propagationPolicy Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground.\n * @param {*} [options] Override http request options.\n */\n deleteNamespacedReplicaSet(name, namespace, pretty, body, dryRun, gracePeriodSeconds, orphanDependents, propagationPolicy, options = {}) {\n const localVarPath = this.basePath + '/apis/extensions/v1beta1/namespaces/{namespace}/replicasets/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling deleteNamespacedReplicaSet.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling deleteNamespacedReplicaSet.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, \"string\");\n }\n if (gracePeriodSeconds !== undefined) {\n localVarQueryParameters['gracePeriodSeconds'] = ObjectSerializer.serialize(gracePeriodSeconds, \"number\");\n }\n if (orphanDependents !== undefined) {\n localVarQueryParameters['orphanDependents'] = ObjectSerializer.serialize(orphanDependents, \"boolean\");\n }\n if (propagationPolicy !== undefined) {\n localVarQueryParameters['propagationPolicy'] = ObjectSerializer.serialize(propagationPolicy, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'DELETE',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: ObjectSerializer.serialize(body, \"V1DeleteOptions\")\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1Status\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * delete a PodSecurityPolicy\n * @param name name of the PodSecurityPolicy\n * @param pretty If 'true', then the output is pretty printed.\n * @param body\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param gracePeriodSeconds The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately.\n * @param orphanDependents Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \\"orphan\\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both.\n * @param propagationPolicy Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground.\n * @param {*} [options] Override http request options.\n */\n deletePodSecurityPolicy(name, pretty, body, dryRun, gracePeriodSeconds, orphanDependents, propagationPolicy, options = {}) {\n const localVarPath = this.basePath + '/apis/extensions/v1beta1/podsecuritypolicies/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling deletePodSecurityPolicy.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, \"string\");\n }\n if (gracePeriodSeconds !== undefined) {\n localVarQueryParameters['gracePeriodSeconds'] = ObjectSerializer.serialize(gracePeriodSeconds, \"number\");\n }\n if (orphanDependents !== undefined) {\n localVarQueryParameters['orphanDependents'] = ObjectSerializer.serialize(orphanDependents, \"boolean\");\n }\n if (propagationPolicy !== undefined) {\n localVarQueryParameters['propagationPolicy'] = ObjectSerializer.serialize(propagationPolicy, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'DELETE',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: ObjectSerializer.serialize(body, \"V1DeleteOptions\")\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1Status\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * get available resources\n * @param {*} [options] Override http request options.\n */\n getAPIResources(options = {}) {\n const localVarPath = this.basePath + '/apis/extensions/v1beta1/';\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1APIResourceList\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * list or watch objects of kind DaemonSet\n * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \\"next key\\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.\n * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything.\n * @param includeUninitialized If true, partially initialized resources are included in the response.\n * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything.\n * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.\n * @param pretty If 'true', then the output is pretty printed.\n * @param resourceVersion When specified with a watch call, shows changes that occur after that particular version of a resource. Defaults to changes from the beginning of history. When specified for list: - if unset, then the result is returned from remote storage based on quorum-read flag; - if it's 0, then we simply return what we currently have in cache, no guarantee; - if set to non zero, then the result is at least as fresh as given rv.\n * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.\n * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.\n * @param {*} [options] Override http request options.\n */\n listDaemonSetForAllNamespaces(_continue, fieldSelector, includeUninitialized, labelSelector, limit, pretty, resourceVersion, timeoutSeconds, watch, options = {}) {\n const localVarPath = this.basePath + '/apis/extensions/v1beta1/daemonsets';\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n if (_continue !== undefined) {\n localVarQueryParameters['continue'] = ObjectSerializer.serialize(_continue, \"string\");\n }\n if (fieldSelector !== undefined) {\n localVarQueryParameters['fieldSelector'] = ObjectSerializer.serialize(fieldSelector, \"string\");\n }\n if (includeUninitialized !== undefined) {\n localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, \"boolean\");\n }\n if (labelSelector !== undefined) {\n localVarQueryParameters['labelSelector'] = ObjectSerializer.serialize(labelSelector, \"string\");\n }\n if (limit !== undefined) {\n localVarQueryParameters['limit'] = ObjectSerializer.serialize(limit, \"number\");\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (resourceVersion !== undefined) {\n localVarQueryParameters['resourceVersion'] = ObjectSerializer.serialize(resourceVersion, \"string\");\n }\n if (timeoutSeconds !== undefined) {\n localVarQueryParameters['timeoutSeconds'] = ObjectSerializer.serialize(timeoutSeconds, \"number\");\n }\n if (watch !== undefined) {\n localVarQueryParameters['watch'] = ObjectSerializer.serialize(watch, \"boolean\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1beta1DaemonSetList\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * list or watch objects of kind Deployment\n * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \\"next key\\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.\n * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything.\n * @param includeUninitialized If true, partially initialized resources are included in the response.\n * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything.\n * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.\n * @param pretty If 'true', then the output is pretty printed.\n * @param resourceVersion When specified with a watch call, shows changes that occur after that particular version of a resource. Defaults to changes from the beginning of history. When specified for list: - if unset, then the result is returned from remote storage based on quorum-read flag; - if it's 0, then we simply return what we currently have in cache, no guarantee; - if set to non zero, then the result is at least as fresh as given rv.\n * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.\n * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.\n * @param {*} [options] Override http request options.\n */\n listDeploymentForAllNamespaces(_continue, fieldSelector, includeUninitialized, labelSelector, limit, pretty, resourceVersion, timeoutSeconds, watch, options = {}) {\n const localVarPath = this.basePath + '/apis/extensions/v1beta1/deployments';\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n if (_continue !== undefined) {\n localVarQueryParameters['continue'] = ObjectSerializer.serialize(_continue, \"string\");\n }\n if (fieldSelector !== undefined) {\n localVarQueryParameters['fieldSelector'] = ObjectSerializer.serialize(fieldSelector, \"string\");\n }\n if (includeUninitialized !== undefined) {\n localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, \"boolean\");\n }\n if (labelSelector !== undefined) {\n localVarQueryParameters['labelSelector'] = ObjectSerializer.serialize(labelSelector, \"string\");\n }\n if (limit !== undefined) {\n localVarQueryParameters['limit'] = ObjectSerializer.serialize(limit, \"number\");\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (resourceVersion !== undefined) {\n localVarQueryParameters['resourceVersion'] = ObjectSerializer.serialize(resourceVersion, \"string\");\n }\n if (timeoutSeconds !== undefined) {\n localVarQueryParameters['timeoutSeconds'] = ObjectSerializer.serialize(timeoutSeconds, \"number\");\n }\n if (watch !== undefined) {\n localVarQueryParameters['watch'] = ObjectSerializer.serialize(watch, \"boolean\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"ExtensionsV1beta1DeploymentList\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * list or watch objects of kind Ingress\n * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \\"next key\\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.\n * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything.\n * @param includeUninitialized If true, partially initialized resources are included in the response.\n * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything.\n * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.\n * @param pretty If 'true', then the output is pretty printed.\n * @param resourceVersion When specified with a watch call, shows changes that occur after that particular version of a resource. Defaults to changes from the beginning of history. When specified for list: - if unset, then the result is returned from remote storage based on quorum-read flag; - if it's 0, then we simply return what we currently have in cache, no guarantee; - if set to non zero, then the result is at least as fresh as given rv.\n * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.\n * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.\n * @param {*} [options] Override http request options.\n */\n listIngressForAllNamespaces(_continue, fieldSelector, includeUninitialized, labelSelector, limit, pretty, resourceVersion, timeoutSeconds, watch, options = {}) {\n const localVarPath = this.basePath + '/apis/extensions/v1beta1/ingresses';\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n if (_continue !== undefined) {\n localVarQueryParameters['continue'] = ObjectSerializer.serialize(_continue, \"string\");\n }\n if (fieldSelector !== undefined) {\n localVarQueryParameters['fieldSelector'] = ObjectSerializer.serialize(fieldSelector, \"string\");\n }\n if (includeUninitialized !== undefined) {\n localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, \"boolean\");\n }\n if (labelSelector !== undefined) {\n localVarQueryParameters['labelSelector'] = ObjectSerializer.serialize(labelSelector, \"string\");\n }\n if (limit !== undefined) {\n localVarQueryParameters['limit'] = ObjectSerializer.serialize(limit, \"number\");\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (resourceVersion !== undefined) {\n localVarQueryParameters['resourceVersion'] = ObjectSerializer.serialize(resourceVersion, \"string\");\n }\n if (timeoutSeconds !== undefined) {\n localVarQueryParameters['timeoutSeconds'] = ObjectSerializer.serialize(timeoutSeconds, \"number\");\n }\n if (watch !== undefined) {\n localVarQueryParameters['watch'] = ObjectSerializer.serialize(watch, \"boolean\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1beta1IngressList\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * list or watch objects of kind DaemonSet\n * @param namespace object name and auth scope, such as for teams and projects\n * @param includeUninitialized If true, partially initialized resources are included in the response.\n * @param pretty If 'true', then the output is pretty printed.\n * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \\"next key\\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.\n * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything.\n * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything.\n * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.\n * @param resourceVersion When specified with a watch call, shows changes that occur after that particular version of a resource. Defaults to changes from the beginning of history. When specified for list: - if unset, then the result is returned from remote storage based on quorum-read flag; - if it's 0, then we simply return what we currently have in cache, no guarantee; - if set to non zero, then the result is at least as fresh as given rv.\n * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.\n * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.\n * @param {*} [options] Override http request options.\n */\n listNamespacedDaemonSet(namespace, includeUninitialized, pretty, _continue, fieldSelector, labelSelector, limit, resourceVersion, timeoutSeconds, watch, options = {}) {\n const localVarPath = this.basePath + '/apis/extensions/v1beta1/namespaces/{namespace}/daemonsets'\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling listNamespacedDaemonSet.');\n }\n if (includeUninitialized !== undefined) {\n localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, \"boolean\");\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (_continue !== undefined) {\n localVarQueryParameters['continue'] = ObjectSerializer.serialize(_continue, \"string\");\n }\n if (fieldSelector !== undefined) {\n localVarQueryParameters['fieldSelector'] = ObjectSerializer.serialize(fieldSelector, \"string\");\n }\n if (labelSelector !== undefined) {\n localVarQueryParameters['labelSelector'] = ObjectSerializer.serialize(labelSelector, \"string\");\n }\n if (limit !== undefined) {\n localVarQueryParameters['limit'] = ObjectSerializer.serialize(limit, \"number\");\n }\n if (resourceVersion !== undefined) {\n localVarQueryParameters['resourceVersion'] = ObjectSerializer.serialize(resourceVersion, \"string\");\n }\n if (timeoutSeconds !== undefined) {\n localVarQueryParameters['timeoutSeconds'] = ObjectSerializer.serialize(timeoutSeconds, \"number\");\n }\n if (watch !== undefined) {\n localVarQueryParameters['watch'] = ObjectSerializer.serialize(watch, \"boolean\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1beta1DaemonSetList\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * list or watch objects of kind Deployment\n * @param namespace object name and auth scope, such as for teams and projects\n * @param includeUninitialized If true, partially initialized resources are included in the response.\n * @param pretty If 'true', then the output is pretty printed.\n * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \\"next key\\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.\n * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything.\n * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything.\n * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.\n * @param resourceVersion When specified with a watch call, shows changes that occur after that particular version of a resource. Defaults to changes from the beginning of history. When specified for list: - if unset, then the result is returned from remote storage based on quorum-read flag; - if it's 0, then we simply return what we currently have in cache, no guarantee; - if set to non zero, then the result is at least as fresh as given rv.\n * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.\n * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.\n * @param {*} [options] Override http request options.\n */\n listNamespacedDeployment(namespace, includeUninitialized, pretty, _continue, fieldSelector, labelSelector, limit, resourceVersion, timeoutSeconds, watch, options = {}) {\n const localVarPath = this.basePath + '/apis/extensions/v1beta1/namespaces/{namespace}/deployments'\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling listNamespacedDeployment.');\n }\n if (includeUninitialized !== undefined) {\n localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, \"boolean\");\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (_continue !== undefined) {\n localVarQueryParameters['continue'] = ObjectSerializer.serialize(_continue, \"string\");\n }\n if (fieldSelector !== undefined) {\n localVarQueryParameters['fieldSelector'] = ObjectSerializer.serialize(fieldSelector, \"string\");\n }\n if (labelSelector !== undefined) {\n localVarQueryParameters['labelSelector'] = ObjectSerializer.serialize(labelSelector, \"string\");\n }\n if (limit !== undefined) {\n localVarQueryParameters['limit'] = ObjectSerializer.serialize(limit, \"number\");\n }\n if (resourceVersion !== undefined) {\n localVarQueryParameters['resourceVersion'] = ObjectSerializer.serialize(resourceVersion, \"string\");\n }\n if (timeoutSeconds !== undefined) {\n localVarQueryParameters['timeoutSeconds'] = ObjectSerializer.serialize(timeoutSeconds, \"number\");\n }\n if (watch !== undefined) {\n localVarQueryParameters['watch'] = ObjectSerializer.serialize(watch, \"boolean\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"ExtensionsV1beta1DeploymentList\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * list or watch objects of kind Ingress\n * @param namespace object name and auth scope, such as for teams and projects\n * @param includeUninitialized If true, partially initialized resources are included in the response.\n * @param pretty If 'true', then the output is pretty printed.\n * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \\"next key\\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.\n * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything.\n * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything.\n * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.\n * @param resourceVersion When specified with a watch call, shows changes that occur after that particular version of a resource. Defaults to changes from the beginning of history. When specified for list: - if unset, then the result is returned from remote storage based on quorum-read flag; - if it's 0, then we simply return what we currently have in cache, no guarantee; - if set to non zero, then the result is at least as fresh as given rv.\n * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.\n * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.\n * @param {*} [options] Override http request options.\n */\n listNamespacedIngress(namespace, includeUninitialized, pretty, _continue, fieldSelector, labelSelector, limit, resourceVersion, timeoutSeconds, watch, options = {}) {\n const localVarPath = this.basePath + '/apis/extensions/v1beta1/namespaces/{namespace}/ingresses'\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling listNamespacedIngress.');\n }\n if (includeUninitialized !== undefined) {\n localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, \"boolean\");\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (_continue !== undefined) {\n localVarQueryParameters['continue'] = ObjectSerializer.serialize(_continue, \"string\");\n }\n if (fieldSelector !== undefined) {\n localVarQueryParameters['fieldSelector'] = ObjectSerializer.serialize(fieldSelector, \"string\");\n }\n if (labelSelector !== undefined) {\n localVarQueryParameters['labelSelector'] = ObjectSerializer.serialize(labelSelector, \"string\");\n }\n if (limit !== undefined) {\n localVarQueryParameters['limit'] = ObjectSerializer.serialize(limit, \"number\");\n }\n if (resourceVersion !== undefined) {\n localVarQueryParameters['resourceVersion'] = ObjectSerializer.serialize(resourceVersion, \"string\");\n }\n if (timeoutSeconds !== undefined) {\n localVarQueryParameters['timeoutSeconds'] = ObjectSerializer.serialize(timeoutSeconds, \"number\");\n }\n if (watch !== undefined) {\n localVarQueryParameters['watch'] = ObjectSerializer.serialize(watch, \"boolean\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1beta1IngressList\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * list or watch objects of kind NetworkPolicy\n * @param namespace object name and auth scope, such as for teams and projects\n * @param includeUninitialized If true, partially initialized resources are included in the response.\n * @param pretty If 'true', then the output is pretty printed.\n * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \\"next key\\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.\n * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything.\n * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything.\n * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.\n * @param resourceVersion When specified with a watch call, shows changes that occur after that particular version of a resource. Defaults to changes from the beginning of history. When specified for list: - if unset, then the result is returned from remote storage based on quorum-read flag; - if it's 0, then we simply return what we currently have in cache, no guarantee; - if set to non zero, then the result is at least as fresh as given rv.\n * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.\n * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.\n * @param {*} [options] Override http request options.\n */\n listNamespacedNetworkPolicy(namespace, includeUninitialized, pretty, _continue, fieldSelector, labelSelector, limit, resourceVersion, timeoutSeconds, watch, options = {}) {\n const localVarPath = this.basePath + '/apis/extensions/v1beta1/namespaces/{namespace}/networkpolicies'\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling listNamespacedNetworkPolicy.');\n }\n if (includeUninitialized !== undefined) {\n localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, \"boolean\");\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (_continue !== undefined) {\n localVarQueryParameters['continue'] = ObjectSerializer.serialize(_continue, \"string\");\n }\n if (fieldSelector !== undefined) {\n localVarQueryParameters['fieldSelector'] = ObjectSerializer.serialize(fieldSelector, \"string\");\n }\n if (labelSelector !== undefined) {\n localVarQueryParameters['labelSelector'] = ObjectSerializer.serialize(labelSelector, \"string\");\n }\n if (limit !== undefined) {\n localVarQueryParameters['limit'] = ObjectSerializer.serialize(limit, \"number\");\n }\n if (resourceVersion !== undefined) {\n localVarQueryParameters['resourceVersion'] = ObjectSerializer.serialize(resourceVersion, \"string\");\n }\n if (timeoutSeconds !== undefined) {\n localVarQueryParameters['timeoutSeconds'] = ObjectSerializer.serialize(timeoutSeconds, \"number\");\n }\n if (watch !== undefined) {\n localVarQueryParameters['watch'] = ObjectSerializer.serialize(watch, \"boolean\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1beta1NetworkPolicyList\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * list or watch objects of kind ReplicaSet\n * @param namespace object name and auth scope, such as for teams and projects\n * @param includeUninitialized If true, partially initialized resources are included in the response.\n * @param pretty If 'true', then the output is pretty printed.\n * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \\"next key\\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.\n * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything.\n * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything.\n * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.\n * @param resourceVersion When specified with a watch call, shows changes that occur after that particular version of a resource. Defaults to changes from the beginning of history. When specified for list: - if unset, then the result is returned from remote storage based on quorum-read flag; - if it's 0, then we simply return what we currently have in cache, no guarantee; - if set to non zero, then the result is at least as fresh as given rv.\n * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.\n * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.\n * @param {*} [options] Override http request options.\n */\n listNamespacedReplicaSet(namespace, includeUninitialized, pretty, _continue, fieldSelector, labelSelector, limit, resourceVersion, timeoutSeconds, watch, options = {}) {\n const localVarPath = this.basePath + '/apis/extensions/v1beta1/namespaces/{namespace}/replicasets'\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling listNamespacedReplicaSet.');\n }\n if (includeUninitialized !== undefined) {\n localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, \"boolean\");\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (_continue !== undefined) {\n localVarQueryParameters['continue'] = ObjectSerializer.serialize(_continue, \"string\");\n }\n if (fieldSelector !== undefined) {\n localVarQueryParameters['fieldSelector'] = ObjectSerializer.serialize(fieldSelector, \"string\");\n }\n if (labelSelector !== undefined) {\n localVarQueryParameters['labelSelector'] = ObjectSerializer.serialize(labelSelector, \"string\");\n }\n if (limit !== undefined) {\n localVarQueryParameters['limit'] = ObjectSerializer.serialize(limit, \"number\");\n }\n if (resourceVersion !== undefined) {\n localVarQueryParameters['resourceVersion'] = ObjectSerializer.serialize(resourceVersion, \"string\");\n }\n if (timeoutSeconds !== undefined) {\n localVarQueryParameters['timeoutSeconds'] = ObjectSerializer.serialize(timeoutSeconds, \"number\");\n }\n if (watch !== undefined) {\n localVarQueryParameters['watch'] = ObjectSerializer.serialize(watch, \"boolean\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1beta1ReplicaSetList\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * list or watch objects of kind NetworkPolicy\n * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \\"next key\\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.\n * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything.\n * @param includeUninitialized If true, partially initialized resources are included in the response.\n * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything.\n * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.\n * @param pretty If 'true', then the output is pretty printed.\n * @param resourceVersion When specified with a watch call, shows changes that occur after that particular version of a resource. Defaults to changes from the beginning of history. When specified for list: - if unset, then the result is returned from remote storage based on quorum-read flag; - if it's 0, then we simply return what we currently have in cache, no guarantee; - if set to non zero, then the result is at least as fresh as given rv.\n * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.\n * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.\n * @param {*} [options] Override http request options.\n */\n listNetworkPolicyForAllNamespaces(_continue, fieldSelector, includeUninitialized, labelSelector, limit, pretty, resourceVersion, timeoutSeconds, watch, options = {}) {\n const localVarPath = this.basePath + '/apis/extensions/v1beta1/networkpolicies';\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n if (_continue !== undefined) {\n localVarQueryParameters['continue'] = ObjectSerializer.serialize(_continue, \"string\");\n }\n if (fieldSelector !== undefined) {\n localVarQueryParameters['fieldSelector'] = ObjectSerializer.serialize(fieldSelector, \"string\");\n }\n if (includeUninitialized !== undefined) {\n localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, \"boolean\");\n }\n if (labelSelector !== undefined) {\n localVarQueryParameters['labelSelector'] = ObjectSerializer.serialize(labelSelector, \"string\");\n }\n if (limit !== undefined) {\n localVarQueryParameters['limit'] = ObjectSerializer.serialize(limit, \"number\");\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (resourceVersion !== undefined) {\n localVarQueryParameters['resourceVersion'] = ObjectSerializer.serialize(resourceVersion, \"string\");\n }\n if (timeoutSeconds !== undefined) {\n localVarQueryParameters['timeoutSeconds'] = ObjectSerializer.serialize(timeoutSeconds, \"number\");\n }\n if (watch !== undefined) {\n localVarQueryParameters['watch'] = ObjectSerializer.serialize(watch, \"boolean\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1beta1NetworkPolicyList\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * list or watch objects of kind PodSecurityPolicy\n * @param includeUninitialized If true, partially initialized resources are included in the response.\n * @param pretty If 'true', then the output is pretty printed.\n * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \\"next key\\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.\n * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything.\n * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything.\n * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.\n * @param resourceVersion When specified with a watch call, shows changes that occur after that particular version of a resource. Defaults to changes from the beginning of history. When specified for list: - if unset, then the result is returned from remote storage based on quorum-read flag; - if it's 0, then we simply return what we currently have in cache, no guarantee; - if set to non zero, then the result is at least as fresh as given rv.\n * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.\n * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.\n * @param {*} [options] Override http request options.\n */\n listPodSecurityPolicy(includeUninitialized, pretty, _continue, fieldSelector, labelSelector, limit, resourceVersion, timeoutSeconds, watch, options = {}) {\n const localVarPath = this.basePath + '/apis/extensions/v1beta1/podsecuritypolicies';\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n if (includeUninitialized !== undefined) {\n localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, \"boolean\");\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (_continue !== undefined) {\n localVarQueryParameters['continue'] = ObjectSerializer.serialize(_continue, \"string\");\n }\n if (fieldSelector !== undefined) {\n localVarQueryParameters['fieldSelector'] = ObjectSerializer.serialize(fieldSelector, \"string\");\n }\n if (labelSelector !== undefined) {\n localVarQueryParameters['labelSelector'] = ObjectSerializer.serialize(labelSelector, \"string\");\n }\n if (limit !== undefined) {\n localVarQueryParameters['limit'] = ObjectSerializer.serialize(limit, \"number\");\n }\n if (resourceVersion !== undefined) {\n localVarQueryParameters['resourceVersion'] = ObjectSerializer.serialize(resourceVersion, \"string\");\n }\n if (timeoutSeconds !== undefined) {\n localVarQueryParameters['timeoutSeconds'] = ObjectSerializer.serialize(timeoutSeconds, \"number\");\n }\n if (watch !== undefined) {\n localVarQueryParameters['watch'] = ObjectSerializer.serialize(watch, \"boolean\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"ExtensionsV1beta1PodSecurityPolicyList\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * list or watch objects of kind ReplicaSet\n * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \\"next key\\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.\n * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything.\n * @param includeUninitialized If true, partially initialized resources are included in the response.\n * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything.\n * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.\n * @param pretty If 'true', then the output is pretty printed.\n * @param resourceVersion When specified with a watch call, shows changes that occur after that particular version of a resource. Defaults to changes from the beginning of history. When specified for list: - if unset, then the result is returned from remote storage based on quorum-read flag; - if it's 0, then we simply return what we currently have in cache, no guarantee; - if set to non zero, then the result is at least as fresh as given rv.\n * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.\n * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.\n * @param {*} [options] Override http request options.\n */\n listReplicaSetForAllNamespaces(_continue, fieldSelector, includeUninitialized, labelSelector, limit, pretty, resourceVersion, timeoutSeconds, watch, options = {}) {\n const localVarPath = this.basePath + '/apis/extensions/v1beta1/replicasets';\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n if (_continue !== undefined) {\n localVarQueryParameters['continue'] = ObjectSerializer.serialize(_continue, \"string\");\n }\n if (fieldSelector !== undefined) {\n localVarQueryParameters['fieldSelector'] = ObjectSerializer.serialize(fieldSelector, \"string\");\n }\n if (includeUninitialized !== undefined) {\n localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, \"boolean\");\n }\n if (labelSelector !== undefined) {\n localVarQueryParameters['labelSelector'] = ObjectSerializer.serialize(labelSelector, \"string\");\n }\n if (limit !== undefined) {\n localVarQueryParameters['limit'] = ObjectSerializer.serialize(limit, \"number\");\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (resourceVersion !== undefined) {\n localVarQueryParameters['resourceVersion'] = ObjectSerializer.serialize(resourceVersion, \"string\");\n }\n if (timeoutSeconds !== undefined) {\n localVarQueryParameters['timeoutSeconds'] = ObjectSerializer.serialize(timeoutSeconds, \"number\");\n }\n if (watch !== undefined) {\n localVarQueryParameters['watch'] = ObjectSerializer.serialize(watch, \"boolean\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1beta1ReplicaSetList\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * partially update the specified DaemonSet\n * @param name name of the DaemonSet\n * @param namespace object name and auth scope, such as for teams and projects\n * @param body\n * @param pretty If 'true', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param {*} [options] Override http request options.\n */\n patchNamespacedDaemonSet(name, namespace, body, pretty, dryRun, options = {}) {\n const localVarPath = this.basePath + '/apis/extensions/v1beta1/namespaces/{namespace}/daemonsets/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling patchNamespacedDaemonSet.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling patchNamespacedDaemonSet.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling patchNamespacedDaemonSet.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'PATCH',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: ObjectSerializer.serialize(body, \"any\")\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1beta1DaemonSet\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * partially update status of the specified DaemonSet\n * @param name name of the DaemonSet\n * @param namespace object name and auth scope, such as for teams and projects\n * @param body\n * @param pretty If 'true', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param {*} [options] Override http request options.\n */\n patchNamespacedDaemonSetStatus(name, namespace, body, pretty, dryRun, options = {}) {\n const localVarPath = this.basePath + '/apis/extensions/v1beta1/namespaces/{namespace}/daemonsets/{name}/status'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling patchNamespacedDaemonSetStatus.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling patchNamespacedDaemonSetStatus.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling patchNamespacedDaemonSetStatus.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'PATCH',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: ObjectSerializer.serialize(body, \"any\")\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1beta1DaemonSet\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * partially update the specified Deployment\n * @param name name of the Deployment\n * @param namespace object name and auth scope, such as for teams and projects\n * @param body\n * @param pretty If 'true', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param {*} [options] Override http request options.\n */\n patchNamespacedDeployment(name, namespace, body, pretty, dryRun, options = {}) {\n const localVarPath = this.basePath + '/apis/extensions/v1beta1/namespaces/{namespace}/deployments/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling patchNamespacedDeployment.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling patchNamespacedDeployment.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling patchNamespacedDeployment.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'PATCH',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: ObjectSerializer.serialize(body, \"any\")\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"ExtensionsV1beta1Deployment\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * partially update scale of the specified Deployment\n * @param name name of the Scale\n * @param namespace object name and auth scope, such as for teams and projects\n * @param body\n * @param pretty If 'true', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param {*} [options] Override http request options.\n */\n patchNamespacedDeploymentScale(name, namespace, body, pretty, dryRun, options = {}) {\n const localVarPath = this.basePath + '/apis/extensions/v1beta1/namespaces/{namespace}/deployments/{name}/scale'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling patchNamespacedDeploymentScale.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling patchNamespacedDeploymentScale.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling patchNamespacedDeploymentScale.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'PATCH',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: ObjectSerializer.serialize(body, \"any\")\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"ExtensionsV1beta1Scale\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * partially update status of the specified Deployment\n * @param name name of the Deployment\n * @param namespace object name and auth scope, such as for teams and projects\n * @param body\n * @param pretty If 'true', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param {*} [options] Override http request options.\n */\n patchNamespacedDeploymentStatus(name, namespace, body, pretty, dryRun, options = {}) {\n const localVarPath = this.basePath + '/apis/extensions/v1beta1/namespaces/{namespace}/deployments/{name}/status'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling patchNamespacedDeploymentStatus.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling patchNamespacedDeploymentStatus.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling patchNamespacedDeploymentStatus.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'PATCH',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: ObjectSerializer.serialize(body, \"any\")\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"ExtensionsV1beta1Deployment\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * partially update the specified Ingress\n * @param name name of the Ingress\n * @param namespace object name and auth scope, such as for teams and projects\n * @param body\n * @param pretty If 'true', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param {*} [options] Override http request options.\n */\n patchNamespacedIngress(name, namespace, body, pretty, dryRun, options = {}) {\n const localVarPath = this.basePath + '/apis/extensions/v1beta1/namespaces/{namespace}/ingresses/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling patchNamespacedIngress.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling patchNamespacedIngress.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling patchNamespacedIngress.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'PATCH',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: ObjectSerializer.serialize(body, \"any\")\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1beta1Ingress\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * partially update status of the specified Ingress\n * @param name name of the Ingress\n * @param namespace object name and auth scope, such as for teams and projects\n * @param body\n * @param pretty If 'true', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param {*} [options] Override http request options.\n */\n patchNamespacedIngressStatus(name, namespace, body, pretty, dryRun, options = {}) {\n const localVarPath = this.basePath + '/apis/extensions/v1beta1/namespaces/{namespace}/ingresses/{name}/status'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling patchNamespacedIngressStatus.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling patchNamespacedIngressStatus.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling patchNamespacedIngressStatus.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'PATCH',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: ObjectSerializer.serialize(body, \"any\")\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1beta1Ingress\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * partially update the specified NetworkPolicy\n * @param name name of the NetworkPolicy\n * @param namespace object name and auth scope, such as for teams and projects\n * @param body\n * @param pretty If 'true', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param {*} [options] Override http request options.\n */\n patchNamespacedNetworkPolicy(name, namespace, body, pretty, dryRun, options = {}) {\n const localVarPath = this.basePath + '/apis/extensions/v1beta1/namespaces/{namespace}/networkpolicies/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling patchNamespacedNetworkPolicy.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling patchNamespacedNetworkPolicy.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling patchNamespacedNetworkPolicy.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'PATCH',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: ObjectSerializer.serialize(body, \"any\")\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1beta1NetworkPolicy\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * partially update the specified ReplicaSet\n * @param name name of the ReplicaSet\n * @param namespace object name and auth scope, such as for teams and projects\n * @param body\n * @param pretty If 'true', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param {*} [options] Override http request options.\n */\n patchNamespacedReplicaSet(name, namespace, body, pretty, dryRun, options = {}) {\n const localVarPath = this.basePath + '/apis/extensions/v1beta1/namespaces/{namespace}/replicasets/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling patchNamespacedReplicaSet.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling patchNamespacedReplicaSet.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling patchNamespacedReplicaSet.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'PATCH',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: ObjectSerializer.serialize(body, \"any\")\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1beta1ReplicaSet\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * partially update scale of the specified ReplicaSet\n * @param name name of the Scale\n * @param namespace object name and auth scope, such as for teams and projects\n * @param body\n * @param pretty If 'true', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param {*} [options] Override http request options.\n */\n patchNamespacedReplicaSetScale(name, namespace, body, pretty, dryRun, options = {}) {\n const localVarPath = this.basePath + '/apis/extensions/v1beta1/namespaces/{namespace}/replicasets/{name}/scale'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling patchNamespacedReplicaSetScale.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling patchNamespacedReplicaSetScale.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling patchNamespacedReplicaSetScale.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'PATCH',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: ObjectSerializer.serialize(body, \"any\")\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"ExtensionsV1beta1Scale\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * partially update status of the specified ReplicaSet\n * @param name name of the ReplicaSet\n * @param namespace object name and auth scope, such as for teams and projects\n * @param body\n * @param pretty If 'true', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param {*} [options] Override http request options.\n */\n patchNamespacedReplicaSetStatus(name, namespace, body, pretty, dryRun, options = {}) {\n const localVarPath = this.basePath + '/apis/extensions/v1beta1/namespaces/{namespace}/replicasets/{name}/status'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling patchNamespacedReplicaSetStatus.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling patchNamespacedReplicaSetStatus.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling patchNamespacedReplicaSetStatus.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'PATCH',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: ObjectSerializer.serialize(body, \"any\")\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1beta1ReplicaSet\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * partially update scale of the specified ReplicationControllerDummy\n * @param name name of the Scale\n * @param namespace object name and auth scope, such as for teams and projects\n * @param body\n * @param pretty If 'true', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param {*} [options] Override http request options.\n */\n patchNamespacedReplicationControllerDummyScale(name, namespace, body, pretty, dryRun, options = {}) {\n const localVarPath = this.basePath + '/apis/extensions/v1beta1/namespaces/{namespace}/replicationcontrollers/{name}/scale'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling patchNamespacedReplicationControllerDummyScale.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling patchNamespacedReplicationControllerDummyScale.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling patchNamespacedReplicationControllerDummyScale.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'PATCH',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: ObjectSerializer.serialize(body, \"any\")\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"ExtensionsV1beta1Scale\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * partially update the specified PodSecurityPolicy\n * @param name name of the PodSecurityPolicy\n * @param body\n * @param pretty If 'true', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param {*} [options] Override http request options.\n */\n patchPodSecurityPolicy(name, body, pretty, dryRun, options = {}) {\n const localVarPath = this.basePath + '/apis/extensions/v1beta1/podsecuritypolicies/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling patchPodSecurityPolicy.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling patchPodSecurityPolicy.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'PATCH',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: ObjectSerializer.serialize(body, \"any\")\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"ExtensionsV1beta1PodSecurityPolicy\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * read the specified DaemonSet\n * @param name name of the DaemonSet\n * @param namespace object name and auth scope, such as for teams and projects\n * @param pretty If 'true', then the output is pretty printed.\n * @param exact Should the export be exact. Exact export maintains cluster-specific fields like 'Namespace'.\n * @param _export Should this value be exported. Export strips fields that a user can not specify.\n * @param {*} [options] Override http request options.\n */\n readNamespacedDaemonSet(name, namespace, pretty, exact, _export, options = {}) {\n const localVarPath = this.basePath + '/apis/extensions/v1beta1/namespaces/{namespace}/daemonsets/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling readNamespacedDaemonSet.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling readNamespacedDaemonSet.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (exact !== undefined) {\n localVarQueryParameters['exact'] = ObjectSerializer.serialize(exact, \"boolean\");\n }\n if (_export !== undefined) {\n localVarQueryParameters['export'] = ObjectSerializer.serialize(_export, \"boolean\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1beta1DaemonSet\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * read status of the specified DaemonSet\n * @param name name of the DaemonSet\n * @param namespace object name and auth scope, such as for teams and projects\n * @param pretty If 'true', then the output is pretty printed.\n * @param {*} [options] Override http request options.\n */\n readNamespacedDaemonSetStatus(name, namespace, pretty, options = {}) {\n const localVarPath = this.basePath + '/apis/extensions/v1beta1/namespaces/{namespace}/daemonsets/{name}/status'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling readNamespacedDaemonSetStatus.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling readNamespacedDaemonSetStatus.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1beta1DaemonSet\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * read the specified Deployment\n * @param name name of the Deployment\n * @param namespace object name and auth scope, such as for teams and projects\n * @param pretty If 'true', then the output is pretty printed.\n * @param exact Should the export be exact. Exact export maintains cluster-specific fields like 'Namespace'.\n * @param _export Should this value be exported. Export strips fields that a user can not specify.\n * @param {*} [options] Override http request options.\n */\n readNamespacedDeployment(name, namespace, pretty, exact, _export, options = {}) {\n const localVarPath = this.basePath + '/apis/extensions/v1beta1/namespaces/{namespace}/deployments/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling readNamespacedDeployment.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling readNamespacedDeployment.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (exact !== undefined) {\n localVarQueryParameters['exact'] = ObjectSerializer.serialize(exact, \"boolean\");\n }\n if (_export !== undefined) {\n localVarQueryParameters['export'] = ObjectSerializer.serialize(_export, \"boolean\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"ExtensionsV1beta1Deployment\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * read scale of the specified Deployment\n * @param name name of the Scale\n * @param namespace object name and auth scope, such as for teams and projects\n * @param pretty If 'true', then the output is pretty printed.\n * @param {*} [options] Override http request options.\n */\n readNamespacedDeploymentScale(name, namespace, pretty, options = {}) {\n const localVarPath = this.basePath + '/apis/extensions/v1beta1/namespaces/{namespace}/deployments/{name}/scale'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling readNamespacedDeploymentScale.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling readNamespacedDeploymentScale.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"ExtensionsV1beta1Scale\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * read status of the specified Deployment\n * @param name name of the Deployment\n * @param namespace object name and auth scope, such as for teams and projects\n * @param pretty If 'true', then the output is pretty printed.\n * @param {*} [options] Override http request options.\n */\n readNamespacedDeploymentStatus(name, namespace, pretty, options = {}) {\n const localVarPath = this.basePath + '/apis/extensions/v1beta1/namespaces/{namespace}/deployments/{name}/status'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling readNamespacedDeploymentStatus.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling readNamespacedDeploymentStatus.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"ExtensionsV1beta1Deployment\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * read the specified Ingress\n * @param name name of the Ingress\n * @param namespace object name and auth scope, such as for teams and projects\n * @param pretty If 'true', then the output is pretty printed.\n * @param exact Should the export be exact. Exact export maintains cluster-specific fields like 'Namespace'.\n * @param _export Should this value be exported. Export strips fields that a user can not specify.\n * @param {*} [options] Override http request options.\n */\n readNamespacedIngress(name, namespace, pretty, exact, _export, options = {}) {\n const localVarPath = this.basePath + '/apis/extensions/v1beta1/namespaces/{namespace}/ingresses/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling readNamespacedIngress.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling readNamespacedIngress.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (exact !== undefined) {\n localVarQueryParameters['exact'] = ObjectSerializer.serialize(exact, \"boolean\");\n }\n if (_export !== undefined) {\n localVarQueryParameters['export'] = ObjectSerializer.serialize(_export, \"boolean\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1beta1Ingress\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * read status of the specified Ingress\n * @param name name of the Ingress\n * @param namespace object name and auth scope, such as for teams and projects\n * @param pretty If 'true', then the output is pretty printed.\n * @param {*} [options] Override http request options.\n */\n readNamespacedIngressStatus(name, namespace, pretty, options = {}) {\n const localVarPath = this.basePath + '/apis/extensions/v1beta1/namespaces/{namespace}/ingresses/{name}/status'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling readNamespacedIngressStatus.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling readNamespacedIngressStatus.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1beta1Ingress\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * read the specified NetworkPolicy\n * @param name name of the NetworkPolicy\n * @param namespace object name and auth scope, such as for teams and projects\n * @param pretty If 'true', then the output is pretty printed.\n * @param exact Should the export be exact. Exact export maintains cluster-specific fields like 'Namespace'.\n * @param _export Should this value be exported. Export strips fields that a user can not specify.\n * @param {*} [options] Override http request options.\n */\n readNamespacedNetworkPolicy(name, namespace, pretty, exact, _export, options = {}) {\n const localVarPath = this.basePath + '/apis/extensions/v1beta1/namespaces/{namespace}/networkpolicies/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling readNamespacedNetworkPolicy.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling readNamespacedNetworkPolicy.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (exact !== undefined) {\n localVarQueryParameters['exact'] = ObjectSerializer.serialize(exact, \"boolean\");\n }\n if (_export !== undefined) {\n localVarQueryParameters['export'] = ObjectSerializer.serialize(_export, \"boolean\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1beta1NetworkPolicy\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * read the specified ReplicaSet\n * @param name name of the ReplicaSet\n * @param namespace object name and auth scope, such as for teams and projects\n * @param pretty If 'true', then the output is pretty printed.\n * @param exact Should the export be exact. Exact export maintains cluster-specific fields like 'Namespace'.\n * @param _export Should this value be exported. Export strips fields that a user can not specify.\n * @param {*} [options] Override http request options.\n */\n readNamespacedReplicaSet(name, namespace, pretty, exact, _export, options = {}) {\n const localVarPath = this.basePath + '/apis/extensions/v1beta1/namespaces/{namespace}/replicasets/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling readNamespacedReplicaSet.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling readNamespacedReplicaSet.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (exact !== undefined) {\n localVarQueryParameters['exact'] = ObjectSerializer.serialize(exact, \"boolean\");\n }\n if (_export !== undefined) {\n localVarQueryParameters['export'] = ObjectSerializer.serialize(_export, \"boolean\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1beta1ReplicaSet\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * read scale of the specified ReplicaSet\n * @param name name of the Scale\n * @param namespace object name and auth scope, such as for teams and projects\n * @param pretty If 'true', then the output is pretty printed.\n * @param {*} [options] Override http request options.\n */\n readNamespacedReplicaSetScale(name, namespace, pretty, options = {}) {\n const localVarPath = this.basePath + '/apis/extensions/v1beta1/namespaces/{namespace}/replicasets/{name}/scale'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling readNamespacedReplicaSetScale.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling readNamespacedReplicaSetScale.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"ExtensionsV1beta1Scale\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * read status of the specified ReplicaSet\n * @param name name of the ReplicaSet\n * @param namespace object name and auth scope, such as for teams and projects\n * @param pretty If 'true', then the output is pretty printed.\n * @param {*} [options] Override http request options.\n */\n readNamespacedReplicaSetStatus(name, namespace, pretty, options = {}) {\n const localVarPath = this.basePath + '/apis/extensions/v1beta1/namespaces/{namespace}/replicasets/{name}/status'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling readNamespacedReplicaSetStatus.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling readNamespacedReplicaSetStatus.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1beta1ReplicaSet\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * read scale of the specified ReplicationControllerDummy\n * @param name name of the Scale\n * @param namespace object name and auth scope, such as for teams and projects\n * @param pretty If 'true', then the output is pretty printed.\n * @param {*} [options] Override http request options.\n */\n readNamespacedReplicationControllerDummyScale(name, namespace, pretty, options = {}) {\n const localVarPath = this.basePath + '/apis/extensions/v1beta1/namespaces/{namespace}/replicationcontrollers/{name}/scale'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling readNamespacedReplicationControllerDummyScale.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling readNamespacedReplicationControllerDummyScale.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"ExtensionsV1beta1Scale\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * read the specified PodSecurityPolicy\n * @param name name of the PodSecurityPolicy\n * @param pretty If 'true', then the output is pretty printed.\n * @param exact Should the export be exact. Exact export maintains cluster-specific fields like 'Namespace'.\n * @param _export Should this value be exported. Export strips fields that a user can not specify.\n * @param {*} [options] Override http request options.\n */\n readPodSecurityPolicy(name, pretty, exact, _export, options = {}) {\n const localVarPath = this.basePath + '/apis/extensions/v1beta1/podsecuritypolicies/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling readPodSecurityPolicy.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (exact !== undefined) {\n localVarQueryParameters['exact'] = ObjectSerializer.serialize(exact, \"boolean\");\n }\n if (_export !== undefined) {\n localVarQueryParameters['export'] = ObjectSerializer.serialize(_export, \"boolean\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"ExtensionsV1beta1PodSecurityPolicy\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * replace the specified DaemonSet\n * @param name name of the DaemonSet\n * @param namespace object name and auth scope, such as for teams and projects\n * @param body\n * @param pretty If 'true', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param {*} [options] Override http request options.\n */\n replaceNamespacedDaemonSet(name, namespace, body, pretty, dryRun, options = {}) {\n const localVarPath = this.basePath + '/apis/extensions/v1beta1/namespaces/{namespace}/daemonsets/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling replaceNamespacedDaemonSet.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling replaceNamespacedDaemonSet.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling replaceNamespacedDaemonSet.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'PUT',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: ObjectSerializer.serialize(body, \"V1beta1DaemonSet\")\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1beta1DaemonSet\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * replace status of the specified DaemonSet\n * @param name name of the DaemonSet\n * @param namespace object name and auth scope, such as for teams and projects\n * @param body\n * @param pretty If 'true', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param {*} [options] Override http request options.\n */\n replaceNamespacedDaemonSetStatus(name, namespace, body, pretty, dryRun, options = {}) {\n const localVarPath = this.basePath + '/apis/extensions/v1beta1/namespaces/{namespace}/daemonsets/{name}/status'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling replaceNamespacedDaemonSetStatus.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling replaceNamespacedDaemonSetStatus.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling replaceNamespacedDaemonSetStatus.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'PUT',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: ObjectSerializer.serialize(body, \"V1beta1DaemonSet\")\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1beta1DaemonSet\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * replace the specified Deployment\n * @param name name of the Deployment\n * @param namespace object name and auth scope, such as for teams and projects\n * @param body\n * @param pretty If 'true', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param {*} [options] Override http request options.\n */\n replaceNamespacedDeployment(name, namespace, body, pretty, dryRun, options = {}) {\n const localVarPath = this.basePath + '/apis/extensions/v1beta1/namespaces/{namespace}/deployments/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling replaceNamespacedDeployment.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling replaceNamespacedDeployment.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling replaceNamespacedDeployment.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'PUT',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: ObjectSerializer.serialize(body, \"ExtensionsV1beta1Deployment\")\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"ExtensionsV1beta1Deployment\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * replace scale of the specified Deployment\n * @param name name of the Scale\n * @param namespace object name and auth scope, such as for teams and projects\n * @param body\n * @param pretty If 'true', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param {*} [options] Override http request options.\n */\n replaceNamespacedDeploymentScale(name, namespace, body, pretty, dryRun, options = {}) {\n const localVarPath = this.basePath + '/apis/extensions/v1beta1/namespaces/{namespace}/deployments/{name}/scale'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling replaceNamespacedDeploymentScale.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling replaceNamespacedDeploymentScale.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling replaceNamespacedDeploymentScale.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'PUT',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: ObjectSerializer.serialize(body, \"ExtensionsV1beta1Scale\")\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"ExtensionsV1beta1Scale\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * replace status of the specified Deployment\n * @param name name of the Deployment\n * @param namespace object name and auth scope, such as for teams and projects\n * @param body\n * @param pretty If 'true', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param {*} [options] Override http request options.\n */\n replaceNamespacedDeploymentStatus(name, namespace, body, pretty, dryRun, options = {}) {\n const localVarPath = this.basePath + '/apis/extensions/v1beta1/namespaces/{namespace}/deployments/{name}/status'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling replaceNamespacedDeploymentStatus.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling replaceNamespacedDeploymentStatus.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling replaceNamespacedDeploymentStatus.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'PUT',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: ObjectSerializer.serialize(body, \"ExtensionsV1beta1Deployment\")\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"ExtensionsV1beta1Deployment\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * replace the specified Ingress\n * @param name name of the Ingress\n * @param namespace object name and auth scope, such as for teams and projects\n * @param body\n * @param pretty If 'true', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param {*} [options] Override http request options.\n */\n replaceNamespacedIngress(name, namespace, body, pretty, dryRun, options = {}) {\n const localVarPath = this.basePath + '/apis/extensions/v1beta1/namespaces/{namespace}/ingresses/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling replaceNamespacedIngress.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling replaceNamespacedIngress.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling replaceNamespacedIngress.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'PUT',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: ObjectSerializer.serialize(body, \"V1beta1Ingress\")\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1beta1Ingress\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * replace status of the specified Ingress\n * @param name name of the Ingress\n * @param namespace object name and auth scope, such as for teams and projects\n * @param body\n * @param pretty If 'true', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param {*} [options] Override http request options.\n */\n replaceNamespacedIngressStatus(name, namespace, body, pretty, dryRun, options = {}) {\n const localVarPath = this.basePath + '/apis/extensions/v1beta1/namespaces/{namespace}/ingresses/{name}/status'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling replaceNamespacedIngressStatus.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling replaceNamespacedIngressStatus.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling replaceNamespacedIngressStatus.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'PUT',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: ObjectSerializer.serialize(body, \"V1beta1Ingress\")\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1beta1Ingress\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * replace the specified NetworkPolicy\n * @param name name of the NetworkPolicy\n * @param namespace object name and auth scope, such as for teams and projects\n * @param body\n * @param pretty If 'true', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param {*} [options] Override http request options.\n */\n replaceNamespacedNetworkPolicy(name, namespace, body, pretty, dryRun, options = {}) {\n const localVarPath = this.basePath + '/apis/extensions/v1beta1/namespaces/{namespace}/networkpolicies/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling replaceNamespacedNetworkPolicy.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling replaceNamespacedNetworkPolicy.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling replaceNamespacedNetworkPolicy.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'PUT',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: ObjectSerializer.serialize(body, \"V1beta1NetworkPolicy\")\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1beta1NetworkPolicy\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * replace the specified ReplicaSet\n * @param name name of the ReplicaSet\n * @param namespace object name and auth scope, such as for teams and projects\n * @param body\n * @param pretty If 'true', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param {*} [options] Override http request options.\n */\n replaceNamespacedReplicaSet(name, namespace, body, pretty, dryRun, options = {}) {\n const localVarPath = this.basePath + '/apis/extensions/v1beta1/namespaces/{namespace}/replicasets/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling replaceNamespacedReplicaSet.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling replaceNamespacedReplicaSet.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling replaceNamespacedReplicaSet.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'PUT',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: ObjectSerializer.serialize(body, \"V1beta1ReplicaSet\")\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1beta1ReplicaSet\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * replace scale of the specified ReplicaSet\n * @param name name of the Scale\n * @param namespace object name and auth scope, such as for teams and projects\n * @param body\n * @param pretty If 'true', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param {*} [options] Override http request options.\n */\n replaceNamespacedReplicaSetScale(name, namespace, body, pretty, dryRun, options = {}) {\n const localVarPath = this.basePath + '/apis/extensions/v1beta1/namespaces/{namespace}/replicasets/{name}/scale'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling replaceNamespacedReplicaSetScale.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling replaceNamespacedReplicaSetScale.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling replaceNamespacedReplicaSetScale.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'PUT',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: ObjectSerializer.serialize(body, \"ExtensionsV1beta1Scale\")\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"ExtensionsV1beta1Scale\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * replace status of the specified ReplicaSet\n * @param name name of the ReplicaSet\n * @param namespace object name and auth scope, such as for teams and projects\n * @param body\n * @param pretty If 'true', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param {*} [options] Override http request options.\n */\n replaceNamespacedReplicaSetStatus(name, namespace, body, pretty, dryRun, options = {}) {\n const localVarPath = this.basePath + '/apis/extensions/v1beta1/namespaces/{namespace}/replicasets/{name}/status'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling replaceNamespacedReplicaSetStatus.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling replaceNamespacedReplicaSetStatus.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling replaceNamespacedReplicaSetStatus.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'PUT',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: ObjectSerializer.serialize(body, \"V1beta1ReplicaSet\")\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1beta1ReplicaSet\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * replace scale of the specified ReplicationControllerDummy\n * @param name name of the Scale\n * @param namespace object name and auth scope, such as for teams and projects\n * @param body\n * @param pretty If 'true', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param {*} [options] Override http request options.\n */\n replaceNamespacedReplicationControllerDummyScale(name, namespace, body, pretty, dryRun, options = {}) {\n const localVarPath = this.basePath + '/apis/extensions/v1beta1/namespaces/{namespace}/replicationcontrollers/{name}/scale'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling replaceNamespacedReplicationControllerDummyScale.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling replaceNamespacedReplicationControllerDummyScale.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling replaceNamespacedReplicationControllerDummyScale.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'PUT',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: ObjectSerializer.serialize(body, \"ExtensionsV1beta1Scale\")\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"ExtensionsV1beta1Scale\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * replace the specified PodSecurityPolicy\n * @param name name of the PodSecurityPolicy\n * @param body\n * @param pretty If 'true', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param {*} [options] Override http request options.\n */\n replacePodSecurityPolicy(name, body, pretty, dryRun, options = {}) {\n const localVarPath = this.basePath + '/apis/extensions/v1beta1/podsecuritypolicies/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling replacePodSecurityPolicy.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling replacePodSecurityPolicy.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'PUT',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: ObjectSerializer.serialize(body, \"ExtensionsV1beta1PodSecurityPolicy\")\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"ExtensionsV1beta1PodSecurityPolicy\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n}\nexports.ExtensionsV1beta1Api = ExtensionsV1beta1Api;\nvar LogsApiApiKeys;\n(function (LogsApiApiKeys) {\n LogsApiApiKeys[LogsApiApiKeys[\"BearerToken\"] = 0] = \"BearerToken\";\n})(LogsApiApiKeys = exports.LogsApiApiKeys || (exports.LogsApiApiKeys = {}));\nclass LogsApi {\n constructor(basePathOrUsername, password, basePath) {\n this._basePath = defaultBasePath;\n this.defaultHeaders = {};\n this._useQuerystring = false;\n this.authentications = {\n 'default': new VoidAuth(),\n 'BearerToken': new ApiKeyAuth('header', 'authorization'),\n };\n if (password) {\n if (basePath) {\n this.basePath = basePath;\n }\n }\n else {\n if (basePathOrUsername) {\n this.basePath = basePathOrUsername;\n }\n }\n }\n set useQuerystring(value) {\n this._useQuerystring = value;\n }\n set basePath(basePath) {\n this._basePath = basePath;\n }\n get basePath() {\n return this._basePath;\n }\n setDefaultAuthentication(auth) {\n this.authentications.default = auth;\n }\n setApiKey(key, value) {\n this.authentications[LogsApiApiKeys[key]].apiKey = value;\n }\n /**\n *\n * @param logpath path to the log\n * @param {*} [options] Override http request options.\n */\n logFileHandler(logpath, options = {}) {\n const localVarPath = this.basePath + '/logs/{logpath}'\n .replace('{' + 'logpath' + '}', encodeURIComponent(String(logpath)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'logpath' is not null or undefined\n if (logpath === null || logpath === undefined) {\n throw new Error('Required parameter logpath was null or undefined when calling logFileHandler.');\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n *\n * @param {*} [options] Override http request options.\n */\n logFileListHandler(options = {}) {\n const localVarPath = this.basePath + '/logs/';\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n}\nexports.LogsApi = LogsApi;\nvar NetworkingApiApiKeys;\n(function (NetworkingApiApiKeys) {\n NetworkingApiApiKeys[NetworkingApiApiKeys[\"BearerToken\"] = 0] = \"BearerToken\";\n})(NetworkingApiApiKeys = exports.NetworkingApiApiKeys || (exports.NetworkingApiApiKeys = {}));\nclass NetworkingApi {\n constructor(basePathOrUsername, password, basePath) {\n this._basePath = defaultBasePath;\n this.defaultHeaders = {};\n this._useQuerystring = false;\n this.authentications = {\n 'default': new VoidAuth(),\n 'BearerToken': new ApiKeyAuth('header', 'authorization'),\n };\n if (password) {\n if (basePath) {\n this.basePath = basePath;\n }\n }\n else {\n if (basePathOrUsername) {\n this.basePath = basePathOrUsername;\n }\n }\n }\n set useQuerystring(value) {\n this._useQuerystring = value;\n }\n set basePath(basePath) {\n this._basePath = basePath;\n }\n get basePath() {\n return this._basePath;\n }\n setDefaultAuthentication(auth) {\n this.authentications.default = auth;\n }\n setApiKey(key, value) {\n this.authentications[NetworkingApiApiKeys[key]].apiKey = value;\n }\n /**\n * get information of a group\n * @param {*} [options] Override http request options.\n */\n getAPIGroup(options = {}) {\n const localVarPath = this.basePath + '/apis/networking.k8s.io/';\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1APIGroup\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n}\nexports.NetworkingApi = NetworkingApi;\nvar NetworkingV1ApiApiKeys;\n(function (NetworkingV1ApiApiKeys) {\n NetworkingV1ApiApiKeys[NetworkingV1ApiApiKeys[\"BearerToken\"] = 0] = \"BearerToken\";\n})(NetworkingV1ApiApiKeys = exports.NetworkingV1ApiApiKeys || (exports.NetworkingV1ApiApiKeys = {}));\nclass NetworkingV1Api {\n constructor(basePathOrUsername, password, basePath) {\n this._basePath = defaultBasePath;\n this.defaultHeaders = {};\n this._useQuerystring = false;\n this.authentications = {\n 'default': new VoidAuth(),\n 'BearerToken': new ApiKeyAuth('header', 'authorization'),\n };\n if (password) {\n if (basePath) {\n this.basePath = basePath;\n }\n }\n else {\n if (basePathOrUsername) {\n this.basePath = basePathOrUsername;\n }\n }\n }\n set useQuerystring(value) {\n this._useQuerystring = value;\n }\n set basePath(basePath) {\n this._basePath = basePath;\n }\n get basePath() {\n return this._basePath;\n }\n setDefaultAuthentication(auth) {\n this.authentications.default = auth;\n }\n setApiKey(key, value) {\n this.authentications[NetworkingV1ApiApiKeys[key]].apiKey = value;\n }\n /**\n * create a NetworkPolicy\n * @param namespace object name and auth scope, such as for teams and projects\n * @param body\n * @param includeUninitialized If true, partially initialized resources are included in the response.\n * @param pretty If 'true', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param {*} [options] Override http request options.\n */\n createNamespacedNetworkPolicy(namespace, body, includeUninitialized, pretty, dryRun, options = {}) {\n const localVarPath = this.basePath + '/apis/networking.k8s.io/v1/namespaces/{namespace}/networkpolicies'\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling createNamespacedNetworkPolicy.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling createNamespacedNetworkPolicy.');\n }\n if (includeUninitialized !== undefined) {\n localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, \"boolean\");\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'POST',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: ObjectSerializer.serialize(body, \"V1NetworkPolicy\")\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1NetworkPolicy\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * delete collection of NetworkPolicy\n * @param namespace object name and auth scope, such as for teams and projects\n * @param includeUninitialized If true, partially initialized resources are included in the response.\n * @param pretty If 'true', then the output is pretty printed.\n * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \\"next key\\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.\n * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything.\n * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything.\n * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.\n * @param resourceVersion When specified with a watch call, shows changes that occur after that particular version of a resource. Defaults to changes from the beginning of history. When specified for list: - if unset, then the result is returned from remote storage based on quorum-read flag; - if it's 0, then we simply return what we currently have in cache, no guarantee; - if set to non zero, then the result is at least as fresh as given rv.\n * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.\n * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.\n * @param {*} [options] Override http request options.\n */\n deleteCollectionNamespacedNetworkPolicy(namespace, includeUninitialized, pretty, _continue, fieldSelector, labelSelector, limit, resourceVersion, timeoutSeconds, watch, options = {}) {\n const localVarPath = this.basePath + '/apis/networking.k8s.io/v1/namespaces/{namespace}/networkpolicies'\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling deleteCollectionNamespacedNetworkPolicy.');\n }\n if (includeUninitialized !== undefined) {\n localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, \"boolean\");\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (_continue !== undefined) {\n localVarQueryParameters['continue'] = ObjectSerializer.serialize(_continue, \"string\");\n }\n if (fieldSelector !== undefined) {\n localVarQueryParameters['fieldSelector'] = ObjectSerializer.serialize(fieldSelector, \"string\");\n }\n if (labelSelector !== undefined) {\n localVarQueryParameters['labelSelector'] = ObjectSerializer.serialize(labelSelector, \"string\");\n }\n if (limit !== undefined) {\n localVarQueryParameters['limit'] = ObjectSerializer.serialize(limit, \"number\");\n }\n if (resourceVersion !== undefined) {\n localVarQueryParameters['resourceVersion'] = ObjectSerializer.serialize(resourceVersion, \"string\");\n }\n if (timeoutSeconds !== undefined) {\n localVarQueryParameters['timeoutSeconds'] = ObjectSerializer.serialize(timeoutSeconds, \"number\");\n }\n if (watch !== undefined) {\n localVarQueryParameters['watch'] = ObjectSerializer.serialize(watch, \"boolean\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'DELETE',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1Status\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * delete a NetworkPolicy\n * @param name name of the NetworkPolicy\n * @param namespace object name and auth scope, such as for teams and projects\n * @param pretty If 'true', then the output is pretty printed.\n * @param body\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param gracePeriodSeconds The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately.\n * @param orphanDependents Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \\"orphan\\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both.\n * @param propagationPolicy Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground.\n * @param {*} [options] Override http request options.\n */\n deleteNamespacedNetworkPolicy(name, namespace, pretty, body, dryRun, gracePeriodSeconds, orphanDependents, propagationPolicy, options = {}) {\n const localVarPath = this.basePath + '/apis/networking.k8s.io/v1/namespaces/{namespace}/networkpolicies/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling deleteNamespacedNetworkPolicy.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling deleteNamespacedNetworkPolicy.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, \"string\");\n }\n if (gracePeriodSeconds !== undefined) {\n localVarQueryParameters['gracePeriodSeconds'] = ObjectSerializer.serialize(gracePeriodSeconds, \"number\");\n }\n if (orphanDependents !== undefined) {\n localVarQueryParameters['orphanDependents'] = ObjectSerializer.serialize(orphanDependents, \"boolean\");\n }\n if (propagationPolicy !== undefined) {\n localVarQueryParameters['propagationPolicy'] = ObjectSerializer.serialize(propagationPolicy, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'DELETE',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: ObjectSerializer.serialize(body, \"V1DeleteOptions\")\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1Status\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * get available resources\n * @param {*} [options] Override http request options.\n */\n getAPIResources(options = {}) {\n const localVarPath = this.basePath + '/apis/networking.k8s.io/v1/';\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1APIResourceList\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * list or watch objects of kind NetworkPolicy\n * @param namespace object name and auth scope, such as for teams and projects\n * @param includeUninitialized If true, partially initialized resources are included in the response.\n * @param pretty If 'true', then the output is pretty printed.\n * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \\"next key\\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.\n * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything.\n * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything.\n * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.\n * @param resourceVersion When specified with a watch call, shows changes that occur after that particular version of a resource. Defaults to changes from the beginning of history. When specified for list: - if unset, then the result is returned from remote storage based on quorum-read flag; - if it's 0, then we simply return what we currently have in cache, no guarantee; - if set to non zero, then the result is at least as fresh as given rv.\n * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.\n * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.\n * @param {*} [options] Override http request options.\n */\n listNamespacedNetworkPolicy(namespace, includeUninitialized, pretty, _continue, fieldSelector, labelSelector, limit, resourceVersion, timeoutSeconds, watch, options = {}) {\n const localVarPath = this.basePath + '/apis/networking.k8s.io/v1/namespaces/{namespace}/networkpolicies'\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling listNamespacedNetworkPolicy.');\n }\n if (includeUninitialized !== undefined) {\n localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, \"boolean\");\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (_continue !== undefined) {\n localVarQueryParameters['continue'] = ObjectSerializer.serialize(_continue, \"string\");\n }\n if (fieldSelector !== undefined) {\n localVarQueryParameters['fieldSelector'] = ObjectSerializer.serialize(fieldSelector, \"string\");\n }\n if (labelSelector !== undefined) {\n localVarQueryParameters['labelSelector'] = ObjectSerializer.serialize(labelSelector, \"string\");\n }\n if (limit !== undefined) {\n localVarQueryParameters['limit'] = ObjectSerializer.serialize(limit, \"number\");\n }\n if (resourceVersion !== undefined) {\n localVarQueryParameters['resourceVersion'] = ObjectSerializer.serialize(resourceVersion, \"string\");\n }\n if (timeoutSeconds !== undefined) {\n localVarQueryParameters['timeoutSeconds'] = ObjectSerializer.serialize(timeoutSeconds, \"number\");\n }\n if (watch !== undefined) {\n localVarQueryParameters['watch'] = ObjectSerializer.serialize(watch, \"boolean\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1NetworkPolicyList\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * list or watch objects of kind NetworkPolicy\n * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \\"next key\\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.\n * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything.\n * @param includeUninitialized If true, partially initialized resources are included in the response.\n * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything.\n * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.\n * @param pretty If 'true', then the output is pretty printed.\n * @param resourceVersion When specified with a watch call, shows changes that occur after that particular version of a resource. Defaults to changes from the beginning of history. When specified for list: - if unset, then the result is returned from remote storage based on quorum-read flag; - if it's 0, then we simply return what we currently have in cache, no guarantee; - if set to non zero, then the result is at least as fresh as given rv.\n * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.\n * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.\n * @param {*} [options] Override http request options.\n */\n listNetworkPolicyForAllNamespaces(_continue, fieldSelector, includeUninitialized, labelSelector, limit, pretty, resourceVersion, timeoutSeconds, watch, options = {}) {\n const localVarPath = this.basePath + '/apis/networking.k8s.io/v1/networkpolicies';\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n if (_continue !== undefined) {\n localVarQueryParameters['continue'] = ObjectSerializer.serialize(_continue, \"string\");\n }\n if (fieldSelector !== undefined) {\n localVarQueryParameters['fieldSelector'] = ObjectSerializer.serialize(fieldSelector, \"string\");\n }\n if (includeUninitialized !== undefined) {\n localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, \"boolean\");\n }\n if (labelSelector !== undefined) {\n localVarQueryParameters['labelSelector'] = ObjectSerializer.serialize(labelSelector, \"string\");\n }\n if (limit !== undefined) {\n localVarQueryParameters['limit'] = ObjectSerializer.serialize(limit, \"number\");\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (resourceVersion !== undefined) {\n localVarQueryParameters['resourceVersion'] = ObjectSerializer.serialize(resourceVersion, \"string\");\n }\n if (timeoutSeconds !== undefined) {\n localVarQueryParameters['timeoutSeconds'] = ObjectSerializer.serialize(timeoutSeconds, \"number\");\n }\n if (watch !== undefined) {\n localVarQueryParameters['watch'] = ObjectSerializer.serialize(watch, \"boolean\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1NetworkPolicyList\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * partially update the specified NetworkPolicy\n * @param name name of the NetworkPolicy\n * @param namespace object name and auth scope, such as for teams and projects\n * @param body\n * @param pretty If 'true', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param {*} [options] Override http request options.\n */\n patchNamespacedNetworkPolicy(name, namespace, body, pretty, dryRun, options = {}) {\n const localVarPath = this.basePath + '/apis/networking.k8s.io/v1/namespaces/{namespace}/networkpolicies/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling patchNamespacedNetworkPolicy.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling patchNamespacedNetworkPolicy.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling patchNamespacedNetworkPolicy.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'PATCH',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: ObjectSerializer.serialize(body, \"any\")\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1NetworkPolicy\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * read the specified NetworkPolicy\n * @param name name of the NetworkPolicy\n * @param namespace object name and auth scope, such as for teams and projects\n * @param pretty If 'true', then the output is pretty printed.\n * @param exact Should the export be exact. Exact export maintains cluster-specific fields like 'Namespace'.\n * @param _export Should this value be exported. Export strips fields that a user can not specify.\n * @param {*} [options] Override http request options.\n */\n readNamespacedNetworkPolicy(name, namespace, pretty, exact, _export, options = {}) {\n const localVarPath = this.basePath + '/apis/networking.k8s.io/v1/namespaces/{namespace}/networkpolicies/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling readNamespacedNetworkPolicy.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling readNamespacedNetworkPolicy.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (exact !== undefined) {\n localVarQueryParameters['exact'] = ObjectSerializer.serialize(exact, \"boolean\");\n }\n if (_export !== undefined) {\n localVarQueryParameters['export'] = ObjectSerializer.serialize(_export, \"boolean\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1NetworkPolicy\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * replace the specified NetworkPolicy\n * @param name name of the NetworkPolicy\n * @param namespace object name and auth scope, such as for teams and projects\n * @param body\n * @param pretty If 'true', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param {*} [options] Override http request options.\n */\n replaceNamespacedNetworkPolicy(name, namespace, body, pretty, dryRun, options = {}) {\n const localVarPath = this.basePath + '/apis/networking.k8s.io/v1/namespaces/{namespace}/networkpolicies/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling replaceNamespacedNetworkPolicy.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling replaceNamespacedNetworkPolicy.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling replaceNamespacedNetworkPolicy.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'PUT',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: ObjectSerializer.serialize(body, \"V1NetworkPolicy\")\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1NetworkPolicy\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n}\nexports.NetworkingV1Api = NetworkingV1Api;\nvar PolicyApiApiKeys;\n(function (PolicyApiApiKeys) {\n PolicyApiApiKeys[PolicyApiApiKeys[\"BearerToken\"] = 0] = \"BearerToken\";\n})(PolicyApiApiKeys = exports.PolicyApiApiKeys || (exports.PolicyApiApiKeys = {}));\nclass PolicyApi {\n constructor(basePathOrUsername, password, basePath) {\n this._basePath = defaultBasePath;\n this.defaultHeaders = {};\n this._useQuerystring = false;\n this.authentications = {\n 'default': new VoidAuth(),\n 'BearerToken': new ApiKeyAuth('header', 'authorization'),\n };\n if (password) {\n if (basePath) {\n this.basePath = basePath;\n }\n }\n else {\n if (basePathOrUsername) {\n this.basePath = basePathOrUsername;\n }\n }\n }\n set useQuerystring(value) {\n this._useQuerystring = value;\n }\n set basePath(basePath) {\n this._basePath = basePath;\n }\n get basePath() {\n return this._basePath;\n }\n setDefaultAuthentication(auth) {\n this.authentications.default = auth;\n }\n setApiKey(key, value) {\n this.authentications[PolicyApiApiKeys[key]].apiKey = value;\n }\n /**\n * get information of a group\n * @param {*} [options] Override http request options.\n */\n getAPIGroup(options = {}) {\n const localVarPath = this.basePath + '/apis/policy/';\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1APIGroup\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n}\nexports.PolicyApi = PolicyApi;\nvar PolicyV1beta1ApiApiKeys;\n(function (PolicyV1beta1ApiApiKeys) {\n PolicyV1beta1ApiApiKeys[PolicyV1beta1ApiApiKeys[\"BearerToken\"] = 0] = \"BearerToken\";\n})(PolicyV1beta1ApiApiKeys = exports.PolicyV1beta1ApiApiKeys || (exports.PolicyV1beta1ApiApiKeys = {}));\nclass PolicyV1beta1Api {\n constructor(basePathOrUsername, password, basePath) {\n this._basePath = defaultBasePath;\n this.defaultHeaders = {};\n this._useQuerystring = false;\n this.authentications = {\n 'default': new VoidAuth(),\n 'BearerToken': new ApiKeyAuth('header', 'authorization'),\n };\n if (password) {\n if (basePath) {\n this.basePath = basePath;\n }\n }\n else {\n if (basePathOrUsername) {\n this.basePath = basePathOrUsername;\n }\n }\n }\n set useQuerystring(value) {\n this._useQuerystring = value;\n }\n set basePath(basePath) {\n this._basePath = basePath;\n }\n get basePath() {\n return this._basePath;\n }\n setDefaultAuthentication(auth) {\n this.authentications.default = auth;\n }\n setApiKey(key, value) {\n this.authentications[PolicyV1beta1ApiApiKeys[key]].apiKey = value;\n }\n /**\n * create a PodDisruptionBudget\n * @param namespace object name and auth scope, such as for teams and projects\n * @param body\n * @param includeUninitialized If true, partially initialized resources are included in the response.\n * @param pretty If 'true', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param {*} [options] Override http request options.\n */\n createNamespacedPodDisruptionBudget(namespace, body, includeUninitialized, pretty, dryRun, options = {}) {\n const localVarPath = this.basePath + '/apis/policy/v1beta1/namespaces/{namespace}/poddisruptionbudgets'\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling createNamespacedPodDisruptionBudget.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling createNamespacedPodDisruptionBudget.');\n }\n if (includeUninitialized !== undefined) {\n localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, \"boolean\");\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'POST',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: ObjectSerializer.serialize(body, \"V1beta1PodDisruptionBudget\")\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1beta1PodDisruptionBudget\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * create a PodSecurityPolicy\n * @param body\n * @param includeUninitialized If true, partially initialized resources are included in the response.\n * @param pretty If 'true', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param {*} [options] Override http request options.\n */\n createPodSecurityPolicy(body, includeUninitialized, pretty, dryRun, options = {}) {\n const localVarPath = this.basePath + '/apis/policy/v1beta1/podsecuritypolicies';\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling createPodSecurityPolicy.');\n }\n if (includeUninitialized !== undefined) {\n localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, \"boolean\");\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'POST',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: ObjectSerializer.serialize(body, \"PolicyV1beta1PodSecurityPolicy\")\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"PolicyV1beta1PodSecurityPolicy\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * delete collection of PodDisruptionBudget\n * @param namespace object name and auth scope, such as for teams and projects\n * @param includeUninitialized If true, partially initialized resources are included in the response.\n * @param pretty If 'true', then the output is pretty printed.\n * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \\"next key\\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.\n * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything.\n * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything.\n * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.\n * @param resourceVersion When specified with a watch call, shows changes that occur after that particular version of a resource. Defaults to changes from the beginning of history. When specified for list: - if unset, then the result is returned from remote storage based on quorum-read flag; - if it's 0, then we simply return what we currently have in cache, no guarantee; - if set to non zero, then the result is at least as fresh as given rv.\n * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.\n * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.\n * @param {*} [options] Override http request options.\n */\n deleteCollectionNamespacedPodDisruptionBudget(namespace, includeUninitialized, pretty, _continue, fieldSelector, labelSelector, limit, resourceVersion, timeoutSeconds, watch, options = {}) {\n const localVarPath = this.basePath + '/apis/policy/v1beta1/namespaces/{namespace}/poddisruptionbudgets'\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling deleteCollectionNamespacedPodDisruptionBudget.');\n }\n if (includeUninitialized !== undefined) {\n localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, \"boolean\");\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (_continue !== undefined) {\n localVarQueryParameters['continue'] = ObjectSerializer.serialize(_continue, \"string\");\n }\n if (fieldSelector !== undefined) {\n localVarQueryParameters['fieldSelector'] = ObjectSerializer.serialize(fieldSelector, \"string\");\n }\n if (labelSelector !== undefined) {\n localVarQueryParameters['labelSelector'] = ObjectSerializer.serialize(labelSelector, \"string\");\n }\n if (limit !== undefined) {\n localVarQueryParameters['limit'] = ObjectSerializer.serialize(limit, \"number\");\n }\n if (resourceVersion !== undefined) {\n localVarQueryParameters['resourceVersion'] = ObjectSerializer.serialize(resourceVersion, \"string\");\n }\n if (timeoutSeconds !== undefined) {\n localVarQueryParameters['timeoutSeconds'] = ObjectSerializer.serialize(timeoutSeconds, \"number\");\n }\n if (watch !== undefined) {\n localVarQueryParameters['watch'] = ObjectSerializer.serialize(watch, \"boolean\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'DELETE',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1Status\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * delete collection of PodSecurityPolicy\n * @param includeUninitialized If true, partially initialized resources are included in the response.\n * @param pretty If 'true', then the output is pretty printed.\n * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \\"next key\\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.\n * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything.\n * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything.\n * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.\n * @param resourceVersion When specified with a watch call, shows changes that occur after that particular version of a resource. Defaults to changes from the beginning of history. When specified for list: - if unset, then the result is returned from remote storage based on quorum-read flag; - if it's 0, then we simply return what we currently have in cache, no guarantee; - if set to non zero, then the result is at least as fresh as given rv.\n * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.\n * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.\n * @param {*} [options] Override http request options.\n */\n deleteCollectionPodSecurityPolicy(includeUninitialized, pretty, _continue, fieldSelector, labelSelector, limit, resourceVersion, timeoutSeconds, watch, options = {}) {\n const localVarPath = this.basePath + '/apis/policy/v1beta1/podsecuritypolicies';\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n if (includeUninitialized !== undefined) {\n localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, \"boolean\");\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (_continue !== undefined) {\n localVarQueryParameters['continue'] = ObjectSerializer.serialize(_continue, \"string\");\n }\n if (fieldSelector !== undefined) {\n localVarQueryParameters['fieldSelector'] = ObjectSerializer.serialize(fieldSelector, \"string\");\n }\n if (labelSelector !== undefined) {\n localVarQueryParameters['labelSelector'] = ObjectSerializer.serialize(labelSelector, \"string\");\n }\n if (limit !== undefined) {\n localVarQueryParameters['limit'] = ObjectSerializer.serialize(limit, \"number\");\n }\n if (resourceVersion !== undefined) {\n localVarQueryParameters['resourceVersion'] = ObjectSerializer.serialize(resourceVersion, \"string\");\n }\n if (timeoutSeconds !== undefined) {\n localVarQueryParameters['timeoutSeconds'] = ObjectSerializer.serialize(timeoutSeconds, \"number\");\n }\n if (watch !== undefined) {\n localVarQueryParameters['watch'] = ObjectSerializer.serialize(watch, \"boolean\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'DELETE',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1Status\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * delete a PodDisruptionBudget\n * @param name name of the PodDisruptionBudget\n * @param namespace object name and auth scope, such as for teams and projects\n * @param pretty If 'true', then the output is pretty printed.\n * @param body\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param gracePeriodSeconds The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately.\n * @param orphanDependents Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \\"orphan\\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both.\n * @param propagationPolicy Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground.\n * @param {*} [options] Override http request options.\n */\n deleteNamespacedPodDisruptionBudget(name, namespace, pretty, body, dryRun, gracePeriodSeconds, orphanDependents, propagationPolicy, options = {}) {\n const localVarPath = this.basePath + '/apis/policy/v1beta1/namespaces/{namespace}/poddisruptionbudgets/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling deleteNamespacedPodDisruptionBudget.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling deleteNamespacedPodDisruptionBudget.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, \"string\");\n }\n if (gracePeriodSeconds !== undefined) {\n localVarQueryParameters['gracePeriodSeconds'] = ObjectSerializer.serialize(gracePeriodSeconds, \"number\");\n }\n if (orphanDependents !== undefined) {\n localVarQueryParameters['orphanDependents'] = ObjectSerializer.serialize(orphanDependents, \"boolean\");\n }\n if (propagationPolicy !== undefined) {\n localVarQueryParameters['propagationPolicy'] = ObjectSerializer.serialize(propagationPolicy, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'DELETE',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: ObjectSerializer.serialize(body, \"V1DeleteOptions\")\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1Status\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * delete a PodSecurityPolicy\n * @param name name of the PodSecurityPolicy\n * @param pretty If 'true', then the output is pretty printed.\n * @param body\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param gracePeriodSeconds The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately.\n * @param orphanDependents Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \\"orphan\\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both.\n * @param propagationPolicy Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground.\n * @param {*} [options] Override http request options.\n */\n deletePodSecurityPolicy(name, pretty, body, dryRun, gracePeriodSeconds, orphanDependents, propagationPolicy, options = {}) {\n const localVarPath = this.basePath + '/apis/policy/v1beta1/podsecuritypolicies/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling deletePodSecurityPolicy.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, \"string\");\n }\n if (gracePeriodSeconds !== undefined) {\n localVarQueryParameters['gracePeriodSeconds'] = ObjectSerializer.serialize(gracePeriodSeconds, \"number\");\n }\n if (orphanDependents !== undefined) {\n localVarQueryParameters['orphanDependents'] = ObjectSerializer.serialize(orphanDependents, \"boolean\");\n }\n if (propagationPolicy !== undefined) {\n localVarQueryParameters['propagationPolicy'] = ObjectSerializer.serialize(propagationPolicy, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'DELETE',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: ObjectSerializer.serialize(body, \"V1DeleteOptions\")\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1Status\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * get available resources\n * @param {*} [options] Override http request options.\n */\n getAPIResources(options = {}) {\n const localVarPath = this.basePath + '/apis/policy/v1beta1/';\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1APIResourceList\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * list or watch objects of kind PodDisruptionBudget\n * @param namespace object name and auth scope, such as for teams and projects\n * @param includeUninitialized If true, partially initialized resources are included in the response.\n * @param pretty If 'true', then the output is pretty printed.\n * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \\"next key\\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.\n * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything.\n * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything.\n * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.\n * @param resourceVersion When specified with a watch call, shows changes that occur after that particular version of a resource. Defaults to changes from the beginning of history. When specified for list: - if unset, then the result is returned from remote storage based on quorum-read flag; - if it's 0, then we simply return what we currently have in cache, no guarantee; - if set to non zero, then the result is at least as fresh as given rv.\n * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.\n * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.\n * @param {*} [options] Override http request options.\n */\n listNamespacedPodDisruptionBudget(namespace, includeUninitialized, pretty, _continue, fieldSelector, labelSelector, limit, resourceVersion, timeoutSeconds, watch, options = {}) {\n const localVarPath = this.basePath + '/apis/policy/v1beta1/namespaces/{namespace}/poddisruptionbudgets'\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling listNamespacedPodDisruptionBudget.');\n }\n if (includeUninitialized !== undefined) {\n localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, \"boolean\");\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (_continue !== undefined) {\n localVarQueryParameters['continue'] = ObjectSerializer.serialize(_continue, \"string\");\n }\n if (fieldSelector !== undefined) {\n localVarQueryParameters['fieldSelector'] = ObjectSerializer.serialize(fieldSelector, \"string\");\n }\n if (labelSelector !== undefined) {\n localVarQueryParameters['labelSelector'] = ObjectSerializer.serialize(labelSelector, \"string\");\n }\n if (limit !== undefined) {\n localVarQueryParameters['limit'] = ObjectSerializer.serialize(limit, \"number\");\n }\n if (resourceVersion !== undefined) {\n localVarQueryParameters['resourceVersion'] = ObjectSerializer.serialize(resourceVersion, \"string\");\n }\n if (timeoutSeconds !== undefined) {\n localVarQueryParameters['timeoutSeconds'] = ObjectSerializer.serialize(timeoutSeconds, \"number\");\n }\n if (watch !== undefined) {\n localVarQueryParameters['watch'] = ObjectSerializer.serialize(watch, \"boolean\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1beta1PodDisruptionBudgetList\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * list or watch objects of kind PodDisruptionBudget\n * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \\"next key\\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.\n * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything.\n * @param includeUninitialized If true, partially initialized resources are included in the response.\n * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything.\n * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.\n * @param pretty If 'true', then the output is pretty printed.\n * @param resourceVersion When specified with a watch call, shows changes that occur after that particular version of a resource. Defaults to changes from the beginning of history. When specified for list: - if unset, then the result is returned from remote storage based on quorum-read flag; - if it's 0, then we simply return what we currently have in cache, no guarantee; - if set to non zero, then the result is at least as fresh as given rv.\n * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.\n * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.\n * @param {*} [options] Override http request options.\n */\n listPodDisruptionBudgetForAllNamespaces(_continue, fieldSelector, includeUninitialized, labelSelector, limit, pretty, resourceVersion, timeoutSeconds, watch, options = {}) {\n const localVarPath = this.basePath + '/apis/policy/v1beta1/poddisruptionbudgets';\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n if (_continue !== undefined) {\n localVarQueryParameters['continue'] = ObjectSerializer.serialize(_continue, \"string\");\n }\n if (fieldSelector !== undefined) {\n localVarQueryParameters['fieldSelector'] = ObjectSerializer.serialize(fieldSelector, \"string\");\n }\n if (includeUninitialized !== undefined) {\n localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, \"boolean\");\n }\n if (labelSelector !== undefined) {\n localVarQueryParameters['labelSelector'] = ObjectSerializer.serialize(labelSelector, \"string\");\n }\n if (limit !== undefined) {\n localVarQueryParameters['limit'] = ObjectSerializer.serialize(limit, \"number\");\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (resourceVersion !== undefined) {\n localVarQueryParameters['resourceVersion'] = ObjectSerializer.serialize(resourceVersion, \"string\");\n }\n if (timeoutSeconds !== undefined) {\n localVarQueryParameters['timeoutSeconds'] = ObjectSerializer.serialize(timeoutSeconds, \"number\");\n }\n if (watch !== undefined) {\n localVarQueryParameters['watch'] = ObjectSerializer.serialize(watch, \"boolean\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1beta1PodDisruptionBudgetList\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * list or watch objects of kind PodSecurityPolicy\n * @param includeUninitialized If true, partially initialized resources are included in the response.\n * @param pretty If 'true', then the output is pretty printed.\n * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \\"next key\\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.\n * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything.\n * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything.\n * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.\n * @param resourceVersion When specified with a watch call, shows changes that occur after that particular version of a resource. Defaults to changes from the beginning of history. When specified for list: - if unset, then the result is returned from remote storage based on quorum-read flag; - if it's 0, then we simply return what we currently have in cache, no guarantee; - if set to non zero, then the result is at least as fresh as given rv.\n * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.\n * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.\n * @param {*} [options] Override http request options.\n */\n listPodSecurityPolicy(includeUninitialized, pretty, _continue, fieldSelector, labelSelector, limit, resourceVersion, timeoutSeconds, watch, options = {}) {\n const localVarPath = this.basePath + '/apis/policy/v1beta1/podsecuritypolicies';\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n if (includeUninitialized !== undefined) {\n localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, \"boolean\");\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (_continue !== undefined) {\n localVarQueryParameters['continue'] = ObjectSerializer.serialize(_continue, \"string\");\n }\n if (fieldSelector !== undefined) {\n localVarQueryParameters['fieldSelector'] = ObjectSerializer.serialize(fieldSelector, \"string\");\n }\n if (labelSelector !== undefined) {\n localVarQueryParameters['labelSelector'] = ObjectSerializer.serialize(labelSelector, \"string\");\n }\n if (limit !== undefined) {\n localVarQueryParameters['limit'] = ObjectSerializer.serialize(limit, \"number\");\n }\n if (resourceVersion !== undefined) {\n localVarQueryParameters['resourceVersion'] = ObjectSerializer.serialize(resourceVersion, \"string\");\n }\n if (timeoutSeconds !== undefined) {\n localVarQueryParameters['timeoutSeconds'] = ObjectSerializer.serialize(timeoutSeconds, \"number\");\n }\n if (watch !== undefined) {\n localVarQueryParameters['watch'] = ObjectSerializer.serialize(watch, \"boolean\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"PolicyV1beta1PodSecurityPolicyList\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * partially update the specified PodDisruptionBudget\n * @param name name of the PodDisruptionBudget\n * @param namespace object name and auth scope, such as for teams and projects\n * @param body\n * @param pretty If 'true', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param {*} [options] Override http request options.\n */\n patchNamespacedPodDisruptionBudget(name, namespace, body, pretty, dryRun, options = {}) {\n const localVarPath = this.basePath + '/apis/policy/v1beta1/namespaces/{namespace}/poddisruptionbudgets/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling patchNamespacedPodDisruptionBudget.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling patchNamespacedPodDisruptionBudget.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling patchNamespacedPodDisruptionBudget.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'PATCH',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: ObjectSerializer.serialize(body, \"any\")\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1beta1PodDisruptionBudget\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * partially update status of the specified PodDisruptionBudget\n * @param name name of the PodDisruptionBudget\n * @param namespace object name and auth scope, such as for teams and projects\n * @param body\n * @param pretty If 'true', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param {*} [options] Override http request options.\n */\n patchNamespacedPodDisruptionBudgetStatus(name, namespace, body, pretty, dryRun, options = {}) {\n const localVarPath = this.basePath + '/apis/policy/v1beta1/namespaces/{namespace}/poddisruptionbudgets/{name}/status'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling patchNamespacedPodDisruptionBudgetStatus.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling patchNamespacedPodDisruptionBudgetStatus.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling patchNamespacedPodDisruptionBudgetStatus.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'PATCH',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: ObjectSerializer.serialize(body, \"any\")\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1beta1PodDisruptionBudget\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * partially update the specified PodSecurityPolicy\n * @param name name of the PodSecurityPolicy\n * @param body\n * @param pretty If 'true', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param {*} [options] Override http request options.\n */\n patchPodSecurityPolicy(name, body, pretty, dryRun, options = {}) {\n const localVarPath = this.basePath + '/apis/policy/v1beta1/podsecuritypolicies/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling patchPodSecurityPolicy.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling patchPodSecurityPolicy.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'PATCH',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: ObjectSerializer.serialize(body, \"any\")\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"PolicyV1beta1PodSecurityPolicy\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * read the specified PodDisruptionBudget\n * @param name name of the PodDisruptionBudget\n * @param namespace object name and auth scope, such as for teams and projects\n * @param pretty If 'true', then the output is pretty printed.\n * @param exact Should the export be exact. Exact export maintains cluster-specific fields like 'Namespace'.\n * @param _export Should this value be exported. Export strips fields that a user can not specify.\n * @param {*} [options] Override http request options.\n */\n readNamespacedPodDisruptionBudget(name, namespace, pretty, exact, _export, options = {}) {\n const localVarPath = this.basePath + '/apis/policy/v1beta1/namespaces/{namespace}/poddisruptionbudgets/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling readNamespacedPodDisruptionBudget.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling readNamespacedPodDisruptionBudget.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (exact !== undefined) {\n localVarQueryParameters['exact'] = ObjectSerializer.serialize(exact, \"boolean\");\n }\n if (_export !== undefined) {\n localVarQueryParameters['export'] = ObjectSerializer.serialize(_export, \"boolean\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1beta1PodDisruptionBudget\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * read status of the specified PodDisruptionBudget\n * @param name name of the PodDisruptionBudget\n * @param namespace object name and auth scope, such as for teams and projects\n * @param pretty If 'true', then the output is pretty printed.\n * @param {*} [options] Override http request options.\n */\n readNamespacedPodDisruptionBudgetStatus(name, namespace, pretty, options = {}) {\n const localVarPath = this.basePath + '/apis/policy/v1beta1/namespaces/{namespace}/poddisruptionbudgets/{name}/status'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling readNamespacedPodDisruptionBudgetStatus.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling readNamespacedPodDisruptionBudgetStatus.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1beta1PodDisruptionBudget\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * read the specified PodSecurityPolicy\n * @param name name of the PodSecurityPolicy\n * @param pretty If 'true', then the output is pretty printed.\n * @param exact Should the export be exact. Exact export maintains cluster-specific fields like 'Namespace'.\n * @param _export Should this value be exported. Export strips fields that a user can not specify.\n * @param {*} [options] Override http request options.\n */\n readPodSecurityPolicy(name, pretty, exact, _export, options = {}) {\n const localVarPath = this.basePath + '/apis/policy/v1beta1/podsecuritypolicies/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling readPodSecurityPolicy.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (exact !== undefined) {\n localVarQueryParameters['exact'] = ObjectSerializer.serialize(exact, \"boolean\");\n }\n if (_export !== undefined) {\n localVarQueryParameters['export'] = ObjectSerializer.serialize(_export, \"boolean\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"PolicyV1beta1PodSecurityPolicy\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * replace the specified PodDisruptionBudget\n * @param name name of the PodDisruptionBudget\n * @param namespace object name and auth scope, such as for teams and projects\n * @param body\n * @param pretty If 'true', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param {*} [options] Override http request options.\n */\n replaceNamespacedPodDisruptionBudget(name, namespace, body, pretty, dryRun, options = {}) {\n const localVarPath = this.basePath + '/apis/policy/v1beta1/namespaces/{namespace}/poddisruptionbudgets/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling replaceNamespacedPodDisruptionBudget.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling replaceNamespacedPodDisruptionBudget.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling replaceNamespacedPodDisruptionBudget.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'PUT',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: ObjectSerializer.serialize(body, \"V1beta1PodDisruptionBudget\")\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1beta1PodDisruptionBudget\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * replace status of the specified PodDisruptionBudget\n * @param name name of the PodDisruptionBudget\n * @param namespace object name and auth scope, such as for teams and projects\n * @param body\n * @param pretty If 'true', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param {*} [options] Override http request options.\n */\n replaceNamespacedPodDisruptionBudgetStatus(name, namespace, body, pretty, dryRun, options = {}) {\n const localVarPath = this.basePath + '/apis/policy/v1beta1/namespaces/{namespace}/poddisruptionbudgets/{name}/status'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling replaceNamespacedPodDisruptionBudgetStatus.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling replaceNamespacedPodDisruptionBudgetStatus.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling replaceNamespacedPodDisruptionBudgetStatus.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'PUT',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: ObjectSerializer.serialize(body, \"V1beta1PodDisruptionBudget\")\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1beta1PodDisruptionBudget\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * replace the specified PodSecurityPolicy\n * @param name name of the PodSecurityPolicy\n * @param body\n * @param pretty If 'true', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param {*} [options] Override http request options.\n */\n replacePodSecurityPolicy(name, body, pretty, dryRun, options = {}) {\n const localVarPath = this.basePath + '/apis/policy/v1beta1/podsecuritypolicies/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling replacePodSecurityPolicy.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling replacePodSecurityPolicy.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'PUT',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: ObjectSerializer.serialize(body, \"PolicyV1beta1PodSecurityPolicy\")\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"PolicyV1beta1PodSecurityPolicy\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n}\nexports.PolicyV1beta1Api = PolicyV1beta1Api;\nvar RbacAuthorizationApiApiKeys;\n(function (RbacAuthorizationApiApiKeys) {\n RbacAuthorizationApiApiKeys[RbacAuthorizationApiApiKeys[\"BearerToken\"] = 0] = \"BearerToken\";\n})(RbacAuthorizationApiApiKeys = exports.RbacAuthorizationApiApiKeys || (exports.RbacAuthorizationApiApiKeys = {}));\nclass RbacAuthorizationApi {\n constructor(basePathOrUsername, password, basePath) {\n this._basePath = defaultBasePath;\n this.defaultHeaders = {};\n this._useQuerystring = false;\n this.authentications = {\n 'default': new VoidAuth(),\n 'BearerToken': new ApiKeyAuth('header', 'authorization'),\n };\n if (password) {\n if (basePath) {\n this.basePath = basePath;\n }\n }\n else {\n if (basePathOrUsername) {\n this.basePath = basePathOrUsername;\n }\n }\n }\n set useQuerystring(value) {\n this._useQuerystring = value;\n }\n set basePath(basePath) {\n this._basePath = basePath;\n }\n get basePath() {\n return this._basePath;\n }\n setDefaultAuthentication(auth) {\n this.authentications.default = auth;\n }\n setApiKey(key, value) {\n this.authentications[RbacAuthorizationApiApiKeys[key]].apiKey = value;\n }\n /**\n * get information of a group\n * @param {*} [options] Override http request options.\n */\n getAPIGroup(options = {}) {\n const localVarPath = this.basePath + '/apis/rbac.authorization.k8s.io/';\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1APIGroup\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n}\nexports.RbacAuthorizationApi = RbacAuthorizationApi;\nvar RbacAuthorizationV1ApiApiKeys;\n(function (RbacAuthorizationV1ApiApiKeys) {\n RbacAuthorizationV1ApiApiKeys[RbacAuthorizationV1ApiApiKeys[\"BearerToken\"] = 0] = \"BearerToken\";\n})(RbacAuthorizationV1ApiApiKeys = exports.RbacAuthorizationV1ApiApiKeys || (exports.RbacAuthorizationV1ApiApiKeys = {}));\nclass RbacAuthorizationV1Api {\n constructor(basePathOrUsername, password, basePath) {\n this._basePath = defaultBasePath;\n this.defaultHeaders = {};\n this._useQuerystring = false;\n this.authentications = {\n 'default': new VoidAuth(),\n 'BearerToken': new ApiKeyAuth('header', 'authorization'),\n };\n if (password) {\n if (basePath) {\n this.basePath = basePath;\n }\n }\n else {\n if (basePathOrUsername) {\n this.basePath = basePathOrUsername;\n }\n }\n }\n set useQuerystring(value) {\n this._useQuerystring = value;\n }\n set basePath(basePath) {\n this._basePath = basePath;\n }\n get basePath() {\n return this._basePath;\n }\n setDefaultAuthentication(auth) {\n this.authentications.default = auth;\n }\n setApiKey(key, value) {\n this.authentications[RbacAuthorizationV1ApiApiKeys[key]].apiKey = value;\n }\n /**\n * create a ClusterRole\n * @param body\n * @param includeUninitialized If true, partially initialized resources are included in the response.\n * @param pretty If 'true', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param {*} [options] Override http request options.\n */\n createClusterRole(body, includeUninitialized, pretty, dryRun, options = {}) {\n const localVarPath = this.basePath + '/apis/rbac.authorization.k8s.io/v1/clusterroles';\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling createClusterRole.');\n }\n if (includeUninitialized !== undefined) {\n localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, \"boolean\");\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'POST',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: ObjectSerializer.serialize(body, \"V1ClusterRole\")\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1ClusterRole\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * create a ClusterRoleBinding\n * @param body\n * @param includeUninitialized If true, partially initialized resources are included in the response.\n * @param pretty If 'true', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param {*} [options] Override http request options.\n */\n createClusterRoleBinding(body, includeUninitialized, pretty, dryRun, options = {}) {\n const localVarPath = this.basePath + '/apis/rbac.authorization.k8s.io/v1/clusterrolebindings';\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling createClusterRoleBinding.');\n }\n if (includeUninitialized !== undefined) {\n localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, \"boolean\");\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'POST',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: ObjectSerializer.serialize(body, \"V1ClusterRoleBinding\")\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1ClusterRoleBinding\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * create a Role\n * @param namespace object name and auth scope, such as for teams and projects\n * @param body\n * @param includeUninitialized If true, partially initialized resources are included in the response.\n * @param pretty If 'true', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param {*} [options] Override http request options.\n */\n createNamespacedRole(namespace, body, includeUninitialized, pretty, dryRun, options = {}) {\n const localVarPath = this.basePath + '/apis/rbac.authorization.k8s.io/v1/namespaces/{namespace}/roles'\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling createNamespacedRole.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling createNamespacedRole.');\n }\n if (includeUninitialized !== undefined) {\n localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, \"boolean\");\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'POST',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: ObjectSerializer.serialize(body, \"V1Role\")\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1Role\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * create a RoleBinding\n * @param namespace object name and auth scope, such as for teams and projects\n * @param body\n * @param includeUninitialized If true, partially initialized resources are included in the response.\n * @param pretty If 'true', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param {*} [options] Override http request options.\n */\n createNamespacedRoleBinding(namespace, body, includeUninitialized, pretty, dryRun, options = {}) {\n const localVarPath = this.basePath + '/apis/rbac.authorization.k8s.io/v1/namespaces/{namespace}/rolebindings'\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling createNamespacedRoleBinding.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling createNamespacedRoleBinding.');\n }\n if (includeUninitialized !== undefined) {\n localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, \"boolean\");\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'POST',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: ObjectSerializer.serialize(body, \"V1RoleBinding\")\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1RoleBinding\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * delete a ClusterRole\n * @param name name of the ClusterRole\n * @param pretty If 'true', then the output is pretty printed.\n * @param body\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param gracePeriodSeconds The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately.\n * @param orphanDependents Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \\"orphan\\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both.\n * @param propagationPolicy Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground.\n * @param {*} [options] Override http request options.\n */\n deleteClusterRole(name, pretty, body, dryRun, gracePeriodSeconds, orphanDependents, propagationPolicy, options = {}) {\n const localVarPath = this.basePath + '/apis/rbac.authorization.k8s.io/v1/clusterroles/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling deleteClusterRole.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, \"string\");\n }\n if (gracePeriodSeconds !== undefined) {\n localVarQueryParameters['gracePeriodSeconds'] = ObjectSerializer.serialize(gracePeriodSeconds, \"number\");\n }\n if (orphanDependents !== undefined) {\n localVarQueryParameters['orphanDependents'] = ObjectSerializer.serialize(orphanDependents, \"boolean\");\n }\n if (propagationPolicy !== undefined) {\n localVarQueryParameters['propagationPolicy'] = ObjectSerializer.serialize(propagationPolicy, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'DELETE',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: ObjectSerializer.serialize(body, \"V1DeleteOptions\")\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1Status\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * delete a ClusterRoleBinding\n * @param name name of the ClusterRoleBinding\n * @param pretty If 'true', then the output is pretty printed.\n * @param body\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param gracePeriodSeconds The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately.\n * @param orphanDependents Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \\"orphan\\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both.\n * @param propagationPolicy Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground.\n * @param {*} [options] Override http request options.\n */\n deleteClusterRoleBinding(name, pretty, body, dryRun, gracePeriodSeconds, orphanDependents, propagationPolicy, options = {}) {\n const localVarPath = this.basePath + '/apis/rbac.authorization.k8s.io/v1/clusterrolebindings/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling deleteClusterRoleBinding.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, \"string\");\n }\n if (gracePeriodSeconds !== undefined) {\n localVarQueryParameters['gracePeriodSeconds'] = ObjectSerializer.serialize(gracePeriodSeconds, \"number\");\n }\n if (orphanDependents !== undefined) {\n localVarQueryParameters['orphanDependents'] = ObjectSerializer.serialize(orphanDependents, \"boolean\");\n }\n if (propagationPolicy !== undefined) {\n localVarQueryParameters['propagationPolicy'] = ObjectSerializer.serialize(propagationPolicy, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'DELETE',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: ObjectSerializer.serialize(body, \"V1DeleteOptions\")\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1Status\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * delete collection of ClusterRole\n * @param includeUninitialized If true, partially initialized resources are included in the response.\n * @param pretty If 'true', then the output is pretty printed.\n * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \\"next key\\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.\n * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything.\n * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything.\n * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.\n * @param resourceVersion When specified with a watch call, shows changes that occur after that particular version of a resource. Defaults to changes from the beginning of history. When specified for list: - if unset, then the result is returned from remote storage based on quorum-read flag; - if it's 0, then we simply return what we currently have in cache, no guarantee; - if set to non zero, then the result is at least as fresh as given rv.\n * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.\n * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.\n * @param {*} [options] Override http request options.\n */\n deleteCollectionClusterRole(includeUninitialized, pretty, _continue, fieldSelector, labelSelector, limit, resourceVersion, timeoutSeconds, watch, options = {}) {\n const localVarPath = this.basePath + '/apis/rbac.authorization.k8s.io/v1/clusterroles';\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n if (includeUninitialized !== undefined) {\n localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, \"boolean\");\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (_continue !== undefined) {\n localVarQueryParameters['continue'] = ObjectSerializer.serialize(_continue, \"string\");\n }\n if (fieldSelector !== undefined) {\n localVarQueryParameters['fieldSelector'] = ObjectSerializer.serialize(fieldSelector, \"string\");\n }\n if (labelSelector !== undefined) {\n localVarQueryParameters['labelSelector'] = ObjectSerializer.serialize(labelSelector, \"string\");\n }\n if (limit !== undefined) {\n localVarQueryParameters['limit'] = ObjectSerializer.serialize(limit, \"number\");\n }\n if (resourceVersion !== undefined) {\n localVarQueryParameters['resourceVersion'] = ObjectSerializer.serialize(resourceVersion, \"string\");\n }\n if (timeoutSeconds !== undefined) {\n localVarQueryParameters['timeoutSeconds'] = ObjectSerializer.serialize(timeoutSeconds, \"number\");\n }\n if (watch !== undefined) {\n localVarQueryParameters['watch'] = ObjectSerializer.serialize(watch, \"boolean\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'DELETE',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1Status\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * delete collection of ClusterRoleBinding\n * @param includeUninitialized If true, partially initialized resources are included in the response.\n * @param pretty If 'true', then the output is pretty printed.\n * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \\"next key\\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.\n * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything.\n * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything.\n * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.\n * @param resourceVersion When specified with a watch call, shows changes that occur after that particular version of a resource. Defaults to changes from the beginning of history. When specified for list: - if unset, then the result is returned from remote storage based on quorum-read flag; - if it's 0, then we simply return what we currently have in cache, no guarantee; - if set to non zero, then the result is at least as fresh as given rv.\n * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.\n * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.\n * @param {*} [options] Override http request options.\n */\n deleteCollectionClusterRoleBinding(includeUninitialized, pretty, _continue, fieldSelector, labelSelector, limit, resourceVersion, timeoutSeconds, watch, options = {}) {\n const localVarPath = this.basePath + '/apis/rbac.authorization.k8s.io/v1/clusterrolebindings';\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n if (includeUninitialized !== undefined) {\n localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, \"boolean\");\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (_continue !== undefined) {\n localVarQueryParameters['continue'] = ObjectSerializer.serialize(_continue, \"string\");\n }\n if (fieldSelector !== undefined) {\n localVarQueryParameters['fieldSelector'] = ObjectSerializer.serialize(fieldSelector, \"string\");\n }\n if (labelSelector !== undefined) {\n localVarQueryParameters['labelSelector'] = ObjectSerializer.serialize(labelSelector, \"string\");\n }\n if (limit !== undefined) {\n localVarQueryParameters['limit'] = ObjectSerializer.serialize(limit, \"number\");\n }\n if (resourceVersion !== undefined) {\n localVarQueryParameters['resourceVersion'] = ObjectSerializer.serialize(resourceVersion, \"string\");\n }\n if (timeoutSeconds !== undefined) {\n localVarQueryParameters['timeoutSeconds'] = ObjectSerializer.serialize(timeoutSeconds, \"number\");\n }\n if (watch !== undefined) {\n localVarQueryParameters['watch'] = ObjectSerializer.serialize(watch, \"boolean\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'DELETE',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1Status\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * delete collection of Role\n * @param namespace object name and auth scope, such as for teams and projects\n * @param includeUninitialized If true, partially initialized resources are included in the response.\n * @param pretty If 'true', then the output is pretty printed.\n * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \\"next key\\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.\n * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything.\n * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything.\n * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.\n * @param resourceVersion When specified with a watch call, shows changes that occur after that particular version of a resource. Defaults to changes from the beginning of history. When specified for list: - if unset, then the result is returned from remote storage based on quorum-read flag; - if it's 0, then we simply return what we currently have in cache, no guarantee; - if set to non zero, then the result is at least as fresh as given rv.\n * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.\n * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.\n * @param {*} [options] Override http request options.\n */\n deleteCollectionNamespacedRole(namespace, includeUninitialized, pretty, _continue, fieldSelector, labelSelector, limit, resourceVersion, timeoutSeconds, watch, options = {}) {\n const localVarPath = this.basePath + '/apis/rbac.authorization.k8s.io/v1/namespaces/{namespace}/roles'\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling deleteCollectionNamespacedRole.');\n }\n if (includeUninitialized !== undefined) {\n localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, \"boolean\");\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (_continue !== undefined) {\n localVarQueryParameters['continue'] = ObjectSerializer.serialize(_continue, \"string\");\n }\n if (fieldSelector !== undefined) {\n localVarQueryParameters['fieldSelector'] = ObjectSerializer.serialize(fieldSelector, \"string\");\n }\n if (labelSelector !== undefined) {\n localVarQueryParameters['labelSelector'] = ObjectSerializer.serialize(labelSelector, \"string\");\n }\n if (limit !== undefined) {\n localVarQueryParameters['limit'] = ObjectSerializer.serialize(limit, \"number\");\n }\n if (resourceVersion !== undefined) {\n localVarQueryParameters['resourceVersion'] = ObjectSerializer.serialize(resourceVersion, \"string\");\n }\n if (timeoutSeconds !== undefined) {\n localVarQueryParameters['timeoutSeconds'] = ObjectSerializer.serialize(timeoutSeconds, \"number\");\n }\n if (watch !== undefined) {\n localVarQueryParameters['watch'] = ObjectSerializer.serialize(watch, \"boolean\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'DELETE',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1Status\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * delete collection of RoleBinding\n * @param namespace object name and auth scope, such as for teams and projects\n * @param includeUninitialized If true, partially initialized resources are included in the response.\n * @param pretty If 'true', then the output is pretty printed.\n * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \\"next key\\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.\n * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything.\n * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything.\n * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.\n * @param resourceVersion When specified with a watch call, shows changes that occur after that particular version of a resource. Defaults to changes from the beginning of history. When specified for list: - if unset, then the result is returned from remote storage based on quorum-read flag; - if it's 0, then we simply return what we currently have in cache, no guarantee; - if set to non zero, then the result is at least as fresh as given rv.\n * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.\n * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.\n * @param {*} [options] Override http request options.\n */\n deleteCollectionNamespacedRoleBinding(namespace, includeUninitialized, pretty, _continue, fieldSelector, labelSelector, limit, resourceVersion, timeoutSeconds, watch, options = {}) {\n const localVarPath = this.basePath + '/apis/rbac.authorization.k8s.io/v1/namespaces/{namespace}/rolebindings'\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling deleteCollectionNamespacedRoleBinding.');\n }\n if (includeUninitialized !== undefined) {\n localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, \"boolean\");\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (_continue !== undefined) {\n localVarQueryParameters['continue'] = ObjectSerializer.serialize(_continue, \"string\");\n }\n if (fieldSelector !== undefined) {\n localVarQueryParameters['fieldSelector'] = ObjectSerializer.serialize(fieldSelector, \"string\");\n }\n if (labelSelector !== undefined) {\n localVarQueryParameters['labelSelector'] = ObjectSerializer.serialize(labelSelector, \"string\");\n }\n if (limit !== undefined) {\n localVarQueryParameters['limit'] = ObjectSerializer.serialize(limit, \"number\");\n }\n if (resourceVersion !== undefined) {\n localVarQueryParameters['resourceVersion'] = ObjectSerializer.serialize(resourceVersion, \"string\");\n }\n if (timeoutSeconds !== undefined) {\n localVarQueryParameters['timeoutSeconds'] = ObjectSerializer.serialize(timeoutSeconds, \"number\");\n }\n if (watch !== undefined) {\n localVarQueryParameters['watch'] = ObjectSerializer.serialize(watch, \"boolean\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'DELETE',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1Status\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * delete a Role\n * @param name name of the Role\n * @param namespace object name and auth scope, such as for teams and projects\n * @param pretty If 'true', then the output is pretty printed.\n * @param body\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param gracePeriodSeconds The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately.\n * @param orphanDependents Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \\"orphan\\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both.\n * @param propagationPolicy Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground.\n * @param {*} [options] Override http request options.\n */\n deleteNamespacedRole(name, namespace, pretty, body, dryRun, gracePeriodSeconds, orphanDependents, propagationPolicy, options = {}) {\n const localVarPath = this.basePath + '/apis/rbac.authorization.k8s.io/v1/namespaces/{namespace}/roles/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling deleteNamespacedRole.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling deleteNamespacedRole.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, \"string\");\n }\n if (gracePeriodSeconds !== undefined) {\n localVarQueryParameters['gracePeriodSeconds'] = ObjectSerializer.serialize(gracePeriodSeconds, \"number\");\n }\n if (orphanDependents !== undefined) {\n localVarQueryParameters['orphanDependents'] = ObjectSerializer.serialize(orphanDependents, \"boolean\");\n }\n if (propagationPolicy !== undefined) {\n localVarQueryParameters['propagationPolicy'] = ObjectSerializer.serialize(propagationPolicy, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'DELETE',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: ObjectSerializer.serialize(body, \"V1DeleteOptions\")\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1Status\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * delete a RoleBinding\n * @param name name of the RoleBinding\n * @param namespace object name and auth scope, such as for teams and projects\n * @param pretty If 'true', then the output is pretty printed.\n * @param body\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param gracePeriodSeconds The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately.\n * @param orphanDependents Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \\"orphan\\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both.\n * @param propagationPolicy Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground.\n * @param {*} [options] Override http request options.\n */\n deleteNamespacedRoleBinding(name, namespace, pretty, body, dryRun, gracePeriodSeconds, orphanDependents, propagationPolicy, options = {}) {\n const localVarPath = this.basePath + '/apis/rbac.authorization.k8s.io/v1/namespaces/{namespace}/rolebindings/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling deleteNamespacedRoleBinding.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling deleteNamespacedRoleBinding.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, \"string\");\n }\n if (gracePeriodSeconds !== undefined) {\n localVarQueryParameters['gracePeriodSeconds'] = ObjectSerializer.serialize(gracePeriodSeconds, \"number\");\n }\n if (orphanDependents !== undefined) {\n localVarQueryParameters['orphanDependents'] = ObjectSerializer.serialize(orphanDependents, \"boolean\");\n }\n if (propagationPolicy !== undefined) {\n localVarQueryParameters['propagationPolicy'] = ObjectSerializer.serialize(propagationPolicy, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'DELETE',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: ObjectSerializer.serialize(body, \"V1DeleteOptions\")\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1Status\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * get available resources\n * @param {*} [options] Override http request options.\n */\n getAPIResources(options = {}) {\n const localVarPath = this.basePath + '/apis/rbac.authorization.k8s.io/v1/';\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1APIResourceList\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * list or watch objects of kind ClusterRole\n * @param includeUninitialized If true, partially initialized resources are included in the response.\n * @param pretty If 'true', then the output is pretty printed.\n * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \\"next key\\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.\n * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything.\n * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything.\n * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.\n * @param resourceVersion When specified with a watch call, shows changes that occur after that particular version of a resource. Defaults to changes from the beginning of history. When specified for list: - if unset, then the result is returned from remote storage based on quorum-read flag; - if it's 0, then we simply return what we currently have in cache, no guarantee; - if set to non zero, then the result is at least as fresh as given rv.\n * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.\n * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.\n * @param {*} [options] Override http request options.\n */\n listClusterRole(includeUninitialized, pretty, _continue, fieldSelector, labelSelector, limit, resourceVersion, timeoutSeconds, watch, options = {}) {\n const localVarPath = this.basePath + '/apis/rbac.authorization.k8s.io/v1/clusterroles';\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n if (includeUninitialized !== undefined) {\n localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, \"boolean\");\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (_continue !== undefined) {\n localVarQueryParameters['continue'] = ObjectSerializer.serialize(_continue, \"string\");\n }\n if (fieldSelector !== undefined) {\n localVarQueryParameters['fieldSelector'] = ObjectSerializer.serialize(fieldSelector, \"string\");\n }\n if (labelSelector !== undefined) {\n localVarQueryParameters['labelSelector'] = ObjectSerializer.serialize(labelSelector, \"string\");\n }\n if (limit !== undefined) {\n localVarQueryParameters['limit'] = ObjectSerializer.serialize(limit, \"number\");\n }\n if (resourceVersion !== undefined) {\n localVarQueryParameters['resourceVersion'] = ObjectSerializer.serialize(resourceVersion, \"string\");\n }\n if (timeoutSeconds !== undefined) {\n localVarQueryParameters['timeoutSeconds'] = ObjectSerializer.serialize(timeoutSeconds, \"number\");\n }\n if (watch !== undefined) {\n localVarQueryParameters['watch'] = ObjectSerializer.serialize(watch, \"boolean\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1ClusterRoleList\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * list or watch objects of kind ClusterRoleBinding\n * @param includeUninitialized If true, partially initialized resources are included in the response.\n * @param pretty If 'true', then the output is pretty printed.\n * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \\"next key\\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.\n * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything.\n * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything.\n * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.\n * @param resourceVersion When specified with a watch call, shows changes that occur after that particular version of a resource. Defaults to changes from the beginning of history. When specified for list: - if unset, then the result is returned from remote storage based on quorum-read flag; - if it's 0, then we simply return what we currently have in cache, no guarantee; - if set to non zero, then the result is at least as fresh as given rv.\n * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.\n * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.\n * @param {*} [options] Override http request options.\n */\n listClusterRoleBinding(includeUninitialized, pretty, _continue, fieldSelector, labelSelector, limit, resourceVersion, timeoutSeconds, watch, options = {}) {\n const localVarPath = this.basePath + '/apis/rbac.authorization.k8s.io/v1/clusterrolebindings';\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n if (includeUninitialized !== undefined) {\n localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, \"boolean\");\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (_continue !== undefined) {\n localVarQueryParameters['continue'] = ObjectSerializer.serialize(_continue, \"string\");\n }\n if (fieldSelector !== undefined) {\n localVarQueryParameters['fieldSelector'] = ObjectSerializer.serialize(fieldSelector, \"string\");\n }\n if (labelSelector !== undefined) {\n localVarQueryParameters['labelSelector'] = ObjectSerializer.serialize(labelSelector, \"string\");\n }\n if (limit !== undefined) {\n localVarQueryParameters['limit'] = ObjectSerializer.serialize(limit, \"number\");\n }\n if (resourceVersion !== undefined) {\n localVarQueryParameters['resourceVersion'] = ObjectSerializer.serialize(resourceVersion, \"string\");\n }\n if (timeoutSeconds !== undefined) {\n localVarQueryParameters['timeoutSeconds'] = ObjectSerializer.serialize(timeoutSeconds, \"number\");\n }\n if (watch !== undefined) {\n localVarQueryParameters['watch'] = ObjectSerializer.serialize(watch, \"boolean\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1ClusterRoleBindingList\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * list or watch objects of kind Role\n * @param namespace object name and auth scope, such as for teams and projects\n * @param includeUninitialized If true, partially initialized resources are included in the response.\n * @param pretty If 'true', then the output is pretty printed.\n * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \\"next key\\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.\n * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything.\n * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything.\n * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.\n * @param resourceVersion When specified with a watch call, shows changes that occur after that particular version of a resource. Defaults to changes from the beginning of history. When specified for list: - if unset, then the result is returned from remote storage based on quorum-read flag; - if it's 0, then we simply return what we currently have in cache, no guarantee; - if set to non zero, then the result is at least as fresh as given rv.\n * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.\n * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.\n * @param {*} [options] Override http request options.\n */\n listNamespacedRole(namespace, includeUninitialized, pretty, _continue, fieldSelector, labelSelector, limit, resourceVersion, timeoutSeconds, watch, options = {}) {\n const localVarPath = this.basePath + '/apis/rbac.authorization.k8s.io/v1/namespaces/{namespace}/roles'\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling listNamespacedRole.');\n }\n if (includeUninitialized !== undefined) {\n localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, \"boolean\");\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (_continue !== undefined) {\n localVarQueryParameters['continue'] = ObjectSerializer.serialize(_continue, \"string\");\n }\n if (fieldSelector !== undefined) {\n localVarQueryParameters['fieldSelector'] = ObjectSerializer.serialize(fieldSelector, \"string\");\n }\n if (labelSelector !== undefined) {\n localVarQueryParameters['labelSelector'] = ObjectSerializer.serialize(labelSelector, \"string\");\n }\n if (limit !== undefined) {\n localVarQueryParameters['limit'] = ObjectSerializer.serialize(limit, \"number\");\n }\n if (resourceVersion !== undefined) {\n localVarQueryParameters['resourceVersion'] = ObjectSerializer.serialize(resourceVersion, \"string\");\n }\n if (timeoutSeconds !== undefined) {\n localVarQueryParameters['timeoutSeconds'] = ObjectSerializer.serialize(timeoutSeconds, \"number\");\n }\n if (watch !== undefined) {\n localVarQueryParameters['watch'] = ObjectSerializer.serialize(watch, \"boolean\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1RoleList\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * list or watch objects of kind RoleBinding\n * @param namespace object name and auth scope, such as for teams and projects\n * @param includeUninitialized If true, partially initialized resources are included in the response.\n * @param pretty If 'true', then the output is pretty printed.\n * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \\"next key\\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.\n * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything.\n * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything.\n * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.\n * @param resourceVersion When specified with a watch call, shows changes that occur after that particular version of a resource. Defaults to changes from the beginning of history. When specified for list: - if unset, then the result is returned from remote storage based on quorum-read flag; - if it's 0, then we simply return what we currently have in cache, no guarantee; - if set to non zero, then the result is at least as fresh as given rv.\n * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.\n * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.\n * @param {*} [options] Override http request options.\n */\n listNamespacedRoleBinding(namespace, includeUninitialized, pretty, _continue, fieldSelector, labelSelector, limit, resourceVersion, timeoutSeconds, watch, options = {}) {\n const localVarPath = this.basePath + '/apis/rbac.authorization.k8s.io/v1/namespaces/{namespace}/rolebindings'\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling listNamespacedRoleBinding.');\n }\n if (includeUninitialized !== undefined) {\n localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, \"boolean\");\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (_continue !== undefined) {\n localVarQueryParameters['continue'] = ObjectSerializer.serialize(_continue, \"string\");\n }\n if (fieldSelector !== undefined) {\n localVarQueryParameters['fieldSelector'] = ObjectSerializer.serialize(fieldSelector, \"string\");\n }\n if (labelSelector !== undefined) {\n localVarQueryParameters['labelSelector'] = ObjectSerializer.serialize(labelSelector, \"string\");\n }\n if (limit !== undefined) {\n localVarQueryParameters['limit'] = ObjectSerializer.serialize(limit, \"number\");\n }\n if (resourceVersion !== undefined) {\n localVarQueryParameters['resourceVersion'] = ObjectSerializer.serialize(resourceVersion, \"string\");\n }\n if (timeoutSeconds !== undefined) {\n localVarQueryParameters['timeoutSeconds'] = ObjectSerializer.serialize(timeoutSeconds, \"number\");\n }\n if (watch !== undefined) {\n localVarQueryParameters['watch'] = ObjectSerializer.serialize(watch, \"boolean\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1RoleBindingList\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * list or watch objects of kind RoleBinding\n * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \\"next key\\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.\n * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything.\n * @param includeUninitialized If true, partially initialized resources are included in the response.\n * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything.\n * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.\n * @param pretty If 'true', then the output is pretty printed.\n * @param resourceVersion When specified with a watch call, shows changes that occur after that particular version of a resource. Defaults to changes from the beginning of history. When specified for list: - if unset, then the result is returned from remote storage based on quorum-read flag; - if it's 0, then we simply return what we currently have in cache, no guarantee; - if set to non zero, then the result is at least as fresh as given rv.\n * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.\n * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.\n * @param {*} [options] Override http request options.\n */\n listRoleBindingForAllNamespaces(_continue, fieldSelector, includeUninitialized, labelSelector, limit, pretty, resourceVersion, timeoutSeconds, watch, options = {}) {\n const localVarPath = this.basePath + '/apis/rbac.authorization.k8s.io/v1/rolebindings';\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n if (_continue !== undefined) {\n localVarQueryParameters['continue'] = ObjectSerializer.serialize(_continue, \"string\");\n }\n if (fieldSelector !== undefined) {\n localVarQueryParameters['fieldSelector'] = ObjectSerializer.serialize(fieldSelector, \"string\");\n }\n if (includeUninitialized !== undefined) {\n localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, \"boolean\");\n }\n if (labelSelector !== undefined) {\n localVarQueryParameters['labelSelector'] = ObjectSerializer.serialize(labelSelector, \"string\");\n }\n if (limit !== undefined) {\n localVarQueryParameters['limit'] = ObjectSerializer.serialize(limit, \"number\");\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (resourceVersion !== undefined) {\n localVarQueryParameters['resourceVersion'] = ObjectSerializer.serialize(resourceVersion, \"string\");\n }\n if (timeoutSeconds !== undefined) {\n localVarQueryParameters['timeoutSeconds'] = ObjectSerializer.serialize(timeoutSeconds, \"number\");\n }\n if (watch !== undefined) {\n localVarQueryParameters['watch'] = ObjectSerializer.serialize(watch, \"boolean\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1RoleBindingList\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * list or watch objects of kind Role\n * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \\"next key\\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.\n * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything.\n * @param includeUninitialized If true, partially initialized resources are included in the response.\n * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything.\n * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.\n * @param pretty If 'true', then the output is pretty printed.\n * @param resourceVersion When specified with a watch call, shows changes that occur after that particular version of a resource. Defaults to changes from the beginning of history. When specified for list: - if unset, then the result is returned from remote storage based on quorum-read flag; - if it's 0, then we simply return what we currently have in cache, no guarantee; - if set to non zero, then the result is at least as fresh as given rv.\n * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.\n * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.\n * @param {*} [options] Override http request options.\n */\n listRoleForAllNamespaces(_continue, fieldSelector, includeUninitialized, labelSelector, limit, pretty, resourceVersion, timeoutSeconds, watch, options = {}) {\n const localVarPath = this.basePath + '/apis/rbac.authorization.k8s.io/v1/roles';\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n if (_continue !== undefined) {\n localVarQueryParameters['continue'] = ObjectSerializer.serialize(_continue, \"string\");\n }\n if (fieldSelector !== undefined) {\n localVarQueryParameters['fieldSelector'] = ObjectSerializer.serialize(fieldSelector, \"string\");\n }\n if (includeUninitialized !== undefined) {\n localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, \"boolean\");\n }\n if (labelSelector !== undefined) {\n localVarQueryParameters['labelSelector'] = ObjectSerializer.serialize(labelSelector, \"string\");\n }\n if (limit !== undefined) {\n localVarQueryParameters['limit'] = ObjectSerializer.serialize(limit, \"number\");\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (resourceVersion !== undefined) {\n localVarQueryParameters['resourceVersion'] = ObjectSerializer.serialize(resourceVersion, \"string\");\n }\n if (timeoutSeconds !== undefined) {\n localVarQueryParameters['timeoutSeconds'] = ObjectSerializer.serialize(timeoutSeconds, \"number\");\n }\n if (watch !== undefined) {\n localVarQueryParameters['watch'] = ObjectSerializer.serialize(watch, \"boolean\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1RoleList\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * partially update the specified ClusterRole\n * @param name name of the ClusterRole\n * @param body\n * @param pretty If 'true', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param {*} [options] Override http request options.\n */\n patchClusterRole(name, body, pretty, dryRun, options = {}) {\n const localVarPath = this.basePath + '/apis/rbac.authorization.k8s.io/v1/clusterroles/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling patchClusterRole.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling patchClusterRole.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'PATCH',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: ObjectSerializer.serialize(body, \"any\")\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1ClusterRole\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * partially update the specified ClusterRoleBinding\n * @param name name of the ClusterRoleBinding\n * @param body\n * @param pretty If 'true', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param {*} [options] Override http request options.\n */\n patchClusterRoleBinding(name, body, pretty, dryRun, options = {}) {\n const localVarPath = this.basePath + '/apis/rbac.authorization.k8s.io/v1/clusterrolebindings/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling patchClusterRoleBinding.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling patchClusterRoleBinding.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'PATCH',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: ObjectSerializer.serialize(body, \"any\")\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1ClusterRoleBinding\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * partially update the specified Role\n * @param name name of the Role\n * @param namespace object name and auth scope, such as for teams and projects\n * @param body\n * @param pretty If 'true', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param {*} [options] Override http request options.\n */\n patchNamespacedRole(name, namespace, body, pretty, dryRun, options = {}) {\n const localVarPath = this.basePath + '/apis/rbac.authorization.k8s.io/v1/namespaces/{namespace}/roles/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling patchNamespacedRole.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling patchNamespacedRole.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling patchNamespacedRole.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'PATCH',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: ObjectSerializer.serialize(body, \"any\")\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1Role\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * partially update the specified RoleBinding\n * @param name name of the RoleBinding\n * @param namespace object name and auth scope, such as for teams and projects\n * @param body\n * @param pretty If 'true', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param {*} [options] Override http request options.\n */\n patchNamespacedRoleBinding(name, namespace, body, pretty, dryRun, options = {}) {\n const localVarPath = this.basePath + '/apis/rbac.authorization.k8s.io/v1/namespaces/{namespace}/rolebindings/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling patchNamespacedRoleBinding.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling patchNamespacedRoleBinding.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling patchNamespacedRoleBinding.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'PATCH',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: ObjectSerializer.serialize(body, \"any\")\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1RoleBinding\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * read the specified ClusterRole\n * @param name name of the ClusterRole\n * @param pretty If 'true', then the output is pretty printed.\n * @param {*} [options] Override http request options.\n */\n readClusterRole(name, pretty, options = {}) {\n const localVarPath = this.basePath + '/apis/rbac.authorization.k8s.io/v1/clusterroles/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling readClusterRole.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1ClusterRole\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * read the specified ClusterRoleBinding\n * @param name name of the ClusterRoleBinding\n * @param pretty If 'true', then the output is pretty printed.\n * @param {*} [options] Override http request options.\n */\n readClusterRoleBinding(name, pretty, options = {}) {\n const localVarPath = this.basePath + '/apis/rbac.authorization.k8s.io/v1/clusterrolebindings/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling readClusterRoleBinding.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1ClusterRoleBinding\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * read the specified Role\n * @param name name of the Role\n * @param namespace object name and auth scope, such as for teams and projects\n * @param pretty If 'true', then the output is pretty printed.\n * @param {*} [options] Override http request options.\n */\n readNamespacedRole(name, namespace, pretty, options = {}) {\n const localVarPath = this.basePath + '/apis/rbac.authorization.k8s.io/v1/namespaces/{namespace}/roles/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling readNamespacedRole.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling readNamespacedRole.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1Role\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * read the specified RoleBinding\n * @param name name of the RoleBinding\n * @param namespace object name and auth scope, such as for teams and projects\n * @param pretty If 'true', then the output is pretty printed.\n * @param {*} [options] Override http request options.\n */\n readNamespacedRoleBinding(name, namespace, pretty, options = {}) {\n const localVarPath = this.basePath + '/apis/rbac.authorization.k8s.io/v1/namespaces/{namespace}/rolebindings/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling readNamespacedRoleBinding.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling readNamespacedRoleBinding.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1RoleBinding\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * replace the specified ClusterRole\n * @param name name of the ClusterRole\n * @param body\n * @param pretty If 'true', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param {*} [options] Override http request options.\n */\n replaceClusterRole(name, body, pretty, dryRun, options = {}) {\n const localVarPath = this.basePath + '/apis/rbac.authorization.k8s.io/v1/clusterroles/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling replaceClusterRole.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling replaceClusterRole.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'PUT',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: ObjectSerializer.serialize(body, \"V1ClusterRole\")\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1ClusterRole\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * replace the specified ClusterRoleBinding\n * @param name name of the ClusterRoleBinding\n * @param body\n * @param pretty If 'true', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param {*} [options] Override http request options.\n */\n replaceClusterRoleBinding(name, body, pretty, dryRun, options = {}) {\n const localVarPath = this.basePath + '/apis/rbac.authorization.k8s.io/v1/clusterrolebindings/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling replaceClusterRoleBinding.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling replaceClusterRoleBinding.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'PUT',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: ObjectSerializer.serialize(body, \"V1ClusterRoleBinding\")\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1ClusterRoleBinding\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * replace the specified Role\n * @param name name of the Role\n * @param namespace object name and auth scope, such as for teams and projects\n * @param body\n * @param pretty If 'true', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param {*} [options] Override http request options.\n */\n replaceNamespacedRole(name, namespace, body, pretty, dryRun, options = {}) {\n const localVarPath = this.basePath + '/apis/rbac.authorization.k8s.io/v1/namespaces/{namespace}/roles/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling replaceNamespacedRole.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling replaceNamespacedRole.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling replaceNamespacedRole.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'PUT',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: ObjectSerializer.serialize(body, \"V1Role\")\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1Role\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * replace the specified RoleBinding\n * @param name name of the RoleBinding\n * @param namespace object name and auth scope, such as for teams and projects\n * @param body\n * @param pretty If 'true', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param {*} [options] Override http request options.\n */\n replaceNamespacedRoleBinding(name, namespace, body, pretty, dryRun, options = {}) {\n const localVarPath = this.basePath + '/apis/rbac.authorization.k8s.io/v1/namespaces/{namespace}/rolebindings/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling replaceNamespacedRoleBinding.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling replaceNamespacedRoleBinding.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling replaceNamespacedRoleBinding.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'PUT',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: ObjectSerializer.serialize(body, \"V1RoleBinding\")\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1RoleBinding\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n}\nexports.RbacAuthorizationV1Api = RbacAuthorizationV1Api;\nvar RbacAuthorizationV1alpha1ApiApiKeys;\n(function (RbacAuthorizationV1alpha1ApiApiKeys) {\n RbacAuthorizationV1alpha1ApiApiKeys[RbacAuthorizationV1alpha1ApiApiKeys[\"BearerToken\"] = 0] = \"BearerToken\";\n})(RbacAuthorizationV1alpha1ApiApiKeys = exports.RbacAuthorizationV1alpha1ApiApiKeys || (exports.RbacAuthorizationV1alpha1ApiApiKeys = {}));\nclass RbacAuthorizationV1alpha1Api {\n constructor(basePathOrUsername, password, basePath) {\n this._basePath = defaultBasePath;\n this.defaultHeaders = {};\n this._useQuerystring = false;\n this.authentications = {\n 'default': new VoidAuth(),\n 'BearerToken': new ApiKeyAuth('header', 'authorization'),\n };\n if (password) {\n if (basePath) {\n this.basePath = basePath;\n }\n }\n else {\n if (basePathOrUsername) {\n this.basePath = basePathOrUsername;\n }\n }\n }\n set useQuerystring(value) {\n this._useQuerystring = value;\n }\n set basePath(basePath) {\n this._basePath = basePath;\n }\n get basePath() {\n return this._basePath;\n }\n setDefaultAuthentication(auth) {\n this.authentications.default = auth;\n }\n setApiKey(key, value) {\n this.authentications[RbacAuthorizationV1alpha1ApiApiKeys[key]].apiKey = value;\n }\n /**\n * create a ClusterRole\n * @param body\n * @param includeUninitialized If true, partially initialized resources are included in the response.\n * @param pretty If 'true', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param {*} [options] Override http request options.\n */\n createClusterRole(body, includeUninitialized, pretty, dryRun, options = {}) {\n const localVarPath = this.basePath + '/apis/rbac.authorization.k8s.io/v1alpha1/clusterroles';\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling createClusterRole.');\n }\n if (includeUninitialized !== undefined) {\n localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, \"boolean\");\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'POST',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: ObjectSerializer.serialize(body, \"V1alpha1ClusterRole\")\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1alpha1ClusterRole\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * create a ClusterRoleBinding\n * @param body\n * @param includeUninitialized If true, partially initialized resources are included in the response.\n * @param pretty If 'true', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param {*} [options] Override http request options.\n */\n createClusterRoleBinding(body, includeUninitialized, pretty, dryRun, options = {}) {\n const localVarPath = this.basePath + '/apis/rbac.authorization.k8s.io/v1alpha1/clusterrolebindings';\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling createClusterRoleBinding.');\n }\n if (includeUninitialized !== undefined) {\n localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, \"boolean\");\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'POST',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: ObjectSerializer.serialize(body, \"V1alpha1ClusterRoleBinding\")\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1alpha1ClusterRoleBinding\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * create a Role\n * @param namespace object name and auth scope, such as for teams and projects\n * @param body\n * @param includeUninitialized If true, partially initialized resources are included in the response.\n * @param pretty If 'true', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param {*} [options] Override http request options.\n */\n createNamespacedRole(namespace, body, includeUninitialized, pretty, dryRun, options = {}) {\n const localVarPath = this.basePath + '/apis/rbac.authorization.k8s.io/v1alpha1/namespaces/{namespace}/roles'\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling createNamespacedRole.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling createNamespacedRole.');\n }\n if (includeUninitialized !== undefined) {\n localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, \"boolean\");\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'POST',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: ObjectSerializer.serialize(body, \"V1alpha1Role\")\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1alpha1Role\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * create a RoleBinding\n * @param namespace object name and auth scope, such as for teams and projects\n * @param body\n * @param includeUninitialized If true, partially initialized resources are included in the response.\n * @param pretty If 'true', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param {*} [options] Override http request options.\n */\n createNamespacedRoleBinding(namespace, body, includeUninitialized, pretty, dryRun, options = {}) {\n const localVarPath = this.basePath + '/apis/rbac.authorization.k8s.io/v1alpha1/namespaces/{namespace}/rolebindings'\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling createNamespacedRoleBinding.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling createNamespacedRoleBinding.');\n }\n if (includeUninitialized !== undefined) {\n localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, \"boolean\");\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'POST',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: ObjectSerializer.serialize(body, \"V1alpha1RoleBinding\")\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1alpha1RoleBinding\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * delete a ClusterRole\n * @param name name of the ClusterRole\n * @param pretty If 'true', then the output is pretty printed.\n * @param body\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param gracePeriodSeconds The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately.\n * @param orphanDependents Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \\"orphan\\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both.\n * @param propagationPolicy Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground.\n * @param {*} [options] Override http request options.\n */\n deleteClusterRole(name, pretty, body, dryRun, gracePeriodSeconds, orphanDependents, propagationPolicy, options = {}) {\n const localVarPath = this.basePath + '/apis/rbac.authorization.k8s.io/v1alpha1/clusterroles/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling deleteClusterRole.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, \"string\");\n }\n if (gracePeriodSeconds !== undefined) {\n localVarQueryParameters['gracePeriodSeconds'] = ObjectSerializer.serialize(gracePeriodSeconds, \"number\");\n }\n if (orphanDependents !== undefined) {\n localVarQueryParameters['orphanDependents'] = ObjectSerializer.serialize(orphanDependents, \"boolean\");\n }\n if (propagationPolicy !== undefined) {\n localVarQueryParameters['propagationPolicy'] = ObjectSerializer.serialize(propagationPolicy, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'DELETE',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: ObjectSerializer.serialize(body, \"V1DeleteOptions\")\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1Status\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * delete a ClusterRoleBinding\n * @param name name of the ClusterRoleBinding\n * @param pretty If 'true', then the output is pretty printed.\n * @param body\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param gracePeriodSeconds The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately.\n * @param orphanDependents Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \\"orphan\\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both.\n * @param propagationPolicy Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground.\n * @param {*} [options] Override http request options.\n */\n deleteClusterRoleBinding(name, pretty, body, dryRun, gracePeriodSeconds, orphanDependents, propagationPolicy, options = {}) {\n const localVarPath = this.basePath + '/apis/rbac.authorization.k8s.io/v1alpha1/clusterrolebindings/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling deleteClusterRoleBinding.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, \"string\");\n }\n if (gracePeriodSeconds !== undefined) {\n localVarQueryParameters['gracePeriodSeconds'] = ObjectSerializer.serialize(gracePeriodSeconds, \"number\");\n }\n if (orphanDependents !== undefined) {\n localVarQueryParameters['orphanDependents'] = ObjectSerializer.serialize(orphanDependents, \"boolean\");\n }\n if (propagationPolicy !== undefined) {\n localVarQueryParameters['propagationPolicy'] = ObjectSerializer.serialize(propagationPolicy, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'DELETE',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: ObjectSerializer.serialize(body, \"V1DeleteOptions\")\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1Status\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * delete collection of ClusterRole\n * @param includeUninitialized If true, partially initialized resources are included in the response.\n * @param pretty If 'true', then the output is pretty printed.\n * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \\"next key\\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.\n * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything.\n * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything.\n * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.\n * @param resourceVersion When specified with a watch call, shows changes that occur after that particular version of a resource. Defaults to changes from the beginning of history. When specified for list: - if unset, then the result is returned from remote storage based on quorum-read flag; - if it's 0, then we simply return what we currently have in cache, no guarantee; - if set to non zero, then the result is at least as fresh as given rv.\n * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.\n * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.\n * @param {*} [options] Override http request options.\n */\n deleteCollectionClusterRole(includeUninitialized, pretty, _continue, fieldSelector, labelSelector, limit, resourceVersion, timeoutSeconds, watch, options = {}) {\n const localVarPath = this.basePath + '/apis/rbac.authorization.k8s.io/v1alpha1/clusterroles';\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n if (includeUninitialized !== undefined) {\n localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, \"boolean\");\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (_continue !== undefined) {\n localVarQueryParameters['continue'] = ObjectSerializer.serialize(_continue, \"string\");\n }\n if (fieldSelector !== undefined) {\n localVarQueryParameters['fieldSelector'] = ObjectSerializer.serialize(fieldSelector, \"string\");\n }\n if (labelSelector !== undefined) {\n localVarQueryParameters['labelSelector'] = ObjectSerializer.serialize(labelSelector, \"string\");\n }\n if (limit !== undefined) {\n localVarQueryParameters['limit'] = ObjectSerializer.serialize(limit, \"number\");\n }\n if (resourceVersion !== undefined) {\n localVarQueryParameters['resourceVersion'] = ObjectSerializer.serialize(resourceVersion, \"string\");\n }\n if (timeoutSeconds !== undefined) {\n localVarQueryParameters['timeoutSeconds'] = ObjectSerializer.serialize(timeoutSeconds, \"number\");\n }\n if (watch !== undefined) {\n localVarQueryParameters['watch'] = ObjectSerializer.serialize(watch, \"boolean\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'DELETE',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1Status\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * delete collection of ClusterRoleBinding\n * @param includeUninitialized If true, partially initialized resources are included in the response.\n * @param pretty If 'true', then the output is pretty printed.\n * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \\"next key\\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.\n * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything.\n * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything.\n * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.\n * @param resourceVersion When specified with a watch call, shows changes that occur after that particular version of a resource. Defaults to changes from the beginning of history. When specified for list: - if unset, then the result is returned from remote storage based on quorum-read flag; - if it's 0, then we simply return what we currently have in cache, no guarantee; - if set to non zero, then the result is at least as fresh as given rv.\n * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.\n * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.\n * @param {*} [options] Override http request options.\n */\n deleteCollectionClusterRoleBinding(includeUninitialized, pretty, _continue, fieldSelector, labelSelector, limit, resourceVersion, timeoutSeconds, watch, options = {}) {\n const localVarPath = this.basePath + '/apis/rbac.authorization.k8s.io/v1alpha1/clusterrolebindings';\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n if (includeUninitialized !== undefined) {\n localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, \"boolean\");\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (_continue !== undefined) {\n localVarQueryParameters['continue'] = ObjectSerializer.serialize(_continue, \"string\");\n }\n if (fieldSelector !== undefined) {\n localVarQueryParameters['fieldSelector'] = ObjectSerializer.serialize(fieldSelector, \"string\");\n }\n if (labelSelector !== undefined) {\n localVarQueryParameters['labelSelector'] = ObjectSerializer.serialize(labelSelector, \"string\");\n }\n if (limit !== undefined) {\n localVarQueryParameters['limit'] = ObjectSerializer.serialize(limit, \"number\");\n }\n if (resourceVersion !== undefined) {\n localVarQueryParameters['resourceVersion'] = ObjectSerializer.serialize(resourceVersion, \"string\");\n }\n if (timeoutSeconds !== undefined) {\n localVarQueryParameters['timeoutSeconds'] = ObjectSerializer.serialize(timeoutSeconds, \"number\");\n }\n if (watch !== undefined) {\n localVarQueryParameters['watch'] = ObjectSerializer.serialize(watch, \"boolean\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'DELETE',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1Status\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * delete collection of Role\n * @param namespace object name and auth scope, such as for teams and projects\n * @param includeUninitialized If true, partially initialized resources are included in the response.\n * @param pretty If 'true', then the output is pretty printed.\n * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \\"next key\\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.\n * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything.\n * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything.\n * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.\n * @param resourceVersion When specified with a watch call, shows changes that occur after that particular version of a resource. Defaults to changes from the beginning of history. When specified for list: - if unset, then the result is returned from remote storage based on quorum-read flag; - if it's 0, then we simply return what we currently have in cache, no guarantee; - if set to non zero, then the result is at least as fresh as given rv.\n * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.\n * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.\n * @param {*} [options] Override http request options.\n */\n deleteCollectionNamespacedRole(namespace, includeUninitialized, pretty, _continue, fieldSelector, labelSelector, limit, resourceVersion, timeoutSeconds, watch, options = {}) {\n const localVarPath = this.basePath + '/apis/rbac.authorization.k8s.io/v1alpha1/namespaces/{namespace}/roles'\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling deleteCollectionNamespacedRole.');\n }\n if (includeUninitialized !== undefined) {\n localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, \"boolean\");\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (_continue !== undefined) {\n localVarQueryParameters['continue'] = ObjectSerializer.serialize(_continue, \"string\");\n }\n if (fieldSelector !== undefined) {\n localVarQueryParameters['fieldSelector'] = ObjectSerializer.serialize(fieldSelector, \"string\");\n }\n if (labelSelector !== undefined) {\n localVarQueryParameters['labelSelector'] = ObjectSerializer.serialize(labelSelector, \"string\");\n }\n if (limit !== undefined) {\n localVarQueryParameters['limit'] = ObjectSerializer.serialize(limit, \"number\");\n }\n if (resourceVersion !== undefined) {\n localVarQueryParameters['resourceVersion'] = ObjectSerializer.serialize(resourceVersion, \"string\");\n }\n if (timeoutSeconds !== undefined) {\n localVarQueryParameters['timeoutSeconds'] = ObjectSerializer.serialize(timeoutSeconds, \"number\");\n }\n if (watch !== undefined) {\n localVarQueryParameters['watch'] = ObjectSerializer.serialize(watch, \"boolean\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'DELETE',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1Status\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * delete collection of RoleBinding\n * @param namespace object name and auth scope, such as for teams and projects\n * @param includeUninitialized If true, partially initialized resources are included in the response.\n * @param pretty If 'true', then the output is pretty printed.\n * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \\"next key\\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.\n * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything.\n * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything.\n * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.\n * @param resourceVersion When specified with a watch call, shows changes that occur after that particular version of a resource. Defaults to changes from the beginning of history. When specified for list: - if unset, then the result is returned from remote storage based on quorum-read flag; - if it's 0, then we simply return what we currently have in cache, no guarantee; - if set to non zero, then the result is at least as fresh as given rv.\n * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.\n * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.\n * @param {*} [options] Override http request options.\n */\n deleteCollectionNamespacedRoleBinding(namespace, includeUninitialized, pretty, _continue, fieldSelector, labelSelector, limit, resourceVersion, timeoutSeconds, watch, options = {}) {\n const localVarPath = this.basePath + '/apis/rbac.authorization.k8s.io/v1alpha1/namespaces/{namespace}/rolebindings'\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling deleteCollectionNamespacedRoleBinding.');\n }\n if (includeUninitialized !== undefined) {\n localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, \"boolean\");\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (_continue !== undefined) {\n localVarQueryParameters['continue'] = ObjectSerializer.serialize(_continue, \"string\");\n }\n if (fieldSelector !== undefined) {\n localVarQueryParameters['fieldSelector'] = ObjectSerializer.serialize(fieldSelector, \"string\");\n }\n if (labelSelector !== undefined) {\n localVarQueryParameters['labelSelector'] = ObjectSerializer.serialize(labelSelector, \"string\");\n }\n if (limit !== undefined) {\n localVarQueryParameters['limit'] = ObjectSerializer.serialize(limit, \"number\");\n }\n if (resourceVersion !== undefined) {\n localVarQueryParameters['resourceVersion'] = ObjectSerializer.serialize(resourceVersion, \"string\");\n }\n if (timeoutSeconds !== undefined) {\n localVarQueryParameters['timeoutSeconds'] = ObjectSerializer.serialize(timeoutSeconds, \"number\");\n }\n if (watch !== undefined) {\n localVarQueryParameters['watch'] = ObjectSerializer.serialize(watch, \"boolean\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'DELETE',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1Status\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * delete a Role\n * @param name name of the Role\n * @param namespace object name and auth scope, such as for teams and projects\n * @param pretty If 'true', then the output is pretty printed.\n * @param body\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param gracePeriodSeconds The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately.\n * @param orphanDependents Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \\"orphan\\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both.\n * @param propagationPolicy Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground.\n * @param {*} [options] Override http request options.\n */\n deleteNamespacedRole(name, namespace, pretty, body, dryRun, gracePeriodSeconds, orphanDependents, propagationPolicy, options = {}) {\n const localVarPath = this.basePath + '/apis/rbac.authorization.k8s.io/v1alpha1/namespaces/{namespace}/roles/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling deleteNamespacedRole.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling deleteNamespacedRole.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, \"string\");\n }\n if (gracePeriodSeconds !== undefined) {\n localVarQueryParameters['gracePeriodSeconds'] = ObjectSerializer.serialize(gracePeriodSeconds, \"number\");\n }\n if (orphanDependents !== undefined) {\n localVarQueryParameters['orphanDependents'] = ObjectSerializer.serialize(orphanDependents, \"boolean\");\n }\n if (propagationPolicy !== undefined) {\n localVarQueryParameters['propagationPolicy'] = ObjectSerializer.serialize(propagationPolicy, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'DELETE',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: ObjectSerializer.serialize(body, \"V1DeleteOptions\")\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1Status\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * delete a RoleBinding\n * @param name name of the RoleBinding\n * @param namespace object name and auth scope, such as for teams and projects\n * @param pretty If 'true', then the output is pretty printed.\n * @param body\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param gracePeriodSeconds The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately.\n * @param orphanDependents Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \\"orphan\\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both.\n * @param propagationPolicy Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground.\n * @param {*} [options] Override http request options.\n */\n deleteNamespacedRoleBinding(name, namespace, pretty, body, dryRun, gracePeriodSeconds, orphanDependents, propagationPolicy, options = {}) {\n const localVarPath = this.basePath + '/apis/rbac.authorization.k8s.io/v1alpha1/namespaces/{namespace}/rolebindings/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling deleteNamespacedRoleBinding.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling deleteNamespacedRoleBinding.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, \"string\");\n }\n if (gracePeriodSeconds !== undefined) {\n localVarQueryParameters['gracePeriodSeconds'] = ObjectSerializer.serialize(gracePeriodSeconds, \"number\");\n }\n if (orphanDependents !== undefined) {\n localVarQueryParameters['orphanDependents'] = ObjectSerializer.serialize(orphanDependents, \"boolean\");\n }\n if (propagationPolicy !== undefined) {\n localVarQueryParameters['propagationPolicy'] = ObjectSerializer.serialize(propagationPolicy, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'DELETE',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: ObjectSerializer.serialize(body, \"V1DeleteOptions\")\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1Status\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * get available resources\n * @param {*} [options] Override http request options.\n */\n getAPIResources(options = {}) {\n const localVarPath = this.basePath + '/apis/rbac.authorization.k8s.io/v1alpha1/';\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1APIResourceList\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * list or watch objects of kind ClusterRole\n * @param includeUninitialized If true, partially initialized resources are included in the response.\n * @param pretty If 'true', then the output is pretty printed.\n * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \\"next key\\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.\n * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything.\n * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything.\n * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.\n * @param resourceVersion When specified with a watch call, shows changes that occur after that particular version of a resource. Defaults to changes from the beginning of history. When specified for list: - if unset, then the result is returned from remote storage based on quorum-read flag; - if it's 0, then we simply return what we currently have in cache, no guarantee; - if set to non zero, then the result is at least as fresh as given rv.\n * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.\n * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.\n * @param {*} [options] Override http request options.\n */\n listClusterRole(includeUninitialized, pretty, _continue, fieldSelector, labelSelector, limit, resourceVersion, timeoutSeconds, watch, options = {}) {\n const localVarPath = this.basePath + '/apis/rbac.authorization.k8s.io/v1alpha1/clusterroles';\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n if (includeUninitialized !== undefined) {\n localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, \"boolean\");\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (_continue !== undefined) {\n localVarQueryParameters['continue'] = ObjectSerializer.serialize(_continue, \"string\");\n }\n if (fieldSelector !== undefined) {\n localVarQueryParameters['fieldSelector'] = ObjectSerializer.serialize(fieldSelector, \"string\");\n }\n if (labelSelector !== undefined) {\n localVarQueryParameters['labelSelector'] = ObjectSerializer.serialize(labelSelector, \"string\");\n }\n if (limit !== undefined) {\n localVarQueryParameters['limit'] = ObjectSerializer.serialize(limit, \"number\");\n }\n if (resourceVersion !== undefined) {\n localVarQueryParameters['resourceVersion'] = ObjectSerializer.serialize(resourceVersion, \"string\");\n }\n if (timeoutSeconds !== undefined) {\n localVarQueryParameters['timeoutSeconds'] = ObjectSerializer.serialize(timeoutSeconds, \"number\");\n }\n if (watch !== undefined) {\n localVarQueryParameters['watch'] = ObjectSerializer.serialize(watch, \"boolean\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1alpha1ClusterRoleList\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * list or watch objects of kind ClusterRoleBinding\n * @param includeUninitialized If true, partially initialized resources are included in the response.\n * @param pretty If 'true', then the output is pretty printed.\n * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \\"next key\\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.\n * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything.\n * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything.\n * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.\n * @param resourceVersion When specified with a watch call, shows changes that occur after that particular version of a resource. Defaults to changes from the beginning of history. When specified for list: - if unset, then the result is returned from remote storage based on quorum-read flag; - if it's 0, then we simply return what we currently have in cache, no guarantee; - if set to non zero, then the result is at least as fresh as given rv.\n * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.\n * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.\n * @param {*} [options] Override http request options.\n */\n listClusterRoleBinding(includeUninitialized, pretty, _continue, fieldSelector, labelSelector, limit, resourceVersion, timeoutSeconds, watch, options = {}) {\n const localVarPath = this.basePath + '/apis/rbac.authorization.k8s.io/v1alpha1/clusterrolebindings';\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n if (includeUninitialized !== undefined) {\n localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, \"boolean\");\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (_continue !== undefined) {\n localVarQueryParameters['continue'] = ObjectSerializer.serialize(_continue, \"string\");\n }\n if (fieldSelector !== undefined) {\n localVarQueryParameters['fieldSelector'] = ObjectSerializer.serialize(fieldSelector, \"string\");\n }\n if (labelSelector !== undefined) {\n localVarQueryParameters['labelSelector'] = ObjectSerializer.serialize(labelSelector, \"string\");\n }\n if (limit !== undefined) {\n localVarQueryParameters['limit'] = ObjectSerializer.serialize(limit, \"number\");\n }\n if (resourceVersion !== undefined) {\n localVarQueryParameters['resourceVersion'] = ObjectSerializer.serialize(resourceVersion, \"string\");\n }\n if (timeoutSeconds !== undefined) {\n localVarQueryParameters['timeoutSeconds'] = ObjectSerializer.serialize(timeoutSeconds, \"number\");\n }\n if (watch !== undefined) {\n localVarQueryParameters['watch'] = ObjectSerializer.serialize(watch, \"boolean\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1alpha1ClusterRoleBindingList\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * list or watch objects of kind Role\n * @param namespace object name and auth scope, such as for teams and projects\n * @param includeUninitialized If true, partially initialized resources are included in the response.\n * @param pretty If 'true', then the output is pretty printed.\n * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \\"next key\\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.\n * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything.\n * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything.\n * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.\n * @param resourceVersion When specified with a watch call, shows changes that occur after that particular version of a resource. Defaults to changes from the beginning of history. When specified for list: - if unset, then the result is returned from remote storage based on quorum-read flag; - if it's 0, then we simply return what we currently have in cache, no guarantee; - if set to non zero, then the result is at least as fresh as given rv.\n * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.\n * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.\n * @param {*} [options] Override http request options.\n */\n listNamespacedRole(namespace, includeUninitialized, pretty, _continue, fieldSelector, labelSelector, limit, resourceVersion, timeoutSeconds, watch, options = {}) {\n const localVarPath = this.basePath + '/apis/rbac.authorization.k8s.io/v1alpha1/namespaces/{namespace}/roles'\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling listNamespacedRole.');\n }\n if (includeUninitialized !== undefined) {\n localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, \"boolean\");\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (_continue !== undefined) {\n localVarQueryParameters['continue'] = ObjectSerializer.serialize(_continue, \"string\");\n }\n if (fieldSelector !== undefined) {\n localVarQueryParameters['fieldSelector'] = ObjectSerializer.serialize(fieldSelector, \"string\");\n }\n if (labelSelector !== undefined) {\n localVarQueryParameters['labelSelector'] = ObjectSerializer.serialize(labelSelector, \"string\");\n }\n if (limit !== undefined) {\n localVarQueryParameters['limit'] = ObjectSerializer.serialize(limit, \"number\");\n }\n if (resourceVersion !== undefined) {\n localVarQueryParameters['resourceVersion'] = ObjectSerializer.serialize(resourceVersion, \"string\");\n }\n if (timeoutSeconds !== undefined) {\n localVarQueryParameters['timeoutSeconds'] = ObjectSerializer.serialize(timeoutSeconds, \"number\");\n }\n if (watch !== undefined) {\n localVarQueryParameters['watch'] = ObjectSerializer.serialize(watch, \"boolean\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1alpha1RoleList\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * list or watch objects of kind RoleBinding\n * @param namespace object name and auth scope, such as for teams and projects\n * @param includeUninitialized If true, partially initialized resources are included in the response.\n * @param pretty If 'true', then the output is pretty printed.\n * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \\"next key\\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.\n * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything.\n * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything.\n * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.\n * @param resourceVersion When specified with a watch call, shows changes that occur after that particular version of a resource. Defaults to changes from the beginning of history. When specified for list: - if unset, then the result is returned from remote storage based on quorum-read flag; - if it's 0, then we simply return what we currently have in cache, no guarantee; - if set to non zero, then the result is at least as fresh as given rv.\n * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.\n * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.\n * @param {*} [options] Override http request options.\n */\n listNamespacedRoleBinding(namespace, includeUninitialized, pretty, _continue, fieldSelector, labelSelector, limit, resourceVersion, timeoutSeconds, watch, options = {}) {\n const localVarPath = this.basePath + '/apis/rbac.authorization.k8s.io/v1alpha1/namespaces/{namespace}/rolebindings'\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling listNamespacedRoleBinding.');\n }\n if (includeUninitialized !== undefined) {\n localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, \"boolean\");\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (_continue !== undefined) {\n localVarQueryParameters['continue'] = ObjectSerializer.serialize(_continue, \"string\");\n }\n if (fieldSelector !== undefined) {\n localVarQueryParameters['fieldSelector'] = ObjectSerializer.serialize(fieldSelector, \"string\");\n }\n if (labelSelector !== undefined) {\n localVarQueryParameters['labelSelector'] = ObjectSerializer.serialize(labelSelector, \"string\");\n }\n if (limit !== undefined) {\n localVarQueryParameters['limit'] = ObjectSerializer.serialize(limit, \"number\");\n }\n if (resourceVersion !== undefined) {\n localVarQueryParameters['resourceVersion'] = ObjectSerializer.serialize(resourceVersion, \"string\");\n }\n if (timeoutSeconds !== undefined) {\n localVarQueryParameters['timeoutSeconds'] = ObjectSerializer.serialize(timeoutSeconds, \"number\");\n }\n if (watch !== undefined) {\n localVarQueryParameters['watch'] = ObjectSerializer.serialize(watch, \"boolean\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1alpha1RoleBindingList\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * list or watch objects of kind RoleBinding\n * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \\"next key\\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.\n * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything.\n * @param includeUninitialized If true, partially initialized resources are included in the response.\n * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything.\n * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.\n * @param pretty If 'true', then the output is pretty printed.\n * @param resourceVersion When specified with a watch call, shows changes that occur after that particular version of a resource. Defaults to changes from the beginning of history. When specified for list: - if unset, then the result is returned from remote storage based on quorum-read flag; - if it's 0, then we simply return what we currently have in cache, no guarantee; - if set to non zero, then the result is at least as fresh as given rv.\n * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.\n * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.\n * @param {*} [options] Override http request options.\n */\n listRoleBindingForAllNamespaces(_continue, fieldSelector, includeUninitialized, labelSelector, limit, pretty, resourceVersion, timeoutSeconds, watch, options = {}) {\n const localVarPath = this.basePath + '/apis/rbac.authorization.k8s.io/v1alpha1/rolebindings';\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n if (_continue !== undefined) {\n localVarQueryParameters['continue'] = ObjectSerializer.serialize(_continue, \"string\");\n }\n if (fieldSelector !== undefined) {\n localVarQueryParameters['fieldSelector'] = ObjectSerializer.serialize(fieldSelector, \"string\");\n }\n if (includeUninitialized !== undefined) {\n localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, \"boolean\");\n }\n if (labelSelector !== undefined) {\n localVarQueryParameters['labelSelector'] = ObjectSerializer.serialize(labelSelector, \"string\");\n }\n if (limit !== undefined) {\n localVarQueryParameters['limit'] = ObjectSerializer.serialize(limit, \"number\");\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (resourceVersion !== undefined) {\n localVarQueryParameters['resourceVersion'] = ObjectSerializer.serialize(resourceVersion, \"string\");\n }\n if (timeoutSeconds !== undefined) {\n localVarQueryParameters['timeoutSeconds'] = ObjectSerializer.serialize(timeoutSeconds, \"number\");\n }\n if (watch !== undefined) {\n localVarQueryParameters['watch'] = ObjectSerializer.serialize(watch, \"boolean\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1alpha1RoleBindingList\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * list or watch objects of kind Role\n * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \\"next key\\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.\n * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything.\n * @param includeUninitialized If true, partially initialized resources are included in the response.\n * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything.\n * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.\n * @param pretty If 'true', then the output is pretty printed.\n * @param resourceVersion When specified with a watch call, shows changes that occur after that particular version of a resource. Defaults to changes from the beginning of history. When specified for list: - if unset, then the result is returned from remote storage based on quorum-read flag; - if it's 0, then we simply return what we currently have in cache, no guarantee; - if set to non zero, then the result is at least as fresh as given rv.\n * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.\n * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.\n * @param {*} [options] Override http request options.\n */\n listRoleForAllNamespaces(_continue, fieldSelector, includeUninitialized, labelSelector, limit, pretty, resourceVersion, timeoutSeconds, watch, options = {}) {\n const localVarPath = this.basePath + '/apis/rbac.authorization.k8s.io/v1alpha1/roles';\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n if (_continue !== undefined) {\n localVarQueryParameters['continue'] = ObjectSerializer.serialize(_continue, \"string\");\n }\n if (fieldSelector !== undefined) {\n localVarQueryParameters['fieldSelector'] = ObjectSerializer.serialize(fieldSelector, \"string\");\n }\n if (includeUninitialized !== undefined) {\n localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, \"boolean\");\n }\n if (labelSelector !== undefined) {\n localVarQueryParameters['labelSelector'] = ObjectSerializer.serialize(labelSelector, \"string\");\n }\n if (limit !== undefined) {\n localVarQueryParameters['limit'] = ObjectSerializer.serialize(limit, \"number\");\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (resourceVersion !== undefined) {\n localVarQueryParameters['resourceVersion'] = ObjectSerializer.serialize(resourceVersion, \"string\");\n }\n if (timeoutSeconds !== undefined) {\n localVarQueryParameters['timeoutSeconds'] = ObjectSerializer.serialize(timeoutSeconds, \"number\");\n }\n if (watch !== undefined) {\n localVarQueryParameters['watch'] = ObjectSerializer.serialize(watch, \"boolean\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1alpha1RoleList\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * partially update the specified ClusterRole\n * @param name name of the ClusterRole\n * @param body\n * @param pretty If 'true', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param {*} [options] Override http request options.\n */\n patchClusterRole(name, body, pretty, dryRun, options = {}) {\n const localVarPath = this.basePath + '/apis/rbac.authorization.k8s.io/v1alpha1/clusterroles/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling patchClusterRole.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling patchClusterRole.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'PATCH',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: ObjectSerializer.serialize(body, \"any\")\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1alpha1ClusterRole\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * partially update the specified ClusterRoleBinding\n * @param name name of the ClusterRoleBinding\n * @param body\n * @param pretty If 'true', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param {*} [options] Override http request options.\n */\n patchClusterRoleBinding(name, body, pretty, dryRun, options = {}) {\n const localVarPath = this.basePath + '/apis/rbac.authorization.k8s.io/v1alpha1/clusterrolebindings/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling patchClusterRoleBinding.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling patchClusterRoleBinding.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'PATCH',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: ObjectSerializer.serialize(body, \"any\")\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1alpha1ClusterRoleBinding\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * partially update the specified Role\n * @param name name of the Role\n * @param namespace object name and auth scope, such as for teams and projects\n * @param body\n * @param pretty If 'true', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param {*} [options] Override http request options.\n */\n patchNamespacedRole(name, namespace, body, pretty, dryRun, options = {}) {\n const localVarPath = this.basePath + '/apis/rbac.authorization.k8s.io/v1alpha1/namespaces/{namespace}/roles/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling patchNamespacedRole.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling patchNamespacedRole.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling patchNamespacedRole.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'PATCH',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: ObjectSerializer.serialize(body, \"any\")\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1alpha1Role\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * partially update the specified RoleBinding\n * @param name name of the RoleBinding\n * @param namespace object name and auth scope, such as for teams and projects\n * @param body\n * @param pretty If 'true', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param {*} [options] Override http request options.\n */\n patchNamespacedRoleBinding(name, namespace, body, pretty, dryRun, options = {}) {\n const localVarPath = this.basePath + '/apis/rbac.authorization.k8s.io/v1alpha1/namespaces/{namespace}/rolebindings/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling patchNamespacedRoleBinding.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling patchNamespacedRoleBinding.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling patchNamespacedRoleBinding.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'PATCH',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: ObjectSerializer.serialize(body, \"any\")\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1alpha1RoleBinding\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * read the specified ClusterRole\n * @param name name of the ClusterRole\n * @param pretty If 'true', then the output is pretty printed.\n * @param {*} [options] Override http request options.\n */\n readClusterRole(name, pretty, options = {}) {\n const localVarPath = this.basePath + '/apis/rbac.authorization.k8s.io/v1alpha1/clusterroles/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling readClusterRole.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1alpha1ClusterRole\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * read the specified ClusterRoleBinding\n * @param name name of the ClusterRoleBinding\n * @param pretty If 'true', then the output is pretty printed.\n * @param {*} [options] Override http request options.\n */\n readClusterRoleBinding(name, pretty, options = {}) {\n const localVarPath = this.basePath + '/apis/rbac.authorization.k8s.io/v1alpha1/clusterrolebindings/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling readClusterRoleBinding.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1alpha1ClusterRoleBinding\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * read the specified Role\n * @param name name of the Role\n * @param namespace object name and auth scope, such as for teams and projects\n * @param pretty If 'true', then the output is pretty printed.\n * @param {*} [options] Override http request options.\n */\n readNamespacedRole(name, namespace, pretty, options = {}) {\n const localVarPath = this.basePath + '/apis/rbac.authorization.k8s.io/v1alpha1/namespaces/{namespace}/roles/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling readNamespacedRole.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling readNamespacedRole.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1alpha1Role\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * read the specified RoleBinding\n * @param name name of the RoleBinding\n * @param namespace object name and auth scope, such as for teams and projects\n * @param pretty If 'true', then the output is pretty printed.\n * @param {*} [options] Override http request options.\n */\n readNamespacedRoleBinding(name, namespace, pretty, options = {}) {\n const localVarPath = this.basePath + '/apis/rbac.authorization.k8s.io/v1alpha1/namespaces/{namespace}/rolebindings/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling readNamespacedRoleBinding.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling readNamespacedRoleBinding.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1alpha1RoleBinding\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * replace the specified ClusterRole\n * @param name name of the ClusterRole\n * @param body\n * @param pretty If 'true', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param {*} [options] Override http request options.\n */\n replaceClusterRole(name, body, pretty, dryRun, options = {}) {\n const localVarPath = this.basePath + '/apis/rbac.authorization.k8s.io/v1alpha1/clusterroles/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling replaceClusterRole.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling replaceClusterRole.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'PUT',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: ObjectSerializer.serialize(body, \"V1alpha1ClusterRole\")\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1alpha1ClusterRole\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * replace the specified ClusterRoleBinding\n * @param name name of the ClusterRoleBinding\n * @param body\n * @param pretty If 'true', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param {*} [options] Override http request options.\n */\n replaceClusterRoleBinding(name, body, pretty, dryRun, options = {}) {\n const localVarPath = this.basePath + '/apis/rbac.authorization.k8s.io/v1alpha1/clusterrolebindings/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling replaceClusterRoleBinding.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling replaceClusterRoleBinding.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'PUT',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: ObjectSerializer.serialize(body, \"V1alpha1ClusterRoleBinding\")\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1alpha1ClusterRoleBinding\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * replace the specified Role\n * @param name name of the Role\n * @param namespace object name and auth scope, such as for teams and projects\n * @param body\n * @param pretty If 'true', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param {*} [options] Override http request options.\n */\n replaceNamespacedRole(name, namespace, body, pretty, dryRun, options = {}) {\n const localVarPath = this.basePath + '/apis/rbac.authorization.k8s.io/v1alpha1/namespaces/{namespace}/roles/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling replaceNamespacedRole.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling replaceNamespacedRole.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling replaceNamespacedRole.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'PUT',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: ObjectSerializer.serialize(body, \"V1alpha1Role\")\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1alpha1Role\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * replace the specified RoleBinding\n * @param name name of the RoleBinding\n * @param namespace object name and auth scope, such as for teams and projects\n * @param body\n * @param pretty If 'true', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param {*} [options] Override http request options.\n */\n replaceNamespacedRoleBinding(name, namespace, body, pretty, dryRun, options = {}) {\n const localVarPath = this.basePath + '/apis/rbac.authorization.k8s.io/v1alpha1/namespaces/{namespace}/rolebindings/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling replaceNamespacedRoleBinding.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling replaceNamespacedRoleBinding.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling replaceNamespacedRoleBinding.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'PUT',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: ObjectSerializer.serialize(body, \"V1alpha1RoleBinding\")\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1alpha1RoleBinding\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n}\nexports.RbacAuthorizationV1alpha1Api = RbacAuthorizationV1alpha1Api;\nvar RbacAuthorizationV1beta1ApiApiKeys;\n(function (RbacAuthorizationV1beta1ApiApiKeys) {\n RbacAuthorizationV1beta1ApiApiKeys[RbacAuthorizationV1beta1ApiApiKeys[\"BearerToken\"] = 0] = \"BearerToken\";\n})(RbacAuthorizationV1beta1ApiApiKeys = exports.RbacAuthorizationV1beta1ApiApiKeys || (exports.RbacAuthorizationV1beta1ApiApiKeys = {}));\nclass RbacAuthorizationV1beta1Api {\n constructor(basePathOrUsername, password, basePath) {\n this._basePath = defaultBasePath;\n this.defaultHeaders = {};\n this._useQuerystring = false;\n this.authentications = {\n 'default': new VoidAuth(),\n 'BearerToken': new ApiKeyAuth('header', 'authorization'),\n };\n if (password) {\n if (basePath) {\n this.basePath = basePath;\n }\n }\n else {\n if (basePathOrUsername) {\n this.basePath = basePathOrUsername;\n }\n }\n }\n set useQuerystring(value) {\n this._useQuerystring = value;\n }\n set basePath(basePath) {\n this._basePath = basePath;\n }\n get basePath() {\n return this._basePath;\n }\n setDefaultAuthentication(auth) {\n this.authentications.default = auth;\n }\n setApiKey(key, value) {\n this.authentications[RbacAuthorizationV1beta1ApiApiKeys[key]].apiKey = value;\n }\n /**\n * create a ClusterRole\n * @param body\n * @param includeUninitialized If true, partially initialized resources are included in the response.\n * @param pretty If 'true', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param {*} [options] Override http request options.\n */\n createClusterRole(body, includeUninitialized, pretty, dryRun, options = {}) {\n const localVarPath = this.basePath + '/apis/rbac.authorization.k8s.io/v1beta1/clusterroles';\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling createClusterRole.');\n }\n if (includeUninitialized !== undefined) {\n localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, \"boolean\");\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'POST',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: ObjectSerializer.serialize(body, \"V1beta1ClusterRole\")\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1beta1ClusterRole\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * create a ClusterRoleBinding\n * @param body\n * @param includeUninitialized If true, partially initialized resources are included in the response.\n * @param pretty If 'true', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param {*} [options] Override http request options.\n */\n createClusterRoleBinding(body, includeUninitialized, pretty, dryRun, options = {}) {\n const localVarPath = this.basePath + '/apis/rbac.authorization.k8s.io/v1beta1/clusterrolebindings';\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling createClusterRoleBinding.');\n }\n if (includeUninitialized !== undefined) {\n localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, \"boolean\");\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'POST',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: ObjectSerializer.serialize(body, \"V1beta1ClusterRoleBinding\")\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1beta1ClusterRoleBinding\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * create a Role\n * @param namespace object name and auth scope, such as for teams and projects\n * @param body\n * @param includeUninitialized If true, partially initialized resources are included in the response.\n * @param pretty If 'true', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param {*} [options] Override http request options.\n */\n createNamespacedRole(namespace, body, includeUninitialized, pretty, dryRun, options = {}) {\n const localVarPath = this.basePath + '/apis/rbac.authorization.k8s.io/v1beta1/namespaces/{namespace}/roles'\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling createNamespacedRole.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling createNamespacedRole.');\n }\n if (includeUninitialized !== undefined) {\n localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, \"boolean\");\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'POST',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: ObjectSerializer.serialize(body, \"V1beta1Role\")\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1beta1Role\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * create a RoleBinding\n * @param namespace object name and auth scope, such as for teams and projects\n * @param body\n * @param includeUninitialized If true, partially initialized resources are included in the response.\n * @param pretty If 'true', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param {*} [options] Override http request options.\n */\n createNamespacedRoleBinding(namespace, body, includeUninitialized, pretty, dryRun, options = {}) {\n const localVarPath = this.basePath + '/apis/rbac.authorization.k8s.io/v1beta1/namespaces/{namespace}/rolebindings'\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling createNamespacedRoleBinding.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling createNamespacedRoleBinding.');\n }\n if (includeUninitialized !== undefined) {\n localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, \"boolean\");\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'POST',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: ObjectSerializer.serialize(body, \"V1beta1RoleBinding\")\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1beta1RoleBinding\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * delete a ClusterRole\n * @param name name of the ClusterRole\n * @param pretty If 'true', then the output is pretty printed.\n * @param body\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param gracePeriodSeconds The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately.\n * @param orphanDependents Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \\"orphan\\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both.\n * @param propagationPolicy Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground.\n * @param {*} [options] Override http request options.\n */\n deleteClusterRole(name, pretty, body, dryRun, gracePeriodSeconds, orphanDependents, propagationPolicy, options = {}) {\n const localVarPath = this.basePath + '/apis/rbac.authorization.k8s.io/v1beta1/clusterroles/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling deleteClusterRole.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, \"string\");\n }\n if (gracePeriodSeconds !== undefined) {\n localVarQueryParameters['gracePeriodSeconds'] = ObjectSerializer.serialize(gracePeriodSeconds, \"number\");\n }\n if (orphanDependents !== undefined) {\n localVarQueryParameters['orphanDependents'] = ObjectSerializer.serialize(orphanDependents, \"boolean\");\n }\n if (propagationPolicy !== undefined) {\n localVarQueryParameters['propagationPolicy'] = ObjectSerializer.serialize(propagationPolicy, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'DELETE',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: ObjectSerializer.serialize(body, \"V1DeleteOptions\")\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1Status\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * delete a ClusterRoleBinding\n * @param name name of the ClusterRoleBinding\n * @param pretty If 'true', then the output is pretty printed.\n * @param body\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param gracePeriodSeconds The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately.\n * @param orphanDependents Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \\"orphan\\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both.\n * @param propagationPolicy Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground.\n * @param {*} [options] Override http request options.\n */\n deleteClusterRoleBinding(name, pretty, body, dryRun, gracePeriodSeconds, orphanDependents, propagationPolicy, options = {}) {\n const localVarPath = this.basePath + '/apis/rbac.authorization.k8s.io/v1beta1/clusterrolebindings/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling deleteClusterRoleBinding.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, \"string\");\n }\n if (gracePeriodSeconds !== undefined) {\n localVarQueryParameters['gracePeriodSeconds'] = ObjectSerializer.serialize(gracePeriodSeconds, \"number\");\n }\n if (orphanDependents !== undefined) {\n localVarQueryParameters['orphanDependents'] = ObjectSerializer.serialize(orphanDependents, \"boolean\");\n }\n if (propagationPolicy !== undefined) {\n localVarQueryParameters['propagationPolicy'] = ObjectSerializer.serialize(propagationPolicy, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'DELETE',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: ObjectSerializer.serialize(body, \"V1DeleteOptions\")\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1Status\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * delete collection of ClusterRole\n * @param includeUninitialized If true, partially initialized resources are included in the response.\n * @param pretty If 'true', then the output is pretty printed.\n * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \\"next key\\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.\n * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything.\n * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything.\n * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.\n * @param resourceVersion When specified with a watch call, shows changes that occur after that particular version of a resource. Defaults to changes from the beginning of history. When specified for list: - if unset, then the result is returned from remote storage based on quorum-read flag; - if it's 0, then we simply return what we currently have in cache, no guarantee; - if set to non zero, then the result is at least as fresh as given rv.\n * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.\n * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.\n * @param {*} [options] Override http request options.\n */\n deleteCollectionClusterRole(includeUninitialized, pretty, _continue, fieldSelector, labelSelector, limit, resourceVersion, timeoutSeconds, watch, options = {}) {\n const localVarPath = this.basePath + '/apis/rbac.authorization.k8s.io/v1beta1/clusterroles';\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n if (includeUninitialized !== undefined) {\n localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, \"boolean\");\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (_continue !== undefined) {\n localVarQueryParameters['continue'] = ObjectSerializer.serialize(_continue, \"string\");\n }\n if (fieldSelector !== undefined) {\n localVarQueryParameters['fieldSelector'] = ObjectSerializer.serialize(fieldSelector, \"string\");\n }\n if (labelSelector !== undefined) {\n localVarQueryParameters['labelSelector'] = ObjectSerializer.serialize(labelSelector, \"string\");\n }\n if (limit !== undefined) {\n localVarQueryParameters['limit'] = ObjectSerializer.serialize(limit, \"number\");\n }\n if (resourceVersion !== undefined) {\n localVarQueryParameters['resourceVersion'] = ObjectSerializer.serialize(resourceVersion, \"string\");\n }\n if (timeoutSeconds !== undefined) {\n localVarQueryParameters['timeoutSeconds'] = ObjectSerializer.serialize(timeoutSeconds, \"number\");\n }\n if (watch !== undefined) {\n localVarQueryParameters['watch'] = ObjectSerializer.serialize(watch, \"boolean\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'DELETE',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1Status\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * delete collection of ClusterRoleBinding\n * @param includeUninitialized If true, partially initialized resources are included in the response.\n * @param pretty If 'true', then the output is pretty printed.\n * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \\"next key\\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.\n * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything.\n * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything.\n * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.\n * @param resourceVersion When specified with a watch call, shows changes that occur after that particular version of a resource. Defaults to changes from the beginning of history. When specified for list: - if unset, then the result is returned from remote storage based on quorum-read flag; - if it's 0, then we simply return what we currently have in cache, no guarantee; - if set to non zero, then the result is at least as fresh as given rv.\n * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.\n * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.\n * @param {*} [options] Override http request options.\n */\n deleteCollectionClusterRoleBinding(includeUninitialized, pretty, _continue, fieldSelector, labelSelector, limit, resourceVersion, timeoutSeconds, watch, options = {}) {\n const localVarPath = this.basePath + '/apis/rbac.authorization.k8s.io/v1beta1/clusterrolebindings';\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n if (includeUninitialized !== undefined) {\n localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, \"boolean\");\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (_continue !== undefined) {\n localVarQueryParameters['continue'] = ObjectSerializer.serialize(_continue, \"string\");\n }\n if (fieldSelector !== undefined) {\n localVarQueryParameters['fieldSelector'] = ObjectSerializer.serialize(fieldSelector, \"string\");\n }\n if (labelSelector !== undefined) {\n localVarQueryParameters['labelSelector'] = ObjectSerializer.serialize(labelSelector, \"string\");\n }\n if (limit !== undefined) {\n localVarQueryParameters['limit'] = ObjectSerializer.serialize(limit, \"number\");\n }\n if (resourceVersion !== undefined) {\n localVarQueryParameters['resourceVersion'] = ObjectSerializer.serialize(resourceVersion, \"string\");\n }\n if (timeoutSeconds !== undefined) {\n localVarQueryParameters['timeoutSeconds'] = ObjectSerializer.serialize(timeoutSeconds, \"number\");\n }\n if (watch !== undefined) {\n localVarQueryParameters['watch'] = ObjectSerializer.serialize(watch, \"boolean\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'DELETE',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1Status\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * delete collection of Role\n * @param namespace object name and auth scope, such as for teams and projects\n * @param includeUninitialized If true, partially initialized resources are included in the response.\n * @param pretty If 'true', then the output is pretty printed.\n * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \\"next key\\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.\n * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything.\n * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything.\n * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.\n * @param resourceVersion When specified with a watch call, shows changes that occur after that particular version of a resource. Defaults to changes from the beginning of history. When specified for list: - if unset, then the result is returned from remote storage based on quorum-read flag; - if it's 0, then we simply return what we currently have in cache, no guarantee; - if set to non zero, then the result is at least as fresh as given rv.\n * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.\n * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.\n * @param {*} [options] Override http request options.\n */\n deleteCollectionNamespacedRole(namespace, includeUninitialized, pretty, _continue, fieldSelector, labelSelector, limit, resourceVersion, timeoutSeconds, watch, options = {}) {\n const localVarPath = this.basePath + '/apis/rbac.authorization.k8s.io/v1beta1/namespaces/{namespace}/roles'\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling deleteCollectionNamespacedRole.');\n }\n if (includeUninitialized !== undefined) {\n localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, \"boolean\");\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (_continue !== undefined) {\n localVarQueryParameters['continue'] = ObjectSerializer.serialize(_continue, \"string\");\n }\n if (fieldSelector !== undefined) {\n localVarQueryParameters['fieldSelector'] = ObjectSerializer.serialize(fieldSelector, \"string\");\n }\n if (labelSelector !== undefined) {\n localVarQueryParameters['labelSelector'] = ObjectSerializer.serialize(labelSelector, \"string\");\n }\n if (limit !== undefined) {\n localVarQueryParameters['limit'] = ObjectSerializer.serialize(limit, \"number\");\n }\n if (resourceVersion !== undefined) {\n localVarQueryParameters['resourceVersion'] = ObjectSerializer.serialize(resourceVersion, \"string\");\n }\n if (timeoutSeconds !== undefined) {\n localVarQueryParameters['timeoutSeconds'] = ObjectSerializer.serialize(timeoutSeconds, \"number\");\n }\n if (watch !== undefined) {\n localVarQueryParameters['watch'] = ObjectSerializer.serialize(watch, \"boolean\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'DELETE',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1Status\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * delete collection of RoleBinding\n * @param namespace object name and auth scope, such as for teams and projects\n * @param includeUninitialized If true, partially initialized resources are included in the response.\n * @param pretty If 'true', then the output is pretty printed.\n * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \\"next key\\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.\n * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything.\n * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything.\n * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.\n * @param resourceVersion When specified with a watch call, shows changes that occur after that particular version of a resource. Defaults to changes from the beginning of history. When specified for list: - if unset, then the result is returned from remote storage based on quorum-read flag; - if it's 0, then we simply return what we currently have in cache, no guarantee; - if set to non zero, then the result is at least as fresh as given rv.\n * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.\n * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.\n * @param {*} [options] Override http request options.\n */\n deleteCollectionNamespacedRoleBinding(namespace, includeUninitialized, pretty, _continue, fieldSelector, labelSelector, limit, resourceVersion, timeoutSeconds, watch, options = {}) {\n const localVarPath = this.basePath + '/apis/rbac.authorization.k8s.io/v1beta1/namespaces/{namespace}/rolebindings'\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling deleteCollectionNamespacedRoleBinding.');\n }\n if (includeUninitialized !== undefined) {\n localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, \"boolean\");\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (_continue !== undefined) {\n localVarQueryParameters['continue'] = ObjectSerializer.serialize(_continue, \"string\");\n }\n if (fieldSelector !== undefined) {\n localVarQueryParameters['fieldSelector'] = ObjectSerializer.serialize(fieldSelector, \"string\");\n }\n if (labelSelector !== undefined) {\n localVarQueryParameters['labelSelector'] = ObjectSerializer.serialize(labelSelector, \"string\");\n }\n if (limit !== undefined) {\n localVarQueryParameters['limit'] = ObjectSerializer.serialize(limit, \"number\");\n }\n if (resourceVersion !== undefined) {\n localVarQueryParameters['resourceVersion'] = ObjectSerializer.serialize(resourceVersion, \"string\");\n }\n if (timeoutSeconds !== undefined) {\n localVarQueryParameters['timeoutSeconds'] = ObjectSerializer.serialize(timeoutSeconds, \"number\");\n }\n if (watch !== undefined) {\n localVarQueryParameters['watch'] = ObjectSerializer.serialize(watch, \"boolean\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'DELETE',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1Status\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * delete a Role\n * @param name name of the Role\n * @param namespace object name and auth scope, such as for teams and projects\n * @param pretty If 'true', then the output is pretty printed.\n * @param body\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param gracePeriodSeconds The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately.\n * @param orphanDependents Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \\"orphan\\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both.\n * @param propagationPolicy Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground.\n * @param {*} [options] Override http request options.\n */\n deleteNamespacedRole(name, namespace, pretty, body, dryRun, gracePeriodSeconds, orphanDependents, propagationPolicy, options = {}) {\n const localVarPath = this.basePath + '/apis/rbac.authorization.k8s.io/v1beta1/namespaces/{namespace}/roles/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling deleteNamespacedRole.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling deleteNamespacedRole.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, \"string\");\n }\n if (gracePeriodSeconds !== undefined) {\n localVarQueryParameters['gracePeriodSeconds'] = ObjectSerializer.serialize(gracePeriodSeconds, \"number\");\n }\n if (orphanDependents !== undefined) {\n localVarQueryParameters['orphanDependents'] = ObjectSerializer.serialize(orphanDependents, \"boolean\");\n }\n if (propagationPolicy !== undefined) {\n localVarQueryParameters['propagationPolicy'] = ObjectSerializer.serialize(propagationPolicy, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'DELETE',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: ObjectSerializer.serialize(body, \"V1DeleteOptions\")\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1Status\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * delete a RoleBinding\n * @param name name of the RoleBinding\n * @param namespace object name and auth scope, such as for teams and projects\n * @param pretty If 'true', then the output is pretty printed.\n * @param body\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param gracePeriodSeconds The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately.\n * @param orphanDependents Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \\"orphan\\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both.\n * @param propagationPolicy Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground.\n * @param {*} [options] Override http request options.\n */\n deleteNamespacedRoleBinding(name, namespace, pretty, body, dryRun, gracePeriodSeconds, orphanDependents, propagationPolicy, options = {}) {\n const localVarPath = this.basePath + '/apis/rbac.authorization.k8s.io/v1beta1/namespaces/{namespace}/rolebindings/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling deleteNamespacedRoleBinding.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling deleteNamespacedRoleBinding.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, \"string\");\n }\n if (gracePeriodSeconds !== undefined) {\n localVarQueryParameters['gracePeriodSeconds'] = ObjectSerializer.serialize(gracePeriodSeconds, \"number\");\n }\n if (orphanDependents !== undefined) {\n localVarQueryParameters['orphanDependents'] = ObjectSerializer.serialize(orphanDependents, \"boolean\");\n }\n if (propagationPolicy !== undefined) {\n localVarQueryParameters['propagationPolicy'] = ObjectSerializer.serialize(propagationPolicy, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'DELETE',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: ObjectSerializer.serialize(body, \"V1DeleteOptions\")\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1Status\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * get available resources\n * @param {*} [options] Override http request options.\n */\n getAPIResources(options = {}) {\n const localVarPath = this.basePath + '/apis/rbac.authorization.k8s.io/v1beta1/';\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1APIResourceList\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * list or watch objects of kind ClusterRole\n * @param includeUninitialized If true, partially initialized resources are included in the response.\n * @param pretty If 'true', then the output is pretty printed.\n * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \\"next key\\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.\n * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything.\n * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything.\n * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.\n * @param resourceVersion When specified with a watch call, shows changes that occur after that particular version of a resource. Defaults to changes from the beginning of history. When specified for list: - if unset, then the result is returned from remote storage based on quorum-read flag; - if it's 0, then we simply return what we currently have in cache, no guarantee; - if set to non zero, then the result is at least as fresh as given rv.\n * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.\n * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.\n * @param {*} [options] Override http request options.\n */\n listClusterRole(includeUninitialized, pretty, _continue, fieldSelector, labelSelector, limit, resourceVersion, timeoutSeconds, watch, options = {}) {\n const localVarPath = this.basePath + '/apis/rbac.authorization.k8s.io/v1beta1/clusterroles';\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n if (includeUninitialized !== undefined) {\n localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, \"boolean\");\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (_continue !== undefined) {\n localVarQueryParameters['continue'] = ObjectSerializer.serialize(_continue, \"string\");\n }\n if (fieldSelector !== undefined) {\n localVarQueryParameters['fieldSelector'] = ObjectSerializer.serialize(fieldSelector, \"string\");\n }\n if (labelSelector !== undefined) {\n localVarQueryParameters['labelSelector'] = ObjectSerializer.serialize(labelSelector, \"string\");\n }\n if (limit !== undefined) {\n localVarQueryParameters['limit'] = ObjectSerializer.serialize(limit, \"number\");\n }\n if (resourceVersion !== undefined) {\n localVarQueryParameters['resourceVersion'] = ObjectSerializer.serialize(resourceVersion, \"string\");\n }\n if (timeoutSeconds !== undefined) {\n localVarQueryParameters['timeoutSeconds'] = ObjectSerializer.serialize(timeoutSeconds, \"number\");\n }\n if (watch !== undefined) {\n localVarQueryParameters['watch'] = ObjectSerializer.serialize(watch, \"boolean\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1beta1ClusterRoleList\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * list or watch objects of kind ClusterRoleBinding\n * @param includeUninitialized If true, partially initialized resources are included in the response.\n * @param pretty If 'true', then the output is pretty printed.\n * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \\"next key\\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.\n * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything.\n * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything.\n * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.\n * @param resourceVersion When specified with a watch call, shows changes that occur after that particular version of a resource. Defaults to changes from the beginning of history. When specified for list: - if unset, then the result is returned from remote storage based on quorum-read flag; - if it's 0, then we simply return what we currently have in cache, no guarantee; - if set to non zero, then the result is at least as fresh as given rv.\n * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.\n * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.\n * @param {*} [options] Override http request options.\n */\n listClusterRoleBinding(includeUninitialized, pretty, _continue, fieldSelector, labelSelector, limit, resourceVersion, timeoutSeconds, watch, options = {}) {\n const localVarPath = this.basePath + '/apis/rbac.authorization.k8s.io/v1beta1/clusterrolebindings';\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n if (includeUninitialized !== undefined) {\n localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, \"boolean\");\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (_continue !== undefined) {\n localVarQueryParameters['continue'] = ObjectSerializer.serialize(_continue, \"string\");\n }\n if (fieldSelector !== undefined) {\n localVarQueryParameters['fieldSelector'] = ObjectSerializer.serialize(fieldSelector, \"string\");\n }\n if (labelSelector !== undefined) {\n localVarQueryParameters['labelSelector'] = ObjectSerializer.serialize(labelSelector, \"string\");\n }\n if (limit !== undefined) {\n localVarQueryParameters['limit'] = ObjectSerializer.serialize(limit, \"number\");\n }\n if (resourceVersion !== undefined) {\n localVarQueryParameters['resourceVersion'] = ObjectSerializer.serialize(resourceVersion, \"string\");\n }\n if (timeoutSeconds !== undefined) {\n localVarQueryParameters['timeoutSeconds'] = ObjectSerializer.serialize(timeoutSeconds, \"number\");\n }\n if (watch !== undefined) {\n localVarQueryParameters['watch'] = ObjectSerializer.serialize(watch, \"boolean\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1beta1ClusterRoleBindingList\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * list or watch objects of kind Role\n * @param namespace object name and auth scope, such as for teams and projects\n * @param includeUninitialized If true, partially initialized resources are included in the response.\n * @param pretty If 'true', then the output is pretty printed.\n * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \\"next key\\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.\n * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything.\n * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything.\n * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.\n * @param resourceVersion When specified with a watch call, shows changes that occur after that particular version of a resource. Defaults to changes from the beginning of history. When specified for list: - if unset, then the result is returned from remote storage based on quorum-read flag; - if it's 0, then we simply return what we currently have in cache, no guarantee; - if set to non zero, then the result is at least as fresh as given rv.\n * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.\n * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.\n * @param {*} [options] Override http request options.\n */\n listNamespacedRole(namespace, includeUninitialized, pretty, _continue, fieldSelector, labelSelector, limit, resourceVersion, timeoutSeconds, watch, options = {}) {\n const localVarPath = this.basePath + '/apis/rbac.authorization.k8s.io/v1beta1/namespaces/{namespace}/roles'\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling listNamespacedRole.');\n }\n if (includeUninitialized !== undefined) {\n localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, \"boolean\");\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (_continue !== undefined) {\n localVarQueryParameters['continue'] = ObjectSerializer.serialize(_continue, \"string\");\n }\n if (fieldSelector !== undefined) {\n localVarQueryParameters['fieldSelector'] = ObjectSerializer.serialize(fieldSelector, \"string\");\n }\n if (labelSelector !== undefined) {\n localVarQueryParameters['labelSelector'] = ObjectSerializer.serialize(labelSelector, \"string\");\n }\n if (limit !== undefined) {\n localVarQueryParameters['limit'] = ObjectSerializer.serialize(limit, \"number\");\n }\n if (resourceVersion !== undefined) {\n localVarQueryParameters['resourceVersion'] = ObjectSerializer.serialize(resourceVersion, \"string\");\n }\n if (timeoutSeconds !== undefined) {\n localVarQueryParameters['timeoutSeconds'] = ObjectSerializer.serialize(timeoutSeconds, \"number\");\n }\n if (watch !== undefined) {\n localVarQueryParameters['watch'] = ObjectSerializer.serialize(watch, \"boolean\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1beta1RoleList\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * list or watch objects of kind RoleBinding\n * @param namespace object name and auth scope, such as for teams and projects\n * @param includeUninitialized If true, partially initialized resources are included in the response.\n * @param pretty If 'true', then the output is pretty printed.\n * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \\"next key\\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.\n * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything.\n * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything.\n * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.\n * @param resourceVersion When specified with a watch call, shows changes that occur after that particular version of a resource. Defaults to changes from the beginning of history. When specified for list: - if unset, then the result is returned from remote storage based on quorum-read flag; - if it's 0, then we simply return what we currently have in cache, no guarantee; - if set to non zero, then the result is at least as fresh as given rv.\n * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.\n * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.\n * @param {*} [options] Override http request options.\n */\n listNamespacedRoleBinding(namespace, includeUninitialized, pretty, _continue, fieldSelector, labelSelector, limit, resourceVersion, timeoutSeconds, watch, options = {}) {\n const localVarPath = this.basePath + '/apis/rbac.authorization.k8s.io/v1beta1/namespaces/{namespace}/rolebindings'\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling listNamespacedRoleBinding.');\n }\n if (includeUninitialized !== undefined) {\n localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, \"boolean\");\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (_continue !== undefined) {\n localVarQueryParameters['continue'] = ObjectSerializer.serialize(_continue, \"string\");\n }\n if (fieldSelector !== undefined) {\n localVarQueryParameters['fieldSelector'] = ObjectSerializer.serialize(fieldSelector, \"string\");\n }\n if (labelSelector !== undefined) {\n localVarQueryParameters['labelSelector'] = ObjectSerializer.serialize(labelSelector, \"string\");\n }\n if (limit !== undefined) {\n localVarQueryParameters['limit'] = ObjectSerializer.serialize(limit, \"number\");\n }\n if (resourceVersion !== undefined) {\n localVarQueryParameters['resourceVersion'] = ObjectSerializer.serialize(resourceVersion, \"string\");\n }\n if (timeoutSeconds !== undefined) {\n localVarQueryParameters['timeoutSeconds'] = ObjectSerializer.serialize(timeoutSeconds, \"number\");\n }\n if (watch !== undefined) {\n localVarQueryParameters['watch'] = ObjectSerializer.serialize(watch, \"boolean\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1beta1RoleBindingList\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * list or watch objects of kind RoleBinding\n * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \\"next key\\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.\n * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything.\n * @param includeUninitialized If true, partially initialized resources are included in the response.\n * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything.\n * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.\n * @param pretty If 'true', then the output is pretty printed.\n * @param resourceVersion When specified with a watch call, shows changes that occur after that particular version of a resource. Defaults to changes from the beginning of history. When specified for list: - if unset, then the result is returned from remote storage based on quorum-read flag; - if it's 0, then we simply return what we currently have in cache, no guarantee; - if set to non zero, then the result is at least as fresh as given rv.\n * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.\n * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.\n * @param {*} [options] Override http request options.\n */\n listRoleBindingForAllNamespaces(_continue, fieldSelector, includeUninitialized, labelSelector, limit, pretty, resourceVersion, timeoutSeconds, watch, options = {}) {\n const localVarPath = this.basePath + '/apis/rbac.authorization.k8s.io/v1beta1/rolebindings';\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n if (_continue !== undefined) {\n localVarQueryParameters['continue'] = ObjectSerializer.serialize(_continue, \"string\");\n }\n if (fieldSelector !== undefined) {\n localVarQueryParameters['fieldSelector'] = ObjectSerializer.serialize(fieldSelector, \"string\");\n }\n if (includeUninitialized !== undefined) {\n localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, \"boolean\");\n }\n if (labelSelector !== undefined) {\n localVarQueryParameters['labelSelector'] = ObjectSerializer.serialize(labelSelector, \"string\");\n }\n if (limit !== undefined) {\n localVarQueryParameters['limit'] = ObjectSerializer.serialize(limit, \"number\");\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (resourceVersion !== undefined) {\n localVarQueryParameters['resourceVersion'] = ObjectSerializer.serialize(resourceVersion, \"string\");\n }\n if (timeoutSeconds !== undefined) {\n localVarQueryParameters['timeoutSeconds'] = ObjectSerializer.serialize(timeoutSeconds, \"number\");\n }\n if (watch !== undefined) {\n localVarQueryParameters['watch'] = ObjectSerializer.serialize(watch, \"boolean\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1beta1RoleBindingList\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * list or watch objects of kind Role\n * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \\"next key\\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.\n * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything.\n * @param includeUninitialized If true, partially initialized resources are included in the response.\n * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything.\n * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.\n * @param pretty If 'true', then the output is pretty printed.\n * @param resourceVersion When specified with a watch call, shows changes that occur after that particular version of a resource. Defaults to changes from the beginning of history. When specified for list: - if unset, then the result is returned from remote storage based on quorum-read flag; - if it's 0, then we simply return what we currently have in cache, no guarantee; - if set to non zero, then the result is at least as fresh as given rv.\n * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.\n * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.\n * @param {*} [options] Override http request options.\n */\n listRoleForAllNamespaces(_continue, fieldSelector, includeUninitialized, labelSelector, limit, pretty, resourceVersion, timeoutSeconds, watch, options = {}) {\n const localVarPath = this.basePath + '/apis/rbac.authorization.k8s.io/v1beta1/roles';\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n if (_continue !== undefined) {\n localVarQueryParameters['continue'] = ObjectSerializer.serialize(_continue, \"string\");\n }\n if (fieldSelector !== undefined) {\n localVarQueryParameters['fieldSelector'] = ObjectSerializer.serialize(fieldSelector, \"string\");\n }\n if (includeUninitialized !== undefined) {\n localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, \"boolean\");\n }\n if (labelSelector !== undefined) {\n localVarQueryParameters['labelSelector'] = ObjectSerializer.serialize(labelSelector, \"string\");\n }\n if (limit !== undefined) {\n localVarQueryParameters['limit'] = ObjectSerializer.serialize(limit, \"number\");\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (resourceVersion !== undefined) {\n localVarQueryParameters['resourceVersion'] = ObjectSerializer.serialize(resourceVersion, \"string\");\n }\n if (timeoutSeconds !== undefined) {\n localVarQueryParameters['timeoutSeconds'] = ObjectSerializer.serialize(timeoutSeconds, \"number\");\n }\n if (watch !== undefined) {\n localVarQueryParameters['watch'] = ObjectSerializer.serialize(watch, \"boolean\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1beta1RoleList\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * partially update the specified ClusterRole\n * @param name name of the ClusterRole\n * @param body\n * @param pretty If 'true', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param {*} [options] Override http request options.\n */\n patchClusterRole(name, body, pretty, dryRun, options = {}) {\n const localVarPath = this.basePath + '/apis/rbac.authorization.k8s.io/v1beta1/clusterroles/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling patchClusterRole.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling patchClusterRole.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'PATCH',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: ObjectSerializer.serialize(body, \"any\")\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1beta1ClusterRole\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * partially update the specified ClusterRoleBinding\n * @param name name of the ClusterRoleBinding\n * @param body\n * @param pretty If 'true', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param {*} [options] Override http request options.\n */\n patchClusterRoleBinding(name, body, pretty, dryRun, options = {}) {\n const localVarPath = this.basePath + '/apis/rbac.authorization.k8s.io/v1beta1/clusterrolebindings/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling patchClusterRoleBinding.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling patchClusterRoleBinding.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'PATCH',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: ObjectSerializer.serialize(body, \"any\")\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1beta1ClusterRoleBinding\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * partially update the specified Role\n * @param name name of the Role\n * @param namespace object name and auth scope, such as for teams and projects\n * @param body\n * @param pretty If 'true', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param {*} [options] Override http request options.\n */\n patchNamespacedRole(name, namespace, body, pretty, dryRun, options = {}) {\n const localVarPath = this.basePath + '/apis/rbac.authorization.k8s.io/v1beta1/namespaces/{namespace}/roles/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling patchNamespacedRole.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling patchNamespacedRole.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling patchNamespacedRole.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'PATCH',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: ObjectSerializer.serialize(body, \"any\")\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1beta1Role\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * partially update the specified RoleBinding\n * @param name name of the RoleBinding\n * @param namespace object name and auth scope, such as for teams and projects\n * @param body\n * @param pretty If 'true', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param {*} [options] Override http request options.\n */\n patchNamespacedRoleBinding(name, namespace, body, pretty, dryRun, options = {}) {\n const localVarPath = this.basePath + '/apis/rbac.authorization.k8s.io/v1beta1/namespaces/{namespace}/rolebindings/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling patchNamespacedRoleBinding.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling patchNamespacedRoleBinding.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling patchNamespacedRoleBinding.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'PATCH',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: ObjectSerializer.serialize(body, \"any\")\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1beta1RoleBinding\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * read the specified ClusterRole\n * @param name name of the ClusterRole\n * @param pretty If 'true', then the output is pretty printed.\n * @param {*} [options] Override http request options.\n */\n readClusterRole(name, pretty, options = {}) {\n const localVarPath = this.basePath + '/apis/rbac.authorization.k8s.io/v1beta1/clusterroles/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling readClusterRole.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1beta1ClusterRole\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * read the specified ClusterRoleBinding\n * @param name name of the ClusterRoleBinding\n * @param pretty If 'true', then the output is pretty printed.\n * @param {*} [options] Override http request options.\n */\n readClusterRoleBinding(name, pretty, options = {}) {\n const localVarPath = this.basePath + '/apis/rbac.authorization.k8s.io/v1beta1/clusterrolebindings/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling readClusterRoleBinding.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1beta1ClusterRoleBinding\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * read the specified Role\n * @param name name of the Role\n * @param namespace object name and auth scope, such as for teams and projects\n * @param pretty If 'true', then the output is pretty printed.\n * @param {*} [options] Override http request options.\n */\n readNamespacedRole(name, namespace, pretty, options = {}) {\n const localVarPath = this.basePath + '/apis/rbac.authorization.k8s.io/v1beta1/namespaces/{namespace}/roles/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling readNamespacedRole.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling readNamespacedRole.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1beta1Role\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * read the specified RoleBinding\n * @param name name of the RoleBinding\n * @param namespace object name and auth scope, such as for teams and projects\n * @param pretty If 'true', then the output is pretty printed.\n * @param {*} [options] Override http request options.\n */\n readNamespacedRoleBinding(name, namespace, pretty, options = {}) {\n const localVarPath = this.basePath + '/apis/rbac.authorization.k8s.io/v1beta1/namespaces/{namespace}/rolebindings/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling readNamespacedRoleBinding.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling readNamespacedRoleBinding.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1beta1RoleBinding\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * replace the specified ClusterRole\n * @param name name of the ClusterRole\n * @param body\n * @param pretty If 'true', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param {*} [options] Override http request options.\n */\n replaceClusterRole(name, body, pretty, dryRun, options = {}) {\n const localVarPath = this.basePath + '/apis/rbac.authorization.k8s.io/v1beta1/clusterroles/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling replaceClusterRole.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling replaceClusterRole.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'PUT',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: ObjectSerializer.serialize(body, \"V1beta1ClusterRole\")\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1beta1ClusterRole\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * replace the specified ClusterRoleBinding\n * @param name name of the ClusterRoleBinding\n * @param body\n * @param pretty If 'true', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param {*} [options] Override http request options.\n */\n replaceClusterRoleBinding(name, body, pretty, dryRun, options = {}) {\n const localVarPath = this.basePath + '/apis/rbac.authorization.k8s.io/v1beta1/clusterrolebindings/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling replaceClusterRoleBinding.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling replaceClusterRoleBinding.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'PUT',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: ObjectSerializer.serialize(body, \"V1beta1ClusterRoleBinding\")\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1beta1ClusterRoleBinding\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * replace the specified Role\n * @param name name of the Role\n * @param namespace object name and auth scope, such as for teams and projects\n * @param body\n * @param pretty If 'true', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param {*} [options] Override http request options.\n */\n replaceNamespacedRole(name, namespace, body, pretty, dryRun, options = {}) {\n const localVarPath = this.basePath + '/apis/rbac.authorization.k8s.io/v1beta1/namespaces/{namespace}/roles/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling replaceNamespacedRole.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling replaceNamespacedRole.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling replaceNamespacedRole.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'PUT',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: ObjectSerializer.serialize(body, \"V1beta1Role\")\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1beta1Role\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * replace the specified RoleBinding\n * @param name name of the RoleBinding\n * @param namespace object name and auth scope, such as for teams and projects\n * @param body\n * @param pretty If 'true', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param {*} [options] Override http request options.\n */\n replaceNamespacedRoleBinding(name, namespace, body, pretty, dryRun, options = {}) {\n const localVarPath = this.basePath + '/apis/rbac.authorization.k8s.io/v1beta1/namespaces/{namespace}/rolebindings/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling replaceNamespacedRoleBinding.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling replaceNamespacedRoleBinding.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling replaceNamespacedRoleBinding.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'PUT',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: ObjectSerializer.serialize(body, \"V1beta1RoleBinding\")\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1beta1RoleBinding\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n}\nexports.RbacAuthorizationV1beta1Api = RbacAuthorizationV1beta1Api;\nvar SchedulingApiApiKeys;\n(function (SchedulingApiApiKeys) {\n SchedulingApiApiKeys[SchedulingApiApiKeys[\"BearerToken\"] = 0] = \"BearerToken\";\n})(SchedulingApiApiKeys = exports.SchedulingApiApiKeys || (exports.SchedulingApiApiKeys = {}));\nclass SchedulingApi {\n constructor(basePathOrUsername, password, basePath) {\n this._basePath = defaultBasePath;\n this.defaultHeaders = {};\n this._useQuerystring = false;\n this.authentications = {\n 'default': new VoidAuth(),\n 'BearerToken': new ApiKeyAuth('header', 'authorization'),\n };\n if (password) {\n if (basePath) {\n this.basePath = basePath;\n }\n }\n else {\n if (basePathOrUsername) {\n this.basePath = basePathOrUsername;\n }\n }\n }\n set useQuerystring(value) {\n this._useQuerystring = value;\n }\n set basePath(basePath) {\n this._basePath = basePath;\n }\n get basePath() {\n return this._basePath;\n }\n setDefaultAuthentication(auth) {\n this.authentications.default = auth;\n }\n setApiKey(key, value) {\n this.authentications[SchedulingApiApiKeys[key]].apiKey = value;\n }\n /**\n * get information of a group\n * @param {*} [options] Override http request options.\n */\n getAPIGroup(options = {}) {\n const localVarPath = this.basePath + '/apis/scheduling.k8s.io/';\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1APIGroup\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n}\nexports.SchedulingApi = SchedulingApi;\nvar SchedulingV1alpha1ApiApiKeys;\n(function (SchedulingV1alpha1ApiApiKeys) {\n SchedulingV1alpha1ApiApiKeys[SchedulingV1alpha1ApiApiKeys[\"BearerToken\"] = 0] = \"BearerToken\";\n})(SchedulingV1alpha1ApiApiKeys = exports.SchedulingV1alpha1ApiApiKeys || (exports.SchedulingV1alpha1ApiApiKeys = {}));\nclass SchedulingV1alpha1Api {\n constructor(basePathOrUsername, password, basePath) {\n this._basePath = defaultBasePath;\n this.defaultHeaders = {};\n this._useQuerystring = false;\n this.authentications = {\n 'default': new VoidAuth(),\n 'BearerToken': new ApiKeyAuth('header', 'authorization'),\n };\n if (password) {\n if (basePath) {\n this.basePath = basePath;\n }\n }\n else {\n if (basePathOrUsername) {\n this.basePath = basePathOrUsername;\n }\n }\n }\n set useQuerystring(value) {\n this._useQuerystring = value;\n }\n set basePath(basePath) {\n this._basePath = basePath;\n }\n get basePath() {\n return this._basePath;\n }\n setDefaultAuthentication(auth) {\n this.authentications.default = auth;\n }\n setApiKey(key, value) {\n this.authentications[SchedulingV1alpha1ApiApiKeys[key]].apiKey = value;\n }\n /**\n * create a PriorityClass\n * @param body\n * @param includeUninitialized If true, partially initialized resources are included in the response.\n * @param pretty If 'true', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param {*} [options] Override http request options.\n */\n createPriorityClass(body, includeUninitialized, pretty, dryRun, options = {}) {\n const localVarPath = this.basePath + '/apis/scheduling.k8s.io/v1alpha1/priorityclasses';\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling createPriorityClass.');\n }\n if (includeUninitialized !== undefined) {\n localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, \"boolean\");\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'POST',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: ObjectSerializer.serialize(body, \"V1alpha1PriorityClass\")\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1alpha1PriorityClass\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * delete collection of PriorityClass\n * @param includeUninitialized If true, partially initialized resources are included in the response.\n * @param pretty If 'true', then the output is pretty printed.\n * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \\"next key\\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.\n * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything.\n * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything.\n * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.\n * @param resourceVersion When specified with a watch call, shows changes that occur after that particular version of a resource. Defaults to changes from the beginning of history. When specified for list: - if unset, then the result is returned from remote storage based on quorum-read flag; - if it's 0, then we simply return what we currently have in cache, no guarantee; - if set to non zero, then the result is at least as fresh as given rv.\n * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.\n * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.\n * @param {*} [options] Override http request options.\n */\n deleteCollectionPriorityClass(includeUninitialized, pretty, _continue, fieldSelector, labelSelector, limit, resourceVersion, timeoutSeconds, watch, options = {}) {\n const localVarPath = this.basePath + '/apis/scheduling.k8s.io/v1alpha1/priorityclasses';\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n if (includeUninitialized !== undefined) {\n localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, \"boolean\");\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (_continue !== undefined) {\n localVarQueryParameters['continue'] = ObjectSerializer.serialize(_continue, \"string\");\n }\n if (fieldSelector !== undefined) {\n localVarQueryParameters['fieldSelector'] = ObjectSerializer.serialize(fieldSelector, \"string\");\n }\n if (labelSelector !== undefined) {\n localVarQueryParameters['labelSelector'] = ObjectSerializer.serialize(labelSelector, \"string\");\n }\n if (limit !== undefined) {\n localVarQueryParameters['limit'] = ObjectSerializer.serialize(limit, \"number\");\n }\n if (resourceVersion !== undefined) {\n localVarQueryParameters['resourceVersion'] = ObjectSerializer.serialize(resourceVersion, \"string\");\n }\n if (timeoutSeconds !== undefined) {\n localVarQueryParameters['timeoutSeconds'] = ObjectSerializer.serialize(timeoutSeconds, \"number\");\n }\n if (watch !== undefined) {\n localVarQueryParameters['watch'] = ObjectSerializer.serialize(watch, \"boolean\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'DELETE',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1Status\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * delete a PriorityClass\n * @param name name of the PriorityClass\n * @param pretty If 'true', then the output is pretty printed.\n * @param body\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param gracePeriodSeconds The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately.\n * @param orphanDependents Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \\"orphan\\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both.\n * @param propagationPolicy Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground.\n * @param {*} [options] Override http request options.\n */\n deletePriorityClass(name, pretty, body, dryRun, gracePeriodSeconds, orphanDependents, propagationPolicy, options = {}) {\n const localVarPath = this.basePath + '/apis/scheduling.k8s.io/v1alpha1/priorityclasses/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling deletePriorityClass.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, \"string\");\n }\n if (gracePeriodSeconds !== undefined) {\n localVarQueryParameters['gracePeriodSeconds'] = ObjectSerializer.serialize(gracePeriodSeconds, \"number\");\n }\n if (orphanDependents !== undefined) {\n localVarQueryParameters['orphanDependents'] = ObjectSerializer.serialize(orphanDependents, \"boolean\");\n }\n if (propagationPolicy !== undefined) {\n localVarQueryParameters['propagationPolicy'] = ObjectSerializer.serialize(propagationPolicy, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'DELETE',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: ObjectSerializer.serialize(body, \"V1DeleteOptions\")\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1Status\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * get available resources\n * @param {*} [options] Override http request options.\n */\n getAPIResources(options = {}) {\n const localVarPath = this.basePath + '/apis/scheduling.k8s.io/v1alpha1/';\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1APIResourceList\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * list or watch objects of kind PriorityClass\n * @param includeUninitialized If true, partially initialized resources are included in the response.\n * @param pretty If 'true', then the output is pretty printed.\n * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \\"next key\\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.\n * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything.\n * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything.\n * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.\n * @param resourceVersion When specified with a watch call, shows changes that occur after that particular version of a resource. Defaults to changes from the beginning of history. When specified for list: - if unset, then the result is returned from remote storage based on quorum-read flag; - if it's 0, then we simply return what we currently have in cache, no guarantee; - if set to non zero, then the result is at least as fresh as given rv.\n * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.\n * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.\n * @param {*} [options] Override http request options.\n */\n listPriorityClass(includeUninitialized, pretty, _continue, fieldSelector, labelSelector, limit, resourceVersion, timeoutSeconds, watch, options = {}) {\n const localVarPath = this.basePath + '/apis/scheduling.k8s.io/v1alpha1/priorityclasses';\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n if (includeUninitialized !== undefined) {\n localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, \"boolean\");\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (_continue !== undefined) {\n localVarQueryParameters['continue'] = ObjectSerializer.serialize(_continue, \"string\");\n }\n if (fieldSelector !== undefined) {\n localVarQueryParameters['fieldSelector'] = ObjectSerializer.serialize(fieldSelector, \"string\");\n }\n if (labelSelector !== undefined) {\n localVarQueryParameters['labelSelector'] = ObjectSerializer.serialize(labelSelector, \"string\");\n }\n if (limit !== undefined) {\n localVarQueryParameters['limit'] = ObjectSerializer.serialize(limit, \"number\");\n }\n if (resourceVersion !== undefined) {\n localVarQueryParameters['resourceVersion'] = ObjectSerializer.serialize(resourceVersion, \"string\");\n }\n if (timeoutSeconds !== undefined) {\n localVarQueryParameters['timeoutSeconds'] = ObjectSerializer.serialize(timeoutSeconds, \"number\");\n }\n if (watch !== undefined) {\n localVarQueryParameters['watch'] = ObjectSerializer.serialize(watch, \"boolean\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1alpha1PriorityClassList\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * partially update the specified PriorityClass\n * @param name name of the PriorityClass\n * @param body\n * @param pretty If 'true', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param {*} [options] Override http request options.\n */\n patchPriorityClass(name, body, pretty, dryRun, options = {}) {\n const localVarPath = this.basePath + '/apis/scheduling.k8s.io/v1alpha1/priorityclasses/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling patchPriorityClass.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling patchPriorityClass.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'PATCH',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: ObjectSerializer.serialize(body, \"any\")\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1alpha1PriorityClass\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * read the specified PriorityClass\n * @param name name of the PriorityClass\n * @param pretty If 'true', then the output is pretty printed.\n * @param exact Should the export be exact. Exact export maintains cluster-specific fields like 'Namespace'.\n * @param _export Should this value be exported. Export strips fields that a user can not specify.\n * @param {*} [options] Override http request options.\n */\n readPriorityClass(name, pretty, exact, _export, options = {}) {\n const localVarPath = this.basePath + '/apis/scheduling.k8s.io/v1alpha1/priorityclasses/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling readPriorityClass.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (exact !== undefined) {\n localVarQueryParameters['exact'] = ObjectSerializer.serialize(exact, \"boolean\");\n }\n if (_export !== undefined) {\n localVarQueryParameters['export'] = ObjectSerializer.serialize(_export, \"boolean\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1alpha1PriorityClass\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * replace the specified PriorityClass\n * @param name name of the PriorityClass\n * @param body\n * @param pretty If 'true', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param {*} [options] Override http request options.\n */\n replacePriorityClass(name, body, pretty, dryRun, options = {}) {\n const localVarPath = this.basePath + '/apis/scheduling.k8s.io/v1alpha1/priorityclasses/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling replacePriorityClass.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling replacePriorityClass.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'PUT',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: ObjectSerializer.serialize(body, \"V1alpha1PriorityClass\")\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1alpha1PriorityClass\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n}\nexports.SchedulingV1alpha1Api = SchedulingV1alpha1Api;\nvar SchedulingV1beta1ApiApiKeys;\n(function (SchedulingV1beta1ApiApiKeys) {\n SchedulingV1beta1ApiApiKeys[SchedulingV1beta1ApiApiKeys[\"BearerToken\"] = 0] = \"BearerToken\";\n})(SchedulingV1beta1ApiApiKeys = exports.SchedulingV1beta1ApiApiKeys || (exports.SchedulingV1beta1ApiApiKeys = {}));\nclass SchedulingV1beta1Api {\n constructor(basePathOrUsername, password, basePath) {\n this._basePath = defaultBasePath;\n this.defaultHeaders = {};\n this._useQuerystring = false;\n this.authentications = {\n 'default': new VoidAuth(),\n 'BearerToken': new ApiKeyAuth('header', 'authorization'),\n };\n if (password) {\n if (basePath) {\n this.basePath = basePath;\n }\n }\n else {\n if (basePathOrUsername) {\n this.basePath = basePathOrUsername;\n }\n }\n }\n set useQuerystring(value) {\n this._useQuerystring = value;\n }\n set basePath(basePath) {\n this._basePath = basePath;\n }\n get basePath() {\n return this._basePath;\n }\n setDefaultAuthentication(auth) {\n this.authentications.default = auth;\n }\n setApiKey(key, value) {\n this.authentications[SchedulingV1beta1ApiApiKeys[key]].apiKey = value;\n }\n /**\n * create a PriorityClass\n * @param body\n * @param includeUninitialized If true, partially initialized resources are included in the response.\n * @param pretty If 'true', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param {*} [options] Override http request options.\n */\n createPriorityClass(body, includeUninitialized, pretty, dryRun, options = {}) {\n const localVarPath = this.basePath + '/apis/scheduling.k8s.io/v1beta1/priorityclasses';\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling createPriorityClass.');\n }\n if (includeUninitialized !== undefined) {\n localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, \"boolean\");\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'POST',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: ObjectSerializer.serialize(body, \"V1beta1PriorityClass\")\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1beta1PriorityClass\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * delete collection of PriorityClass\n * @param includeUninitialized If true, partially initialized resources are included in the response.\n * @param pretty If 'true', then the output is pretty printed.\n * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \\"next key\\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.\n * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything.\n * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything.\n * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.\n * @param resourceVersion When specified with a watch call, shows changes that occur after that particular version of a resource. Defaults to changes from the beginning of history. When specified for list: - if unset, then the result is returned from remote storage based on quorum-read flag; - if it's 0, then we simply return what we currently have in cache, no guarantee; - if set to non zero, then the result is at least as fresh as given rv.\n * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.\n * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.\n * @param {*} [options] Override http request options.\n */\n deleteCollectionPriorityClass(includeUninitialized, pretty, _continue, fieldSelector, labelSelector, limit, resourceVersion, timeoutSeconds, watch, options = {}) {\n const localVarPath = this.basePath + '/apis/scheduling.k8s.io/v1beta1/priorityclasses';\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n if (includeUninitialized !== undefined) {\n localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, \"boolean\");\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (_continue !== undefined) {\n localVarQueryParameters['continue'] = ObjectSerializer.serialize(_continue, \"string\");\n }\n if (fieldSelector !== undefined) {\n localVarQueryParameters['fieldSelector'] = ObjectSerializer.serialize(fieldSelector, \"string\");\n }\n if (labelSelector !== undefined) {\n localVarQueryParameters['labelSelector'] = ObjectSerializer.serialize(labelSelector, \"string\");\n }\n if (limit !== undefined) {\n localVarQueryParameters['limit'] = ObjectSerializer.serialize(limit, \"number\");\n }\n if (resourceVersion !== undefined) {\n localVarQueryParameters['resourceVersion'] = ObjectSerializer.serialize(resourceVersion, \"string\");\n }\n if (timeoutSeconds !== undefined) {\n localVarQueryParameters['timeoutSeconds'] = ObjectSerializer.serialize(timeoutSeconds, \"number\");\n }\n if (watch !== undefined) {\n localVarQueryParameters['watch'] = ObjectSerializer.serialize(watch, \"boolean\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'DELETE',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1Status\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * delete a PriorityClass\n * @param name name of the PriorityClass\n * @param pretty If 'true', then the output is pretty printed.\n * @param body\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param gracePeriodSeconds The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately.\n * @param orphanDependents Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \\"orphan\\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both.\n * @param propagationPolicy Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground.\n * @param {*} [options] Override http request options.\n */\n deletePriorityClass(name, pretty, body, dryRun, gracePeriodSeconds, orphanDependents, propagationPolicy, options = {}) {\n const localVarPath = this.basePath + '/apis/scheduling.k8s.io/v1beta1/priorityclasses/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling deletePriorityClass.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, \"string\");\n }\n if (gracePeriodSeconds !== undefined) {\n localVarQueryParameters['gracePeriodSeconds'] = ObjectSerializer.serialize(gracePeriodSeconds, \"number\");\n }\n if (orphanDependents !== undefined) {\n localVarQueryParameters['orphanDependents'] = ObjectSerializer.serialize(orphanDependents, \"boolean\");\n }\n if (propagationPolicy !== undefined) {\n localVarQueryParameters['propagationPolicy'] = ObjectSerializer.serialize(propagationPolicy, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'DELETE',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: ObjectSerializer.serialize(body, \"V1DeleteOptions\")\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1Status\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * get available resources\n * @param {*} [options] Override http request options.\n */\n getAPIResources(options = {}) {\n const localVarPath = this.basePath + '/apis/scheduling.k8s.io/v1beta1/';\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1APIResourceList\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * list or watch objects of kind PriorityClass\n * @param includeUninitialized If true, partially initialized resources are included in the response.\n * @param pretty If 'true', then the output is pretty printed.\n * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \\"next key\\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.\n * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything.\n * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything.\n * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.\n * @param resourceVersion When specified with a watch call, shows changes that occur after that particular version of a resource. Defaults to changes from the beginning of history. When specified for list: - if unset, then the result is returned from remote storage based on quorum-read flag; - if it's 0, then we simply return what we currently have in cache, no guarantee; - if set to non zero, then the result is at least as fresh as given rv.\n * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.\n * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.\n * @param {*} [options] Override http request options.\n */\n listPriorityClass(includeUninitialized, pretty, _continue, fieldSelector, labelSelector, limit, resourceVersion, timeoutSeconds, watch, options = {}) {\n const localVarPath = this.basePath + '/apis/scheduling.k8s.io/v1beta1/priorityclasses';\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n if (includeUninitialized !== undefined) {\n localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, \"boolean\");\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (_continue !== undefined) {\n localVarQueryParameters['continue'] = ObjectSerializer.serialize(_continue, \"string\");\n }\n if (fieldSelector !== undefined) {\n localVarQueryParameters['fieldSelector'] = ObjectSerializer.serialize(fieldSelector, \"string\");\n }\n if (labelSelector !== undefined) {\n localVarQueryParameters['labelSelector'] = ObjectSerializer.serialize(labelSelector, \"string\");\n }\n if (limit !== undefined) {\n localVarQueryParameters['limit'] = ObjectSerializer.serialize(limit, \"number\");\n }\n if (resourceVersion !== undefined) {\n localVarQueryParameters['resourceVersion'] = ObjectSerializer.serialize(resourceVersion, \"string\");\n }\n if (timeoutSeconds !== undefined) {\n localVarQueryParameters['timeoutSeconds'] = ObjectSerializer.serialize(timeoutSeconds, \"number\");\n }\n if (watch !== undefined) {\n localVarQueryParameters['watch'] = ObjectSerializer.serialize(watch, \"boolean\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1beta1PriorityClassList\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * partially update the specified PriorityClass\n * @param name name of the PriorityClass\n * @param body\n * @param pretty If 'true', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param {*} [options] Override http request options.\n */\n patchPriorityClass(name, body, pretty, dryRun, options = {}) {\n const localVarPath = this.basePath + '/apis/scheduling.k8s.io/v1beta1/priorityclasses/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling patchPriorityClass.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling patchPriorityClass.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'PATCH',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: ObjectSerializer.serialize(body, \"any\")\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1beta1PriorityClass\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * read the specified PriorityClass\n * @param name name of the PriorityClass\n * @param pretty If 'true', then the output is pretty printed.\n * @param exact Should the export be exact. Exact export maintains cluster-specific fields like 'Namespace'.\n * @param _export Should this value be exported. Export strips fields that a user can not specify.\n * @param {*} [options] Override http request options.\n */\n readPriorityClass(name, pretty, exact, _export, options = {}) {\n const localVarPath = this.basePath + '/apis/scheduling.k8s.io/v1beta1/priorityclasses/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling readPriorityClass.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (exact !== undefined) {\n localVarQueryParameters['exact'] = ObjectSerializer.serialize(exact, \"boolean\");\n }\n if (_export !== undefined) {\n localVarQueryParameters['export'] = ObjectSerializer.serialize(_export, \"boolean\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1beta1PriorityClass\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * replace the specified PriorityClass\n * @param name name of the PriorityClass\n * @param body\n * @param pretty If 'true', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param {*} [options] Override http request options.\n */\n replacePriorityClass(name, body, pretty, dryRun, options = {}) {\n const localVarPath = this.basePath + '/apis/scheduling.k8s.io/v1beta1/priorityclasses/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling replacePriorityClass.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling replacePriorityClass.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'PUT',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: ObjectSerializer.serialize(body, \"V1beta1PriorityClass\")\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1beta1PriorityClass\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n}\nexports.SchedulingV1beta1Api = SchedulingV1beta1Api;\nvar SettingsApiApiKeys;\n(function (SettingsApiApiKeys) {\n SettingsApiApiKeys[SettingsApiApiKeys[\"BearerToken\"] = 0] = \"BearerToken\";\n})(SettingsApiApiKeys = exports.SettingsApiApiKeys || (exports.SettingsApiApiKeys = {}));\nclass SettingsApi {\n constructor(basePathOrUsername, password, basePath) {\n this._basePath = defaultBasePath;\n this.defaultHeaders = {};\n this._useQuerystring = false;\n this.authentications = {\n 'default': new VoidAuth(),\n 'BearerToken': new ApiKeyAuth('header', 'authorization'),\n };\n if (password) {\n if (basePath) {\n this.basePath = basePath;\n }\n }\n else {\n if (basePathOrUsername) {\n this.basePath = basePathOrUsername;\n }\n }\n }\n set useQuerystring(value) {\n this._useQuerystring = value;\n }\n set basePath(basePath) {\n this._basePath = basePath;\n }\n get basePath() {\n return this._basePath;\n }\n setDefaultAuthentication(auth) {\n this.authentications.default = auth;\n }\n setApiKey(key, value) {\n this.authentications[SettingsApiApiKeys[key]].apiKey = value;\n }\n /**\n * get information of a group\n * @param {*} [options] Override http request options.\n */\n getAPIGroup(options = {}) {\n const localVarPath = this.basePath + '/apis/settings.k8s.io/';\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1APIGroup\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n}\nexports.SettingsApi = SettingsApi;\nvar SettingsV1alpha1ApiApiKeys;\n(function (SettingsV1alpha1ApiApiKeys) {\n SettingsV1alpha1ApiApiKeys[SettingsV1alpha1ApiApiKeys[\"BearerToken\"] = 0] = \"BearerToken\";\n})(SettingsV1alpha1ApiApiKeys = exports.SettingsV1alpha1ApiApiKeys || (exports.SettingsV1alpha1ApiApiKeys = {}));\nclass SettingsV1alpha1Api {\n constructor(basePathOrUsername, password, basePath) {\n this._basePath = defaultBasePath;\n this.defaultHeaders = {};\n this._useQuerystring = false;\n this.authentications = {\n 'default': new VoidAuth(),\n 'BearerToken': new ApiKeyAuth('header', 'authorization'),\n };\n if (password) {\n if (basePath) {\n this.basePath = basePath;\n }\n }\n else {\n if (basePathOrUsername) {\n this.basePath = basePathOrUsername;\n }\n }\n }\n set useQuerystring(value) {\n this._useQuerystring = value;\n }\n set basePath(basePath) {\n this._basePath = basePath;\n }\n get basePath() {\n return this._basePath;\n }\n setDefaultAuthentication(auth) {\n this.authentications.default = auth;\n }\n setApiKey(key, value) {\n this.authentications[SettingsV1alpha1ApiApiKeys[key]].apiKey = value;\n }\n /**\n * create a PodPreset\n * @param namespace object name and auth scope, such as for teams and projects\n * @param body\n * @param includeUninitialized If true, partially initialized resources are included in the response.\n * @param pretty If 'true', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param {*} [options] Override http request options.\n */\n createNamespacedPodPreset(namespace, body, includeUninitialized, pretty, dryRun, options = {}) {\n const localVarPath = this.basePath + '/apis/settings.k8s.io/v1alpha1/namespaces/{namespace}/podpresets'\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling createNamespacedPodPreset.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling createNamespacedPodPreset.');\n }\n if (includeUninitialized !== undefined) {\n localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, \"boolean\");\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'POST',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: ObjectSerializer.serialize(body, \"V1alpha1PodPreset\")\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1alpha1PodPreset\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * delete collection of PodPreset\n * @param namespace object name and auth scope, such as for teams and projects\n * @param includeUninitialized If true, partially initialized resources are included in the response.\n * @param pretty If 'true', then the output is pretty printed.\n * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \\"next key\\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.\n * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything.\n * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything.\n * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.\n * @param resourceVersion When specified with a watch call, shows changes that occur after that particular version of a resource. Defaults to changes from the beginning of history. When specified for list: - if unset, then the result is returned from remote storage based on quorum-read flag; - if it's 0, then we simply return what we currently have in cache, no guarantee; - if set to non zero, then the result is at least as fresh as given rv.\n * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.\n * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.\n * @param {*} [options] Override http request options.\n */\n deleteCollectionNamespacedPodPreset(namespace, includeUninitialized, pretty, _continue, fieldSelector, labelSelector, limit, resourceVersion, timeoutSeconds, watch, options = {}) {\n const localVarPath = this.basePath + '/apis/settings.k8s.io/v1alpha1/namespaces/{namespace}/podpresets'\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling deleteCollectionNamespacedPodPreset.');\n }\n if (includeUninitialized !== undefined) {\n localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, \"boolean\");\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (_continue !== undefined) {\n localVarQueryParameters['continue'] = ObjectSerializer.serialize(_continue, \"string\");\n }\n if (fieldSelector !== undefined) {\n localVarQueryParameters['fieldSelector'] = ObjectSerializer.serialize(fieldSelector, \"string\");\n }\n if (labelSelector !== undefined) {\n localVarQueryParameters['labelSelector'] = ObjectSerializer.serialize(labelSelector, \"string\");\n }\n if (limit !== undefined) {\n localVarQueryParameters['limit'] = ObjectSerializer.serialize(limit, \"number\");\n }\n if (resourceVersion !== undefined) {\n localVarQueryParameters['resourceVersion'] = ObjectSerializer.serialize(resourceVersion, \"string\");\n }\n if (timeoutSeconds !== undefined) {\n localVarQueryParameters['timeoutSeconds'] = ObjectSerializer.serialize(timeoutSeconds, \"number\");\n }\n if (watch !== undefined) {\n localVarQueryParameters['watch'] = ObjectSerializer.serialize(watch, \"boolean\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'DELETE',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1Status\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * delete a PodPreset\n * @param name name of the PodPreset\n * @param namespace object name and auth scope, such as for teams and projects\n * @param pretty If 'true', then the output is pretty printed.\n * @param body\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param gracePeriodSeconds The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately.\n * @param orphanDependents Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \\"orphan\\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both.\n * @param propagationPolicy Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground.\n * @param {*} [options] Override http request options.\n */\n deleteNamespacedPodPreset(name, namespace, pretty, body, dryRun, gracePeriodSeconds, orphanDependents, propagationPolicy, options = {}) {\n const localVarPath = this.basePath + '/apis/settings.k8s.io/v1alpha1/namespaces/{namespace}/podpresets/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling deleteNamespacedPodPreset.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling deleteNamespacedPodPreset.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, \"string\");\n }\n if (gracePeriodSeconds !== undefined) {\n localVarQueryParameters['gracePeriodSeconds'] = ObjectSerializer.serialize(gracePeriodSeconds, \"number\");\n }\n if (orphanDependents !== undefined) {\n localVarQueryParameters['orphanDependents'] = ObjectSerializer.serialize(orphanDependents, \"boolean\");\n }\n if (propagationPolicy !== undefined) {\n localVarQueryParameters['propagationPolicy'] = ObjectSerializer.serialize(propagationPolicy, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'DELETE',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: ObjectSerializer.serialize(body, \"V1DeleteOptions\")\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1Status\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * get available resources\n * @param {*} [options] Override http request options.\n */\n getAPIResources(options = {}) {\n const localVarPath = this.basePath + '/apis/settings.k8s.io/v1alpha1/';\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1APIResourceList\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * list or watch objects of kind PodPreset\n * @param namespace object name and auth scope, such as for teams and projects\n * @param includeUninitialized If true, partially initialized resources are included in the response.\n * @param pretty If 'true', then the output is pretty printed.\n * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \\"next key\\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.\n * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything.\n * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything.\n * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.\n * @param resourceVersion When specified with a watch call, shows changes that occur after that particular version of a resource. Defaults to changes from the beginning of history. When specified for list: - if unset, then the result is returned from remote storage based on quorum-read flag; - if it's 0, then we simply return what we currently have in cache, no guarantee; - if set to non zero, then the result is at least as fresh as given rv.\n * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.\n * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.\n * @param {*} [options] Override http request options.\n */\n listNamespacedPodPreset(namespace, includeUninitialized, pretty, _continue, fieldSelector, labelSelector, limit, resourceVersion, timeoutSeconds, watch, options = {}) {\n const localVarPath = this.basePath + '/apis/settings.k8s.io/v1alpha1/namespaces/{namespace}/podpresets'\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling listNamespacedPodPreset.');\n }\n if (includeUninitialized !== undefined) {\n localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, \"boolean\");\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (_continue !== undefined) {\n localVarQueryParameters['continue'] = ObjectSerializer.serialize(_continue, \"string\");\n }\n if (fieldSelector !== undefined) {\n localVarQueryParameters['fieldSelector'] = ObjectSerializer.serialize(fieldSelector, \"string\");\n }\n if (labelSelector !== undefined) {\n localVarQueryParameters['labelSelector'] = ObjectSerializer.serialize(labelSelector, \"string\");\n }\n if (limit !== undefined) {\n localVarQueryParameters['limit'] = ObjectSerializer.serialize(limit, \"number\");\n }\n if (resourceVersion !== undefined) {\n localVarQueryParameters['resourceVersion'] = ObjectSerializer.serialize(resourceVersion, \"string\");\n }\n if (timeoutSeconds !== undefined) {\n localVarQueryParameters['timeoutSeconds'] = ObjectSerializer.serialize(timeoutSeconds, \"number\");\n }\n if (watch !== undefined) {\n localVarQueryParameters['watch'] = ObjectSerializer.serialize(watch, \"boolean\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1alpha1PodPresetList\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * list or watch objects of kind PodPreset\n * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \\"next key\\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.\n * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything.\n * @param includeUninitialized If true, partially initialized resources are included in the response.\n * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything.\n * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.\n * @param pretty If 'true', then the output is pretty printed.\n * @param resourceVersion When specified with a watch call, shows changes that occur after that particular version of a resource. Defaults to changes from the beginning of history. When specified for list: - if unset, then the result is returned from remote storage based on quorum-read flag; - if it's 0, then we simply return what we currently have in cache, no guarantee; - if set to non zero, then the result is at least as fresh as given rv.\n * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.\n * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.\n * @param {*} [options] Override http request options.\n */\n listPodPresetForAllNamespaces(_continue, fieldSelector, includeUninitialized, labelSelector, limit, pretty, resourceVersion, timeoutSeconds, watch, options = {}) {\n const localVarPath = this.basePath + '/apis/settings.k8s.io/v1alpha1/podpresets';\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n if (_continue !== undefined) {\n localVarQueryParameters['continue'] = ObjectSerializer.serialize(_continue, \"string\");\n }\n if (fieldSelector !== undefined) {\n localVarQueryParameters['fieldSelector'] = ObjectSerializer.serialize(fieldSelector, \"string\");\n }\n if (includeUninitialized !== undefined) {\n localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, \"boolean\");\n }\n if (labelSelector !== undefined) {\n localVarQueryParameters['labelSelector'] = ObjectSerializer.serialize(labelSelector, \"string\");\n }\n if (limit !== undefined) {\n localVarQueryParameters['limit'] = ObjectSerializer.serialize(limit, \"number\");\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (resourceVersion !== undefined) {\n localVarQueryParameters['resourceVersion'] = ObjectSerializer.serialize(resourceVersion, \"string\");\n }\n if (timeoutSeconds !== undefined) {\n localVarQueryParameters['timeoutSeconds'] = ObjectSerializer.serialize(timeoutSeconds, \"number\");\n }\n if (watch !== undefined) {\n localVarQueryParameters['watch'] = ObjectSerializer.serialize(watch, \"boolean\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1alpha1PodPresetList\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * partially update the specified PodPreset\n * @param name name of the PodPreset\n * @param namespace object name and auth scope, such as for teams and projects\n * @param body\n * @param pretty If 'true', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param {*} [options] Override http request options.\n */\n patchNamespacedPodPreset(name, namespace, body, pretty, dryRun, options = {}) {\n const localVarPath = this.basePath + '/apis/settings.k8s.io/v1alpha1/namespaces/{namespace}/podpresets/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling patchNamespacedPodPreset.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling patchNamespacedPodPreset.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling patchNamespacedPodPreset.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'PATCH',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: ObjectSerializer.serialize(body, \"any\")\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1alpha1PodPreset\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * read the specified PodPreset\n * @param name name of the PodPreset\n * @param namespace object name and auth scope, such as for teams and projects\n * @param pretty If 'true', then the output is pretty printed.\n * @param exact Should the export be exact. Exact export maintains cluster-specific fields like 'Namespace'.\n * @param _export Should this value be exported. Export strips fields that a user can not specify.\n * @param {*} [options] Override http request options.\n */\n readNamespacedPodPreset(name, namespace, pretty, exact, _export, options = {}) {\n const localVarPath = this.basePath + '/apis/settings.k8s.io/v1alpha1/namespaces/{namespace}/podpresets/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling readNamespacedPodPreset.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling readNamespacedPodPreset.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (exact !== undefined) {\n localVarQueryParameters['exact'] = ObjectSerializer.serialize(exact, \"boolean\");\n }\n if (_export !== undefined) {\n localVarQueryParameters['export'] = ObjectSerializer.serialize(_export, \"boolean\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1alpha1PodPreset\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * replace the specified PodPreset\n * @param name name of the PodPreset\n * @param namespace object name and auth scope, such as for teams and projects\n * @param body\n * @param pretty If 'true', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param {*} [options] Override http request options.\n */\n replaceNamespacedPodPreset(name, namespace, body, pretty, dryRun, options = {}) {\n const localVarPath = this.basePath + '/apis/settings.k8s.io/v1alpha1/namespaces/{namespace}/podpresets/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling replaceNamespacedPodPreset.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling replaceNamespacedPodPreset.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling replaceNamespacedPodPreset.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'PUT',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: ObjectSerializer.serialize(body, \"V1alpha1PodPreset\")\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1alpha1PodPreset\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n}\nexports.SettingsV1alpha1Api = SettingsV1alpha1Api;\nvar StorageApiApiKeys;\n(function (StorageApiApiKeys) {\n StorageApiApiKeys[StorageApiApiKeys[\"BearerToken\"] = 0] = \"BearerToken\";\n})(StorageApiApiKeys = exports.StorageApiApiKeys || (exports.StorageApiApiKeys = {}));\nclass StorageApi {\n constructor(basePathOrUsername, password, basePath) {\n this._basePath = defaultBasePath;\n this.defaultHeaders = {};\n this._useQuerystring = false;\n this.authentications = {\n 'default': new VoidAuth(),\n 'BearerToken': new ApiKeyAuth('header', 'authorization'),\n };\n if (password) {\n if (basePath) {\n this.basePath = basePath;\n }\n }\n else {\n if (basePathOrUsername) {\n this.basePath = basePathOrUsername;\n }\n }\n }\n set useQuerystring(value) {\n this._useQuerystring = value;\n }\n set basePath(basePath) {\n this._basePath = basePath;\n }\n get basePath() {\n return this._basePath;\n }\n setDefaultAuthentication(auth) {\n this.authentications.default = auth;\n }\n setApiKey(key, value) {\n this.authentications[StorageApiApiKeys[key]].apiKey = value;\n }\n /**\n * get information of a group\n * @param {*} [options] Override http request options.\n */\n getAPIGroup(options = {}) {\n const localVarPath = this.basePath + '/apis/storage.k8s.io/';\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1APIGroup\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n}\nexports.StorageApi = StorageApi;\nvar StorageV1ApiApiKeys;\n(function (StorageV1ApiApiKeys) {\n StorageV1ApiApiKeys[StorageV1ApiApiKeys[\"BearerToken\"] = 0] = \"BearerToken\";\n})(StorageV1ApiApiKeys = exports.StorageV1ApiApiKeys || (exports.StorageV1ApiApiKeys = {}));\nclass StorageV1Api {\n constructor(basePathOrUsername, password, basePath) {\n this._basePath = defaultBasePath;\n this.defaultHeaders = {};\n this._useQuerystring = false;\n this.authentications = {\n 'default': new VoidAuth(),\n 'BearerToken': new ApiKeyAuth('header', 'authorization'),\n };\n if (password) {\n if (basePath) {\n this.basePath = basePath;\n }\n }\n else {\n if (basePathOrUsername) {\n this.basePath = basePathOrUsername;\n }\n }\n }\n set useQuerystring(value) {\n this._useQuerystring = value;\n }\n set basePath(basePath) {\n this._basePath = basePath;\n }\n get basePath() {\n return this._basePath;\n }\n setDefaultAuthentication(auth) {\n this.authentications.default = auth;\n }\n setApiKey(key, value) {\n this.authentications[StorageV1ApiApiKeys[key]].apiKey = value;\n }\n /**\n * create a StorageClass\n * @param body\n * @param includeUninitialized If true, partially initialized resources are included in the response.\n * @param pretty If 'true', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param {*} [options] Override http request options.\n */\n createStorageClass(body, includeUninitialized, pretty, dryRun, options = {}) {\n const localVarPath = this.basePath + '/apis/storage.k8s.io/v1/storageclasses';\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling createStorageClass.');\n }\n if (includeUninitialized !== undefined) {\n localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, \"boolean\");\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'POST',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: ObjectSerializer.serialize(body, \"V1StorageClass\")\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1StorageClass\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * create a VolumeAttachment\n * @param body\n * @param includeUninitialized If true, partially initialized resources are included in the response.\n * @param pretty If 'true', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param {*} [options] Override http request options.\n */\n createVolumeAttachment(body, includeUninitialized, pretty, dryRun, options = {}) {\n const localVarPath = this.basePath + '/apis/storage.k8s.io/v1/volumeattachments';\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling createVolumeAttachment.');\n }\n if (includeUninitialized !== undefined) {\n localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, \"boolean\");\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'POST',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: ObjectSerializer.serialize(body, \"V1VolumeAttachment\")\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1VolumeAttachment\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * delete collection of StorageClass\n * @param includeUninitialized If true, partially initialized resources are included in the response.\n * @param pretty If 'true', then the output is pretty printed.\n * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \\"next key\\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.\n * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything.\n * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything.\n * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.\n * @param resourceVersion When specified with a watch call, shows changes that occur after that particular version of a resource. Defaults to changes from the beginning of history. When specified for list: - if unset, then the result is returned from remote storage based on quorum-read flag; - if it's 0, then we simply return what we currently have in cache, no guarantee; - if set to non zero, then the result is at least as fresh as given rv.\n * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.\n * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.\n * @param {*} [options] Override http request options.\n */\n deleteCollectionStorageClass(includeUninitialized, pretty, _continue, fieldSelector, labelSelector, limit, resourceVersion, timeoutSeconds, watch, options = {}) {\n const localVarPath = this.basePath + '/apis/storage.k8s.io/v1/storageclasses';\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n if (includeUninitialized !== undefined) {\n localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, \"boolean\");\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (_continue !== undefined) {\n localVarQueryParameters['continue'] = ObjectSerializer.serialize(_continue, \"string\");\n }\n if (fieldSelector !== undefined) {\n localVarQueryParameters['fieldSelector'] = ObjectSerializer.serialize(fieldSelector, \"string\");\n }\n if (labelSelector !== undefined) {\n localVarQueryParameters['labelSelector'] = ObjectSerializer.serialize(labelSelector, \"string\");\n }\n if (limit !== undefined) {\n localVarQueryParameters['limit'] = ObjectSerializer.serialize(limit, \"number\");\n }\n if (resourceVersion !== undefined) {\n localVarQueryParameters['resourceVersion'] = ObjectSerializer.serialize(resourceVersion, \"string\");\n }\n if (timeoutSeconds !== undefined) {\n localVarQueryParameters['timeoutSeconds'] = ObjectSerializer.serialize(timeoutSeconds, \"number\");\n }\n if (watch !== undefined) {\n localVarQueryParameters['watch'] = ObjectSerializer.serialize(watch, \"boolean\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'DELETE',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1Status\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * delete collection of VolumeAttachment\n * @param includeUninitialized If true, partially initialized resources are included in the response.\n * @param pretty If 'true', then the output is pretty printed.\n * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \\"next key\\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.\n * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything.\n * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything.\n * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.\n * @param resourceVersion When specified with a watch call, shows changes that occur after that particular version of a resource. Defaults to changes from the beginning of history. When specified for list: - if unset, then the result is returned from remote storage based on quorum-read flag; - if it's 0, then we simply return what we currently have in cache, no guarantee; - if set to non zero, then the result is at least as fresh as given rv.\n * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.\n * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.\n * @param {*} [options] Override http request options.\n */\n deleteCollectionVolumeAttachment(includeUninitialized, pretty, _continue, fieldSelector, labelSelector, limit, resourceVersion, timeoutSeconds, watch, options = {}) {\n const localVarPath = this.basePath + '/apis/storage.k8s.io/v1/volumeattachments';\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n if (includeUninitialized !== undefined) {\n localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, \"boolean\");\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (_continue !== undefined) {\n localVarQueryParameters['continue'] = ObjectSerializer.serialize(_continue, \"string\");\n }\n if (fieldSelector !== undefined) {\n localVarQueryParameters['fieldSelector'] = ObjectSerializer.serialize(fieldSelector, \"string\");\n }\n if (labelSelector !== undefined) {\n localVarQueryParameters['labelSelector'] = ObjectSerializer.serialize(labelSelector, \"string\");\n }\n if (limit !== undefined) {\n localVarQueryParameters['limit'] = ObjectSerializer.serialize(limit, \"number\");\n }\n if (resourceVersion !== undefined) {\n localVarQueryParameters['resourceVersion'] = ObjectSerializer.serialize(resourceVersion, \"string\");\n }\n if (timeoutSeconds !== undefined) {\n localVarQueryParameters['timeoutSeconds'] = ObjectSerializer.serialize(timeoutSeconds, \"number\");\n }\n if (watch !== undefined) {\n localVarQueryParameters['watch'] = ObjectSerializer.serialize(watch, \"boolean\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'DELETE',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1Status\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * delete a StorageClass\n * @param name name of the StorageClass\n * @param pretty If 'true', then the output is pretty printed.\n * @param body\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param gracePeriodSeconds The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately.\n * @param orphanDependents Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \\"orphan\\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both.\n * @param propagationPolicy Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground.\n * @param {*} [options] Override http request options.\n */\n deleteStorageClass(name, pretty, body, dryRun, gracePeriodSeconds, orphanDependents, propagationPolicy, options = {}) {\n const localVarPath = this.basePath + '/apis/storage.k8s.io/v1/storageclasses/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling deleteStorageClass.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, \"string\");\n }\n if (gracePeriodSeconds !== undefined) {\n localVarQueryParameters['gracePeriodSeconds'] = ObjectSerializer.serialize(gracePeriodSeconds, \"number\");\n }\n if (orphanDependents !== undefined) {\n localVarQueryParameters['orphanDependents'] = ObjectSerializer.serialize(orphanDependents, \"boolean\");\n }\n if (propagationPolicy !== undefined) {\n localVarQueryParameters['propagationPolicy'] = ObjectSerializer.serialize(propagationPolicy, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'DELETE',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: ObjectSerializer.serialize(body, \"V1DeleteOptions\")\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1Status\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * delete a VolumeAttachment\n * @param name name of the VolumeAttachment\n * @param pretty If 'true', then the output is pretty printed.\n * @param body\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param gracePeriodSeconds The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately.\n * @param orphanDependents Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \\"orphan\\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both.\n * @param propagationPolicy Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground.\n * @param {*} [options] Override http request options.\n */\n deleteVolumeAttachment(name, pretty, body, dryRun, gracePeriodSeconds, orphanDependents, propagationPolicy, options = {}) {\n const localVarPath = this.basePath + '/apis/storage.k8s.io/v1/volumeattachments/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling deleteVolumeAttachment.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, \"string\");\n }\n if (gracePeriodSeconds !== undefined) {\n localVarQueryParameters['gracePeriodSeconds'] = ObjectSerializer.serialize(gracePeriodSeconds, \"number\");\n }\n if (orphanDependents !== undefined) {\n localVarQueryParameters['orphanDependents'] = ObjectSerializer.serialize(orphanDependents, \"boolean\");\n }\n if (propagationPolicy !== undefined) {\n localVarQueryParameters['propagationPolicy'] = ObjectSerializer.serialize(propagationPolicy, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'DELETE',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: ObjectSerializer.serialize(body, \"V1DeleteOptions\")\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1Status\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * get available resources\n * @param {*} [options] Override http request options.\n */\n getAPIResources(options = {}) {\n const localVarPath = this.basePath + '/apis/storage.k8s.io/v1/';\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1APIResourceList\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * list or watch objects of kind StorageClass\n * @param includeUninitialized If true, partially initialized resources are included in the response.\n * @param pretty If 'true', then the output is pretty printed.\n * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \\"next key\\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.\n * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything.\n * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything.\n * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.\n * @param resourceVersion When specified with a watch call, shows changes that occur after that particular version of a resource. Defaults to changes from the beginning of history. When specified for list: - if unset, then the result is returned from remote storage based on quorum-read flag; - if it's 0, then we simply return what we currently have in cache, no guarantee; - if set to non zero, then the result is at least as fresh as given rv.\n * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.\n * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.\n * @param {*} [options] Override http request options.\n */\n listStorageClass(includeUninitialized, pretty, _continue, fieldSelector, labelSelector, limit, resourceVersion, timeoutSeconds, watch, options = {}) {\n const localVarPath = this.basePath + '/apis/storage.k8s.io/v1/storageclasses';\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n if (includeUninitialized !== undefined) {\n localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, \"boolean\");\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (_continue !== undefined) {\n localVarQueryParameters['continue'] = ObjectSerializer.serialize(_continue, \"string\");\n }\n if (fieldSelector !== undefined) {\n localVarQueryParameters['fieldSelector'] = ObjectSerializer.serialize(fieldSelector, \"string\");\n }\n if (labelSelector !== undefined) {\n localVarQueryParameters['labelSelector'] = ObjectSerializer.serialize(labelSelector, \"string\");\n }\n if (limit !== undefined) {\n localVarQueryParameters['limit'] = ObjectSerializer.serialize(limit, \"number\");\n }\n if (resourceVersion !== undefined) {\n localVarQueryParameters['resourceVersion'] = ObjectSerializer.serialize(resourceVersion, \"string\");\n }\n if (timeoutSeconds !== undefined) {\n localVarQueryParameters['timeoutSeconds'] = ObjectSerializer.serialize(timeoutSeconds, \"number\");\n }\n if (watch !== undefined) {\n localVarQueryParameters['watch'] = ObjectSerializer.serialize(watch, \"boolean\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1StorageClassList\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * list or watch objects of kind VolumeAttachment\n * @param includeUninitialized If true, partially initialized resources are included in the response.\n * @param pretty If 'true', then the output is pretty printed.\n * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \\"next key\\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.\n * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything.\n * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything.\n * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.\n * @param resourceVersion When specified with a watch call, shows changes that occur after that particular version of a resource. Defaults to changes from the beginning of history. When specified for list: - if unset, then the result is returned from remote storage based on quorum-read flag; - if it's 0, then we simply return what we currently have in cache, no guarantee; - if set to non zero, then the result is at least as fresh as given rv.\n * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.\n * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.\n * @param {*} [options] Override http request options.\n */\n listVolumeAttachment(includeUninitialized, pretty, _continue, fieldSelector, labelSelector, limit, resourceVersion, timeoutSeconds, watch, options = {}) {\n const localVarPath = this.basePath + '/apis/storage.k8s.io/v1/volumeattachments';\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n if (includeUninitialized !== undefined) {\n localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, \"boolean\");\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (_continue !== undefined) {\n localVarQueryParameters['continue'] = ObjectSerializer.serialize(_continue, \"string\");\n }\n if (fieldSelector !== undefined) {\n localVarQueryParameters['fieldSelector'] = ObjectSerializer.serialize(fieldSelector, \"string\");\n }\n if (labelSelector !== undefined) {\n localVarQueryParameters['labelSelector'] = ObjectSerializer.serialize(labelSelector, \"string\");\n }\n if (limit !== undefined) {\n localVarQueryParameters['limit'] = ObjectSerializer.serialize(limit, \"number\");\n }\n if (resourceVersion !== undefined) {\n localVarQueryParameters['resourceVersion'] = ObjectSerializer.serialize(resourceVersion, \"string\");\n }\n if (timeoutSeconds !== undefined) {\n localVarQueryParameters['timeoutSeconds'] = ObjectSerializer.serialize(timeoutSeconds, \"number\");\n }\n if (watch !== undefined) {\n localVarQueryParameters['watch'] = ObjectSerializer.serialize(watch, \"boolean\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1VolumeAttachmentList\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * partially update the specified StorageClass\n * @param name name of the StorageClass\n * @param body\n * @param pretty If 'true', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param {*} [options] Override http request options.\n */\n patchStorageClass(name, body, pretty, dryRun, options = {}) {\n const localVarPath = this.basePath + '/apis/storage.k8s.io/v1/storageclasses/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling patchStorageClass.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling patchStorageClass.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'PATCH',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: ObjectSerializer.serialize(body, \"any\")\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1StorageClass\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * partially update the specified VolumeAttachment\n * @param name name of the VolumeAttachment\n * @param body\n * @param pretty If 'true', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param {*} [options] Override http request options.\n */\n patchVolumeAttachment(name, body, pretty, dryRun, options = {}) {\n const localVarPath = this.basePath + '/apis/storage.k8s.io/v1/volumeattachments/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling patchVolumeAttachment.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling patchVolumeAttachment.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'PATCH',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: ObjectSerializer.serialize(body, \"any\")\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1VolumeAttachment\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * partially update status of the specified VolumeAttachment\n * @param name name of the VolumeAttachment\n * @param body\n * @param pretty If 'true', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param {*} [options] Override http request options.\n */\n patchVolumeAttachmentStatus(name, body, pretty, dryRun, options = {}) {\n const localVarPath = this.basePath + '/apis/storage.k8s.io/v1/volumeattachments/{name}/status'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling patchVolumeAttachmentStatus.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling patchVolumeAttachmentStatus.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'PATCH',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: ObjectSerializer.serialize(body, \"any\")\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1VolumeAttachment\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * read the specified StorageClass\n * @param name name of the StorageClass\n * @param pretty If 'true', then the output is pretty printed.\n * @param exact Should the export be exact. Exact export maintains cluster-specific fields like 'Namespace'.\n * @param _export Should this value be exported. Export strips fields that a user can not specify.\n * @param {*} [options] Override http request options.\n */\n readStorageClass(name, pretty, exact, _export, options = {}) {\n const localVarPath = this.basePath + '/apis/storage.k8s.io/v1/storageclasses/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling readStorageClass.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (exact !== undefined) {\n localVarQueryParameters['exact'] = ObjectSerializer.serialize(exact, \"boolean\");\n }\n if (_export !== undefined) {\n localVarQueryParameters['export'] = ObjectSerializer.serialize(_export, \"boolean\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1StorageClass\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * read the specified VolumeAttachment\n * @param name name of the VolumeAttachment\n * @param pretty If 'true', then the output is pretty printed.\n * @param exact Should the export be exact. Exact export maintains cluster-specific fields like 'Namespace'.\n * @param _export Should this value be exported. Export strips fields that a user can not specify.\n * @param {*} [options] Override http request options.\n */\n readVolumeAttachment(name, pretty, exact, _export, options = {}) {\n const localVarPath = this.basePath + '/apis/storage.k8s.io/v1/volumeattachments/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling readVolumeAttachment.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (exact !== undefined) {\n localVarQueryParameters['exact'] = ObjectSerializer.serialize(exact, \"boolean\");\n }\n if (_export !== undefined) {\n localVarQueryParameters['export'] = ObjectSerializer.serialize(_export, \"boolean\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1VolumeAttachment\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * read status of the specified VolumeAttachment\n * @param name name of the VolumeAttachment\n * @param pretty If 'true', then the output is pretty printed.\n * @param {*} [options] Override http request options.\n */\n readVolumeAttachmentStatus(name, pretty, options = {}) {\n const localVarPath = this.basePath + '/apis/storage.k8s.io/v1/volumeattachments/{name}/status'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling readVolumeAttachmentStatus.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1VolumeAttachment\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * replace the specified StorageClass\n * @param name name of the StorageClass\n * @param body\n * @param pretty If 'true', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param {*} [options] Override http request options.\n */\n replaceStorageClass(name, body, pretty, dryRun, options = {}) {\n const localVarPath = this.basePath + '/apis/storage.k8s.io/v1/storageclasses/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling replaceStorageClass.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling replaceStorageClass.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'PUT',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: ObjectSerializer.serialize(body, \"V1StorageClass\")\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1StorageClass\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * replace the specified VolumeAttachment\n * @param name name of the VolumeAttachment\n * @param body\n * @param pretty If 'true', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param {*} [options] Override http request options.\n */\n replaceVolumeAttachment(name, body, pretty, dryRun, options = {}) {\n const localVarPath = this.basePath + '/apis/storage.k8s.io/v1/volumeattachments/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling replaceVolumeAttachment.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling replaceVolumeAttachment.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'PUT',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: ObjectSerializer.serialize(body, \"V1VolumeAttachment\")\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1VolumeAttachment\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * replace status of the specified VolumeAttachment\n * @param name name of the VolumeAttachment\n * @param body\n * @param pretty If 'true', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param {*} [options] Override http request options.\n */\n replaceVolumeAttachmentStatus(name, body, pretty, dryRun, options = {}) {\n const localVarPath = this.basePath + '/apis/storage.k8s.io/v1/volumeattachments/{name}/status'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling replaceVolumeAttachmentStatus.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling replaceVolumeAttachmentStatus.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'PUT',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: ObjectSerializer.serialize(body, \"V1VolumeAttachment\")\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1VolumeAttachment\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n}\nexports.StorageV1Api = StorageV1Api;\nvar StorageV1alpha1ApiApiKeys;\n(function (StorageV1alpha1ApiApiKeys) {\n StorageV1alpha1ApiApiKeys[StorageV1alpha1ApiApiKeys[\"BearerToken\"] = 0] = \"BearerToken\";\n})(StorageV1alpha1ApiApiKeys = exports.StorageV1alpha1ApiApiKeys || (exports.StorageV1alpha1ApiApiKeys = {}));\nclass StorageV1alpha1Api {\n constructor(basePathOrUsername, password, basePath) {\n this._basePath = defaultBasePath;\n this.defaultHeaders = {};\n this._useQuerystring = false;\n this.authentications = {\n 'default': new VoidAuth(),\n 'BearerToken': new ApiKeyAuth('header', 'authorization'),\n };\n if (password) {\n if (basePath) {\n this.basePath = basePath;\n }\n }\n else {\n if (basePathOrUsername) {\n this.basePath = basePathOrUsername;\n }\n }\n }\n set useQuerystring(value) {\n this._useQuerystring = value;\n }\n set basePath(basePath) {\n this._basePath = basePath;\n }\n get basePath() {\n return this._basePath;\n }\n setDefaultAuthentication(auth) {\n this.authentications.default = auth;\n }\n setApiKey(key, value) {\n this.authentications[StorageV1alpha1ApiApiKeys[key]].apiKey = value;\n }\n /**\n * create a VolumeAttachment\n * @param body\n * @param includeUninitialized If true, partially initialized resources are included in the response.\n * @param pretty If 'true', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param {*} [options] Override http request options.\n */\n createVolumeAttachment(body, includeUninitialized, pretty, dryRun, options = {}) {\n const localVarPath = this.basePath + '/apis/storage.k8s.io/v1alpha1/volumeattachments';\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling createVolumeAttachment.');\n }\n if (includeUninitialized !== undefined) {\n localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, \"boolean\");\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'POST',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: ObjectSerializer.serialize(body, \"V1alpha1VolumeAttachment\")\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1alpha1VolumeAttachment\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * delete collection of VolumeAttachment\n * @param includeUninitialized If true, partially initialized resources are included in the response.\n * @param pretty If 'true', then the output is pretty printed.\n * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \\"next key\\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.\n * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything.\n * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything.\n * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.\n * @param resourceVersion When specified with a watch call, shows changes that occur after that particular version of a resource. Defaults to changes from the beginning of history. When specified for list: - if unset, then the result is returned from remote storage based on quorum-read flag; - if it's 0, then we simply return what we currently have in cache, no guarantee; - if set to non zero, then the result is at least as fresh as given rv.\n * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.\n * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.\n * @param {*} [options] Override http request options.\n */\n deleteCollectionVolumeAttachment(includeUninitialized, pretty, _continue, fieldSelector, labelSelector, limit, resourceVersion, timeoutSeconds, watch, options = {}) {\n const localVarPath = this.basePath + '/apis/storage.k8s.io/v1alpha1/volumeattachments';\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n if (includeUninitialized !== undefined) {\n localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, \"boolean\");\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (_continue !== undefined) {\n localVarQueryParameters['continue'] = ObjectSerializer.serialize(_continue, \"string\");\n }\n if (fieldSelector !== undefined) {\n localVarQueryParameters['fieldSelector'] = ObjectSerializer.serialize(fieldSelector, \"string\");\n }\n if (labelSelector !== undefined) {\n localVarQueryParameters['labelSelector'] = ObjectSerializer.serialize(labelSelector, \"string\");\n }\n if (limit !== undefined) {\n localVarQueryParameters['limit'] = ObjectSerializer.serialize(limit, \"number\");\n }\n if (resourceVersion !== undefined) {\n localVarQueryParameters['resourceVersion'] = ObjectSerializer.serialize(resourceVersion, \"string\");\n }\n if (timeoutSeconds !== undefined) {\n localVarQueryParameters['timeoutSeconds'] = ObjectSerializer.serialize(timeoutSeconds, \"number\");\n }\n if (watch !== undefined) {\n localVarQueryParameters['watch'] = ObjectSerializer.serialize(watch, \"boolean\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'DELETE',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1Status\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * delete a VolumeAttachment\n * @param name name of the VolumeAttachment\n * @param pretty If 'true', then the output is pretty printed.\n * @param body\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param gracePeriodSeconds The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately.\n * @param orphanDependents Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \\"orphan\\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both.\n * @param propagationPolicy Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground.\n * @param {*} [options] Override http request options.\n */\n deleteVolumeAttachment(name, pretty, body, dryRun, gracePeriodSeconds, orphanDependents, propagationPolicy, options = {}) {\n const localVarPath = this.basePath + '/apis/storage.k8s.io/v1alpha1/volumeattachments/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling deleteVolumeAttachment.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, \"string\");\n }\n if (gracePeriodSeconds !== undefined) {\n localVarQueryParameters['gracePeriodSeconds'] = ObjectSerializer.serialize(gracePeriodSeconds, \"number\");\n }\n if (orphanDependents !== undefined) {\n localVarQueryParameters['orphanDependents'] = ObjectSerializer.serialize(orphanDependents, \"boolean\");\n }\n if (propagationPolicy !== undefined) {\n localVarQueryParameters['propagationPolicy'] = ObjectSerializer.serialize(propagationPolicy, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'DELETE',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: ObjectSerializer.serialize(body, \"V1DeleteOptions\")\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1Status\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * get available resources\n * @param {*} [options] Override http request options.\n */\n getAPIResources(options = {}) {\n const localVarPath = this.basePath + '/apis/storage.k8s.io/v1alpha1/';\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1APIResourceList\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * list or watch objects of kind VolumeAttachment\n * @param includeUninitialized If true, partially initialized resources are included in the response.\n * @param pretty If 'true', then the output is pretty printed.\n * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \\"next key\\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.\n * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything.\n * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything.\n * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.\n * @param resourceVersion When specified with a watch call, shows changes that occur after that particular version of a resource. Defaults to changes from the beginning of history. When specified for list: - if unset, then the result is returned from remote storage based on quorum-read flag; - if it's 0, then we simply return what we currently have in cache, no guarantee; - if set to non zero, then the result is at least as fresh as given rv.\n * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.\n * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.\n * @param {*} [options] Override http request options.\n */\n listVolumeAttachment(includeUninitialized, pretty, _continue, fieldSelector, labelSelector, limit, resourceVersion, timeoutSeconds, watch, options = {}) {\n const localVarPath = this.basePath + '/apis/storage.k8s.io/v1alpha1/volumeattachments';\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n if (includeUninitialized !== undefined) {\n localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, \"boolean\");\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (_continue !== undefined) {\n localVarQueryParameters['continue'] = ObjectSerializer.serialize(_continue, \"string\");\n }\n if (fieldSelector !== undefined) {\n localVarQueryParameters['fieldSelector'] = ObjectSerializer.serialize(fieldSelector, \"string\");\n }\n if (labelSelector !== undefined) {\n localVarQueryParameters['labelSelector'] = ObjectSerializer.serialize(labelSelector, \"string\");\n }\n if (limit !== undefined) {\n localVarQueryParameters['limit'] = ObjectSerializer.serialize(limit, \"number\");\n }\n if (resourceVersion !== undefined) {\n localVarQueryParameters['resourceVersion'] = ObjectSerializer.serialize(resourceVersion, \"string\");\n }\n if (timeoutSeconds !== undefined) {\n localVarQueryParameters['timeoutSeconds'] = ObjectSerializer.serialize(timeoutSeconds, \"number\");\n }\n if (watch !== undefined) {\n localVarQueryParameters['watch'] = ObjectSerializer.serialize(watch, \"boolean\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1alpha1VolumeAttachmentList\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * partially update the specified VolumeAttachment\n * @param name name of the VolumeAttachment\n * @param body\n * @param pretty If 'true', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param {*} [options] Override http request options.\n */\n patchVolumeAttachment(name, body, pretty, dryRun, options = {}) {\n const localVarPath = this.basePath + '/apis/storage.k8s.io/v1alpha1/volumeattachments/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling patchVolumeAttachment.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling patchVolumeAttachment.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'PATCH',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: ObjectSerializer.serialize(body, \"any\")\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1alpha1VolumeAttachment\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * read the specified VolumeAttachment\n * @param name name of the VolumeAttachment\n * @param pretty If 'true', then the output is pretty printed.\n * @param exact Should the export be exact. Exact export maintains cluster-specific fields like 'Namespace'.\n * @param _export Should this value be exported. Export strips fields that a user can not specify.\n * @param {*} [options] Override http request options.\n */\n readVolumeAttachment(name, pretty, exact, _export, options = {}) {\n const localVarPath = this.basePath + '/apis/storage.k8s.io/v1alpha1/volumeattachments/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling readVolumeAttachment.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (exact !== undefined) {\n localVarQueryParameters['exact'] = ObjectSerializer.serialize(exact, \"boolean\");\n }\n if (_export !== undefined) {\n localVarQueryParameters['export'] = ObjectSerializer.serialize(_export, \"boolean\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1alpha1VolumeAttachment\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * replace the specified VolumeAttachment\n * @param name name of the VolumeAttachment\n * @param body\n * @param pretty If 'true', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param {*} [options] Override http request options.\n */\n replaceVolumeAttachment(name, body, pretty, dryRun, options = {}) {\n const localVarPath = this.basePath + '/apis/storage.k8s.io/v1alpha1/volumeattachments/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling replaceVolumeAttachment.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling replaceVolumeAttachment.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'PUT',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: ObjectSerializer.serialize(body, \"V1alpha1VolumeAttachment\")\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1alpha1VolumeAttachment\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n}\nexports.StorageV1alpha1Api = StorageV1alpha1Api;\nvar StorageV1beta1ApiApiKeys;\n(function (StorageV1beta1ApiApiKeys) {\n StorageV1beta1ApiApiKeys[StorageV1beta1ApiApiKeys[\"BearerToken\"] = 0] = \"BearerToken\";\n})(StorageV1beta1ApiApiKeys = exports.StorageV1beta1ApiApiKeys || (exports.StorageV1beta1ApiApiKeys = {}));\nclass StorageV1beta1Api {\n constructor(basePathOrUsername, password, basePath) {\n this._basePath = defaultBasePath;\n this.defaultHeaders = {};\n this._useQuerystring = false;\n this.authentications = {\n 'default': new VoidAuth(),\n 'BearerToken': new ApiKeyAuth('header', 'authorization'),\n };\n if (password) {\n if (basePath) {\n this.basePath = basePath;\n }\n }\n else {\n if (basePathOrUsername) {\n this.basePath = basePathOrUsername;\n }\n }\n }\n set useQuerystring(value) {\n this._useQuerystring = value;\n }\n set basePath(basePath) {\n this._basePath = basePath;\n }\n get basePath() {\n return this._basePath;\n }\n setDefaultAuthentication(auth) {\n this.authentications.default = auth;\n }\n setApiKey(key, value) {\n this.authentications[StorageV1beta1ApiApiKeys[key]].apiKey = value;\n }\n /**\n * create a StorageClass\n * @param body\n * @param includeUninitialized If true, partially initialized resources are included in the response.\n * @param pretty If 'true', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param {*} [options] Override http request options.\n */\n createStorageClass(body, includeUninitialized, pretty, dryRun, options = {}) {\n const localVarPath = this.basePath + '/apis/storage.k8s.io/v1beta1/storageclasses';\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling createStorageClass.');\n }\n if (includeUninitialized !== undefined) {\n localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, \"boolean\");\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'POST',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: ObjectSerializer.serialize(body, \"V1beta1StorageClass\")\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1beta1StorageClass\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * create a VolumeAttachment\n * @param body\n * @param includeUninitialized If true, partially initialized resources are included in the response.\n * @param pretty If 'true', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param {*} [options] Override http request options.\n */\n createVolumeAttachment(body, includeUninitialized, pretty, dryRun, options = {}) {\n const localVarPath = this.basePath + '/apis/storage.k8s.io/v1beta1/volumeattachments';\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling createVolumeAttachment.');\n }\n if (includeUninitialized !== undefined) {\n localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, \"boolean\");\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'POST',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: ObjectSerializer.serialize(body, \"V1beta1VolumeAttachment\")\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1beta1VolumeAttachment\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * delete collection of StorageClass\n * @param includeUninitialized If true, partially initialized resources are included in the response.\n * @param pretty If 'true', then the output is pretty printed.\n * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \\"next key\\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.\n * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything.\n * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything.\n * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.\n * @param resourceVersion When specified with a watch call, shows changes that occur after that particular version of a resource. Defaults to changes from the beginning of history. When specified for list: - if unset, then the result is returned from remote storage based on quorum-read flag; - if it's 0, then we simply return what we currently have in cache, no guarantee; - if set to non zero, then the result is at least as fresh as given rv.\n * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.\n * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.\n * @param {*} [options] Override http request options.\n */\n deleteCollectionStorageClass(includeUninitialized, pretty, _continue, fieldSelector, labelSelector, limit, resourceVersion, timeoutSeconds, watch, options = {}) {\n const localVarPath = this.basePath + '/apis/storage.k8s.io/v1beta1/storageclasses';\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n if (includeUninitialized !== undefined) {\n localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, \"boolean\");\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (_continue !== undefined) {\n localVarQueryParameters['continue'] = ObjectSerializer.serialize(_continue, \"string\");\n }\n if (fieldSelector !== undefined) {\n localVarQueryParameters['fieldSelector'] = ObjectSerializer.serialize(fieldSelector, \"string\");\n }\n if (labelSelector !== undefined) {\n localVarQueryParameters['labelSelector'] = ObjectSerializer.serialize(labelSelector, \"string\");\n }\n if (limit !== undefined) {\n localVarQueryParameters['limit'] = ObjectSerializer.serialize(limit, \"number\");\n }\n if (resourceVersion !== undefined) {\n localVarQueryParameters['resourceVersion'] = ObjectSerializer.serialize(resourceVersion, \"string\");\n }\n if (timeoutSeconds !== undefined) {\n localVarQueryParameters['timeoutSeconds'] = ObjectSerializer.serialize(timeoutSeconds, \"number\");\n }\n if (watch !== undefined) {\n localVarQueryParameters['watch'] = ObjectSerializer.serialize(watch, \"boolean\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'DELETE',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1Status\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * delete collection of VolumeAttachment\n * @param includeUninitialized If true, partially initialized resources are included in the response.\n * @param pretty If 'true', then the output is pretty printed.\n * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \\"next key\\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.\n * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything.\n * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything.\n * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.\n * @param resourceVersion When specified with a watch call, shows changes that occur after that particular version of a resource. Defaults to changes from the beginning of history. When specified for list: - if unset, then the result is returned from remote storage based on quorum-read flag; - if it's 0, then we simply return what we currently have in cache, no guarantee; - if set to non zero, then the result is at least as fresh as given rv.\n * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.\n * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.\n * @param {*} [options] Override http request options.\n */\n deleteCollectionVolumeAttachment(includeUninitialized, pretty, _continue, fieldSelector, labelSelector, limit, resourceVersion, timeoutSeconds, watch, options = {}) {\n const localVarPath = this.basePath + '/apis/storage.k8s.io/v1beta1/volumeattachments';\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n if (includeUninitialized !== undefined) {\n localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, \"boolean\");\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (_continue !== undefined) {\n localVarQueryParameters['continue'] = ObjectSerializer.serialize(_continue, \"string\");\n }\n if (fieldSelector !== undefined) {\n localVarQueryParameters['fieldSelector'] = ObjectSerializer.serialize(fieldSelector, \"string\");\n }\n if (labelSelector !== undefined) {\n localVarQueryParameters['labelSelector'] = ObjectSerializer.serialize(labelSelector, \"string\");\n }\n if (limit !== undefined) {\n localVarQueryParameters['limit'] = ObjectSerializer.serialize(limit, \"number\");\n }\n if (resourceVersion !== undefined) {\n localVarQueryParameters['resourceVersion'] = ObjectSerializer.serialize(resourceVersion, \"string\");\n }\n if (timeoutSeconds !== undefined) {\n localVarQueryParameters['timeoutSeconds'] = ObjectSerializer.serialize(timeoutSeconds, \"number\");\n }\n if (watch !== undefined) {\n localVarQueryParameters['watch'] = ObjectSerializer.serialize(watch, \"boolean\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'DELETE',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1Status\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * delete a StorageClass\n * @param name name of the StorageClass\n * @param pretty If 'true', then the output is pretty printed.\n * @param body\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param gracePeriodSeconds The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately.\n * @param orphanDependents Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \\"orphan\\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both.\n * @param propagationPolicy Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground.\n * @param {*} [options] Override http request options.\n */\n deleteStorageClass(name, pretty, body, dryRun, gracePeriodSeconds, orphanDependents, propagationPolicy, options = {}) {\n const localVarPath = this.basePath + '/apis/storage.k8s.io/v1beta1/storageclasses/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling deleteStorageClass.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, \"string\");\n }\n if (gracePeriodSeconds !== undefined) {\n localVarQueryParameters['gracePeriodSeconds'] = ObjectSerializer.serialize(gracePeriodSeconds, \"number\");\n }\n if (orphanDependents !== undefined) {\n localVarQueryParameters['orphanDependents'] = ObjectSerializer.serialize(orphanDependents, \"boolean\");\n }\n if (propagationPolicy !== undefined) {\n localVarQueryParameters['propagationPolicy'] = ObjectSerializer.serialize(propagationPolicy, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'DELETE',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: ObjectSerializer.serialize(body, \"V1DeleteOptions\")\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1Status\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * delete a VolumeAttachment\n * @param name name of the VolumeAttachment\n * @param pretty If 'true', then the output is pretty printed.\n * @param body\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param gracePeriodSeconds The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately.\n * @param orphanDependents Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \\"orphan\\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both.\n * @param propagationPolicy Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground.\n * @param {*} [options] Override http request options.\n */\n deleteVolumeAttachment(name, pretty, body, dryRun, gracePeriodSeconds, orphanDependents, propagationPolicy, options = {}) {\n const localVarPath = this.basePath + '/apis/storage.k8s.io/v1beta1/volumeattachments/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling deleteVolumeAttachment.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, \"string\");\n }\n if (gracePeriodSeconds !== undefined) {\n localVarQueryParameters['gracePeriodSeconds'] = ObjectSerializer.serialize(gracePeriodSeconds, \"number\");\n }\n if (orphanDependents !== undefined) {\n localVarQueryParameters['orphanDependents'] = ObjectSerializer.serialize(orphanDependents, \"boolean\");\n }\n if (propagationPolicy !== undefined) {\n localVarQueryParameters['propagationPolicy'] = ObjectSerializer.serialize(propagationPolicy, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'DELETE',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: ObjectSerializer.serialize(body, \"V1DeleteOptions\")\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1Status\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * get available resources\n * @param {*} [options] Override http request options.\n */\n getAPIResources(options = {}) {\n const localVarPath = this.basePath + '/apis/storage.k8s.io/v1beta1/';\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1APIResourceList\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * list or watch objects of kind StorageClass\n * @param includeUninitialized If true, partially initialized resources are included in the response.\n * @param pretty If 'true', then the output is pretty printed.\n * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \\"next key\\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.\n * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything.\n * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything.\n * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.\n * @param resourceVersion When specified with a watch call, shows changes that occur after that particular version of a resource. Defaults to changes from the beginning of history. When specified for list: - if unset, then the result is returned from remote storage based on quorum-read flag; - if it's 0, then we simply return what we currently have in cache, no guarantee; - if set to non zero, then the result is at least as fresh as given rv.\n * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.\n * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.\n * @param {*} [options] Override http request options.\n */\n listStorageClass(includeUninitialized, pretty, _continue, fieldSelector, labelSelector, limit, resourceVersion, timeoutSeconds, watch, options = {}) {\n const localVarPath = this.basePath + '/apis/storage.k8s.io/v1beta1/storageclasses';\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n if (includeUninitialized !== undefined) {\n localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, \"boolean\");\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (_continue !== undefined) {\n localVarQueryParameters['continue'] = ObjectSerializer.serialize(_continue, \"string\");\n }\n if (fieldSelector !== undefined) {\n localVarQueryParameters['fieldSelector'] = ObjectSerializer.serialize(fieldSelector, \"string\");\n }\n if (labelSelector !== undefined) {\n localVarQueryParameters['labelSelector'] = ObjectSerializer.serialize(labelSelector, \"string\");\n }\n if (limit !== undefined) {\n localVarQueryParameters['limit'] = ObjectSerializer.serialize(limit, \"number\");\n }\n if (resourceVersion !== undefined) {\n localVarQueryParameters['resourceVersion'] = ObjectSerializer.serialize(resourceVersion, \"string\");\n }\n if (timeoutSeconds !== undefined) {\n localVarQueryParameters['timeoutSeconds'] = ObjectSerializer.serialize(timeoutSeconds, \"number\");\n }\n if (watch !== undefined) {\n localVarQueryParameters['watch'] = ObjectSerializer.serialize(watch, \"boolean\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1beta1StorageClassList\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * list or watch objects of kind VolumeAttachment\n * @param includeUninitialized If true, partially initialized resources are included in the response.\n * @param pretty If 'true', then the output is pretty printed.\n * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \\"next key\\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.\n * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything.\n * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything.\n * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.\n * @param resourceVersion When specified with a watch call, shows changes that occur after that particular version of a resource. Defaults to changes from the beginning of history. When specified for list: - if unset, then the result is returned from remote storage based on quorum-read flag; - if it's 0, then we simply return what we currently have in cache, no guarantee; - if set to non zero, then the result is at least as fresh as given rv.\n * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.\n * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.\n * @param {*} [options] Override http request options.\n */\n listVolumeAttachment(includeUninitialized, pretty, _continue, fieldSelector, labelSelector, limit, resourceVersion, timeoutSeconds, watch, options = {}) {\n const localVarPath = this.basePath + '/apis/storage.k8s.io/v1beta1/volumeattachments';\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n if (includeUninitialized !== undefined) {\n localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, \"boolean\");\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (_continue !== undefined) {\n localVarQueryParameters['continue'] = ObjectSerializer.serialize(_continue, \"string\");\n }\n if (fieldSelector !== undefined) {\n localVarQueryParameters['fieldSelector'] = ObjectSerializer.serialize(fieldSelector, \"string\");\n }\n if (labelSelector !== undefined) {\n localVarQueryParameters['labelSelector'] = ObjectSerializer.serialize(labelSelector, \"string\");\n }\n if (limit !== undefined) {\n localVarQueryParameters['limit'] = ObjectSerializer.serialize(limit, \"number\");\n }\n if (resourceVersion !== undefined) {\n localVarQueryParameters['resourceVersion'] = ObjectSerializer.serialize(resourceVersion, \"string\");\n }\n if (timeoutSeconds !== undefined) {\n localVarQueryParameters['timeoutSeconds'] = ObjectSerializer.serialize(timeoutSeconds, \"number\");\n }\n if (watch !== undefined) {\n localVarQueryParameters['watch'] = ObjectSerializer.serialize(watch, \"boolean\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1beta1VolumeAttachmentList\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * partially update the specified StorageClass\n * @param name name of the StorageClass\n * @param body\n * @param pretty If 'true', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param {*} [options] Override http request options.\n */\n patchStorageClass(name, body, pretty, dryRun, options = {}) {\n const localVarPath = this.basePath + '/apis/storage.k8s.io/v1beta1/storageclasses/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling patchStorageClass.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling patchStorageClass.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'PATCH',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: ObjectSerializer.serialize(body, \"any\")\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1beta1StorageClass\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * partially update the specified VolumeAttachment\n * @param name name of the VolumeAttachment\n * @param body\n * @param pretty If 'true', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param {*} [options] Override http request options.\n */\n patchVolumeAttachment(name, body, pretty, dryRun, options = {}) {\n const localVarPath = this.basePath + '/apis/storage.k8s.io/v1beta1/volumeattachments/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling patchVolumeAttachment.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling patchVolumeAttachment.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'PATCH',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: ObjectSerializer.serialize(body, \"any\")\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1beta1VolumeAttachment\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * read the specified StorageClass\n * @param name name of the StorageClass\n * @param pretty If 'true', then the output is pretty printed.\n * @param exact Should the export be exact. Exact export maintains cluster-specific fields like 'Namespace'.\n * @param _export Should this value be exported. Export strips fields that a user can not specify.\n * @param {*} [options] Override http request options.\n */\n readStorageClass(name, pretty, exact, _export, options = {}) {\n const localVarPath = this.basePath + '/apis/storage.k8s.io/v1beta1/storageclasses/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling readStorageClass.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (exact !== undefined) {\n localVarQueryParameters['exact'] = ObjectSerializer.serialize(exact, \"boolean\");\n }\n if (_export !== undefined) {\n localVarQueryParameters['export'] = ObjectSerializer.serialize(_export, \"boolean\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1beta1StorageClass\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * read the specified VolumeAttachment\n * @param name name of the VolumeAttachment\n * @param pretty If 'true', then the output is pretty printed.\n * @param exact Should the export be exact. Exact export maintains cluster-specific fields like 'Namespace'.\n * @param _export Should this value be exported. Export strips fields that a user can not specify.\n * @param {*} [options] Override http request options.\n */\n readVolumeAttachment(name, pretty, exact, _export, options = {}) {\n const localVarPath = this.basePath + '/apis/storage.k8s.io/v1beta1/volumeattachments/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling readVolumeAttachment.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (exact !== undefined) {\n localVarQueryParameters['exact'] = ObjectSerializer.serialize(exact, \"boolean\");\n }\n if (_export !== undefined) {\n localVarQueryParameters['export'] = ObjectSerializer.serialize(_export, \"boolean\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1beta1VolumeAttachment\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * replace the specified StorageClass\n * @param name name of the StorageClass\n * @param body\n * @param pretty If 'true', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param {*} [options] Override http request options.\n */\n replaceStorageClass(name, body, pretty, dryRun, options = {}) {\n const localVarPath = this.basePath + '/apis/storage.k8s.io/v1beta1/storageclasses/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling replaceStorageClass.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling replaceStorageClass.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'PUT',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: ObjectSerializer.serialize(body, \"V1beta1StorageClass\")\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1beta1StorageClass\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n /**\n * replace the specified VolumeAttachment\n * @param name name of the VolumeAttachment\n * @param body\n * @param pretty If 'true', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param {*} [options] Override http request options.\n */\n replaceVolumeAttachment(name, body, pretty, dryRun, options = {}) {\n const localVarPath = this.basePath + '/apis/storage.k8s.io/v1beta1/volumeattachments/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling replaceVolumeAttachment.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling replaceVolumeAttachment.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'PUT',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: ObjectSerializer.serialize(body, \"V1beta1VolumeAttachment\")\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"V1beta1VolumeAttachment\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n}\nexports.StorageV1beta1Api = StorageV1beta1Api;\nvar VersionApiApiKeys;\n(function (VersionApiApiKeys) {\n VersionApiApiKeys[VersionApiApiKeys[\"BearerToken\"] = 0] = \"BearerToken\";\n})(VersionApiApiKeys = exports.VersionApiApiKeys || (exports.VersionApiApiKeys = {}));\nclass VersionApi {\n constructor(basePathOrUsername, password, basePath) {\n this._basePath = defaultBasePath;\n this.defaultHeaders = {};\n this._useQuerystring = false;\n this.authentications = {\n 'default': new VoidAuth(),\n 'BearerToken': new ApiKeyAuth('header', 'authorization'),\n };\n if (password) {\n if (basePath) {\n this.basePath = basePath;\n }\n }\n else {\n if (basePathOrUsername) {\n this.basePath = basePathOrUsername;\n }\n }\n }\n set useQuerystring(value) {\n this._useQuerystring = value;\n }\n set basePath(basePath) {\n this._basePath = basePath;\n }\n get basePath() {\n return this._basePath;\n }\n setDefaultAuthentication(auth) {\n this.authentications.default = auth;\n }\n setApiKey(key, value) {\n this.authentications[VersionApiApiKeys[key]].apiKey = value;\n }\n /**\n * get the code version\n * @param {*} [options] Override http request options.\n */\n getCode(options = {}) {\n const localVarPath = this.basePath + '/version/';\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this.defaultHeaders);\n let localVarFormParams = {};\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n this.authentications.BearerToken.applyToRequest(localVarRequestOptions);\n this.authentications.default.applyToRequest(localVarRequestOptions);\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = ObjectSerializer.deserialize(body, \"VersionInfo\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject({ response: response, body: body });\n }\n }\n });\n });\n }\n}\nexports.VersionApi = VersionApi;\n//# sourceMappingURL=api.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst tslib_1 = require(\"tslib\");\nconst querystring = require(\"querystring\");\nconst terminal_size_queue_1 = require(\"./terminal-size-queue\");\nconst web_socket_handler_1 = require(\"./web-socket-handler\");\nclass Attach {\n constructor(config, websocketInterface) {\n if (websocketInterface) {\n this.handler = websocketInterface;\n }\n else {\n this.handler = new web_socket_handler_1.WebSocketHandler(config);\n }\n }\n attach(namespace, podName, containerName, stdout, stderr, stdin, tty) {\n return tslib_1.__awaiter(this, void 0, void 0, function* () {\n const query = {\n container: containerName,\n stderr: stderr != null,\n stdin: stdin != null,\n stdout: stdout != null,\n tty,\n };\n const queryStr = querystring.stringify(query);\n const path = `/api/v1/namespaces/${namespace}/pods/${podName}/attach?${queryStr}`;\n const conn = yield this.handler.connect(path, null, (streamNum, buff) => {\n web_socket_handler_1.WebSocketHandler.handleStandardStreams(streamNum, buff, stdout, stderr);\n return true;\n });\n if (stdin != null) {\n web_socket_handler_1.WebSocketHandler.handleStandardInput(conn, stdin, web_socket_handler_1.WebSocketHandler.StdinStream);\n }\n if (terminal_size_queue_1.isResizable(stdout)) {\n this.terminalSizeQueue = new terminal_size_queue_1.TerminalSizeQueue();\n web_socket_handler_1.WebSocketHandler.handleStandardInput(conn, this.terminalSizeQueue, web_socket_handler_1.WebSocketHandler.ResizeStream);\n this.terminalSizeQueue.handleResizes(stdout);\n }\n return conn;\n });\n }\n}\nexports.Attach = Attach;\n//# sourceMappingURL=attach.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst tslib_1 = require(\"tslib\");\nconst informer_1 = require(\"./informer\");\nclass ListWatch {\n constructor(path, watch, listFn, autoStart = true) {\n this.path = path;\n this.watch = watch;\n this.listFn = listFn;\n this.objects = [];\n this.indexCache = {};\n this.callbackCache = {};\n this.watch = watch;\n this.listFn = listFn;\n if (autoStart) {\n this.doneHandler(null);\n }\n }\n start() {\n this.doneHandler(null);\n }\n on(verb, cb) {\n if (verb !== informer_1.ADD && verb !== informer_1.UPDATE && verb !== informer_1.DELETE) {\n throw new Error(`Unknown verb: ${verb}`);\n }\n if (!this.callbackCache[verb]) {\n this.callbackCache[verb] = [];\n }\n this.callbackCache[verb].push(cb);\n }\n get(name, namespace) {\n return this.objects.find((obj) => {\n return obj.metadata.name === name && (!namespace || obj.metadata.namespace === namespace);\n });\n }\n list(namespace) {\n if (!namespace) {\n return this.objects;\n }\n return this.indexCache[namespace];\n }\n doneHandler(err) {\n return tslib_1.__awaiter(this, void 0, void 0, function* () {\n const promise = this.listFn();\n const result = yield promise;\n const list = result.body;\n deleteItems(this.objects, list.items, this.callbackCache[informer_1.DELETE]);\n this.addOrUpdateItems(list.items);\n this.watch.watch(this.path, { resourceVersion: list.metadata.resourceVersion }, this.watchHandler.bind(this), this.doneHandler.bind(this));\n });\n }\n addOrUpdateItems(items) {\n items.forEach((obj) => {\n addOrUpdateObject(this.objects, obj, this.callbackCache[informer_1.ADD], this.callbackCache[informer_1.UPDATE]);\n if (obj.metadata.namespace) {\n this.indexObj(obj);\n }\n });\n }\n indexObj(obj) {\n let namespaceList = this.indexCache[obj.metadata.namespace];\n if (!namespaceList) {\n namespaceList = [];\n this.indexCache[obj.metadata.namespace] = namespaceList;\n }\n addOrUpdateObject(namespaceList, obj);\n }\n watchHandler(phase, obj) {\n switch (phase) {\n case 'ADDED':\n case 'MODIFIED':\n addOrUpdateObject(this.objects, obj, this.callbackCache[informer_1.ADD], this.callbackCache[informer_1.UPDATE]);\n if (obj.metadata.namespace) {\n this.indexObj(obj);\n }\n break;\n case 'DELETED':\n deleteObject(this.objects, obj, this.callbackCache[informer_1.DELETE]);\n if (obj.metadata.namespace) {\n const namespaceList = this.indexCache[obj.metadata.namespace];\n if (namespaceList) {\n deleteObject(namespaceList, obj);\n }\n }\n break;\n }\n }\n}\nexports.ListWatch = ListWatch;\n// external for testing\nfunction deleteItems(oldObjects, newObjects, deleteCallback) {\n return oldObjects.filter((obj) => {\n if (findKubernetesObject(newObjects, obj) === -1) {\n if (deleteCallback) {\n deleteCallback.forEach((fn) => fn(obj));\n }\n return false;\n }\n return true;\n });\n}\nexports.deleteItems = deleteItems;\n// Only public for testing.\nfunction addOrUpdateObject(objects, obj, addCallback, updateCallback) {\n const ix = findKubernetesObject(objects, obj);\n if (ix === -1) {\n objects.push(obj);\n if (addCallback) {\n addCallback.forEach((elt) => elt(obj));\n }\n }\n else {\n objects[ix] = obj;\n if (updateCallback) {\n updateCallback.forEach((elt) => elt(obj));\n }\n }\n}\nexports.addOrUpdateObject = addOrUpdateObject;\nfunction isSameObject(o1, o2) {\n return o1.metadata.name === o2.metadata.name && o1.metadata.namespace === o2.metadata.namespace;\n}\nfunction findKubernetesObject(objects, obj) {\n return objects.findIndex((elt) => {\n return isSameObject(elt, obj);\n });\n}\n// Public for testing.\nfunction deleteObject(objects, obj, deleteCallback) {\n const ix = findKubernetesObject(objects, obj);\n if (ix !== -1) {\n objects.splice(ix, 1);\n if (deleteCallback) {\n deleteCallback.forEach((elt) => elt(obj));\n }\n }\n}\nexports.deleteObject = deleteObject;\n//# sourceMappingURL=cache.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst jsonpath = require(\"jsonpath-plus\");\nconst shelljs = require(\"shelljs\");\nclass CloudAuth {\n isAuthProvider(user) {\n if (!user || !user.authProvider) {\n return false;\n }\n return user.authProvider.name === 'azure' || user.authProvider.name === 'gcp';\n }\n getToken(user) {\n const config = user.authProvider.config;\n if (this.isExpired(config)) {\n this.updateAccessToken(config);\n }\n return 'Bearer ' + config['access-token'];\n }\n isExpired(config) {\n const token = config['access-token'];\n const expiry = config.expiry;\n if (!token) {\n return true;\n }\n if (!expiry) {\n return false;\n }\n const expiration = Date.parse(expiry);\n if (expiration < Date.now()) {\n return true;\n }\n return false;\n }\n updateAccessToken(config) {\n if (!config['cmd-path']) {\n throw new Error('Token is expired!');\n }\n const args = config['cmd-args'];\n // TODO: Cache to file?\n // TODO: do this asynchronously\n let result;\n try {\n let cmd = config['cmd-path'];\n if (args) {\n cmd = `\"${cmd}\" ${args}`;\n }\n result = shelljs.exec(cmd, { silent: true });\n if (result.code !== 0) {\n throw new Error(result.stderr);\n }\n }\n catch (err) {\n throw new Error('Failed to refresh token: ' + err.message);\n }\n const output = result.stdout.toString();\n const resultObj = JSON.parse(output);\n const tokenPathKeyInConfig = config['token-key'];\n const expiryPathKeyInConfig = config['expiry-key'];\n // Format in file is {}, so slice it out and add '$'\n const tokenPathKey = '$' + tokenPathKeyInConfig.slice(1, -1);\n const expiryPathKey = '$' + expiryPathKeyInConfig.slice(1, -1);\n config['access-token'] = jsonpath.JSONPath(tokenPathKey, resultObj);\n config.expiry = jsonpath.JSONPath(expiryPathKey, resultObj);\n }\n}\nexports.CloudAuth = CloudAuth;\n//# sourceMappingURL=cloud_auth.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst fs = require(\"fs\");\nconst path = require(\"path\");\nconst yaml = require(\"js-yaml\");\nconst shelljs = require(\"shelljs\");\nconst api = require(\"./api\");\nconst cloud_auth_1 = require(\"./cloud_auth\");\nconst config_types_1 = require(\"./config_types\");\nconst exec_auth_1 = require(\"./exec_auth\");\n// fs.existsSync was removed in node 10\nfunction fileExists(filepath) {\n try {\n fs.accessSync(filepath);\n return true;\n // tslint:disable-next-line:no-empty\n }\n catch (ignore) { }\n return false;\n}\nclass KubeConfig {\n getContexts() {\n return this.contexts;\n }\n getClusters() {\n return this.clusters;\n }\n getUsers() {\n return this.users;\n }\n getCurrentContext() {\n return this.currentContext;\n }\n setCurrentContext(context) {\n this.currentContext = context;\n }\n getContextObject(name) {\n if (!this.contexts) {\n return null;\n }\n return findObject(this.contexts, name, 'context');\n }\n getCurrentCluster() {\n const context = this.getCurrentContextObject();\n if (!context) {\n return null;\n }\n return this.getCluster(context.cluster);\n }\n getCluster(name) {\n return findObject(this.clusters, name, 'cluster');\n }\n getCurrentUser() {\n const ctx = this.getCurrentContextObject();\n if (!ctx) {\n return null;\n }\n return this.getUser(ctx.user);\n }\n getUser(name) {\n return findObject(this.users, name, 'user');\n }\n loadFromFile(file) {\n const rootDirectory = path.dirname(file);\n this.loadFromString(fs.readFileSync(file, 'utf8'));\n this.makePathsAbsolute(rootDirectory);\n }\n applytoHTTPSOptions(opts) {\n const user = this.getCurrentUser();\n this.applyOptions(opts);\n if (user && user.username) {\n opts.auth = `${user.username}:${user.password}`;\n }\n }\n applyToRequest(opts) {\n const cluster = this.getCurrentCluster();\n const user = this.getCurrentUser();\n this.applyOptions(opts);\n if (cluster && cluster.skipTLSVerify) {\n opts.strictSSL = false;\n }\n if (user && user.username) {\n opts.auth = {\n password: user.password,\n username: user.username,\n };\n }\n }\n loadFromString(config) {\n const obj = yaml.safeLoad(config);\n if (obj.apiVersion !== 'v1') {\n throw new TypeError('unknown version: ' + obj.apiVersion);\n }\n this.clusters = config_types_1.newClusters(obj.clusters);\n this.contexts = config_types_1.newContexts(obj.contexts);\n this.users = config_types_1.newUsers(obj.users);\n this.currentContext = obj['current-context'];\n }\n loadFromOptions(options) {\n this.clusters = options.clusters;\n this.contexts = options.contexts;\n this.users = options.users;\n this.currentContext = options.currentContext;\n }\n loadFromClusterAndUser(cluster, user) {\n this.clusters = [cluster];\n this.users = [user];\n this.currentContext = 'loaded-context';\n this.contexts = [\n {\n cluster: cluster.name,\n user: user.name,\n name: this.currentContext,\n },\n ];\n }\n loadFromCluster(pathPrefix = '') {\n const host = process.env.KUBERNETES_SERVICE_HOST;\n const port = process.env.KUBERNETES_SERVICE_PORT;\n const clusterName = 'inCluster';\n const userName = 'inClusterUser';\n const contextName = 'inClusterContext';\n let scheme = 'https';\n if (port === '80' || port === '8080' || port === '8001') {\n scheme = 'http';\n }\n this.clusters = [\n {\n name: clusterName,\n caFile: `${pathPrefix}${Config.SERVICEACCOUNT_CA_PATH}`,\n server: `${scheme}://${host}:${port}`,\n skipTLSVerify: false,\n },\n ];\n this.users = [\n {\n name: userName,\n token: fs.readFileSync(`${pathPrefix}${Config.SERVICEACCOUNT_TOKEN_PATH}`).toString(),\n },\n ];\n this.contexts = [\n {\n cluster: clusterName,\n name: contextName,\n user: userName,\n },\n ];\n this.currentContext = contextName;\n }\n mergeConfig(config) {\n this.currentContext = config.currentContext;\n config.clusters.forEach((cluster) => {\n this.addCluster(cluster);\n });\n config.users.forEach((user) => {\n this.addUser(user);\n });\n config.contexts.forEach((ctx) => {\n this.addContext(ctx);\n });\n }\n addCluster(cluster) {\n this.clusters.forEach((c, ix) => {\n if (c.name === cluster.name) {\n throw new Error(`Duplicate cluster: ${c.name}`);\n }\n });\n this.clusters.push(cluster);\n }\n addUser(user) {\n this.users.forEach((c, ix) => {\n if (c.name === user.name) {\n throw new Error(`Duplicate user: ${c.name}`);\n }\n });\n this.users.push(user);\n }\n addContext(ctx) {\n this.contexts.forEach((c, ix) => {\n if (c.name === ctx.name) {\n throw new Error(`Duplicate context: ${c.name}`);\n }\n });\n this.contexts.push(ctx);\n }\n loadFromDefault() {\n if (process.env.KUBECONFIG && process.env.KUBECONFIG.length > 0) {\n const files = process.env.KUBECONFIG.split(path.delimiter);\n this.loadFromFile(files[0]);\n for (let i = 1; i < files.length; i++) {\n const kc = new KubeConfig();\n kc.loadFromFile(files[i]);\n this.mergeConfig(kc);\n }\n return;\n }\n const home = findHomeDir();\n if (home) {\n const config = path.join(home, '.kube', 'config');\n if (fileExists(config)) {\n this.loadFromFile(config);\n return;\n }\n }\n if (process.platform === 'win32' && shelljs.which('wsl.exe')) {\n // TODO: Handle if someome set $KUBECONFIG in wsl here...\n const result = shelljs.exec('wsl.exe cat $HOME/.kube/config', {\n silent: true,\n });\n if (result.code === 0) {\n this.loadFromString(result.stdout);\n return;\n }\n }\n if (fileExists(Config.SERVICEACCOUNT_TOKEN_PATH)) {\n this.loadFromCluster();\n return;\n }\n this.loadFromClusterAndUser({ name: 'cluster', server: 'http://localhost:8080' }, { name: 'user' });\n }\n makeApiClient(apiClientType) {\n const cluster = this.getCurrentCluster();\n if (!cluster) {\n throw new Error('No active cluster!');\n }\n const apiClient = new apiClientType(cluster.server);\n apiClient.setDefaultAuthentication(this);\n return apiClient;\n }\n makePathsAbsolute(rootDirectory) {\n this.clusters.forEach((cluster) => {\n if (cluster.caFile) {\n cluster.caFile = makeAbsolutePath(rootDirectory, cluster.caFile);\n }\n });\n this.users.forEach((user) => {\n if (user.certFile) {\n user.certFile = makeAbsolutePath(rootDirectory, user.certFile);\n }\n if (user.keyFile) {\n user.keyFile = makeAbsolutePath(rootDirectory, user.keyFile);\n }\n });\n }\n getCurrentContextObject() {\n return this.getContextObject(this.currentContext);\n }\n applyHTTPSOptions(opts) {\n const cluster = this.getCurrentCluster();\n const user = this.getCurrentUser();\n if (!user) {\n return;\n }\n if (cluster != null && cluster.skipTLSVerify) {\n opts.rejectUnauthorized = false;\n }\n const ca = cluster != null ? bufferFromFileOrString(cluster.caFile, cluster.caData) : null;\n if (ca) {\n opts.ca = ca;\n }\n const cert = bufferFromFileOrString(user.certFile, user.certData);\n if (cert) {\n opts.cert = cert;\n }\n const key = bufferFromFileOrString(user.keyFile, user.keyData);\n if (key) {\n opts.key = key;\n }\n }\n applyAuthorizationHeader(opts) {\n const user = this.getCurrentUser();\n if (!user) {\n return;\n }\n let token = null;\n KubeConfig.authenticators.forEach((authenticator) => {\n if (authenticator.isAuthProvider(user)) {\n token = authenticator.getToken(user);\n }\n });\n if (user.token) {\n token = 'Bearer ' + user.token;\n }\n if (token) {\n if (!opts.headers) {\n opts.headers = [];\n }\n opts.headers.Authorization = token;\n }\n }\n applyOptions(opts) {\n this.applyHTTPSOptions(opts);\n this.applyAuthorizationHeader(opts);\n }\n}\nKubeConfig.authenticators = [new cloud_auth_1.CloudAuth(), new exec_auth_1.ExecAuth()];\nexports.KubeConfig = KubeConfig;\n// This class is deprecated and will eventually be removed.\nclass Config {\n static fromFile(filename) {\n return Config.apiFromFile(filename, api.CoreV1Api);\n }\n static fromCluster() {\n return Config.apiFromCluster(api.CoreV1Api);\n }\n static defaultClient() {\n return Config.apiFromDefaultClient(api.CoreV1Api);\n }\n static apiFromFile(filename, apiClientType) {\n const kc = new KubeConfig();\n kc.loadFromFile(filename);\n return kc.makeApiClient(apiClientType);\n }\n static apiFromCluster(apiClientType) {\n const kc = new KubeConfig();\n kc.loadFromCluster();\n const cluster = kc.getCurrentCluster();\n if (!cluster) {\n throw new Error('No active cluster!');\n }\n const k8sApi = new apiClientType(cluster.server);\n k8sApi.setDefaultAuthentication(kc);\n return k8sApi;\n }\n static apiFromDefaultClient(apiClientType) {\n const kc = new KubeConfig();\n kc.loadFromDefault();\n return kc.makeApiClient(apiClientType);\n }\n}\nConfig.SERVICEACCOUNT_ROOT = '/var/run/secrets/kubernetes.io/serviceaccount';\nConfig.SERVICEACCOUNT_CA_PATH = Config.SERVICEACCOUNT_ROOT + '/ca.crt';\nConfig.SERVICEACCOUNT_TOKEN_PATH = Config.SERVICEACCOUNT_ROOT + '/token';\nexports.Config = Config;\nfunction makeAbsolutePath(root, file) {\n if (!root || path.isAbsolute(file)) {\n return file;\n }\n return path.join(root, file);\n}\nexports.makeAbsolutePath = makeAbsolutePath;\n// This is public really only for testing.\nfunction bufferFromFileOrString(file, data) {\n if (file) {\n return fs.readFileSync(file);\n }\n if (data) {\n return Buffer.from(data, 'base64');\n }\n return null;\n}\nexports.bufferFromFileOrString = bufferFromFileOrString;\n// Only public for testing.\nfunction findHomeDir() {\n if (process.env.HOME) {\n try {\n fs.accessSync(process.env.HOME);\n return process.env.HOME;\n // tslint:disable-next-line:no-empty\n }\n catch (ignore) { }\n }\n if (process.platform !== 'win32') {\n return null;\n }\n if (process.env.HOMEDRIVE && process.env.HOMEPATH) {\n const dir = path.join(process.env.HOMEDRIVE, process.env.HOMEPATH);\n try {\n fs.accessSync(dir);\n return dir;\n // tslint:disable-next-line:no-empty\n }\n catch (ignore) { }\n }\n if (process.env.USERPROFILE) {\n try {\n fs.accessSync(process.env.USERPROFILE);\n return process.env.USERPROFILE;\n // tslint:disable-next-line:no-empty\n }\n catch (ignore) { }\n }\n return null;\n}\nexports.findHomeDir = findHomeDir;\n// Only really public for testing...\nfunction findObject(list, name, key) {\n for (const obj of list) {\n if (obj.name === name) {\n if (obj[key]) {\n return obj[key];\n }\n return obj;\n }\n }\n return null;\n}\nexports.findObject = findObject;\n//# sourceMappingURL=config.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst fs = require(\"fs\");\nconst u = require(\"underscore\");\nfunction newClusters(a) {\n return u.map(a, clusterIterator());\n}\nexports.newClusters = newClusters;\nfunction clusterIterator() {\n return (elt, i, list) => {\n if (!elt.name) {\n throw new Error(`clusters[${i}].name is missing`);\n }\n if (!elt.cluster) {\n throw new Error(`clusters[${i}].cluster is missing`);\n }\n if (!elt.cluster.server) {\n throw new Error(`clusters[${i}].cluster.server is missing`);\n }\n return {\n caData: elt.cluster['certificate-authority-data'],\n caFile: elt.cluster['certificate-authority'],\n name: elt.name,\n server: elt.cluster.server,\n skipTLSVerify: elt.cluster['insecure-skip-tls-verify'] === true,\n };\n };\n}\nfunction newUsers(a) {\n return u.map(a, userIterator());\n}\nexports.newUsers = newUsers;\nfunction userIterator() {\n return (elt, i, list) => {\n if (!elt.name) {\n throw new Error(`users[${i}].name is missing`);\n }\n return {\n authProvider: elt.user ? elt.user['auth-provider'] : null,\n certData: elt.user ? elt.user['client-certificate-data'] : null,\n certFile: elt.user ? elt.user['client-certificate'] : null,\n exec: elt.user ? elt.user.exec : null,\n keyData: elt.user ? elt.user['client-key-data'] : null,\n keyFile: elt.user ? elt.user['client-key'] : null,\n name: elt.name,\n token: findToken(elt.user),\n password: elt.user ? elt.user.password : null,\n username: elt.user ? elt.user.username : null,\n };\n };\n}\nfunction findToken(user) {\n if (user) {\n if (user.token) {\n return user.token;\n }\n if (user['token-file']) {\n return fs.readFileSync(user['token-file']).toString();\n }\n }\n}\nfunction newContexts(a) {\n return u.map(a, contextIterator());\n}\nexports.newContexts = newContexts;\nfunction contextIterator() {\n return (elt, i, list) => {\n if (!elt.name) {\n throw new Error(`contexts[${i}].name is missing`);\n }\n if (!elt.context) {\n throw new Error(`contexts[${i}].context is missing`);\n }\n if (!elt.context.cluster) {\n throw new Error(`contexts[${i}].context.cluster is missing`);\n }\n return {\n cluster: elt.context.cluster,\n name: elt.name,\n user: elt.context.user || undefined,\n namespace: elt.context.namespace || undefined,\n };\n };\n}\n//# sourceMappingURL=config_types.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst tslib_1 = require(\"tslib\");\nconst querystring = require(\"querystring\");\nconst terminal_size_queue_1 = require(\"./terminal-size-queue\");\nconst web_socket_handler_1 = require(\"./web-socket-handler\");\nclass Exec {\n constructor(config, wsInterface) {\n if (wsInterface) {\n this.handler = wsInterface;\n }\n else {\n this.handler = new web_socket_handler_1.WebSocketHandler(config);\n }\n }\n /**\n * @param {string} namespace - The namespace of the pod to exec the command inside.\n * @param {string} podName - The name of the pod to exec the command inside.\n * @param {string} containerName - The name of the container in the pod to exec the command inside.\n * @param {(string|string[])} command - The command or command and arguments to execute.\n * @param {stream.Writable} stdout - The stream to write stdout data from the command.\n * @param {stream.Writable} stderr - The stream to write stderr data from the command.\n * @param {stream.Readable} stdin - The strream to write stdin data into the command.\n * @param {boolean} tty - Should the command execute in a TTY enabled session.\n * @param {(V1Status) => void} statusCallback -\n * A callback to received the status (e.g. exit code) from the command, optional.\n * @return {string} This is the result\n */\n exec(namespace, podName, containerName, command, stdout, stderr, stdin, tty, statusCallback) {\n return tslib_1.__awaiter(this, void 0, void 0, function* () {\n const query = {\n stdout: stdout != null,\n stderr: stderr != null,\n stdin: stdin != null,\n tty,\n command,\n container: containerName,\n };\n const queryStr = querystring.stringify(query);\n const path = `/api/v1/namespaces/${namespace}/pods/${podName}/exec?${queryStr}`;\n const conn = yield this.handler.connect(path, null, (streamNum, buff) => {\n const status = web_socket_handler_1.WebSocketHandler.handleStandardStreams(streamNum, buff, stdout, stderr);\n if (status != null) {\n if (statusCallback) {\n statusCallback(status);\n }\n return false;\n }\n return true;\n });\n if (stdin != null) {\n web_socket_handler_1.WebSocketHandler.handleStandardInput(conn, stdin, web_socket_handler_1.WebSocketHandler.StdinStream);\n }\n if (terminal_size_queue_1.isResizable(stdout)) {\n this.terminalSizeQueue = new terminal_size_queue_1.TerminalSizeQueue();\n web_socket_handler_1.WebSocketHandler.handleStandardInput(conn, this.terminalSizeQueue, web_socket_handler_1.WebSocketHandler.ResizeStream);\n this.terminalSizeQueue.handleResizes(stdout);\n }\n return conn;\n });\n }\n}\nexports.Exec = Exec;\n//# sourceMappingURL=exec.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst shell = require(\"shelljs\");\nclass ExecAuth {\n constructor() {\n this.tokenCache = {};\n this.execFn = shell.exec;\n }\n isAuthProvider(user) {\n if (!user) {\n return false;\n }\n if (user.exec) {\n return true;\n }\n if (!user.authProvider) {\n return false;\n }\n return (user.authProvider.name === 'exec' || (user.authProvider.config && user.authProvider.config.exec));\n }\n getToken(user) {\n // TODO: Handle client cert auth here, requires auth refactor.\n // See https://kubernetes.io/docs/reference/access-authn-authz/authentication/#input-and-output-formats\n // for details on this protocol.\n // TODO: Add a unit test for token caching.\n const cachedToken = this.tokenCache[user.name];\n if (cachedToken) {\n const date = Date.parse(cachedToken.status.expirationTimestamp);\n if (date > Date.now()) {\n return `Bearer ${cachedToken.status.token}`;\n }\n this.tokenCache[user.name] = null;\n }\n let exec = null;\n if (user.authProvider && user.authProvider.config) {\n exec = user.authProvider.config.exec;\n }\n if (user.exec) {\n exec = user.exec;\n }\n if (!exec) {\n return null;\n }\n if (!exec.command) {\n throw new Error('No command was specified for exec authProvider!');\n }\n let cmd = exec.command;\n if (exec.args) {\n cmd = `${cmd} ${exec.args.join(' ')}`;\n }\n let opts = { silent: true };\n if (exec.env) {\n const env = process.env;\n exec.env.forEach((elt) => (env[elt.name] = elt.value));\n opts = Object.assign({}, opts, { env });\n }\n const result = this.execFn(cmd, opts);\n if (result.code === 0) {\n const obj = JSON.parse(result.stdout);\n this.tokenCache[user.name] = obj;\n return `Bearer ${obj.status.token}`;\n }\n throw new Error(result.stderr);\n }\n}\nexports.ExecAuth = ExecAuth;\n//# sourceMappingURL=exec_auth.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst tslib_1 = require(\"tslib\");\ntslib_1.__exportStar(require(\"./config\"), exports);\ntslib_1.__exportStar(require(\"./cache\"), exports);\ntslib_1.__exportStar(require(\"./api\"), exports);\ntslib_1.__exportStar(require(\"./attach\"), exports);\ntslib_1.__exportStar(require(\"./watch\"), exports);\ntslib_1.__exportStar(require(\"./exec\"), exports);\ntslib_1.__exportStar(require(\"./portforward\"), exports);\ntslib_1.__exportStar(require(\"./yaml\"), exports);\ntslib_1.__exportStar(require(\"./log\"), exports);\ntslib_1.__exportStar(require(\"./informer\"), exports);\n//# sourceMappingURL=index.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst cache_1 = require(\"./cache\");\nconst watch_1 = require(\"./watch\");\nexports.ADD = 'add';\nexports.UPDATE = 'update';\nexports.DELETE = 'delete';\nfunction makeInformer(kubeconfig, path, listPromiseFn) {\n const watch = new watch_1.Watch(kubeconfig);\n return new cache_1.ListWatch(path, watch, listPromiseFn, false);\n}\nexports.makeInformer = makeInformer;\n//# sourceMappingURL=informer.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst request = require(\"request\");\nclass Log {\n constructor(config) {\n this.config = config;\n }\n log(namespace, podName, containerName, stream, done, options = {}) {\n const path = `/api/v1/namespaces/${namespace}/pods/${podName}/log`;\n const cluster = this.config.getCurrentCluster();\n if (!cluster) {\n throw new Error('No currently active cluster');\n }\n const url = cluster.server + path;\n const requestOptions = {\n method: 'GET',\n qs: Object.assign({}, options, { container: containerName }),\n uri: url,\n };\n this.config.applyToRequest(requestOptions);\n const req = request(requestOptions, (error, response, body) => {\n if (error) {\n done(error);\n }\n else if (response && response.statusCode !== 200) {\n done(body);\n }\n else {\n done(null);\n }\n }).on('response', (response) => {\n if (response.statusCode === 200) {\n req.pipe(stream);\n }\n });\n return req;\n }\n}\nexports.Log = Log;\n//# sourceMappingURL=log.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst tslib_1 = require(\"tslib\");\nconst querystring = require(\"querystring\");\nconst util_1 = require(\"util\");\nconst web_socket_handler_1 = require(\"./web-socket-handler\");\nclass PortForward {\n // handler is a parameter really only for injecting for testing.\n constructor(config, disconnectOnErr, handler) {\n if (!handler) {\n this.handler = new web_socket_handler_1.WebSocketHandler(config);\n }\n else {\n this.handler = handler;\n }\n this.disconnectOnErr = util_1.isUndefined(disconnectOnErr) ? true : disconnectOnErr;\n }\n // TODO: support multiple ports for real...\n portForward(namespace, podName, targetPorts, output, err, input, retryCount = 0) {\n return tslib_1.__awaiter(this, void 0, void 0, function* () {\n if (targetPorts.length === 0) {\n throw new Error('You must provide at least one port to forward to.');\n }\n if (targetPorts.length > 1) {\n throw new Error('Only one port is currently supported for port-forward');\n }\n const query = {\n ports: targetPorts[0],\n };\n const queryStr = querystring.stringify(query);\n const needsToReadPortNumber = [];\n targetPorts.forEach((value, index) => {\n needsToReadPortNumber[index * 2] = true;\n needsToReadPortNumber[index * 2 + 1] = true;\n });\n const path = `/api/v1/namespaces/${namespace}/pods/${podName}/portforward?${queryStr}`;\n const createWebSocket = () => {\n return this.handler.connect(path, null, (streamNum, buff) => {\n if (streamNum >= targetPorts.length * 2) {\n return !this.disconnectOnErr;\n }\n // First two bytes of each stream are the port number\n if (needsToReadPortNumber[streamNum]) {\n buff = buff.slice(2);\n needsToReadPortNumber[streamNum] = false;\n }\n if (streamNum % 2 === 1) {\n if (err) {\n err.write(buff);\n }\n }\n else {\n output.write(buff);\n }\n return true;\n });\n };\n if (retryCount < 1) {\n const ws = yield createWebSocket();\n web_socket_handler_1.WebSocketHandler.handleStandardInput(ws, input, 0);\n return ws;\n }\n return web_socket_handler_1.WebSocketHandler.restartableHandleStandardInput(createWebSocket, input, 0, retryCount);\n });\n }\n}\nexports.PortForward = PortForward;\n//# sourceMappingURL=portforward.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst stream_1 = require(\"stream\");\nclass TerminalSizeQueue extends stream_1.Readable {\n constructor(opts = {}) {\n super(Object.assign({}, opts, { \n // tslint:disable-next-line:no-empty\n read() { } }));\n }\n handleResizes(writeStream) {\n // Set initial size\n this.resize(getTerminalSize(writeStream));\n // Handle future size updates\n writeStream.on('resize', () => this.resize(getTerminalSize(writeStream)));\n }\n resize(size) {\n this.push(JSON.stringify(size));\n }\n}\nexports.TerminalSizeQueue = TerminalSizeQueue;\nfunction isResizable(stream) {\n if (stream == null) {\n return false;\n }\n const hasRows = 'rows' in stream;\n const hasColumns = 'columns' in stream;\n const hasOn = typeof stream.on === 'function';\n return hasRows && hasColumns && hasOn;\n}\nexports.isResizable = isResizable;\nfunction getTerminalSize(writeStream) {\n return { height: writeStream.rows, width: writeStream.columns };\n}\n//# sourceMappingURL=terminal-size-queue.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst JSONStream = require(\"json-stream\");\nconst request = require(\"request\");\nclass DefaultRequest {\n webRequest(opts, callback) {\n return request(opts, callback);\n }\n}\nexports.DefaultRequest = DefaultRequest;\nclass Watch {\n constructor(config, requestImpl) {\n this.config = config;\n if (requestImpl) {\n this.requestImpl = requestImpl;\n }\n else {\n this.requestImpl = new DefaultRequest();\n }\n }\n watch(path, queryParams, callback, done) {\n const cluster = this.config.getCurrentCluster();\n if (!cluster) {\n throw new Error('No currently active cluster');\n }\n const url = cluster.server + path;\n queryParams.watch = true;\n const headerParams = {};\n const requestOptions = {\n method: 'GET',\n qs: queryParams,\n headers: headerParams,\n uri: url,\n useQuerystring: true,\n json: true,\n };\n this.config.applyToRequest(requestOptions);\n const stream = new JSONStream();\n stream.on('data', (data) => callback(data.type, data.object));\n const req = this.requestImpl.webRequest(requestOptions, (error, response, body) => {\n if (error) {\n done(error);\n }\n else {\n done(null);\n }\n });\n req.pipe(stream);\n return req;\n }\n}\nexports.Watch = Watch;\n//# sourceMappingURL=watch.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst tslib_1 = require(\"tslib\");\nconst WebSocket = require(\"isomorphic-ws\");\nconst protocols = ['v4.channel.k8s.io', 'v3.channel.k8s.io', 'v2.channel.k8s.io', 'channel.k8s.io'];\nclass WebSocketHandler {\n // factory is really just for test injection\n constructor(config, socketFactory) {\n this.config = config;\n this.socketFactory = socketFactory;\n }\n static handleStandardStreams(streamNum, buff, stdout, stderr) {\n if (buff.length < 1) {\n return null;\n }\n if (stdout && streamNum === WebSocketHandler.StdoutStream) {\n stdout.write(buff);\n }\n else if (stderr && streamNum === WebSocketHandler.StderrStream) {\n stderr.write(buff);\n }\n else if (streamNum === WebSocketHandler.StatusStream) {\n // stream closing.\n if (stdout && stdout !== process.stdout) {\n stdout.end();\n }\n if (stderr && stderr !== process.stderr) {\n stderr.end();\n }\n return JSON.parse(buff.toString('utf8'));\n }\n else {\n throw new Error('Unknown stream: ' + streamNum);\n }\n return null;\n }\n static handleStandardInput(ws, stdin, streamNum = 0) {\n stdin.on('data', (data) => {\n const buff = Buffer.alloc(data.length + 1);\n buff.writeInt8(streamNum, 0);\n if (data instanceof Buffer) {\n data.copy(buff, 1);\n }\n else {\n buff.write(data, 1);\n }\n ws.send(buff);\n });\n stdin.on('end', () => {\n ws.close();\n });\n // Keep the stream open\n return true;\n }\n static restartableHandleStandardInput(createWS, stdin, streamNum = 0, retryCount = 3) {\n if (retryCount < 0) {\n throw new Error(\"retryCount can't be lower than 0.\");\n }\n let queue = Promise.resolve();\n let ws;\n function processData(data) {\n return tslib_1.__awaiter(this, void 0, void 0, function* () {\n const buff = Buffer.alloc(data.length + 1);\n buff.writeInt8(streamNum, 0);\n if (data instanceof Buffer) {\n data.copy(buff, 1);\n }\n else {\n buff.write(data, 1);\n }\n let i = 0;\n for (; i < retryCount; ++i) {\n if (ws !== null && ws.readyState === WebSocket.OPEN) {\n ws.send(buff);\n break;\n }\n else {\n ws = yield createWS();\n }\n }\n if (i >= retryCount) {\n throw new Error(\"can't send data to ws\");\n }\n });\n }\n stdin.on('data', (data) => {\n queue = queue.then(() => processData(data));\n });\n stdin.on('end', () => {\n if (ws) {\n ws.close();\n }\n });\n return () => ws;\n }\n /**\n * Connect to a web socket endpoint.\n * @param path The HTTP Path to connect to on the server.\n * @param textHandler Callback for text over the web socket.\n * Returns true if the connection should be kept alive, false to disconnect.\n * @param binaryHandler Callback for binary data over the web socket.\n * Returns true if the connection should be kept alive, false to disconnect.\n */\n connect(path, textHandler, binaryHandler) {\n const cluster = this.config.getCurrentCluster();\n if (!cluster) {\n throw new Error('No cluster is defined.');\n }\n const server = cluster.server;\n const ssl = server.startsWith('https://');\n const target = ssl ? server.substr(8) : server.substr(7);\n const proto = ssl ? 'wss' : 'ws';\n const uri = `${proto}://${target}${path}`;\n const opts = {};\n this.config.applytoHTTPSOptions(opts);\n return new Promise((resolve, reject) => {\n const client = this.socketFactory\n ? this.socketFactory(uri, opts)\n : new WebSocket(uri, protocols, opts);\n let resolved = false;\n client.onopen = () => {\n resolved = true;\n resolve(client);\n };\n client.onerror = (err) => {\n if (!resolved) {\n reject(err);\n }\n };\n client.onmessage = ({ data }) => {\n // TODO: support ArrayBuffer and Buffer[] data types?\n if (typeof data === 'string') {\n if (textHandler && !textHandler(data)) {\n client.close();\n }\n }\n else if (data instanceof Buffer) {\n const streamNum = data.readInt8(0);\n if (binaryHandler && !binaryHandler(streamNum, data.slice(1))) {\n client.close();\n }\n }\n };\n });\n }\n}\nWebSocketHandler.StdinStream = 0;\nWebSocketHandler.StdoutStream = 1;\nWebSocketHandler.StderrStream = 2;\nWebSocketHandler.StatusStream = 3;\nWebSocketHandler.ResizeStream = 4;\nexports.WebSocketHandler = WebSocketHandler;\n//# sourceMappingURL=web-socket-handler.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst yaml = require(\"js-yaml\");\nfunction loadYaml(data, opts) {\n return yaml.safeLoad(data, opts);\n}\nexports.loadYaml = loadYaml;\nfunction loadAllYaml(data, opts) {\n return yaml.safeLoadAll(data, undefined, opts);\n}\nexports.loadAllYaml = loadAllYaml;\nfunction dumpYaml(object, opts) {\n return yaml.safeDump(object, opts);\n}\nexports.dumpYaml = dumpYaml;\n//# sourceMappingURL=yaml.js.map","const { define } = require('./asn1/api')\nconst base = require('./asn1/base')\nconst constants = require('./asn1/constants')\nconst decoders = require('./asn1/decoders')\nconst encoders = require('./asn1/encoders')\n\nmodule.exports = {\n base,\n constants,\n decoders,\n define,\n encoders\n}\n","const { inherits } = require('util')\nconst encoders = require('./encoders')\nconst decoders = require('./decoders')\n\nmodule.exports.define = function define (name, body) {\n return new Entity(name, body)\n}\n\nfunction Entity (name, body) {\n this.name = name\n this.body = body\n\n this.decoders = {}\n this.encoders = {}\n}\n\nEntity.prototype._createNamed = function createNamed (Base) {\n const name = this.name\n\n function Generated (entity) {\n this._initNamed(entity, name)\n }\n inherits(Generated, Base)\n Generated.prototype._initNamed = function _initNamed (entity, name) {\n Base.call(this, entity, name)\n }\n\n return new Generated(this)\n}\n\nEntity.prototype._getDecoder = function _getDecoder (enc) {\n enc = enc || 'der'\n // Lazily create decoder\n if (!Object.prototype.hasOwnProperty.call(this.decoders, enc)) { this.decoders[enc] = this._createNamed(decoders[enc]) }\n return this.decoders[enc]\n}\n\nEntity.prototype.decode = function decode (data, enc, options) {\n return this._getDecoder(enc).decode(data, options)\n}\n\nEntity.prototype._getEncoder = function _getEncoder (enc) {\n enc = enc || 'der'\n // Lazily create encoder\n if (!Object.prototype.hasOwnProperty.call(this.encoders, enc)) { this.encoders[enc] = this._createNamed(encoders[enc]) }\n return this.encoders[enc]\n}\n\nEntity.prototype.encode = function encode (data, enc, /* internal */ reporter) {\n return this._getEncoder(enc).encode(data, reporter)\n}\n","const { inherits } = require('util')\n\nconst { Reporter } = require('../base/reporter')\n\nfunction DecoderBuffer (base, options) {\n Reporter.call(this, options)\n if (!Buffer.isBuffer(base)) {\n this.error('Input not Buffer')\n return\n }\n\n this.base = base\n this.offset = 0\n this.length = base.length\n}\ninherits(DecoderBuffer, Reporter)\n\nDecoderBuffer.isDecoderBuffer = function isDecoderBuffer (data) {\n if (data instanceof DecoderBuffer) {\n return true\n }\n\n // Or accept compatible API\n const isCompatible = typeof data === 'object' &&\n Buffer.isBuffer(data.base) &&\n data.constructor.name === 'DecoderBuffer' &&\n typeof data.offset === 'number' &&\n typeof data.length === 'number' &&\n typeof data.save === 'function' &&\n typeof data.restore === 'function' &&\n typeof data.isEmpty === 'function' &&\n typeof data.readUInt8 === 'function' &&\n typeof data.skip === 'function' &&\n typeof data.raw === 'function'\n\n return isCompatible\n}\n\nDecoderBuffer.prototype.save = function save () {\n return { offset: this.offset, reporter: Reporter.prototype.save.call(this) }\n}\n\nDecoderBuffer.prototype.restore = function restore (save) {\n // Return skipped data\n const res = new DecoderBuffer(this.base)\n res.offset = save.offset\n res.length = this.offset\n\n this.offset = save.offset\n Reporter.prototype.restore.call(this, save.reporter)\n\n return res\n}\n\nDecoderBuffer.prototype.isEmpty = function isEmpty () {\n return this.offset === this.length\n}\n\nDecoderBuffer.prototype.readUInt8 = function readUInt8 (fail) {\n if (this.offset + 1 <= this.length) { return this.base.readUInt8(this.offset++, true) } else { return this.error(fail || 'DecoderBuffer overrun') }\n}\n\nDecoderBuffer.prototype.skip = function skip (bytes, fail) {\n if (!(this.offset + bytes <= this.length)) { return this.error(fail || 'DecoderBuffer overrun') }\n\n const res = new DecoderBuffer(this.base)\n\n // Share reporter state\n res._reporterState = this._reporterState\n\n res.offset = this.offset\n res.length = this.offset + bytes\n this.offset += bytes\n return res\n}\n\nDecoderBuffer.prototype.raw = function raw (save) {\n return this.base.slice(save ? save.offset : this.offset, this.length)\n}\n\nfunction EncoderBuffer (value, reporter) {\n if (Array.isArray(value)) {\n this.length = 0\n this.value = value.map(function (item) {\n if (!EncoderBuffer.isEncoderBuffer(item)) { item = new EncoderBuffer(item, reporter) }\n this.length += item.length\n return item\n }, this)\n } else if (typeof value === 'number') {\n if (!(value >= 0 && value <= 0xff)) { return reporter.error('non-byte EncoderBuffer value') }\n this.value = value\n this.length = 1\n } else if (typeof value === 'string') {\n this.value = value\n this.length = Buffer.byteLength(value)\n } else if (Buffer.isBuffer(value)) {\n this.value = value\n this.length = value.length\n } else {\n return reporter.error(`Unsupported type: ${typeof value}`)\n }\n}\n\nEncoderBuffer.isEncoderBuffer = function isEncoderBuffer (data) {\n if (data instanceof EncoderBuffer) {\n return true\n }\n\n // Or accept compatible API\n const isCompatible = typeof data === 'object' &&\n data.constructor.name === 'EncoderBuffer' &&\n typeof data.length === 'number' &&\n typeof data.join === 'function'\n\n return isCompatible\n}\n\nEncoderBuffer.prototype.join = function join (out, offset) {\n if (!out) { out = Buffer.alloc(this.length) }\n if (!offset) { offset = 0 }\n\n if (this.length === 0) { return out }\n\n if (Array.isArray(this.value)) {\n this.value.forEach(function (item) {\n item.join(out, offset)\n offset += item.length\n })\n } else {\n if (typeof this.value === 'number') { out[offset] = this.value } else if (typeof this.value === 'string') { out.write(this.value, offset) } else if (Buffer.isBuffer(this.value)) { this.value.copy(out, offset) }\n offset += this.length\n }\n\n return out\n}\n\nmodule.exports = {\n DecoderBuffer,\n EncoderBuffer\n}\n","const { Reporter } = require('./reporter')\nconst { DecoderBuffer, EncoderBuffer } = require('./buffer')\nconst Node = require('./node')\n\nmodule.exports = {\n DecoderBuffer,\n EncoderBuffer,\n Node,\n Reporter\n}\n","const { strict: assert } = require('assert')\n\nconst { Reporter } = require('../base/reporter')\nconst { DecoderBuffer, EncoderBuffer } = require('../base/buffer')\n\n// Supported tags\nconst tags = [\n 'seq', 'seqof', 'set', 'setof', 'objid', 'bool',\n 'gentime', 'utctime', 'null_', 'enum', 'int', 'objDesc',\n 'bitstr', 'bmpstr', 'charstr', 'genstr', 'graphstr', 'ia5str', 'iso646str',\n 'numstr', 'octstr', 'printstr', 't61str', 'unistr', 'utf8str', 'videostr'\n]\n\n// Public methods list\nconst methods = [\n 'key', 'obj', 'use', 'optional', 'explicit', 'implicit', 'def', 'choice',\n 'any', 'contains'\n].concat(tags)\n\n// Overrided methods list\nconst overrided = [\n '_peekTag', '_decodeTag', '_use',\n '_decodeStr', '_decodeObjid', '_decodeTime',\n '_decodeNull', '_decodeInt', '_decodeBool', '_decodeList',\n\n '_encodeComposite', '_encodeStr', '_encodeObjid', '_encodeTime',\n '_encodeNull', '_encodeInt', '_encodeBool'\n]\n\nfunction Node (enc, parent, name) {\n const state = {}\n this._baseState = state\n\n state.name = name\n state.enc = enc\n\n state.parent = parent || null\n state.children = null\n\n // State\n state.tag = null\n state.args = null\n state.reverseArgs = null\n state.choice = null\n state.optional = false\n state.any = false\n state.obj = false\n state.use = null\n state.useDecoder = null\n state.key = null\n state.default = null\n state.explicit = null\n state.implicit = null\n state.contains = null\n\n // Should create new instance on each method\n if (!state.parent) {\n state.children = []\n this._wrap()\n }\n}\n\nconst stateProps = [\n 'enc', 'parent', 'children', 'tag', 'args', 'reverseArgs', 'choice',\n 'optional', 'any', 'obj', 'use', 'alteredUse', 'key', 'default', 'explicit',\n 'implicit', 'contains'\n]\n\nNode.prototype.clone = function clone () {\n const state = this._baseState\n const cstate = {}\n stateProps.forEach(function (prop) {\n cstate[prop] = state[prop]\n })\n const res = new this.constructor(cstate.parent)\n res._baseState = cstate\n return res\n}\n\nNode.prototype._wrap = function wrap () {\n const state = this._baseState\n methods.forEach(function (method) {\n this[method] = function _wrappedMethod () {\n const clone = new this.constructor(this)\n state.children.push(clone)\n return clone[method].apply(clone, arguments)\n }\n }, this)\n}\n\nNode.prototype._init = function init (body) {\n const state = this._baseState\n\n assert(state.parent === null)\n body.call(this)\n\n // Filter children\n state.children = state.children.filter(function (child) {\n return child._baseState.parent === this\n }, this)\n assert.equal(state.children.length, 1, 'Root node can have only one child')\n}\n\nNode.prototype._useArgs = function useArgs (args) {\n const state = this._baseState\n\n // Filter children and args\n const children = args.filter(function (arg) {\n return arg instanceof this.constructor\n }, this)\n args = args.filter(function (arg) {\n return !(arg instanceof this.constructor)\n }, this)\n\n if (children.length !== 0) {\n assert(state.children === null)\n state.children = children\n\n // Replace parent to maintain backward link\n children.forEach(function (child) {\n child._baseState.parent = this\n }, this)\n }\n if (args.length !== 0) {\n assert(state.args === null)\n state.args = args\n state.reverseArgs = args.map(function (arg) {\n if (typeof arg !== 'object' || arg.constructor !== Object) { return arg }\n\n const res = {}\n Object.keys(arg).forEach(function (key) {\n if (key == (key | 0)) { key |= 0 } // eslint-disable-line eqeqeq\n const value = arg[key]\n res[value] = key\n })\n return res\n })\n }\n}\n\n//\n// Overrided methods\n//\n\noverrided.forEach(function (method) {\n Node.prototype[method] = function _overrided () {\n const state = this._baseState\n throw new Error(`${method} not implemented for encoding: ${state.enc}`)\n }\n})\n\n//\n// Public methods\n//\n\ntags.forEach(function (tag) {\n Node.prototype[tag] = function _tagMethod () {\n const state = this._baseState\n const args = Array.prototype.slice.call(arguments)\n\n assert(state.tag === null)\n state.tag = tag\n\n this._useArgs(args)\n\n return this\n }\n})\n\nNode.prototype.use = function use (item) {\n assert(item)\n const state = this._baseState\n\n assert(state.use === null)\n state.use = item\n\n return this\n}\n\nNode.prototype.optional = function optional () {\n const state = this._baseState\n\n state.optional = true\n\n return this\n}\n\nNode.prototype.def = function def (val) {\n const state = this._baseState\n\n assert(state.default === null)\n state.default = val\n state.optional = true\n\n return this\n}\n\nNode.prototype.explicit = function explicit (num) {\n const state = this._baseState\n\n assert(state.explicit === null && state.implicit === null)\n state.explicit = num\n\n return this\n}\n\nNode.prototype.implicit = function implicit (num) {\n const state = this._baseState\n\n assert(state.explicit === null && state.implicit === null)\n state.implicit = num\n\n return this\n}\n\nNode.prototype.obj = function obj () {\n const state = this._baseState\n const args = Array.prototype.slice.call(arguments)\n\n state.obj = true\n\n if (args.length !== 0) { this._useArgs(args) }\n\n return this\n}\n\nNode.prototype.key = function key (newKey) {\n const state = this._baseState\n\n assert(state.key === null)\n state.key = newKey\n\n return this\n}\n\nNode.prototype.any = function any () {\n const state = this._baseState\n\n state.any = true\n\n return this\n}\n\nNode.prototype.choice = function choice (obj) {\n const state = this._baseState\n\n assert(state.choice === null)\n state.choice = obj\n this._useArgs(Object.keys(obj).map(function (key) {\n return obj[key]\n }))\n\n return this\n}\n\nNode.prototype.contains = function contains (item) {\n const state = this._baseState\n\n assert(state.use === null)\n state.contains = item\n\n return this\n}\n\n//\n// Decoding\n//\n\nNode.prototype._decode = function decode (input, options) {\n const state = this._baseState\n\n // Decode root node\n if (state.parent === null) { return input.wrapResult(state.children[0]._decode(input, options)) }\n\n let result = state.default\n let present = true\n\n let prevKey = null\n if (state.key !== null) { prevKey = input.enterKey(state.key) }\n\n // Check if tag is there\n if (state.optional) {\n let tag = null\n if (state.explicit !== null) { tag = state.explicit } else if (state.implicit !== null) { tag = state.implicit } else if (state.tag !== null) { tag = state.tag }\n\n if (tag === null && !state.any) {\n // Trial and Error\n const save = input.save()\n try {\n if (state.choice === null) { this._decodeGeneric(state.tag, input, options) } else { this._decodeChoice(input, options) }\n present = true\n } catch (e) {\n present = false\n }\n input.restore(save)\n } else {\n present = this._peekTag(input, tag, state.any)\n\n if (input.isError(present)) { return present }\n }\n }\n\n // Push object on stack\n let prevObj\n if (state.obj && present) { prevObj = input.enterObject() }\n\n if (present) {\n // Unwrap explicit values\n if (state.explicit !== null) {\n const explicit = this._decodeTag(input, state.explicit)\n if (input.isError(explicit)) { return explicit }\n input = explicit\n }\n\n const start = input.offset\n\n // Unwrap implicit and normal values\n if (state.use === null && state.choice === null) {\n let save\n if (state.any) { save = input.save() }\n const body = this._decodeTag(\n input,\n state.implicit !== null ? state.implicit : state.tag,\n state.any\n )\n if (input.isError(body)) { return body }\n\n if (state.any) { result = input.raw(save) } else { input = body }\n }\n\n if (options && options.track && state.tag !== null) { options.track(input.path(), start, input.length, 'tagged') }\n\n if (options && options.track && state.tag !== null) { options.track(input.path(), input.offset, input.length, 'content') }\n\n // Select proper method for tag\n if (state.any) {\n // no-op\n } else if (state.choice === null) {\n result = this._decodeGeneric(state.tag, input, options)\n } else {\n result = this._decodeChoice(input, options)\n }\n\n if (input.isError(result)) { return result }\n\n // Decode children\n if (!state.any && state.choice === null && state.children !== null) {\n state.children.forEach(function decodeChildren (child) {\n // NOTE: We are ignoring errors here, to let parser continue with other\n // parts of encoded data\n child._decode(input, options)\n })\n }\n\n // Decode contained/encoded by schema, only in bit or octet strings\n if (state.contains && (state.tag === 'octstr' || state.tag === 'bitstr')) {\n const data = new DecoderBuffer(result)\n result = this._getUse(state.contains, input._reporterState.obj)\n ._decode(data, options)\n }\n }\n\n // Pop object\n if (state.obj && present) { result = input.leaveObject(prevObj) }\n\n // Set key\n if (state.key !== null && (result !== null || present === true)) { input.leaveKey(prevKey, state.key, result) } else if (prevKey !== null) { input.exitKey(prevKey) }\n\n return result\n}\n\nNode.prototype._decodeGeneric = function decodeGeneric (tag, input, options) {\n const state = this._baseState\n\n if (tag === 'seq' || tag === 'set') { return null }\n if (tag === 'seqof' || tag === 'setof') { return this._decodeList(input, tag, state.args[0], options) } else if (/str$/.test(tag)) { return this._decodeStr(input, tag, options) } else if (tag === 'objid' && state.args) { return this._decodeObjid(input, state.args[0], state.args[1], options) } else if (tag === 'objid') { return this._decodeObjid(input, null, null, options) } else if (tag === 'gentime' || tag === 'utctime') { return this._decodeTime(input, tag, options) } else if (tag === 'null_') { return this._decodeNull(input, options) } else if (tag === 'bool') { return this._decodeBool(input, options) } else if (tag === 'objDesc') { return this._decodeStr(input, tag, options) } else if (tag === 'int' || tag === 'enum') { return this._decodeInt(input, state.args && state.args[0], options) }\n\n if (state.use !== null) {\n return this._getUse(state.use, input._reporterState.obj)\n ._decode(input, options)\n } else {\n return input.error(`unknown tag: ${tag}`)\n }\n}\n\nNode.prototype._getUse = function _getUse (entity, obj) {\n const state = this._baseState\n // Create altered use decoder if implicit is set\n state.useDecoder = this._use(entity, obj)\n assert(state.useDecoder._baseState.parent === null)\n state.useDecoder = state.useDecoder._baseState.children[0]\n if (state.implicit !== state.useDecoder._baseState.implicit) {\n state.useDecoder = state.useDecoder.clone()\n state.useDecoder._baseState.implicit = state.implicit\n }\n return state.useDecoder\n}\n\nNode.prototype._decodeChoice = function decodeChoice (input, options) {\n const state = this._baseState\n let result = null\n let match = false\n\n Object.keys(state.choice).some(function (key) {\n const save = input.save()\n const node = state.choice[key]\n try {\n const value = node._decode(input, options)\n if (input.isError(value)) { return false }\n\n result = { type: key, value: value }\n match = true\n } catch (e) {\n input.restore(save)\n return false\n }\n return true\n }, this)\n\n if (!match) { return input.error('Choice not matched') }\n\n return result\n}\n\n//\n// Encoding\n//\n\nNode.prototype._createEncoderBuffer = function createEncoderBuffer (data) {\n return new EncoderBuffer(data, this.reporter)\n}\n\nNode.prototype._encode = function encode (data, reporter, parent) {\n const state = this._baseState\n if (state.default !== null && state.default === data) { return }\n\n const result = this._encodeValue(data, reporter, parent)\n if (result === undefined) { return }\n\n if (this._skipDefault(result, reporter, parent)) { return }\n\n return result\n}\n\nNode.prototype._encodeValue = function encode (data, reporter, parent) {\n const state = this._baseState\n\n // Decode root node\n if (state.parent === null) { return state.children[0]._encode(data, reporter || new Reporter()) }\n\n let result = null\n\n // Set reporter to share it with a child class\n this.reporter = reporter\n\n // Check if data is there\n if (state.optional && data === undefined) {\n if (state.default !== null) { data = state.default } else { return }\n }\n\n // Encode children first\n let content = null\n let primitive = false\n if (state.any) {\n // Anything that was given is translated to buffer\n result = this._createEncoderBuffer(data)\n } else if (state.choice) {\n result = this._encodeChoice(data, reporter)\n } else if (state.contains) {\n content = this._getUse(state.contains, parent)._encode(data, reporter)\n primitive = true\n } else if (state.children) {\n content = state.children.map(function (child) {\n if (child._baseState.tag === 'null_') { return child._encode(null, reporter, data) }\n\n if (child._baseState.key === null) { return reporter.error('Child should have a key') }\n const prevKey = reporter.enterKey(child._baseState.key)\n\n if (typeof data !== 'object') { return reporter.error('Child expected, but input is not object') }\n\n const res = child._encode(data[child._baseState.key], reporter, data)\n reporter.leaveKey(prevKey)\n\n return res\n }, this).filter(function (child) {\n return child\n })\n content = this._createEncoderBuffer(content)\n } else {\n if (state.tag === 'seqof' || state.tag === 'setof') {\n if (!(state.args && state.args.length === 1)) { return reporter.error(`Too many args for: ${state.tag}`) }\n\n if (!Array.isArray(data)) { return reporter.error('seqof/setof, but data is not Array') }\n\n const child = this.clone()\n child._baseState.implicit = null\n content = this._createEncoderBuffer(data.map(function (item) {\n const state = this._baseState\n\n return this._getUse(state.args[0], data)._encode(item, reporter)\n }, child))\n } else if (state.use !== null) {\n result = this._getUse(state.use, parent)._encode(data, reporter)\n } else {\n content = this._encodePrimitive(state.tag, data)\n primitive = true\n }\n }\n\n // Encode data itself\n if (!state.any && state.choice === null) {\n const tag = state.implicit !== null ? state.implicit : state.tag\n const cls = state.implicit === null ? 'universal' : 'context'\n\n if (tag === null) {\n if (state.use === null) { reporter.error('Tag could be omitted only for .use()') }\n } else {\n if (state.use === null) { result = this._encodeComposite(tag, primitive, cls, content) }\n }\n }\n\n // Wrap in explicit\n if (state.explicit !== null) { result = this._encodeComposite(state.explicit, false, 'context', result) }\n\n return result\n}\n\nNode.prototype._encodeChoice = function encodeChoice (data, reporter) {\n const state = this._baseState\n\n const node = state.choice[data.type]\n if (!node) {\n assert(\n false,\n `${data.type} not found in ${JSON.stringify(Object.keys(state.choice))}`\n )\n }\n return node._encode(data.value, reporter)\n}\n\nNode.prototype._encodePrimitive = function encodePrimitive (tag, data) {\n const state = this._baseState\n\n if (/str$/.test(tag)) { return this._encodeStr(data, tag) } else if (tag === 'objid' && state.args) { return this._encodeObjid(data, state.reverseArgs[0], state.args[1]) } else if (tag === 'objid') { return this._encodeObjid(data, null, null) } else if (tag === 'gentime' || tag === 'utctime') { return this._encodeTime(data, tag) } else if (tag === 'null_') { return this._encodeNull() } else if (tag === 'int' || tag === 'enum') { return this._encodeInt(data, state.args && state.reverseArgs[0]) } else if (tag === 'bool') { return this._encodeBool(data) } else if (tag === 'objDesc') { return this._encodeStr(data, tag) } else { throw new Error(`Unsupported tag: ${tag}`) }\n}\n\nNode.prototype._isNumstr = function isNumstr (str) {\n return /^[0-9 ]*$/.test(str)\n}\n\nNode.prototype._isPrintstr = function isPrintstr (str) {\n return /^[A-Za-z0-9 '()+,-./:=?]*$/.test(str)\n}\n\nmodule.exports = Node\n","const { inherits } = require('util')\n\nfunction Reporter (options) {\n this._reporterState = {\n obj: null,\n path: [],\n options: options || {},\n errors: []\n }\n}\n\nReporter.prototype.isError = function isError (obj) {\n return obj instanceof ReporterError\n}\n\nReporter.prototype.save = function save () {\n const state = this._reporterState\n\n return { obj: state.obj, pathLen: state.path.length }\n}\n\nReporter.prototype.restore = function restore (data) {\n const state = this._reporterState\n\n state.obj = data.obj\n state.path = state.path.slice(0, data.pathLen)\n}\n\nReporter.prototype.enterKey = function enterKey (key) {\n return this._reporterState.path.push(key)\n}\n\nReporter.prototype.exitKey = function exitKey (index) {\n const state = this._reporterState\n\n state.path = state.path.slice(0, index - 1)\n}\n\nReporter.prototype.leaveKey = function leaveKey (index, key, value) {\n const state = this._reporterState\n\n this.exitKey(index)\n if (state.obj !== null) { state.obj[key] = value }\n}\n\nReporter.prototype.path = function path () {\n return this._reporterState.path.join('/')\n}\n\nReporter.prototype.enterObject = function enterObject () {\n const state = this._reporterState\n\n const prev = state.obj\n state.obj = {}\n return prev\n}\n\nReporter.prototype.leaveObject = function leaveObject (prev) {\n const state = this._reporterState\n\n const now = state.obj\n state.obj = prev\n return now\n}\n\nReporter.prototype.error = function error (msg) {\n let err\n const state = this._reporterState\n\n const inherited = msg instanceof ReporterError\n if (inherited) {\n err = msg\n } else {\n err = new ReporterError(state.path.map(function (elem) {\n return `[${JSON.stringify(elem)}]`\n }).join(''), msg.message || msg, msg.stack)\n }\n\n if (!state.options.partial) { throw err }\n\n if (!inherited) { state.errors.push(err) }\n\n return err\n}\n\nReporter.prototype.wrapResult = function wrapResult (result) {\n const state = this._reporterState\n if (!state.options.partial) { return result }\n\n return {\n result: this.isError(result) ? null : result,\n errors: state.errors\n }\n}\n\nfunction ReporterError (path, msg) {\n this.path = path\n this.rethrow(msg)\n}\ninherits(ReporterError, Error)\n\nReporterError.prototype.rethrow = function rethrow (msg) {\n this.message = `${msg} at: ${this.path || '(shallow)'}`\n if (Error.captureStackTrace) { Error.captureStackTrace(this, ReporterError) }\n\n if (!this.stack) {\n try {\n // IE only adds stack when thrown\n throw new Error(this.message)\n } catch (e) {\n this.stack = e.stack\n }\n }\n return this\n}\n\nexports.Reporter = Reporter\n","// Helper\nfunction reverse (map) {\n const res = {}\n\n Object.keys(map).forEach(function (key) {\n // Convert key to integer if it is stringified\n if ((key | 0) == key) { key = key | 0 } // eslint-disable-line eqeqeq\n\n const value = map[key]\n res[value] = key\n })\n\n return res\n}\n\nexports.tagClass = {\n 0: 'universal',\n 1: 'application',\n 2: 'context',\n 3: 'private'\n}\nexports.tagClassByName = reverse(exports.tagClass)\n\nexports.tag = {\n 0x00: 'end',\n 0x01: 'bool',\n 0x02: 'int',\n 0x03: 'bitstr',\n 0x04: 'octstr',\n 0x05: 'null_',\n 0x06: 'objid',\n 0x07: 'objDesc',\n 0x08: 'external',\n 0x09: 'real',\n 0x0a: 'enum',\n 0x0b: 'embed',\n 0x0c: 'utf8str',\n 0x0d: 'relativeOid',\n 0x10: 'seq',\n 0x11: 'set',\n 0x12: 'numstr',\n 0x13: 'printstr',\n 0x14: 't61str',\n 0x15: 'videostr',\n 0x16: 'ia5str',\n 0x17: 'utctime',\n 0x18: 'gentime',\n 0x19: 'graphstr',\n 0x1a: 'iso646str',\n 0x1b: 'genstr',\n 0x1c: 'unistr',\n 0x1d: 'charstr',\n 0x1e: 'bmpstr'\n}\nexports.tagByName = reverse(exports.tag)\n","module.exports = {\n der: require('./der')\n}\n","/* global BigInt */\nconst { inherits } = require('util')\n\nconst { DecoderBuffer } = require('../base/buffer')\nconst Node = require('../base/node')\n\n// Import DER constants\nconst der = require('../constants/der')\n\nfunction DERDecoder (entity) {\n this.enc = 'der'\n this.name = entity.name\n this.entity = entity\n\n // Construct base tree\n this.tree = new DERNode()\n this.tree._init(entity.body)\n}\n\nDERDecoder.prototype.decode = function decode (data, options) {\n if (!DecoderBuffer.isDecoderBuffer(data)) {\n data = new DecoderBuffer(data, options)\n }\n\n return this.tree._decode(data, options)\n}\n\n// Tree methods\n\nfunction DERNode (parent) {\n Node.call(this, 'der', parent)\n}\ninherits(DERNode, Node)\n\nDERNode.prototype._peekTag = function peekTag (buffer, tag, any) {\n if (buffer.isEmpty()) { return false }\n\n const state = buffer.save()\n const decodedTag = derDecodeTag(buffer, `Failed to peek tag: \"${tag}\"`)\n if (buffer.isError(decodedTag)) { return decodedTag }\n\n buffer.restore(state)\n\n return decodedTag.tag === tag || decodedTag.tagStr === tag || (decodedTag.tagStr + 'of') === tag || any\n}\n\nDERNode.prototype._decodeTag = function decodeTag (buffer, tag, any) {\n const decodedTag = derDecodeTag(buffer,\n `Failed to decode tag of \"${tag}\"`)\n if (buffer.isError(decodedTag)) { return decodedTag }\n\n let len = derDecodeLen(buffer,\n decodedTag.primitive,\n `Failed to get length of \"${tag}\"`)\n\n // Failure\n if (buffer.isError(len)) { return len }\n\n if (!any &&\n decodedTag.tag !== tag &&\n decodedTag.tagStr !== tag &&\n decodedTag.tagStr + 'of' !== tag) {\n return buffer.error(`Failed to match tag: \"${tag}\"`)\n }\n\n if (decodedTag.primitive || len !== null) { return buffer.skip(len, `Failed to match body of: \"${tag}\"`) }\n\n // Indefinite length... find END tag\n const state = buffer.save()\n const res = this._skipUntilEnd(\n buffer,\n `Failed to skip indefinite length body: \"${this.tag}\"`)\n if (buffer.isError(res)) { return res }\n\n len = buffer.offset - state.offset\n buffer.restore(state)\n return buffer.skip(len, `Failed to match body of: \"${tag}\"`)\n}\n\nDERNode.prototype._skipUntilEnd = function skipUntilEnd (buffer, fail) {\n for (;;) {\n const tag = derDecodeTag(buffer, fail)\n if (buffer.isError(tag)) { return tag }\n const len = derDecodeLen(buffer, tag.primitive, fail)\n if (buffer.isError(len)) { return len }\n\n let res\n if (tag.primitive || len !== null) { res = buffer.skip(len) } else { res = this._skipUntilEnd(buffer, fail) }\n\n // Failure\n if (buffer.isError(res)) { return res }\n\n if (tag.tagStr === 'end') { break }\n }\n}\n\nDERNode.prototype._decodeList = function decodeList (buffer, tag, decoder,\n options) {\n const result = []\n while (!buffer.isEmpty()) {\n const possibleEnd = this._peekTag(buffer, 'end')\n if (buffer.isError(possibleEnd)) { return possibleEnd }\n\n const res = decoder.decode(buffer, 'der', options)\n if (buffer.isError(res) && possibleEnd) { break }\n result.push(res)\n }\n return result\n}\n\nDERNode.prototype._decodeStr = function decodeStr (buffer, tag) {\n if (tag === 'bitstr') {\n const unused = buffer.readUInt8()\n if (buffer.isError(unused)) { return unused }\n return { unused: unused, data: buffer.raw() }\n } else if (tag === 'bmpstr') {\n const raw = buffer.raw()\n if (raw.length % 2 === 1) { return buffer.error('Decoding of string type: bmpstr length mismatch') }\n\n let str = ''\n for (let i = 0; i < raw.length / 2; i++) {\n str += String.fromCharCode(raw.readUInt16BE(i * 2))\n }\n return str\n } else if (tag === 'numstr') {\n const numstr = buffer.raw().toString('ascii')\n if (!this._isNumstr(numstr)) {\n return buffer.error('Decoding of string type: numstr unsupported characters')\n }\n return numstr\n } else if (tag === 'octstr') {\n return buffer.raw()\n } else if (tag === 'objDesc') {\n return buffer.raw()\n } else if (tag === 'printstr') {\n const printstr = buffer.raw().toString('ascii')\n if (!this._isPrintstr(printstr)) {\n return buffer.error('Decoding of string type: printstr unsupported characters')\n }\n return printstr\n } else if (/str$/.test(tag)) {\n return buffer.raw().toString()\n } else {\n return buffer.error(`Decoding of string type: ${tag} unsupported`)\n }\n}\n\nDERNode.prototype._decodeObjid = function decodeObjid (buffer, values, relative) {\n let result\n const identifiers = []\n let ident = 0\n let subident = 0\n while (!buffer.isEmpty()) {\n subident = buffer.readUInt8()\n ident <<= 7\n ident |= subident & 0x7f\n if ((subident & 0x80) === 0) {\n identifiers.push(ident)\n ident = 0\n }\n }\n if (subident & 0x80) { identifiers.push(ident) }\n\n const first = (identifiers[0] / 40) | 0\n const second = identifiers[0] % 40\n\n if (relative) { result = identifiers } else { result = [first, second].concat(identifiers.slice(1)) }\n\n if (values) {\n let tmp = values[result.join(' ')]\n if (tmp === undefined) { tmp = values[result.join('.')] }\n if (tmp !== undefined) { result = tmp }\n }\n\n return result\n}\n\nDERNode.prototype._decodeTime = function decodeTime (buffer, tag) {\n const str = buffer.raw().toString()\n\n let year\n let mon\n let day\n let hour\n let min\n let sec\n if (tag === 'gentime') {\n year = str.slice(0, 4) | 0\n mon = str.slice(4, 6) | 0\n day = str.slice(6, 8) | 0\n hour = str.slice(8, 10) | 0\n min = str.slice(10, 12) | 0\n sec = str.slice(12, 14) | 0\n } else if (tag === 'utctime') {\n year = str.slice(0, 2) | 0\n mon = str.slice(2, 4) | 0\n day = str.slice(4, 6) | 0\n hour = str.slice(6, 8) | 0\n min = str.slice(8, 10) | 0\n sec = str.slice(10, 12) | 0\n if (year < 70) { year = 2000 + year } else { year = 1900 + year }\n } else {\n return buffer.error(`Decoding ${tag} time is not supported yet`)\n }\n\n return Date.UTC(year, mon - 1, day, hour, min, sec, 0)\n}\n\nDERNode.prototype._decodeNull = function decodeNull () {\n return null\n}\n\nDERNode.prototype._decodeBool = function decodeBool (buffer) {\n const res = buffer.readUInt8()\n if (buffer.isError(res)) { return res } else { return res !== 0 }\n}\n\nDERNode.prototype._decodeInt = function decodeInt (buffer, values) {\n // Bigint, return as it is (assume big endian)\n const raw = buffer.raw()\n let res = BigInt(`0x${raw.toString('hex')}`)\n\n if (values) {\n res = values[res.toString(10)] || res\n }\n\n return res\n}\n\nDERNode.prototype._use = function use (entity, obj) {\n if (typeof entity === 'function') { entity = entity(obj) }\n return entity._getDecoder('der').tree\n}\n\n// Utility methods\n\nfunction derDecodeTag (buf, fail) {\n let tag = buf.readUInt8(fail)\n if (buf.isError(tag)) { return tag }\n\n const cls = der.tagClass[tag >> 6]\n const primitive = (tag & 0x20) === 0\n\n // Multi-octet tag - load\n if ((tag & 0x1f) === 0x1f) {\n let oct = tag\n tag = 0\n while ((oct & 0x80) === 0x80) {\n oct = buf.readUInt8(fail)\n if (buf.isError(oct)) { return oct }\n\n tag <<= 7\n tag |= oct & 0x7f\n }\n } else {\n tag &= 0x1f\n }\n const tagStr = der.tag[tag]\n\n return {\n cls: cls,\n primitive: primitive,\n tag: tag,\n tagStr: tagStr\n }\n}\n\nfunction derDecodeLen (buf, primitive, fail) {\n let len = buf.readUInt8(fail)\n if (buf.isError(len)) { return len }\n\n // Indefinite form\n if (!primitive && len === 0x80) { return null }\n\n // Definite form\n if ((len & 0x80) === 0) {\n // Short form\n return len\n }\n\n // Long form\n const num = len & 0x7f\n if (num > 4) { return buf.error('length octect is too long') }\n\n len = 0\n for (let i = 0; i < num; i++) {\n len <<= 8\n const j = buf.readUInt8(fail)\n if (buf.isError(j)) { return j }\n len |= j\n }\n\n return len\n}\n\nmodule.exports = DERDecoder\n","module.exports = {\n der: require('./der'),\n pem: require('./pem')\n}\n","const { inherits } = require('util')\n\nconst DERDecoder = require('./der')\n\nfunction PEMDecoder (entity) {\n DERDecoder.call(this, entity)\n this.enc = 'pem'\n}\ninherits(PEMDecoder, DERDecoder)\n\nPEMDecoder.prototype.decode = function decode (data, options) {\n const lines = data.toString().split(/[\\r\\n]+/g)\n\n const label = options.label.toUpperCase()\n\n const re = /^-----(BEGIN|END) ([^-]+)-----$/\n let start = -1\n let end = -1\n for (let i = 0; i < lines.length; i++) {\n const match = lines[i].match(re)\n if (match === null) { continue }\n\n if (match[2] !== label) { continue }\n\n if (start === -1) {\n if (match[1] !== 'BEGIN') { break }\n start = i\n } else {\n if (match[1] !== 'END') { break }\n end = i\n break\n }\n }\n if (start === -1 || end === -1) { throw new Error(`PEM section not found for: ${label}`) }\n\n const base64 = lines.slice(start + 1, end).join('')\n // Remove excessive symbols\n base64.replace(/[^a-z0-9+/=]+/gi, '')\n\n const input = Buffer.from(base64, 'base64')\n return DERDecoder.prototype.decode.call(this, input, options)\n}\n\nmodule.exports = PEMDecoder\n","/* global BigInt */\nconst { inherits } = require('util')\n\nconst Node = require('../base/node')\nconst der = require('../constants/der')\n\nfunction DEREncoder (entity) {\n this.enc = 'der'\n this.name = entity.name\n this.entity = entity\n\n // Construct base tree\n this.tree = new DERNode()\n this.tree._init(entity.body)\n}\n\nDEREncoder.prototype.encode = function encode (data, reporter) {\n return this.tree._encode(data, reporter).join()\n}\n\n// Tree methods\n\nfunction DERNode (parent) {\n Node.call(this, 'der', parent)\n}\ninherits(DERNode, Node)\n\nDERNode.prototype._encodeComposite = function encodeComposite (tag,\n primitive,\n cls,\n content) {\n const encodedTag = encodeTag(tag, primitive, cls, this.reporter)\n\n // Short form\n if (content.length < 0x80) {\n const header = Buffer.alloc(2)\n header[0] = encodedTag\n header[1] = content.length\n return this._createEncoderBuffer([header, content])\n }\n\n // Long form\n // Count octets required to store length\n let lenOctets = 1\n for (let i = content.length; i >= 0x100; i >>= 8) { lenOctets++ }\n\n const header = Buffer.alloc(1 + 1 + lenOctets)\n header[0] = encodedTag\n header[1] = 0x80 | lenOctets\n\n for (let i = 1 + lenOctets, j = content.length; j > 0; i--, j >>= 8) { header[i] = j & 0xff }\n\n return this._createEncoderBuffer([header, content])\n}\n\nDERNode.prototype._encodeStr = function encodeStr (str, tag) {\n if (tag === 'bitstr') {\n return this._createEncoderBuffer([str.unused | 0, str.data])\n } else if (tag === 'bmpstr') {\n const buf = Buffer.alloc(str.length * 2)\n for (let i = 0; i < str.length; i++) {\n buf.writeUInt16BE(str.charCodeAt(i), i * 2)\n }\n return this._createEncoderBuffer(buf)\n } else if (tag === 'numstr') {\n if (!this._isNumstr(str)) {\n return this.reporter.error('Encoding of string type: numstr supports only digits and space')\n }\n return this._createEncoderBuffer(str)\n } else if (tag === 'printstr') {\n if (!this._isPrintstr(str)) {\n return this.reporter.error('Encoding of string type: printstr supports only latin upper and lower case letters, digits, space, apostrophe, left and rigth parenthesis, plus sign, comma, hyphen, dot, slash, colon, equal sign, question mark')\n }\n return this._createEncoderBuffer(str)\n } else if (/str$/.test(tag)) {\n return this._createEncoderBuffer(str)\n } else if (tag === 'objDesc') {\n return this._createEncoderBuffer(str)\n } else {\n return this.reporter.error(`Encoding of string type: ${tag} unsupported`)\n }\n}\n\nDERNode.prototype._encodeObjid = function encodeObjid (id, values, relative) {\n if (typeof id === 'string') {\n if (!values) { return this.reporter.error('string objid given, but no values map found') }\n if (!Object.prototype.hasOwnProperty.call(values, id)) { return this.reporter.error('objid not found in values map') }\n id = values[id].split(/[\\s.]+/g)\n for (let i = 0; i < id.length; i++) { id[i] |= 0 }\n } else if (Array.isArray(id)) {\n id = id.slice()\n for (let i = 0; i < id.length; i++) { id[i] |= 0 }\n }\n\n if (!Array.isArray(id)) {\n return this.reporter.error(`objid() should be either array or string, got: ${JSON.stringify(id)}`)\n }\n\n if (!relative) {\n if (id[1] >= 40) { return this.reporter.error('Second objid identifier OOB') }\n id.splice(0, 2, id[0] * 40 + id[1])\n }\n\n // Count number of octets\n let size = 0\n for (let i = 0; i < id.length; i++) {\n let ident = id[i]\n for (size++; ident >= 0x80; ident >>= 7) { size++ }\n }\n\n const objid = Buffer.alloc(size)\n let offset = objid.length - 1\n for (let i = id.length - 1; i >= 0; i--) {\n let ident = id[i]\n objid[offset--] = ident & 0x7f\n while ((ident >>= 7) > 0) { objid[offset--] = 0x80 | (ident & 0x7f) }\n }\n\n return this._createEncoderBuffer(objid)\n}\n\nfunction two (num) {\n if (num < 10) { return `0${num}` } else { return num }\n}\n\nDERNode.prototype._encodeTime = function encodeTime (time, tag) {\n let str\n const date = new Date(time)\n\n if (tag === 'gentime') {\n str = [\n two(date.getUTCFullYear()),\n two(date.getUTCMonth() + 1),\n two(date.getUTCDate()),\n two(date.getUTCHours()),\n two(date.getUTCMinutes()),\n two(date.getUTCSeconds()),\n 'Z'\n ].join('')\n } else if (tag === 'utctime') {\n str = [\n two(date.getUTCFullYear() % 100),\n two(date.getUTCMonth() + 1),\n two(date.getUTCDate()),\n two(date.getUTCHours()),\n two(date.getUTCMinutes()),\n two(date.getUTCSeconds()),\n 'Z'\n ].join('')\n } else {\n this.reporter.error(`Encoding ${tag} time is not supported yet`)\n }\n\n return this._encodeStr(str, 'octstr')\n}\n\nDERNode.prototype._encodeNull = function encodeNull () {\n return this._createEncoderBuffer('')\n}\n\nfunction bnToBuf (bn) {\n var hex = BigInt(bn).toString(16)\n if (hex.length % 2) { hex = '0' + hex }\n\n var len = hex.length / 2\n var u8 = new Uint8Array(len)\n\n var i = 0\n var j = 0\n while (i < len) {\n u8[i] = parseInt(hex.slice(j, j + 2), 16)\n i += 1\n j += 2\n }\n\n return u8\n}\n\nDERNode.prototype._encodeInt = function encodeInt (num, values) {\n if (typeof num === 'string') {\n if (!values) { return this.reporter.error('String int or enum given, but no values map') }\n if (!Object.prototype.hasOwnProperty.call(values, num)) {\n return this.reporter.error(`Values map doesn't contain: ${JSON.stringify(num)}`)\n }\n num = values[num]\n }\n\n if (typeof num === 'bigint') {\n const numArray = [...bnToBuf(num)]\n if (numArray[0] & 0x80) {\n numArray.unshift(0)\n }\n num = Buffer.from(numArray)\n }\n\n if (Buffer.isBuffer(num)) {\n let size = num.length\n if (num.length === 0) { size++ }\n\n const out = Buffer.alloc(size)\n num.copy(out)\n if (num.length === 0) { out[0] = 0 }\n return this._createEncoderBuffer(out)\n }\n\n if (num < 0x80) { return this._createEncoderBuffer(num) }\n\n if (num < 0x100) { return this._createEncoderBuffer([0, num]) }\n\n let size = 1\n for (let i = num; i >= 0x100; i >>= 8) { size++ }\n\n const out = new Array(size)\n for (let i = out.length - 1; i >= 0; i--) {\n out[i] = num & 0xff\n num >>= 8\n }\n if (out[0] & 0x80) {\n out.unshift(0)\n }\n\n return this._createEncoderBuffer(Buffer.from(out))\n}\n\nDERNode.prototype._encodeBool = function encodeBool (value) {\n return this._createEncoderBuffer(value ? 0xff : 0)\n}\n\nDERNode.prototype._use = function use (entity, obj) {\n if (typeof entity === 'function') { entity = entity(obj) }\n return entity._getEncoder('der').tree\n}\n\nDERNode.prototype._skipDefault = function skipDefault (dataBuffer, reporter, parent) {\n const state = this._baseState\n let i\n if (state.default === null) { return false }\n\n const data = dataBuffer.join()\n if (state.defaultBuffer === undefined) { state.defaultBuffer = this._encodeValue(state.default, reporter, parent).join() }\n\n if (data.length !== state.defaultBuffer.length) { return false }\n\n for (i = 0; i < data.length; i++) {\n if (data[i] !== state.defaultBuffer[i]) { return false }\n }\n\n return true\n}\n\n// Utility methods\n\nfunction encodeTag (tag, primitive, cls, reporter) {\n let res\n\n if (tag === 'seqof') { tag = 'seq' } else if (tag === 'setof') { tag = 'set' }\n\n if (Object.prototype.hasOwnProperty.call(der.tagByName, tag)) { res = der.tagByName[tag] } else if (typeof tag === 'number' && (tag | 0) === tag) { res = tag } else { return reporter.error(`Unknown tag: ${tag}`) }\n\n if (res >= 0x1f) { return reporter.error('Multi-octet tag encoding unsupported') }\n\n if (!primitive) { res |= 0x20 }\n\n res |= (der.tagClassByName[cls || 'universal'] << 6)\n\n return res\n}\n\nmodule.exports = DEREncoder\n","module.exports = {\n der: require('./der'),\n pem: require('./pem')\n}\n","const { inherits } = require('util')\n\nconst DEREncoder = require('./der')\n\nfunction PEMEncoder (entity) {\n DEREncoder.call(this, entity)\n this.enc = 'pem'\n}\ninherits(PEMEncoder, DEREncoder)\n\nPEMEncoder.prototype.encode = function encode (data, options) {\n const buf = DEREncoder.prototype.encode.call(this, data)\n\n const p = buf.toString('base64')\n const out = [`-----BEGIN ${options.label}-----`]\n for (let i = 0; i < p.length; i += 64) { out.push(p.slice(i, i + 64)) }\n out.push(`-----END ${options.label}-----`)\n return out.join('\\n')\n}\n\nmodule.exports = PEMEncoder\n","\"use strict\";\n/// \n/// \n/// \n/// \nObject.defineProperty(exports, \"__esModule\", { value: true });\n// TODO: Use the `URL` global when targeting Node.js 10\n// tslint:disable-next-line\nconst URLGlobal = typeof URL === 'undefined' ? require('url').URL : URL;\nconst toString = Object.prototype.toString;\nconst isOfType = (type) => (value) => typeof value === type;\nconst isBuffer = (input) => !is.nullOrUndefined(input) && !is.nullOrUndefined(input.constructor) && is.function_(input.constructor.isBuffer) && input.constructor.isBuffer(input);\nconst getObjectType = (value) => {\n const objectName = toString.call(value).slice(8, -1);\n if (objectName) {\n return objectName;\n }\n return null;\n};\nconst isObjectOfType = (type) => (value) => getObjectType(value) === type;\nfunction is(value) {\n switch (value) {\n case null:\n return \"null\" /* null */;\n case true:\n case false:\n return \"boolean\" /* boolean */;\n default:\n }\n switch (typeof value) {\n case 'undefined':\n return \"undefined\" /* undefined */;\n case 'string':\n return \"string\" /* string */;\n case 'number':\n return \"number\" /* number */;\n case 'symbol':\n return \"symbol\" /* symbol */;\n default:\n }\n if (is.function_(value)) {\n return \"Function\" /* Function */;\n }\n if (is.observable(value)) {\n return \"Observable\" /* Observable */;\n }\n if (Array.isArray(value)) {\n return \"Array\" /* Array */;\n }\n if (isBuffer(value)) {\n return \"Buffer\" /* Buffer */;\n }\n const tagType = getObjectType(value);\n if (tagType) {\n return tagType;\n }\n if (value instanceof String || value instanceof Boolean || value instanceof Number) {\n throw new TypeError('Please don\\'t use object wrappers for primitive types');\n }\n return \"Object\" /* Object */;\n}\n(function (is) {\n // tslint:disable-next-line:strict-type-predicates\n const isObject = (value) => typeof value === 'object';\n // tslint:disable:variable-name\n is.undefined = isOfType('undefined');\n is.string = isOfType('string');\n is.number = isOfType('number');\n is.function_ = isOfType('function');\n // tslint:disable-next-line:strict-type-predicates\n is.null_ = (value) => value === null;\n is.class_ = (value) => is.function_(value) && value.toString().startsWith('class ');\n is.boolean = (value) => value === true || value === false;\n is.symbol = isOfType('symbol');\n // tslint:enable:variable-name\n is.numericString = (value) => is.string(value) && value.length > 0 && !Number.isNaN(Number(value));\n is.array = Array.isArray;\n is.buffer = isBuffer;\n is.nullOrUndefined = (value) => is.null_(value) || is.undefined(value);\n is.object = (value) => !is.nullOrUndefined(value) && (is.function_(value) || isObject(value));\n is.iterable = (value) => !is.nullOrUndefined(value) && is.function_(value[Symbol.iterator]);\n is.asyncIterable = (value) => !is.nullOrUndefined(value) && is.function_(value[Symbol.asyncIterator]);\n is.generator = (value) => is.iterable(value) && is.function_(value.next) && is.function_(value.throw);\n is.nativePromise = (value) => isObjectOfType(\"Promise\" /* Promise */)(value);\n const hasPromiseAPI = (value) => !is.null_(value) &&\n isObject(value) &&\n is.function_(value.then) &&\n is.function_(value.catch);\n is.promise = (value) => is.nativePromise(value) || hasPromiseAPI(value);\n is.generatorFunction = isObjectOfType(\"GeneratorFunction\" /* GeneratorFunction */);\n is.asyncFunction = isObjectOfType(\"AsyncFunction\" /* AsyncFunction */);\n is.boundFunction = (value) => is.function_(value) && !value.hasOwnProperty('prototype');\n is.regExp = isObjectOfType(\"RegExp\" /* RegExp */);\n is.date = isObjectOfType(\"Date\" /* Date */);\n is.error = isObjectOfType(\"Error\" /* Error */);\n is.map = (value) => isObjectOfType(\"Map\" /* Map */)(value);\n is.set = (value) => isObjectOfType(\"Set\" /* Set */)(value);\n is.weakMap = (value) => isObjectOfType(\"WeakMap\" /* WeakMap */)(value);\n is.weakSet = (value) => isObjectOfType(\"WeakSet\" /* WeakSet */)(value);\n is.int8Array = isObjectOfType(\"Int8Array\" /* Int8Array */);\n is.uint8Array = isObjectOfType(\"Uint8Array\" /* Uint8Array */);\n is.uint8ClampedArray = isObjectOfType(\"Uint8ClampedArray\" /* Uint8ClampedArray */);\n is.int16Array = isObjectOfType(\"Int16Array\" /* Int16Array */);\n is.uint16Array = isObjectOfType(\"Uint16Array\" /* Uint16Array */);\n is.int32Array = isObjectOfType(\"Int32Array\" /* Int32Array */);\n is.uint32Array = isObjectOfType(\"Uint32Array\" /* Uint32Array */);\n is.float32Array = isObjectOfType(\"Float32Array\" /* Float32Array */);\n is.float64Array = isObjectOfType(\"Float64Array\" /* Float64Array */);\n is.arrayBuffer = isObjectOfType(\"ArrayBuffer\" /* ArrayBuffer */);\n is.sharedArrayBuffer = isObjectOfType(\"SharedArrayBuffer\" /* SharedArrayBuffer */);\n is.dataView = isObjectOfType(\"DataView\" /* DataView */);\n is.directInstanceOf = (instance, klass) => Object.getPrototypeOf(instance) === klass.prototype;\n is.urlInstance = (value) => isObjectOfType(\"URL\" /* URL */)(value);\n is.urlString = (value) => {\n if (!is.string(value)) {\n return false;\n }\n try {\n new URLGlobal(value); // tslint:disable-line no-unused-expression\n return true;\n }\n catch (_a) {\n return false;\n }\n };\n is.truthy = (value) => Boolean(value);\n is.falsy = (value) => !value;\n is.nan = (value) => Number.isNaN(value);\n const primitiveTypes = new Set([\n 'undefined',\n 'string',\n 'number',\n 'boolean',\n 'symbol'\n ]);\n is.primitive = (value) => is.null_(value) || primitiveTypes.has(typeof value);\n is.integer = (value) => Number.isInteger(value);\n is.safeInteger = (value) => Number.isSafeInteger(value);\n is.plainObject = (value) => {\n // From: https://github.com/sindresorhus/is-plain-obj/blob/master/index.js\n let prototype;\n return getObjectType(value) === \"Object\" /* Object */ &&\n (prototype = Object.getPrototypeOf(value), prototype === null || // tslint:disable-line:ban-comma-operator\n prototype === Object.getPrototypeOf({}));\n };\n const typedArrayTypes = new Set([\n \"Int8Array\" /* Int8Array */,\n \"Uint8Array\" /* Uint8Array */,\n \"Uint8ClampedArray\" /* Uint8ClampedArray */,\n \"Int16Array\" /* Int16Array */,\n \"Uint16Array\" /* Uint16Array */,\n \"Int32Array\" /* Int32Array */,\n \"Uint32Array\" /* Uint32Array */,\n \"Float32Array\" /* Float32Array */,\n \"Float64Array\" /* Float64Array */\n ]);\n is.typedArray = (value) => {\n const objectType = getObjectType(value);\n if (objectType === null) {\n return false;\n }\n return typedArrayTypes.has(objectType);\n };\n const isValidLength = (value) => is.safeInteger(value) && value > -1;\n is.arrayLike = (value) => !is.nullOrUndefined(value) && !is.function_(value) && isValidLength(value.length);\n is.inRange = (value, range) => {\n if (is.number(range)) {\n return value >= Math.min(0, range) && value <= Math.max(range, 0);\n }\n if (is.array(range) && range.length === 2) {\n return value >= Math.min(...range) && value <= Math.max(...range);\n }\n throw new TypeError(`Invalid range: ${JSON.stringify(range)}`);\n };\n const NODE_TYPE_ELEMENT = 1;\n const DOM_PROPERTIES_TO_CHECK = [\n 'innerHTML',\n 'ownerDocument',\n 'style',\n 'attributes',\n 'nodeValue'\n ];\n is.domElement = (value) => is.object(value) && value.nodeType === NODE_TYPE_ELEMENT && is.string(value.nodeName) &&\n !is.plainObject(value) && DOM_PROPERTIES_TO_CHECK.every(property => property in value);\n is.observable = (value) => {\n if (!value) {\n return false;\n }\n if (value[Symbol.observable] && value === value[Symbol.observable]()) {\n return true;\n }\n if (value['@@observable'] && value === value['@@observable']()) {\n return true;\n }\n return false;\n };\n is.nodeStream = (value) => !is.nullOrUndefined(value) && isObject(value) && is.function_(value.pipe) && !is.observable(value);\n is.infinite = (value) => value === Infinity || value === -Infinity;\n const isAbsoluteMod2 = (rem) => (value) => is.integer(value) && Math.abs(value % 2) === rem;\n is.even = isAbsoluteMod2(0);\n is.odd = isAbsoluteMod2(1);\n const isWhiteSpaceString = (value) => is.string(value) && /\\S/.test(value) === false;\n is.emptyArray = (value) => is.array(value) && value.length === 0;\n is.nonEmptyArray = (value) => is.array(value) && value.length > 0;\n is.emptyString = (value) => is.string(value) && value.length === 0;\n is.nonEmptyString = (value) => is.string(value) && value.length > 0;\n is.emptyStringOrWhitespace = (value) => is.emptyString(value) || isWhiteSpaceString(value);\n is.emptyObject = (value) => is.object(value) && !is.map(value) && !is.set(value) && Object.keys(value).length === 0;\n is.nonEmptyObject = (value) => is.object(value) && !is.map(value) && !is.set(value) && Object.keys(value).length > 0;\n is.emptySet = (value) => is.set(value) && value.size === 0;\n is.nonEmptySet = (value) => is.set(value) && value.size > 0;\n is.emptyMap = (value) => is.map(value) && value.size === 0;\n is.nonEmptyMap = (value) => is.map(value) && value.size > 0;\n const predicateOnArray = (method, predicate, values) => {\n if (is.function_(predicate) === false) {\n throw new TypeError(`Invalid predicate: ${JSON.stringify(predicate)}`);\n }\n if (values.length === 0) {\n throw new TypeError('Invalid number of values');\n }\n return method.call(values, predicate);\n };\n // tslint:disable variable-name\n is.any = (predicate, ...values) => predicateOnArray(Array.prototype.some, predicate, values);\n is.all = (predicate, ...values) => predicateOnArray(Array.prototype.every, predicate, values);\n // tslint:enable variable-name\n})(is || (is = {}));\n// Some few keywords are reserved, but we'll populate them for Node.js users\n// See https://github.com/Microsoft/TypeScript/issues/2536\nObject.defineProperties(is, {\n class: {\n value: is.class_\n },\n function: {\n value: is.function_\n },\n null: {\n value: is.null_\n }\n});\nexports.default = is;\n// For CommonJS default export support\nmodule.exports = is;\nmodule.exports.default = is;\n//# sourceMappingURL=index.js.map","'use strict';\nconst deferToConnect = require('defer-to-connect');\n\nmodule.exports = request => {\n\tconst timings = {\n\t\tstart: Date.now(),\n\t\tsocket: null,\n\t\tlookup: null,\n\t\tconnect: null,\n\t\tupload: null,\n\t\tresponse: null,\n\t\tend: null,\n\t\terror: null,\n\t\tphases: {\n\t\t\twait: null,\n\t\t\tdns: null,\n\t\t\ttcp: null,\n\t\t\trequest: null,\n\t\t\tfirstByte: null,\n\t\t\tdownload: null,\n\t\t\ttotal: null\n\t\t}\n\t};\n\n\tconst handleError = origin => {\n\t\tconst emit = origin.emit.bind(origin);\n\t\torigin.emit = (event, ...args) => {\n\t\t\t// Catches the `error` event\n\t\t\tif (event === 'error') {\n\t\t\t\ttimings.error = Date.now();\n\t\t\t\ttimings.phases.total = timings.error - timings.start;\n\n\t\t\t\torigin.emit = emit;\n\t\t\t}\n\n\t\t\t// Saves the original behavior\n\t\t\treturn emit(event, ...args);\n\t\t};\n\t};\n\n\tlet uploadFinished = false;\n\tconst onUpload = () => {\n\t\ttimings.upload = Date.now();\n\t\ttimings.phases.request = timings.upload - timings.connect;\n\t};\n\n\thandleError(request);\n\n\trequest.once('socket', socket => {\n\t\ttimings.socket = Date.now();\n\t\ttimings.phases.wait = timings.socket - timings.start;\n\n\t\tconst lookupListener = () => {\n\t\t\ttimings.lookup = Date.now();\n\t\t\ttimings.phases.dns = timings.lookup - timings.socket;\n\t\t};\n\n\t\tsocket.once('lookup', lookupListener);\n\n\t\tdeferToConnect(socket, () => {\n\t\t\ttimings.connect = Date.now();\n\n\t\t\tif (timings.lookup === null) {\n\t\t\t\tsocket.removeListener('lookup', lookupListener);\n\t\t\t\ttimings.lookup = timings.connect;\n\t\t\t\ttimings.phases.dns = timings.lookup - timings.socket;\n\t\t\t}\n\n\t\t\ttimings.phases.tcp = timings.connect - timings.lookup;\n\n\t\t\tif (uploadFinished && !timings.upload) {\n\t\t\t\tonUpload();\n\t\t\t}\n\t\t});\n\t});\n\n\trequest.once('finish', () => {\n\t\tuploadFinished = true;\n\n\t\tif (timings.connect) {\n\t\t\tonUpload();\n\t\t}\n\t});\n\n\trequest.once('response', response => {\n\t\ttimings.response = Date.now();\n\t\ttimings.phases.firstByte = timings.response - timings.upload;\n\n\t\thandleError(response);\n\n\t\tresponse.once('end', () => {\n\t\t\ttimings.end = Date.now();\n\t\t\ttimings.phases.download = timings.end - timings.response;\n\t\t\ttimings.phases.total = timings.end - timings.start;\n\t\t});\n\t});\n\n\treturn timings;\n};\n","'use strict';\nconst indentString = require('indent-string');\nconst cleanStack = require('clean-stack');\n\nconst cleanInternalStack = stack => stack.replace(/\\s+at .*aggregate-error\\/index.js:\\d+:\\d+\\)?/g, '');\n\nclass AggregateError extends Error {\n\tconstructor(errors) {\n\t\tif (!Array.isArray(errors)) {\n\t\t\tthrow new TypeError(`Expected input to be an Array, got ${typeof errors}`);\n\t\t}\n\n\t\terrors = [...errors].map(error => {\n\t\t\tif (error instanceof Error) {\n\t\t\t\treturn error;\n\t\t\t}\n\n\t\t\tif (error !== null && typeof error === 'object') {\n\t\t\t\t// Handle plain error objects with message property and/or possibly other metadata\n\t\t\t\treturn Object.assign(new Error(error.message), error);\n\t\t\t}\n\n\t\t\treturn new Error(error);\n\t\t});\n\n\t\tlet message = errors\n\t\t\t.map(error => {\n\t\t\t\t// The `stack` property is not standardized, so we can't assume it exists\n\t\t\t\treturn typeof error.stack === 'string' ? cleanInternalStack(cleanStack(error.stack)) : String(error);\n\t\t\t})\n\t\t\t.join('\\n');\n\t\tmessage = '\\n' + indentString(message, 4);\n\t\tsuper(message);\n\n\t\tthis.name = 'AggregateError';\n\n\t\tObject.defineProperty(this, '_errors', {value: errors});\n\t}\n\n\t* [Symbol.iterator]() {\n\t\tfor (const error of this._errors) {\n\t\t\tyield error;\n\t\t}\n\t}\n}\n\nmodule.exports = AggregateError;\n","'use strict';\n\nvar compileSchema = require('./compile')\n , resolve = require('./compile/resolve')\n , Cache = require('./cache')\n , SchemaObject = require('./compile/schema_obj')\n , stableStringify = require('fast-json-stable-stringify')\n , formats = require('./compile/formats')\n , rules = require('./compile/rules')\n , $dataMetaSchema = require('./data')\n , util = require('./compile/util');\n\nmodule.exports = Ajv;\n\nAjv.prototype.validate = validate;\nAjv.prototype.compile = compile;\nAjv.prototype.addSchema = addSchema;\nAjv.prototype.addMetaSchema = addMetaSchema;\nAjv.prototype.validateSchema = validateSchema;\nAjv.prototype.getSchema = getSchema;\nAjv.prototype.removeSchema = removeSchema;\nAjv.prototype.addFormat = addFormat;\nAjv.prototype.errorsText = errorsText;\n\nAjv.prototype._addSchema = _addSchema;\nAjv.prototype._compile = _compile;\n\nAjv.prototype.compileAsync = require('./compile/async');\nvar customKeyword = require('./keyword');\nAjv.prototype.addKeyword = customKeyword.add;\nAjv.prototype.getKeyword = customKeyword.get;\nAjv.prototype.removeKeyword = customKeyword.remove;\nAjv.prototype.validateKeyword = customKeyword.validate;\n\nvar errorClasses = require('./compile/error_classes');\nAjv.ValidationError = errorClasses.Validation;\nAjv.MissingRefError = errorClasses.MissingRef;\nAjv.$dataMetaSchema = $dataMetaSchema;\n\nvar META_SCHEMA_ID = 'http://json-schema.org/draft-07/schema';\n\nvar META_IGNORE_OPTIONS = [ 'removeAdditional', 'useDefaults', 'coerceTypes', 'strictDefaults' ];\nvar META_SUPPORT_DATA = ['/properties'];\n\n/**\n * Creates validator instance.\n * Usage: `Ajv(opts)`\n * @param {Object} opts optional options\n * @return {Object} ajv instance\n */\nfunction Ajv(opts) {\n if (!(this instanceof Ajv)) return new Ajv(opts);\n opts = this._opts = util.copy(opts) || {};\n setLogger(this);\n this._schemas = {};\n this._refs = {};\n this._fragments = {};\n this._formats = formats(opts.format);\n\n this._cache = opts.cache || new Cache;\n this._loadingSchemas = {};\n this._compilations = [];\n this.RULES = rules();\n this._getId = chooseGetId(opts);\n\n opts.loopRequired = opts.loopRequired || Infinity;\n if (opts.errorDataPath == 'property') opts._errorDataPathProperty = true;\n if (opts.serialize === undefined) opts.serialize = stableStringify;\n this._metaOpts = getMetaSchemaOptions(this);\n\n if (opts.formats) addInitialFormats(this);\n if (opts.keywords) addInitialKeywords(this);\n addDefaultMetaSchema(this);\n if (typeof opts.meta == 'object') this.addMetaSchema(opts.meta);\n if (opts.nullable) this.addKeyword('nullable', {metaSchema: {type: 'boolean'}});\n addInitialSchemas(this);\n}\n\n\n\n/**\n * Validate data using schema\n * Schema will be compiled and cached (using serialized JSON as key. [fast-json-stable-stringify](https://github.com/epoberezkin/fast-json-stable-stringify) is used to serialize.\n * @this Ajv\n * @param {String|Object} schemaKeyRef key, ref or schema object\n * @param {Any} data to be validated\n * @return {Boolean} validation result. Errors from the last validation will be available in `ajv.errors` (and also in compiled schema: `schema.errors`).\n */\nfunction validate(schemaKeyRef, data) {\n var v;\n if (typeof schemaKeyRef == 'string') {\n v = this.getSchema(schemaKeyRef);\n if (!v) throw new Error('no schema with key or ref \"' + schemaKeyRef + '\"');\n } else {\n var schemaObj = this._addSchema(schemaKeyRef);\n v = schemaObj.validate || this._compile(schemaObj);\n }\n\n var valid = v(data);\n if (v.$async !== true) this.errors = v.errors;\n return valid;\n}\n\n\n/**\n * Create validating function for passed schema.\n * @this Ajv\n * @param {Object} schema schema object\n * @param {Boolean} _meta true if schema is a meta-schema. Used internally to compile meta schemas of custom keywords.\n * @return {Function} validating function\n */\nfunction compile(schema, _meta) {\n var schemaObj = this._addSchema(schema, undefined, _meta);\n return schemaObj.validate || this._compile(schemaObj);\n}\n\n\n/**\n * Adds schema to the instance.\n * @this Ajv\n * @param {Object|Array} schema schema or array of schemas. If array is passed, `key` and other parameters will be ignored.\n * @param {String} key Optional schema key. Can be passed to `validate` method instead of schema object or id/ref. One schema per instance can have empty `id` and `key`.\n * @param {Boolean} _skipValidation true to skip schema validation. Used internally, option validateSchema should be used instead.\n * @param {Boolean} _meta true if schema is a meta-schema. Used internally, addMetaSchema should be used instead.\n * @return {Ajv} this for method chaining\n */\nfunction addSchema(schema, key, _skipValidation, _meta) {\n if (Array.isArray(schema)){\n for (var i=0; i} errors optional array of validation errors, if not passed errors from the instance are used.\n * @param {Object} options optional options with properties `separator` and `dataVar`.\n * @return {String} human readable string with all errors descriptions\n */\nfunction errorsText(errors, options) {\n errors = errors || this.errors;\n if (!errors) return 'No errors';\n options = options || {};\n var separator = options.separator === undefined ? ', ' : options.separator;\n var dataVar = options.dataVar === undefined ? 'data' : options.dataVar;\n\n var text = '';\n for (var i=0; i%\\\\^`{|}]|%[0-9a-f]{2})|\\{[+#./;?&=,!@|]?(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\\*)?(?:,(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\\*)?)*\\})*$/i;\n// For the source: https://gist.github.com/dperini/729294\n// For test cases: https://mathiasbynens.be/demo/url-regex\n// @todo Delete current URL in favour of the commented out URL rule when this issue is fixed https://github.com/eslint/eslint/issues/7983.\n// var URL = /^(?:(?:https?|ftp):\\/\\/)(?:\\S+(?::\\S*)?@)?(?:(?!10(?:\\.\\d{1,3}){3})(?!127(?:\\.\\d{1,3}){3})(?!169\\.254(?:\\.\\d{1,3}){2})(?!192\\.168(?:\\.\\d{1,3}){2})(?!172\\.(?:1[6-9]|2\\d|3[0-1])(?:\\.\\d{1,3}){2})(?:[1-9]\\d?|1\\d\\d|2[01]\\d|22[0-3])(?:\\.(?:1?\\d{1,2}|2[0-4]\\d|25[0-5])){2}(?:\\.(?:[1-9]\\d?|1\\d\\d|2[0-4]\\d|25[0-4]))|(?:(?:[a-z\\u{00a1}-\\u{ffff}0-9]+-)*[a-z\\u{00a1}-\\u{ffff}0-9]+)(?:\\.(?:[a-z\\u{00a1}-\\u{ffff}0-9]+-)*[a-z\\u{00a1}-\\u{ffff}0-9]+)*(?:\\.(?:[a-z\\u{00a1}-\\u{ffff}]{2,})))(?::\\d{2,5})?(?:\\/[^\\s]*)?$/iu;\nvar URL = /^(?:(?:http[s\\u017F]?|ftp):\\/\\/)(?:(?:[\\0-\\x08\\x0E-\\x1F!-\\x9F\\xA1-\\u167F\\u1681-\\u1FFF\\u200B-\\u2027\\u202A-\\u202E\\u2030-\\u205E\\u2060-\\u2FFF\\u3001-\\uD7FF\\uE000-\\uFEFE\\uFF00-\\uFFFF]|[\\uD800-\\uDBFF][\\uDC00-\\uDFFF]|[\\uD800-\\uDBFF](?![\\uDC00-\\uDFFF])|(?:[^\\uD800-\\uDBFF]|^)[\\uDC00-\\uDFFF])+(?::(?:[\\0-\\x08\\x0E-\\x1F!-\\x9F\\xA1-\\u167F\\u1681-\\u1FFF\\u200B-\\u2027\\u202A-\\u202E\\u2030-\\u205E\\u2060-\\u2FFF\\u3001-\\uD7FF\\uE000-\\uFEFE\\uFF00-\\uFFFF]|[\\uD800-\\uDBFF][\\uDC00-\\uDFFF]|[\\uD800-\\uDBFF](?![\\uDC00-\\uDFFF])|(?:[^\\uD800-\\uDBFF]|^)[\\uDC00-\\uDFFF])*)?@)?(?:(?!10(?:\\.[0-9]{1,3}){3})(?!127(?:\\.[0-9]{1,3}){3})(?!169\\.254(?:\\.[0-9]{1,3}){2})(?!192\\.168(?:\\.[0-9]{1,3}){2})(?!172\\.(?:1[6-9]|2[0-9]|3[01])(?:\\.[0-9]{1,3}){2})(?:[1-9][0-9]?|1[0-9][0-9]|2[01][0-9]|22[0-3])(?:\\.(?:1?[0-9]{1,2}|2[0-4][0-9]|25[0-5])){2}(?:\\.(?:[1-9][0-9]?|1[0-9][0-9]|2[0-4][0-9]|25[0-4]))|(?:(?:(?:[0-9a-z\\xA1-\\uD7FF\\uE000-\\uFFFF]|[\\uD800-\\uDBFF](?![\\uDC00-\\uDFFF])|(?:[^\\uD800-\\uDBFF]|^)[\\uDC00-\\uDFFF])+-)*(?:[0-9a-z\\xA1-\\uD7FF\\uE000-\\uFFFF]|[\\uD800-\\uDBFF](?![\\uDC00-\\uDFFF])|(?:[^\\uD800-\\uDBFF]|^)[\\uDC00-\\uDFFF])+)(?:\\.(?:(?:[0-9a-z\\xA1-\\uD7FF\\uE000-\\uFFFF]|[\\uD800-\\uDBFF](?![\\uDC00-\\uDFFF])|(?:[^\\uD800-\\uDBFF]|^)[\\uDC00-\\uDFFF])+-)*(?:[0-9a-z\\xA1-\\uD7FF\\uE000-\\uFFFF]|[\\uD800-\\uDBFF](?![\\uDC00-\\uDFFF])|(?:[^\\uD800-\\uDBFF]|^)[\\uDC00-\\uDFFF])+)*(?:\\.(?:(?:[a-z\\xA1-\\uD7FF\\uE000-\\uFFFF]|[\\uD800-\\uDBFF](?![\\uDC00-\\uDFFF])|(?:[^\\uD800-\\uDBFF]|^)[\\uDC00-\\uDFFF]){2,})))(?::[0-9]{2,5})?(?:\\/(?:[\\0-\\x08\\x0E-\\x1F!-\\x9F\\xA1-\\u167F\\u1681-\\u1FFF\\u200B-\\u2027\\u202A-\\u202E\\u2030-\\u205E\\u2060-\\u2FFF\\u3001-\\uD7FF\\uE000-\\uFEFE\\uFF00-\\uFFFF]|[\\uD800-\\uDBFF][\\uDC00-\\uDFFF]|[\\uD800-\\uDBFF](?![\\uDC00-\\uDFFF])|(?:[^\\uD800-\\uDBFF]|^)[\\uDC00-\\uDFFF])*)?$/i;\nvar UUID = /^(?:urn:uuid:)?[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/i;\nvar JSON_POINTER = /^(?:\\/(?:[^~/]|~0|~1)*)*$/;\nvar JSON_POINTER_URI_FRAGMENT = /^#(?:\\/(?:[a-z0-9_\\-.!$&'()*+,;:=@]|%[0-9a-f]{2}|~0|~1)*)*$/i;\nvar RELATIVE_JSON_POINTER = /^(?:0|[1-9][0-9]*)(?:#|(?:\\/(?:[^~/]|~0|~1)*)*)$/;\n\n\nmodule.exports = formats;\n\nfunction formats(mode) {\n mode = mode == 'full' ? 'full' : 'fast';\n return util.copy(formats[mode]);\n}\n\n\nformats.fast = {\n // date: http://tools.ietf.org/html/rfc3339#section-5.6\n date: /^\\d\\d\\d\\d-[0-1]\\d-[0-3]\\d$/,\n // date-time: http://tools.ietf.org/html/rfc3339#section-5.6\n time: /^(?:[0-2]\\d:[0-5]\\d:[0-5]\\d|23:59:60)(?:\\.\\d+)?(?:z|[+-]\\d\\d(?::?\\d\\d)?)?$/i,\n 'date-time': /^\\d\\d\\d\\d-[0-1]\\d-[0-3]\\d[t\\s](?:[0-2]\\d:[0-5]\\d:[0-5]\\d|23:59:60)(?:\\.\\d+)?(?:z|[+-]\\d\\d(?::?\\d\\d)?)$/i,\n // uri: https://github.com/mafintosh/is-my-json-valid/blob/master/formats.js\n uri: /^(?:[a-z][a-z0-9+\\-.]*:)(?:\\/?\\/)?[^\\s]*$/i,\n 'uri-reference': /^(?:(?:[a-z][a-z0-9+\\-.]*:)?\\/?\\/)?(?:[^\\\\\\s#][^\\s#]*)?(?:#[^\\\\\\s]*)?$/i,\n 'uri-template': URITEMPLATE,\n url: URL,\n // email (sources from jsen validator):\n // http://stackoverflow.com/questions/201323/using-a-regular-expression-to-validate-an-email-address#answer-8829363\n // http://www.w3.org/TR/html5/forms.html#valid-e-mail-address (search for 'willful violation')\n email: /^[a-z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\\.[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?)*$/i,\n hostname: HOSTNAME,\n // optimized https://www.safaribooksonline.com/library/view/regular-expressions-cookbook/9780596802837/ch07s16.html\n ipv4: /^(?:(?:25[0-5]|2[0-4]\\d|[01]?\\d\\d?)\\.){3}(?:25[0-5]|2[0-4]\\d|[01]?\\d\\d?)$/,\n // optimized http://stackoverflow.com/questions/53497/regular-expression-that-matches-valid-ipv6-addresses\n ipv6: /^\\s*(?:(?:(?:[0-9a-f]{1,4}:){7}(?:[0-9a-f]{1,4}|:))|(?:(?:[0-9a-f]{1,4}:){6}(?::[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)(?:\\.(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)){3})|:))|(?:(?:[0-9a-f]{1,4}:){5}(?:(?:(?::[0-9a-f]{1,4}){1,2})|:(?:(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)(?:\\.(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)){3})|:))|(?:(?:[0-9a-f]{1,4}:){4}(?:(?:(?::[0-9a-f]{1,4}){1,3})|(?:(?::[0-9a-f]{1,4})?:(?:(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)(?:\\.(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){3}(?:(?:(?::[0-9a-f]{1,4}){1,4})|(?:(?::[0-9a-f]{1,4}){0,2}:(?:(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)(?:\\.(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){2}(?:(?:(?::[0-9a-f]{1,4}){1,5})|(?:(?::[0-9a-f]{1,4}){0,3}:(?:(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)(?:\\.(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){1}(?:(?:(?::[0-9a-f]{1,4}){1,6})|(?:(?::[0-9a-f]{1,4}){0,4}:(?:(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)(?:\\.(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)){3}))|:))|(?::(?:(?:(?::[0-9a-f]{1,4}){1,7})|(?:(?::[0-9a-f]{1,4}){0,5}:(?:(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)(?:\\.(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)){3}))|:)))(?:%.+)?\\s*$/i,\n regex: regex,\n // uuid: http://tools.ietf.org/html/rfc4122\n uuid: UUID,\n // JSON-pointer: https://tools.ietf.org/html/rfc6901\n // uri fragment: https://tools.ietf.org/html/rfc3986#appendix-A\n 'json-pointer': JSON_POINTER,\n 'json-pointer-uri-fragment': JSON_POINTER_URI_FRAGMENT,\n // relative JSON-pointer: http://tools.ietf.org/html/draft-luff-relative-json-pointer-00\n 'relative-json-pointer': RELATIVE_JSON_POINTER\n};\n\n\nformats.full = {\n date: date,\n time: time,\n 'date-time': date_time,\n uri: uri,\n 'uri-reference': URIREF,\n 'uri-template': URITEMPLATE,\n url: URL,\n email: /^[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$/i,\n hostname: HOSTNAME,\n ipv4: /^(?:(?:25[0-5]|2[0-4]\\d|[01]?\\d\\d?)\\.){3}(?:25[0-5]|2[0-4]\\d|[01]?\\d\\d?)$/,\n ipv6: /^\\s*(?:(?:(?:[0-9a-f]{1,4}:){7}(?:[0-9a-f]{1,4}|:))|(?:(?:[0-9a-f]{1,4}:){6}(?::[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)(?:\\.(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)){3})|:))|(?:(?:[0-9a-f]{1,4}:){5}(?:(?:(?::[0-9a-f]{1,4}){1,2})|:(?:(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)(?:\\.(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)){3})|:))|(?:(?:[0-9a-f]{1,4}:){4}(?:(?:(?::[0-9a-f]{1,4}){1,3})|(?:(?::[0-9a-f]{1,4})?:(?:(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)(?:\\.(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){3}(?:(?:(?::[0-9a-f]{1,4}){1,4})|(?:(?::[0-9a-f]{1,4}){0,2}:(?:(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)(?:\\.(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){2}(?:(?:(?::[0-9a-f]{1,4}){1,5})|(?:(?::[0-9a-f]{1,4}){0,3}:(?:(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)(?:\\.(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){1}(?:(?:(?::[0-9a-f]{1,4}){1,6})|(?:(?::[0-9a-f]{1,4}){0,4}:(?:(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)(?:\\.(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)){3}))|:))|(?::(?:(?:(?::[0-9a-f]{1,4}){1,7})|(?:(?::[0-9a-f]{1,4}){0,5}:(?:(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)(?:\\.(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)){3}))|:)))(?:%.+)?\\s*$/i,\n regex: regex,\n uuid: UUID,\n 'json-pointer': JSON_POINTER,\n 'json-pointer-uri-fragment': JSON_POINTER_URI_FRAGMENT,\n 'relative-json-pointer': RELATIVE_JSON_POINTER\n};\n\n\nfunction isLeapYear(year) {\n // https://tools.ietf.org/html/rfc3339#appendix-C\n return year % 4 === 0 && (year % 100 !== 0 || year % 400 === 0);\n}\n\n\nfunction date(str) {\n // full-date from http://tools.ietf.org/html/rfc3339#section-5.6\n var matches = str.match(DATE);\n if (!matches) return false;\n\n var year = +matches[1];\n var month = +matches[2];\n var day = +matches[3];\n\n return month >= 1 && month <= 12 && day >= 1 &&\n day <= (month == 2 && isLeapYear(year) ? 29 : DAYS[month]);\n}\n\n\nfunction time(str, full) {\n var matches = str.match(TIME);\n if (!matches) return false;\n\n var hour = matches[1];\n var minute = matches[2];\n var second = matches[3];\n var timeZone = matches[5];\n return ((hour <= 23 && minute <= 59 && second <= 59) ||\n (hour == 23 && minute == 59 && second == 60)) &&\n (!full || timeZone);\n}\n\n\nvar DATE_TIME_SEPARATOR = /t|\\s/i;\nfunction date_time(str) {\n // http://tools.ietf.org/html/rfc3339#section-5.6\n var dateTime = str.split(DATE_TIME_SEPARATOR);\n return dateTime.length == 2 && date(dateTime[0]) && time(dateTime[1], true);\n}\n\n\nvar NOT_URI_FRAGMENT = /\\/|:/;\nfunction uri(str) {\n // http://jmrware.com/articles/2009/uri_regexp/URI_regex.html + optional protocol + required \".\"\n return NOT_URI_FRAGMENT.test(str) && URI.test(str);\n}\n\n\nvar Z_ANCHOR = /[^\\\\]\\\\Z/;\nfunction regex(str) {\n if (Z_ANCHOR.test(str)) return false;\n try {\n new RegExp(str);\n return true;\n } catch(e) {\n return false;\n }\n}\n","'use strict';\n\nvar resolve = require('./resolve')\n , util = require('./util')\n , errorClasses = require('./error_classes')\n , stableStringify = require('fast-json-stable-stringify');\n\nvar validateGenerator = require('../dotjs/validate');\n\n/**\n * Functions below are used inside compiled validations function\n */\n\nvar ucs2length = util.ucs2length;\nvar equal = require('fast-deep-equal');\n\n// this error is thrown by async schemas to return validation errors via exception\nvar ValidationError = errorClasses.Validation;\n\nmodule.exports = compile;\n\n\n/**\n * Compiles schema to validation function\n * @this Ajv\n * @param {Object} schema schema object\n * @param {Object} root object with information about the root schema for this schema\n * @param {Object} localRefs the hash of local references inside the schema (created by resolve.id), used for inline resolution\n * @param {String} baseId base ID for IDs in the schema\n * @return {Function} validation function\n */\nfunction compile(schema, root, localRefs, baseId) {\n /* jshint validthis: true, evil: true */\n /* eslint no-shadow: 0 */\n var self = this\n , opts = this._opts\n , refVal = [ undefined ]\n , refs = {}\n , patterns = []\n , patternsHash = {}\n , defaults = []\n , defaultsHash = {}\n , customRules = [];\n\n root = root || { schema: schema, refVal: refVal, refs: refs };\n\n var c = checkCompiling.call(this, schema, root, baseId);\n var compilation = this._compilations[c.index];\n if (c.compiling) return (compilation.callValidate = callValidate);\n\n var formats = this._formats;\n var RULES = this.RULES;\n\n try {\n var v = localCompile(schema, root, localRefs, baseId);\n compilation.validate = v;\n var cv = compilation.callValidate;\n if (cv) {\n cv.schema = v.schema;\n cv.errors = null;\n cv.refs = v.refs;\n cv.refVal = v.refVal;\n cv.root = v.root;\n cv.$async = v.$async;\n if (opts.sourceCode) cv.source = v.source;\n }\n return v;\n } finally {\n endCompiling.call(this, schema, root, baseId);\n }\n\n /* @this {*} - custom context, see passContext option */\n function callValidate() {\n /* jshint validthis: true */\n var validate = compilation.validate;\n var result = validate.apply(this, arguments);\n callValidate.errors = validate.errors;\n return result;\n }\n\n function localCompile(_schema, _root, localRefs, baseId) {\n var isRoot = !_root || (_root && _root.schema == _schema);\n if (_root.schema != root.schema)\n return compile.call(self, _schema, _root, localRefs, baseId);\n\n var $async = _schema.$async === true;\n\n var sourceCode = validateGenerator({\n isTop: true,\n schema: _schema,\n isRoot: isRoot,\n baseId: baseId,\n root: _root,\n schemaPath: '',\n errSchemaPath: '#',\n errorPath: '\"\"',\n MissingRefError: errorClasses.MissingRef,\n RULES: RULES,\n validate: validateGenerator,\n util: util,\n resolve: resolve,\n resolveRef: resolveRef,\n usePattern: usePattern,\n useDefault: useDefault,\n useCustomRule: useCustomRule,\n opts: opts,\n formats: formats,\n logger: self.logger,\n self: self\n });\n\n sourceCode = vars(refVal, refValCode) + vars(patterns, patternCode)\n + vars(defaults, defaultCode) + vars(customRules, customRuleCode)\n + sourceCode;\n\n if (opts.processCode) sourceCode = opts.processCode(sourceCode, _schema);\n // console.log('\\n\\n\\n *** \\n', JSON.stringify(sourceCode));\n var validate;\n try {\n var makeValidate = new Function(\n 'self',\n 'RULES',\n 'formats',\n 'root',\n 'refVal',\n 'defaults',\n 'customRules',\n 'equal',\n 'ucs2length',\n 'ValidationError',\n sourceCode\n );\n\n validate = makeValidate(\n self,\n RULES,\n formats,\n root,\n refVal,\n defaults,\n customRules,\n equal,\n ucs2length,\n ValidationError\n );\n\n refVal[0] = validate;\n } catch(e) {\n self.logger.error('Error compiling schema, function code:', sourceCode);\n throw e;\n }\n\n validate.schema = _schema;\n validate.errors = null;\n validate.refs = refs;\n validate.refVal = refVal;\n validate.root = isRoot ? validate : _root;\n if ($async) validate.$async = true;\n if (opts.sourceCode === true) {\n validate.source = {\n code: sourceCode,\n patterns: patterns,\n defaults: defaults\n };\n }\n\n return validate;\n }\n\n function resolveRef(baseId, ref, isRoot) {\n ref = resolve.url(baseId, ref);\n var refIndex = refs[ref];\n var _refVal, refCode;\n if (refIndex !== undefined) {\n _refVal = refVal[refIndex];\n refCode = 'refVal[' + refIndex + ']';\n return resolvedRef(_refVal, refCode);\n }\n if (!isRoot && root.refs) {\n var rootRefId = root.refs[ref];\n if (rootRefId !== undefined) {\n _refVal = root.refVal[rootRefId];\n refCode = addLocalRef(ref, _refVal);\n return resolvedRef(_refVal, refCode);\n }\n }\n\n refCode = addLocalRef(ref);\n var v = resolve.call(self, localCompile, root, ref);\n if (v === undefined) {\n var localSchema = localRefs && localRefs[ref];\n if (localSchema) {\n v = resolve.inlineRef(localSchema, opts.inlineRefs)\n ? localSchema\n : compile.call(self, localSchema, root, localRefs, baseId);\n }\n }\n\n if (v === undefined) {\n removeLocalRef(ref);\n } else {\n replaceLocalRef(ref, v);\n return resolvedRef(v, refCode);\n }\n }\n\n function addLocalRef(ref, v) {\n var refId = refVal.length;\n refVal[refId] = v;\n refs[ref] = refId;\n return 'refVal' + refId;\n }\n\n function removeLocalRef(ref) {\n delete refs[ref];\n }\n\n function replaceLocalRef(ref, v) {\n var refId = refs[ref];\n refVal[refId] = v;\n }\n\n function resolvedRef(refVal, code) {\n return typeof refVal == 'object' || typeof refVal == 'boolean'\n ? { code: code, schema: refVal, inline: true }\n : { code: code, $async: refVal && !!refVal.$async };\n }\n\n function usePattern(regexStr) {\n var index = patternsHash[regexStr];\n if (index === undefined) {\n index = patternsHash[regexStr] = patterns.length;\n patterns[index] = regexStr;\n }\n return 'pattern' + index;\n }\n\n function useDefault(value) {\n switch (typeof value) {\n case 'boolean':\n case 'number':\n return '' + value;\n case 'string':\n return util.toQuotedString(value);\n case 'object':\n if (value === null) return 'null';\n var valueStr = stableStringify(value);\n var index = defaultsHash[valueStr];\n if (index === undefined) {\n index = defaultsHash[valueStr] = defaults.length;\n defaults[index] = value;\n }\n return 'default' + index;\n }\n }\n\n function useCustomRule(rule, schema, parentSchema, it) {\n if (self._opts.validateSchema !== false) {\n var deps = rule.definition.dependencies;\n if (deps && !deps.every(function(keyword) {\n return Object.prototype.hasOwnProperty.call(parentSchema, keyword);\n }))\n throw new Error('parent schema must have all required keywords: ' + deps.join(','));\n\n var validateSchema = rule.definition.validateSchema;\n if (validateSchema) {\n var valid = validateSchema(schema);\n if (!valid) {\n var message = 'keyword schema is invalid: ' + self.errorsText(validateSchema.errors);\n if (self._opts.validateSchema == 'log') self.logger.error(message);\n else throw new Error(message);\n }\n }\n }\n\n var compile = rule.definition.compile\n , inline = rule.definition.inline\n , macro = rule.definition.macro;\n\n var validate;\n if (compile) {\n validate = compile.call(self, schema, parentSchema, it);\n } else if (macro) {\n validate = macro.call(self, schema, parentSchema, it);\n if (opts.validateSchema !== false) self.validateSchema(validate, true);\n } else if (inline) {\n validate = inline.call(self, it, rule.keyword, schema, parentSchema);\n } else {\n validate = rule.definition.validate;\n if (!validate) return;\n }\n\n if (validate === undefined)\n throw new Error('custom keyword \"' + rule.keyword + '\"failed to compile');\n\n var index = customRules.length;\n customRules[index] = validate;\n\n return {\n code: 'customRule' + index,\n validate: validate\n };\n }\n}\n\n\n/**\n * Checks if the schema is currently compiled\n * @this Ajv\n * @param {Object} schema schema to compile\n * @param {Object} root root object\n * @param {String} baseId base schema ID\n * @return {Object} object with properties \"index\" (compilation index) and \"compiling\" (boolean)\n */\nfunction checkCompiling(schema, root, baseId) {\n /* jshint validthis: true */\n var index = compIndex.call(this, schema, root, baseId);\n if (index >= 0) return { index: index, compiling: true };\n index = this._compilations.length;\n this._compilations[index] = {\n schema: schema,\n root: root,\n baseId: baseId\n };\n return { index: index, compiling: false };\n}\n\n\n/**\n * Removes the schema from the currently compiled list\n * @this Ajv\n * @param {Object} schema schema to compile\n * @param {Object} root root object\n * @param {String} baseId base schema ID\n */\nfunction endCompiling(schema, root, baseId) {\n /* jshint validthis: true */\n var i = compIndex.call(this, schema, root, baseId);\n if (i >= 0) this._compilations.splice(i, 1);\n}\n\n\n/**\n * Index of schema compilation in the currently compiled list\n * @this Ajv\n * @param {Object} schema schema to compile\n * @param {Object} root root object\n * @param {String} baseId base schema ID\n * @return {Integer} compilation index\n */\nfunction compIndex(schema, root, baseId) {\n /* jshint validthis: true */\n for (var i=0; i= 0xD800 && value <= 0xDBFF && pos < len) {\n // high surrogate, and there is a next character\n value = str.charCodeAt(pos);\n if ((value & 0xFC00) == 0xDC00) pos++; // low surrogate\n }\n }\n return length;\n};\n","'use strict';\n\n\nmodule.exports = {\n copy: copy,\n checkDataType: checkDataType,\n checkDataTypes: checkDataTypes,\n coerceToTypes: coerceToTypes,\n toHash: toHash,\n getProperty: getProperty,\n escapeQuotes: escapeQuotes,\n equal: require('fast-deep-equal'),\n ucs2length: require('./ucs2length'),\n varOccurences: varOccurences,\n varReplace: varReplace,\n schemaHasRules: schemaHasRules,\n schemaHasRulesExcept: schemaHasRulesExcept,\n schemaUnknownRules: schemaUnknownRules,\n toQuotedString: toQuotedString,\n getPathExpr: getPathExpr,\n getPath: getPath,\n getData: getData,\n unescapeFragment: unescapeFragment,\n unescapeJsonPointer: unescapeJsonPointer,\n escapeFragment: escapeFragment,\n escapeJsonPointer: escapeJsonPointer\n};\n\n\nfunction copy(o, to) {\n to = to || {};\n for (var key in o) to[key] = o[key];\n return to;\n}\n\n\nfunction checkDataType(dataType, data, strictNumbers, negate) {\n var EQUAL = negate ? ' !== ' : ' === '\n , AND = negate ? ' || ' : ' && '\n , OK = negate ? '!' : ''\n , NOT = negate ? '' : '!';\n switch (dataType) {\n case 'null': return data + EQUAL + 'null';\n case 'array': return OK + 'Array.isArray(' + data + ')';\n case 'object': return '(' + OK + data + AND +\n 'typeof ' + data + EQUAL + '\"object\"' + AND +\n NOT + 'Array.isArray(' + data + '))';\n case 'integer': return '(typeof ' + data + EQUAL + '\"number\"' + AND +\n NOT + '(' + data + ' % 1)' +\n AND + data + EQUAL + data +\n (strictNumbers ? (AND + OK + 'isFinite(' + data + ')') : '') + ')';\n case 'number': return '(typeof ' + data + EQUAL + '\"' + dataType + '\"' +\n (strictNumbers ? (AND + OK + 'isFinite(' + data + ')') : '') + ')';\n default: return 'typeof ' + data + EQUAL + '\"' + dataType + '\"';\n }\n}\n\n\nfunction checkDataTypes(dataTypes, data, strictNumbers) {\n switch (dataTypes.length) {\n case 1: return checkDataType(dataTypes[0], data, strictNumbers, true);\n default:\n var code = '';\n var types = toHash(dataTypes);\n if (types.array && types.object) {\n code = types.null ? '(': '(!' + data + ' || ';\n code += 'typeof ' + data + ' !== \"object\")';\n delete types.null;\n delete types.array;\n delete types.object;\n }\n if (types.number) delete types.integer;\n for (var t in types)\n code += (code ? ' && ' : '' ) + checkDataType(t, data, strictNumbers, true);\n\n return code;\n }\n}\n\n\nvar COERCE_TO_TYPES = toHash([ 'string', 'number', 'integer', 'boolean', 'null' ]);\nfunction coerceToTypes(optionCoerceTypes, dataTypes) {\n if (Array.isArray(dataTypes)) {\n var types = [];\n for (var i=0; i= lvl) throw new Error('Cannot access property/index ' + up + ' levels up, current level is ' + lvl);\n return paths[lvl - up];\n }\n\n if (up > lvl) throw new Error('Cannot access data ' + up + ' levels up, current level is ' + lvl);\n data = 'data' + ((lvl - up) || '');\n if (!jsonPointer) return data;\n }\n\n var expr = data;\n var segments = jsonPointer.split('/');\n for (var i=0; i',\n $notOp = $isMax ? '>' : '<',\n $errorKeyword = undefined;\n if (!($isData || typeof $schema == 'number' || $schema === undefined)) {\n throw new Error($keyword + ' must be number');\n }\n if (!($isDataExcl || $schemaExcl === undefined || typeof $schemaExcl == 'number' || typeof $schemaExcl == 'boolean')) {\n throw new Error($exclusiveKeyword + ' must be number or boolean');\n }\n if ($isDataExcl) {\n var $schemaValueExcl = it.util.getData($schemaExcl.$data, $dataLvl, it.dataPathArr),\n $exclusive = 'exclusive' + $lvl,\n $exclType = 'exclType' + $lvl,\n $exclIsNumber = 'exclIsNumber' + $lvl,\n $opExpr = 'op' + $lvl,\n $opStr = '\\' + ' + $opExpr + ' + \\'';\n out += ' var schemaExcl' + ($lvl) + ' = ' + ($schemaValueExcl) + '; ';\n $schemaValueExcl = 'schemaExcl' + $lvl;\n out += ' var ' + ($exclusive) + '; var ' + ($exclType) + ' = typeof ' + ($schemaValueExcl) + '; if (' + ($exclType) + ' != \\'boolean\\' && ' + ($exclType) + ' != \\'undefined\\' && ' + ($exclType) + ' != \\'number\\') { ';\n var $errorKeyword = $exclusiveKeyword;\n var $$outStack = $$outStack || [];\n $$outStack.push(out);\n out = ''; /* istanbul ignore else */\n if (it.createErrors !== false) {\n out += ' { keyword: \\'' + ($errorKeyword || '_exclusiveLimit') + '\\' , dataPath: (dataPath || \\'\\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: {} ';\n if (it.opts.messages !== false) {\n out += ' , message: \\'' + ($exclusiveKeyword) + ' should be boolean\\' ';\n }\n if (it.opts.verbose) {\n out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' ';\n }\n out += ' } ';\n } else {\n out += ' {} ';\n }\n var __err = out;\n out = $$outStack.pop();\n if (!it.compositeRule && $breakOnError) {\n /* istanbul ignore if */\n if (it.async) {\n out += ' throw new ValidationError([' + (__err) + ']); ';\n } else {\n out += ' validate.errors = [' + (__err) + ']; return false; ';\n }\n } else {\n out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ';\n }\n out += ' } else if ( ';\n if ($isData) {\n out += ' (' + ($schemaValue) + ' !== undefined && typeof ' + ($schemaValue) + ' != \\'number\\') || ';\n }\n out += ' ' + ($exclType) + ' == \\'number\\' ? ( (' + ($exclusive) + ' = ' + ($schemaValue) + ' === undefined || ' + ($schemaValueExcl) + ' ' + ($op) + '= ' + ($schemaValue) + ') ? ' + ($data) + ' ' + ($notOp) + '= ' + ($schemaValueExcl) + ' : ' + ($data) + ' ' + ($notOp) + ' ' + ($schemaValue) + ' ) : ( (' + ($exclusive) + ' = ' + ($schemaValueExcl) + ' === true) ? ' + ($data) + ' ' + ($notOp) + '= ' + ($schemaValue) + ' : ' + ($data) + ' ' + ($notOp) + ' ' + ($schemaValue) + ' ) || ' + ($data) + ' !== ' + ($data) + ') { var op' + ($lvl) + ' = ' + ($exclusive) + ' ? \\'' + ($op) + '\\' : \\'' + ($op) + '=\\'; ';\n if ($schema === undefined) {\n $errorKeyword = $exclusiveKeyword;\n $errSchemaPath = it.errSchemaPath + '/' + $exclusiveKeyword;\n $schemaValue = $schemaValueExcl;\n $isData = $isDataExcl;\n }\n } else {\n var $exclIsNumber = typeof $schemaExcl == 'number',\n $opStr = $op;\n if ($exclIsNumber && $isData) {\n var $opExpr = '\\'' + $opStr + '\\'';\n out += ' if ( ';\n if ($isData) {\n out += ' (' + ($schemaValue) + ' !== undefined && typeof ' + ($schemaValue) + ' != \\'number\\') || ';\n }\n out += ' ( ' + ($schemaValue) + ' === undefined || ' + ($schemaExcl) + ' ' + ($op) + '= ' + ($schemaValue) + ' ? ' + ($data) + ' ' + ($notOp) + '= ' + ($schemaExcl) + ' : ' + ($data) + ' ' + ($notOp) + ' ' + ($schemaValue) + ' ) || ' + ($data) + ' !== ' + ($data) + ') { ';\n } else {\n if ($exclIsNumber && $schema === undefined) {\n $exclusive = true;\n $errorKeyword = $exclusiveKeyword;\n $errSchemaPath = it.errSchemaPath + '/' + $exclusiveKeyword;\n $schemaValue = $schemaExcl;\n $notOp += '=';\n } else {\n if ($exclIsNumber) $schemaValue = Math[$isMax ? 'min' : 'max']($schemaExcl, $schema);\n if ($schemaExcl === ($exclIsNumber ? $schemaValue : true)) {\n $exclusive = true;\n $errorKeyword = $exclusiveKeyword;\n $errSchemaPath = it.errSchemaPath + '/' + $exclusiveKeyword;\n $notOp += '=';\n } else {\n $exclusive = false;\n $opStr += '=';\n }\n }\n var $opExpr = '\\'' + $opStr + '\\'';\n out += ' if ( ';\n if ($isData) {\n out += ' (' + ($schemaValue) + ' !== undefined && typeof ' + ($schemaValue) + ' != \\'number\\') || ';\n }\n out += ' ' + ($data) + ' ' + ($notOp) + ' ' + ($schemaValue) + ' || ' + ($data) + ' !== ' + ($data) + ') { ';\n }\n }\n $errorKeyword = $errorKeyword || $keyword;\n var $$outStack = $$outStack || [];\n $$outStack.push(out);\n out = ''; /* istanbul ignore else */\n if (it.createErrors !== false) {\n out += ' { keyword: \\'' + ($errorKeyword || '_limit') + '\\' , dataPath: (dataPath || \\'\\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { comparison: ' + ($opExpr) + ', limit: ' + ($schemaValue) + ', exclusive: ' + ($exclusive) + ' } ';\n if (it.opts.messages !== false) {\n out += ' , message: \\'should be ' + ($opStr) + ' ';\n if ($isData) {\n out += '\\' + ' + ($schemaValue);\n } else {\n out += '' + ($schemaValue) + '\\'';\n }\n }\n if (it.opts.verbose) {\n out += ' , schema: ';\n if ($isData) {\n out += 'validate.schema' + ($schemaPath);\n } else {\n out += '' + ($schema);\n }\n out += ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' ';\n }\n out += ' } ';\n } else {\n out += ' {} ';\n }\n var __err = out;\n out = $$outStack.pop();\n if (!it.compositeRule && $breakOnError) {\n /* istanbul ignore if */\n if (it.async) {\n out += ' throw new ValidationError([' + (__err) + ']); ';\n } else {\n out += ' validate.errors = [' + (__err) + ']; return false; ';\n }\n } else {\n out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ';\n }\n out += ' } ';\n if ($breakOnError) {\n out += ' else { ';\n }\n return out;\n}\n","'use strict';\nmodule.exports = function generate__limitItems(it, $keyword, $ruleType) {\n var out = ' ';\n var $lvl = it.level;\n var $dataLvl = it.dataLevel;\n var $schema = it.schema[$keyword];\n var $schemaPath = it.schemaPath + it.util.getProperty($keyword);\n var $errSchemaPath = it.errSchemaPath + '/' + $keyword;\n var $breakOnError = !it.opts.allErrors;\n var $errorKeyword;\n var $data = 'data' + ($dataLvl || '');\n var $isData = it.opts.$data && $schema && $schema.$data,\n $schemaValue;\n if ($isData) {\n out += ' var schema' + ($lvl) + ' = ' + (it.util.getData($schema.$data, $dataLvl, it.dataPathArr)) + '; ';\n $schemaValue = 'schema' + $lvl;\n } else {\n $schemaValue = $schema;\n }\n if (!($isData || typeof $schema == 'number')) {\n throw new Error($keyword + ' must be number');\n }\n var $op = $keyword == 'maxItems' ? '>' : '<';\n out += 'if ( ';\n if ($isData) {\n out += ' (' + ($schemaValue) + ' !== undefined && typeof ' + ($schemaValue) + ' != \\'number\\') || ';\n }\n out += ' ' + ($data) + '.length ' + ($op) + ' ' + ($schemaValue) + ') { ';\n var $errorKeyword = $keyword;\n var $$outStack = $$outStack || [];\n $$outStack.push(out);\n out = ''; /* istanbul ignore else */\n if (it.createErrors !== false) {\n out += ' { keyword: \\'' + ($errorKeyword || '_limitItems') + '\\' , dataPath: (dataPath || \\'\\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { limit: ' + ($schemaValue) + ' } ';\n if (it.opts.messages !== false) {\n out += ' , message: \\'should NOT have ';\n if ($keyword == 'maxItems') {\n out += 'more';\n } else {\n out += 'fewer';\n }\n out += ' than ';\n if ($isData) {\n out += '\\' + ' + ($schemaValue) + ' + \\'';\n } else {\n out += '' + ($schema);\n }\n out += ' items\\' ';\n }\n if (it.opts.verbose) {\n out += ' , schema: ';\n if ($isData) {\n out += 'validate.schema' + ($schemaPath);\n } else {\n out += '' + ($schema);\n }\n out += ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' ';\n }\n out += ' } ';\n } else {\n out += ' {} ';\n }\n var __err = out;\n out = $$outStack.pop();\n if (!it.compositeRule && $breakOnError) {\n /* istanbul ignore if */\n if (it.async) {\n out += ' throw new ValidationError([' + (__err) + ']); ';\n } else {\n out += ' validate.errors = [' + (__err) + ']; return false; ';\n }\n } else {\n out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ';\n }\n out += '} ';\n if ($breakOnError) {\n out += ' else { ';\n }\n return out;\n}\n","'use strict';\nmodule.exports = function generate__limitLength(it, $keyword, $ruleType) {\n var out = ' ';\n var $lvl = it.level;\n var $dataLvl = it.dataLevel;\n var $schema = it.schema[$keyword];\n var $schemaPath = it.schemaPath + it.util.getProperty($keyword);\n var $errSchemaPath = it.errSchemaPath + '/' + $keyword;\n var $breakOnError = !it.opts.allErrors;\n var $errorKeyword;\n var $data = 'data' + ($dataLvl || '');\n var $isData = it.opts.$data && $schema && $schema.$data,\n $schemaValue;\n if ($isData) {\n out += ' var schema' + ($lvl) + ' = ' + (it.util.getData($schema.$data, $dataLvl, it.dataPathArr)) + '; ';\n $schemaValue = 'schema' + $lvl;\n } else {\n $schemaValue = $schema;\n }\n if (!($isData || typeof $schema == 'number')) {\n throw new Error($keyword + ' must be number');\n }\n var $op = $keyword == 'maxLength' ? '>' : '<';\n out += 'if ( ';\n if ($isData) {\n out += ' (' + ($schemaValue) + ' !== undefined && typeof ' + ($schemaValue) + ' != \\'number\\') || ';\n }\n if (it.opts.unicode === false) {\n out += ' ' + ($data) + '.length ';\n } else {\n out += ' ucs2length(' + ($data) + ') ';\n }\n out += ' ' + ($op) + ' ' + ($schemaValue) + ') { ';\n var $errorKeyword = $keyword;\n var $$outStack = $$outStack || [];\n $$outStack.push(out);\n out = ''; /* istanbul ignore else */\n if (it.createErrors !== false) {\n out += ' { keyword: \\'' + ($errorKeyword || '_limitLength') + '\\' , dataPath: (dataPath || \\'\\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { limit: ' + ($schemaValue) + ' } ';\n if (it.opts.messages !== false) {\n out += ' , message: \\'should NOT be ';\n if ($keyword == 'maxLength') {\n out += 'longer';\n } else {\n out += 'shorter';\n }\n out += ' than ';\n if ($isData) {\n out += '\\' + ' + ($schemaValue) + ' + \\'';\n } else {\n out += '' + ($schema);\n }\n out += ' characters\\' ';\n }\n if (it.opts.verbose) {\n out += ' , schema: ';\n if ($isData) {\n out += 'validate.schema' + ($schemaPath);\n } else {\n out += '' + ($schema);\n }\n out += ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' ';\n }\n out += ' } ';\n } else {\n out += ' {} ';\n }\n var __err = out;\n out = $$outStack.pop();\n if (!it.compositeRule && $breakOnError) {\n /* istanbul ignore if */\n if (it.async) {\n out += ' throw new ValidationError([' + (__err) + ']); ';\n } else {\n out += ' validate.errors = [' + (__err) + ']; return false; ';\n }\n } else {\n out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ';\n }\n out += '} ';\n if ($breakOnError) {\n out += ' else { ';\n }\n return out;\n}\n","'use strict';\nmodule.exports = function generate__limitProperties(it, $keyword, $ruleType) {\n var out = ' ';\n var $lvl = it.level;\n var $dataLvl = it.dataLevel;\n var $schema = it.schema[$keyword];\n var $schemaPath = it.schemaPath + it.util.getProperty($keyword);\n var $errSchemaPath = it.errSchemaPath + '/' + $keyword;\n var $breakOnError = !it.opts.allErrors;\n var $errorKeyword;\n var $data = 'data' + ($dataLvl || '');\n var $isData = it.opts.$data && $schema && $schema.$data,\n $schemaValue;\n if ($isData) {\n out += ' var schema' + ($lvl) + ' = ' + (it.util.getData($schema.$data, $dataLvl, it.dataPathArr)) + '; ';\n $schemaValue = 'schema' + $lvl;\n } else {\n $schemaValue = $schema;\n }\n if (!($isData || typeof $schema == 'number')) {\n throw new Error($keyword + ' must be number');\n }\n var $op = $keyword == 'maxProperties' ? '>' : '<';\n out += 'if ( ';\n if ($isData) {\n out += ' (' + ($schemaValue) + ' !== undefined && typeof ' + ($schemaValue) + ' != \\'number\\') || ';\n }\n out += ' Object.keys(' + ($data) + ').length ' + ($op) + ' ' + ($schemaValue) + ') { ';\n var $errorKeyword = $keyword;\n var $$outStack = $$outStack || [];\n $$outStack.push(out);\n out = ''; /* istanbul ignore else */\n if (it.createErrors !== false) {\n out += ' { keyword: \\'' + ($errorKeyword || '_limitProperties') + '\\' , dataPath: (dataPath || \\'\\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { limit: ' + ($schemaValue) + ' } ';\n if (it.opts.messages !== false) {\n out += ' , message: \\'should NOT have ';\n if ($keyword == 'maxProperties') {\n out += 'more';\n } else {\n out += 'fewer';\n }\n out += ' than ';\n if ($isData) {\n out += '\\' + ' + ($schemaValue) + ' + \\'';\n } else {\n out += '' + ($schema);\n }\n out += ' properties\\' ';\n }\n if (it.opts.verbose) {\n out += ' , schema: ';\n if ($isData) {\n out += 'validate.schema' + ($schemaPath);\n } else {\n out += '' + ($schema);\n }\n out += ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' ';\n }\n out += ' } ';\n } else {\n out += ' {} ';\n }\n var __err = out;\n out = $$outStack.pop();\n if (!it.compositeRule && $breakOnError) {\n /* istanbul ignore if */\n if (it.async) {\n out += ' throw new ValidationError([' + (__err) + ']); ';\n } else {\n out += ' validate.errors = [' + (__err) + ']; return false; ';\n }\n } else {\n out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ';\n }\n out += '} ';\n if ($breakOnError) {\n out += ' else { ';\n }\n return out;\n}\n","'use strict';\nmodule.exports = function generate_allOf(it, $keyword, $ruleType) {\n var out = ' ';\n var $schema = it.schema[$keyword];\n var $schemaPath = it.schemaPath + it.util.getProperty($keyword);\n var $errSchemaPath = it.errSchemaPath + '/' + $keyword;\n var $breakOnError = !it.opts.allErrors;\n var $it = it.util.copy(it);\n var $closingBraces = '';\n $it.level++;\n var $nextValid = 'valid' + $it.level;\n var $currentBaseId = $it.baseId,\n $allSchemasEmpty = true;\n var arr1 = $schema;\n if (arr1) {\n var $sch, $i = -1,\n l1 = arr1.length - 1;\n while ($i < l1) {\n $sch = arr1[$i += 1];\n if ((it.opts.strictKeywords ? (typeof $sch == 'object' && Object.keys($sch).length > 0) || $sch === false : it.util.schemaHasRules($sch, it.RULES.all))) {\n $allSchemasEmpty = false;\n $it.schema = $sch;\n $it.schemaPath = $schemaPath + '[' + $i + ']';\n $it.errSchemaPath = $errSchemaPath + '/' + $i;\n out += ' ' + (it.validate($it)) + ' ';\n $it.baseId = $currentBaseId;\n if ($breakOnError) {\n out += ' if (' + ($nextValid) + ') { ';\n $closingBraces += '}';\n }\n }\n }\n }\n if ($breakOnError) {\n if ($allSchemasEmpty) {\n out += ' if (true) { ';\n } else {\n out += ' ' + ($closingBraces.slice(0, -1)) + ' ';\n }\n }\n return out;\n}\n","'use strict';\nmodule.exports = function generate_anyOf(it, $keyword, $ruleType) {\n var out = ' ';\n var $lvl = it.level;\n var $dataLvl = it.dataLevel;\n var $schema = it.schema[$keyword];\n var $schemaPath = it.schemaPath + it.util.getProperty($keyword);\n var $errSchemaPath = it.errSchemaPath + '/' + $keyword;\n var $breakOnError = !it.opts.allErrors;\n var $data = 'data' + ($dataLvl || '');\n var $valid = 'valid' + $lvl;\n var $errs = 'errs__' + $lvl;\n var $it = it.util.copy(it);\n var $closingBraces = '';\n $it.level++;\n var $nextValid = 'valid' + $it.level;\n var $noEmptySchema = $schema.every(function($sch) {\n return (it.opts.strictKeywords ? (typeof $sch == 'object' && Object.keys($sch).length > 0) || $sch === false : it.util.schemaHasRules($sch, it.RULES.all));\n });\n if ($noEmptySchema) {\n var $currentBaseId = $it.baseId;\n out += ' var ' + ($errs) + ' = errors; var ' + ($valid) + ' = false; ';\n var $wasComposite = it.compositeRule;\n it.compositeRule = $it.compositeRule = true;\n var arr1 = $schema;\n if (arr1) {\n var $sch, $i = -1,\n l1 = arr1.length - 1;\n while ($i < l1) {\n $sch = arr1[$i += 1];\n $it.schema = $sch;\n $it.schemaPath = $schemaPath + '[' + $i + ']';\n $it.errSchemaPath = $errSchemaPath + '/' + $i;\n out += ' ' + (it.validate($it)) + ' ';\n $it.baseId = $currentBaseId;\n out += ' ' + ($valid) + ' = ' + ($valid) + ' || ' + ($nextValid) + '; if (!' + ($valid) + ') { ';\n $closingBraces += '}';\n }\n }\n it.compositeRule = $it.compositeRule = $wasComposite;\n out += ' ' + ($closingBraces) + ' if (!' + ($valid) + ') { var err = '; /* istanbul ignore else */\n if (it.createErrors !== false) {\n out += ' { keyword: \\'' + ('anyOf') + '\\' , dataPath: (dataPath || \\'\\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: {} ';\n if (it.opts.messages !== false) {\n out += ' , message: \\'should match some schema in anyOf\\' ';\n }\n if (it.opts.verbose) {\n out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' ';\n }\n out += ' } ';\n } else {\n out += ' {} ';\n }\n out += '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ';\n if (!it.compositeRule && $breakOnError) {\n /* istanbul ignore if */\n if (it.async) {\n out += ' throw new ValidationError(vErrors); ';\n } else {\n out += ' validate.errors = vErrors; return false; ';\n }\n }\n out += ' } else { errors = ' + ($errs) + '; if (vErrors !== null) { if (' + ($errs) + ') vErrors.length = ' + ($errs) + '; else vErrors = null; } ';\n if (it.opts.allErrors) {\n out += ' } ';\n }\n } else {\n if ($breakOnError) {\n out += ' if (true) { ';\n }\n }\n return out;\n}\n","'use strict';\nmodule.exports = function generate_comment(it, $keyword, $ruleType) {\n var out = ' ';\n var $schema = it.schema[$keyword];\n var $errSchemaPath = it.errSchemaPath + '/' + $keyword;\n var $breakOnError = !it.opts.allErrors;\n var $comment = it.util.toQuotedString($schema);\n if (it.opts.$comment === true) {\n out += ' console.log(' + ($comment) + ');';\n } else if (typeof it.opts.$comment == 'function') {\n out += ' self._opts.$comment(' + ($comment) + ', ' + (it.util.toQuotedString($errSchemaPath)) + ', validate.root.schema);';\n }\n return out;\n}\n","'use strict';\nmodule.exports = function generate_const(it, $keyword, $ruleType) {\n var out = ' ';\n var $lvl = it.level;\n var $dataLvl = it.dataLevel;\n var $schema = it.schema[$keyword];\n var $schemaPath = it.schemaPath + it.util.getProperty($keyword);\n var $errSchemaPath = it.errSchemaPath + '/' + $keyword;\n var $breakOnError = !it.opts.allErrors;\n var $data = 'data' + ($dataLvl || '');\n var $valid = 'valid' + $lvl;\n var $isData = it.opts.$data && $schema && $schema.$data,\n $schemaValue;\n if ($isData) {\n out += ' var schema' + ($lvl) + ' = ' + (it.util.getData($schema.$data, $dataLvl, it.dataPathArr)) + '; ';\n $schemaValue = 'schema' + $lvl;\n } else {\n $schemaValue = $schema;\n }\n if (!$isData) {\n out += ' var schema' + ($lvl) + ' = validate.schema' + ($schemaPath) + ';';\n }\n out += 'var ' + ($valid) + ' = equal(' + ($data) + ', schema' + ($lvl) + '); if (!' + ($valid) + ') { ';\n var $$outStack = $$outStack || [];\n $$outStack.push(out);\n out = ''; /* istanbul ignore else */\n if (it.createErrors !== false) {\n out += ' { keyword: \\'' + ('const') + '\\' , dataPath: (dataPath || \\'\\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { allowedValue: schema' + ($lvl) + ' } ';\n if (it.opts.messages !== false) {\n out += ' , message: \\'should be equal to constant\\' ';\n }\n if (it.opts.verbose) {\n out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' ';\n }\n out += ' } ';\n } else {\n out += ' {} ';\n }\n var __err = out;\n out = $$outStack.pop();\n if (!it.compositeRule && $breakOnError) {\n /* istanbul ignore if */\n if (it.async) {\n out += ' throw new ValidationError([' + (__err) + ']); ';\n } else {\n out += ' validate.errors = [' + (__err) + ']; return false; ';\n }\n } else {\n out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ';\n }\n out += ' }';\n if ($breakOnError) {\n out += ' else { ';\n }\n return out;\n}\n","'use strict';\nmodule.exports = function generate_contains(it, $keyword, $ruleType) {\n var out = ' ';\n var $lvl = it.level;\n var $dataLvl = it.dataLevel;\n var $schema = it.schema[$keyword];\n var $schemaPath = it.schemaPath + it.util.getProperty($keyword);\n var $errSchemaPath = it.errSchemaPath + '/' + $keyword;\n var $breakOnError = !it.opts.allErrors;\n var $data = 'data' + ($dataLvl || '');\n var $valid = 'valid' + $lvl;\n var $errs = 'errs__' + $lvl;\n var $it = it.util.copy(it);\n var $closingBraces = '';\n $it.level++;\n var $nextValid = 'valid' + $it.level;\n var $idx = 'i' + $lvl,\n $dataNxt = $it.dataLevel = it.dataLevel + 1,\n $nextData = 'data' + $dataNxt,\n $currentBaseId = it.baseId,\n $nonEmptySchema = (it.opts.strictKeywords ? (typeof $schema == 'object' && Object.keys($schema).length > 0) || $schema === false : it.util.schemaHasRules($schema, it.RULES.all));\n out += 'var ' + ($errs) + ' = errors;var ' + ($valid) + ';';\n if ($nonEmptySchema) {\n var $wasComposite = it.compositeRule;\n it.compositeRule = $it.compositeRule = true;\n $it.schema = $schema;\n $it.schemaPath = $schemaPath;\n $it.errSchemaPath = $errSchemaPath;\n out += ' var ' + ($nextValid) + ' = false; for (var ' + ($idx) + ' = 0; ' + ($idx) + ' < ' + ($data) + '.length; ' + ($idx) + '++) { ';\n $it.errorPath = it.util.getPathExpr(it.errorPath, $idx, it.opts.jsonPointers, true);\n var $passData = $data + '[' + $idx + ']';\n $it.dataPathArr[$dataNxt] = $idx;\n var $code = it.validate($it);\n $it.baseId = $currentBaseId;\n if (it.util.varOccurences($code, $nextData) < 2) {\n out += ' ' + (it.util.varReplace($code, $nextData, $passData)) + ' ';\n } else {\n out += ' var ' + ($nextData) + ' = ' + ($passData) + '; ' + ($code) + ' ';\n }\n out += ' if (' + ($nextValid) + ') break; } ';\n it.compositeRule = $it.compositeRule = $wasComposite;\n out += ' ' + ($closingBraces) + ' if (!' + ($nextValid) + ') {';\n } else {\n out += ' if (' + ($data) + '.length == 0) {';\n }\n var $$outStack = $$outStack || [];\n $$outStack.push(out);\n out = ''; /* istanbul ignore else */\n if (it.createErrors !== false) {\n out += ' { keyword: \\'' + ('contains') + '\\' , dataPath: (dataPath || \\'\\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: {} ';\n if (it.opts.messages !== false) {\n out += ' , message: \\'should contain a valid item\\' ';\n }\n if (it.opts.verbose) {\n out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' ';\n }\n out += ' } ';\n } else {\n out += ' {} ';\n }\n var __err = out;\n out = $$outStack.pop();\n if (!it.compositeRule && $breakOnError) {\n /* istanbul ignore if */\n if (it.async) {\n out += ' throw new ValidationError([' + (__err) + ']); ';\n } else {\n out += ' validate.errors = [' + (__err) + ']; return false; ';\n }\n } else {\n out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ';\n }\n out += ' } else { ';\n if ($nonEmptySchema) {\n out += ' errors = ' + ($errs) + '; if (vErrors !== null) { if (' + ($errs) + ') vErrors.length = ' + ($errs) + '; else vErrors = null; } ';\n }\n if (it.opts.allErrors) {\n out += ' } ';\n }\n return out;\n}\n","'use strict';\nmodule.exports = function generate_custom(it, $keyword, $ruleType) {\n var out = ' ';\n var $lvl = it.level;\n var $dataLvl = it.dataLevel;\n var $schema = it.schema[$keyword];\n var $schemaPath = it.schemaPath + it.util.getProperty($keyword);\n var $errSchemaPath = it.errSchemaPath + '/' + $keyword;\n var $breakOnError = !it.opts.allErrors;\n var $errorKeyword;\n var $data = 'data' + ($dataLvl || '');\n var $valid = 'valid' + $lvl;\n var $errs = 'errs__' + $lvl;\n var $isData = it.opts.$data && $schema && $schema.$data,\n $schemaValue;\n if ($isData) {\n out += ' var schema' + ($lvl) + ' = ' + (it.util.getData($schema.$data, $dataLvl, it.dataPathArr)) + '; ';\n $schemaValue = 'schema' + $lvl;\n } else {\n $schemaValue = $schema;\n }\n var $rule = this,\n $definition = 'definition' + $lvl,\n $rDef = $rule.definition,\n $closingBraces = '';\n var $compile, $inline, $macro, $ruleValidate, $validateCode;\n if ($isData && $rDef.$data) {\n $validateCode = 'keywordValidate' + $lvl;\n var $validateSchema = $rDef.validateSchema;\n out += ' var ' + ($definition) + ' = RULES.custom[\\'' + ($keyword) + '\\'].definition; var ' + ($validateCode) + ' = ' + ($definition) + '.validate;';\n } else {\n $ruleValidate = it.useCustomRule($rule, $schema, it.schema, it);\n if (!$ruleValidate) return;\n $schemaValue = 'validate.schema' + $schemaPath;\n $validateCode = $ruleValidate.code;\n $compile = $rDef.compile;\n $inline = $rDef.inline;\n $macro = $rDef.macro;\n }\n var $ruleErrs = $validateCode + '.errors',\n $i = 'i' + $lvl,\n $ruleErr = 'ruleErr' + $lvl,\n $asyncKeyword = $rDef.async;\n if ($asyncKeyword && !it.async) throw new Error('async keyword in sync schema');\n if (!($inline || $macro)) {\n out += '' + ($ruleErrs) + ' = null;';\n }\n out += 'var ' + ($errs) + ' = errors;var ' + ($valid) + ';';\n if ($isData && $rDef.$data) {\n $closingBraces += '}';\n out += ' if (' + ($schemaValue) + ' === undefined) { ' + ($valid) + ' = true; } else { ';\n if ($validateSchema) {\n $closingBraces += '}';\n out += ' ' + ($valid) + ' = ' + ($definition) + '.validateSchema(' + ($schemaValue) + '); if (' + ($valid) + ') { ';\n }\n }\n if ($inline) {\n if ($rDef.statements) {\n out += ' ' + ($ruleValidate.validate) + ' ';\n } else {\n out += ' ' + ($valid) + ' = ' + ($ruleValidate.validate) + '; ';\n }\n } else if ($macro) {\n var $it = it.util.copy(it);\n var $closingBraces = '';\n $it.level++;\n var $nextValid = 'valid' + $it.level;\n $it.schema = $ruleValidate.validate;\n $it.schemaPath = '';\n var $wasComposite = it.compositeRule;\n it.compositeRule = $it.compositeRule = true;\n var $code = it.validate($it).replace(/validate\\.schema/g, $validateCode);\n it.compositeRule = $it.compositeRule = $wasComposite;\n out += ' ' + ($code);\n } else {\n var $$outStack = $$outStack || [];\n $$outStack.push(out);\n out = '';\n out += ' ' + ($validateCode) + '.call( ';\n if (it.opts.passContext) {\n out += 'this';\n } else {\n out += 'self';\n }\n if ($compile || $rDef.schema === false) {\n out += ' , ' + ($data) + ' ';\n } else {\n out += ' , ' + ($schemaValue) + ' , ' + ($data) + ' , validate.schema' + (it.schemaPath) + ' ';\n }\n out += ' , (dataPath || \\'\\')';\n if (it.errorPath != '\"\"') {\n out += ' + ' + (it.errorPath);\n }\n var $parentData = $dataLvl ? 'data' + (($dataLvl - 1) || '') : 'parentData',\n $parentDataProperty = $dataLvl ? it.dataPathArr[$dataLvl] : 'parentDataProperty';\n out += ' , ' + ($parentData) + ' , ' + ($parentDataProperty) + ' , rootData ) ';\n var def_callRuleValidate = out;\n out = $$outStack.pop();\n if ($rDef.errors === false) {\n out += ' ' + ($valid) + ' = ';\n if ($asyncKeyword) {\n out += 'await ';\n }\n out += '' + (def_callRuleValidate) + '; ';\n } else {\n if ($asyncKeyword) {\n $ruleErrs = 'customErrors' + $lvl;\n out += ' var ' + ($ruleErrs) + ' = null; try { ' + ($valid) + ' = await ' + (def_callRuleValidate) + '; } catch (e) { ' + ($valid) + ' = false; if (e instanceof ValidationError) ' + ($ruleErrs) + ' = e.errors; else throw e; } ';\n } else {\n out += ' ' + ($ruleErrs) + ' = null; ' + ($valid) + ' = ' + (def_callRuleValidate) + '; ';\n }\n }\n }\n if ($rDef.modifying) {\n out += ' if (' + ($parentData) + ') ' + ($data) + ' = ' + ($parentData) + '[' + ($parentDataProperty) + '];';\n }\n out += '' + ($closingBraces);\n if ($rDef.valid) {\n if ($breakOnError) {\n out += ' if (true) { ';\n }\n } else {\n out += ' if ( ';\n if ($rDef.valid === undefined) {\n out += ' !';\n if ($macro) {\n out += '' + ($nextValid);\n } else {\n out += '' + ($valid);\n }\n } else {\n out += ' ' + (!$rDef.valid) + ' ';\n }\n out += ') { ';\n $errorKeyword = $rule.keyword;\n var $$outStack = $$outStack || [];\n $$outStack.push(out);\n out = '';\n var $$outStack = $$outStack || [];\n $$outStack.push(out);\n out = ''; /* istanbul ignore else */\n if (it.createErrors !== false) {\n out += ' { keyword: \\'' + ($errorKeyword || 'custom') + '\\' , dataPath: (dataPath || \\'\\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { keyword: \\'' + ($rule.keyword) + '\\' } ';\n if (it.opts.messages !== false) {\n out += ' , message: \\'should pass \"' + ($rule.keyword) + '\" keyword validation\\' ';\n }\n if (it.opts.verbose) {\n out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' ';\n }\n out += ' } ';\n } else {\n out += ' {} ';\n }\n var __err = out;\n out = $$outStack.pop();\n if (!it.compositeRule && $breakOnError) {\n /* istanbul ignore if */\n if (it.async) {\n out += ' throw new ValidationError([' + (__err) + ']); ';\n } else {\n out += ' validate.errors = [' + (__err) + ']; return false; ';\n }\n } else {\n out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ';\n }\n var def_customError = out;\n out = $$outStack.pop();\n if ($inline) {\n if ($rDef.errors) {\n if ($rDef.errors != 'full') {\n out += ' for (var ' + ($i) + '=' + ($errs) + '; ' + ($i) + ' 0) || $sch === false : it.util.schemaHasRules($sch, it.RULES.all))) {\n out += ' ' + ($nextValid) + ' = true; if ( ' + ($data) + (it.util.getProperty($property)) + ' !== undefined ';\n if ($ownProperties) {\n out += ' && Object.prototype.hasOwnProperty.call(' + ($data) + ', \\'' + (it.util.escapeQuotes($property)) + '\\') ';\n }\n out += ') { ';\n $it.schema = $sch;\n $it.schemaPath = $schemaPath + it.util.getProperty($property);\n $it.errSchemaPath = $errSchemaPath + '/' + it.util.escapeFragment($property);\n out += ' ' + (it.validate($it)) + ' ';\n $it.baseId = $currentBaseId;\n out += ' } ';\n if ($breakOnError) {\n out += ' if (' + ($nextValid) + ') { ';\n $closingBraces += '}';\n }\n }\n }\n if ($breakOnError) {\n out += ' ' + ($closingBraces) + ' if (' + ($errs) + ' == errors) {';\n }\n return out;\n}\n","'use strict';\nmodule.exports = function generate_enum(it, $keyword, $ruleType) {\n var out = ' ';\n var $lvl = it.level;\n var $dataLvl = it.dataLevel;\n var $schema = it.schema[$keyword];\n var $schemaPath = it.schemaPath + it.util.getProperty($keyword);\n var $errSchemaPath = it.errSchemaPath + '/' + $keyword;\n var $breakOnError = !it.opts.allErrors;\n var $data = 'data' + ($dataLvl || '');\n var $valid = 'valid' + $lvl;\n var $isData = it.opts.$data && $schema && $schema.$data,\n $schemaValue;\n if ($isData) {\n out += ' var schema' + ($lvl) + ' = ' + (it.util.getData($schema.$data, $dataLvl, it.dataPathArr)) + '; ';\n $schemaValue = 'schema' + $lvl;\n } else {\n $schemaValue = $schema;\n }\n var $i = 'i' + $lvl,\n $vSchema = 'schema' + $lvl;\n if (!$isData) {\n out += ' var ' + ($vSchema) + ' = validate.schema' + ($schemaPath) + ';';\n }\n out += 'var ' + ($valid) + ';';\n if ($isData) {\n out += ' if (schema' + ($lvl) + ' === undefined) ' + ($valid) + ' = true; else if (!Array.isArray(schema' + ($lvl) + ')) ' + ($valid) + ' = false; else {';\n }\n out += '' + ($valid) + ' = false;for (var ' + ($i) + '=0; ' + ($i) + '<' + ($vSchema) + '.length; ' + ($i) + '++) if (equal(' + ($data) + ', ' + ($vSchema) + '[' + ($i) + '])) { ' + ($valid) + ' = true; break; }';\n if ($isData) {\n out += ' } ';\n }\n out += ' if (!' + ($valid) + ') { ';\n var $$outStack = $$outStack || [];\n $$outStack.push(out);\n out = ''; /* istanbul ignore else */\n if (it.createErrors !== false) {\n out += ' { keyword: \\'' + ('enum') + '\\' , dataPath: (dataPath || \\'\\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { allowedValues: schema' + ($lvl) + ' } ';\n if (it.opts.messages !== false) {\n out += ' , message: \\'should be equal to one of the allowed values\\' ';\n }\n if (it.opts.verbose) {\n out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' ';\n }\n out += ' } ';\n } else {\n out += ' {} ';\n }\n var __err = out;\n out = $$outStack.pop();\n if (!it.compositeRule && $breakOnError) {\n /* istanbul ignore if */\n if (it.async) {\n out += ' throw new ValidationError([' + (__err) + ']); ';\n } else {\n out += ' validate.errors = [' + (__err) + ']; return false; ';\n }\n } else {\n out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ';\n }\n out += ' }';\n if ($breakOnError) {\n out += ' else { ';\n }\n return out;\n}\n","'use strict';\nmodule.exports = function generate_format(it, $keyword, $ruleType) {\n var out = ' ';\n var $lvl = it.level;\n var $dataLvl = it.dataLevel;\n var $schema = it.schema[$keyword];\n var $schemaPath = it.schemaPath + it.util.getProperty($keyword);\n var $errSchemaPath = it.errSchemaPath + '/' + $keyword;\n var $breakOnError = !it.opts.allErrors;\n var $data = 'data' + ($dataLvl || '');\n if (it.opts.format === false) {\n if ($breakOnError) {\n out += ' if (true) { ';\n }\n return out;\n }\n var $isData = it.opts.$data && $schema && $schema.$data,\n $schemaValue;\n if ($isData) {\n out += ' var schema' + ($lvl) + ' = ' + (it.util.getData($schema.$data, $dataLvl, it.dataPathArr)) + '; ';\n $schemaValue = 'schema' + $lvl;\n } else {\n $schemaValue = $schema;\n }\n var $unknownFormats = it.opts.unknownFormats,\n $allowUnknown = Array.isArray($unknownFormats);\n if ($isData) {\n var $format = 'format' + $lvl,\n $isObject = 'isObject' + $lvl,\n $formatType = 'formatType' + $lvl;\n out += ' var ' + ($format) + ' = formats[' + ($schemaValue) + ']; var ' + ($isObject) + ' = typeof ' + ($format) + ' == \\'object\\' && !(' + ($format) + ' instanceof RegExp) && ' + ($format) + '.validate; var ' + ($formatType) + ' = ' + ($isObject) + ' && ' + ($format) + '.type || \\'string\\'; if (' + ($isObject) + ') { ';\n if (it.async) {\n out += ' var async' + ($lvl) + ' = ' + ($format) + '.async; ';\n }\n out += ' ' + ($format) + ' = ' + ($format) + '.validate; } if ( ';\n if ($isData) {\n out += ' (' + ($schemaValue) + ' !== undefined && typeof ' + ($schemaValue) + ' != \\'string\\') || ';\n }\n out += ' (';\n if ($unknownFormats != 'ignore') {\n out += ' (' + ($schemaValue) + ' && !' + ($format) + ' ';\n if ($allowUnknown) {\n out += ' && self._opts.unknownFormats.indexOf(' + ($schemaValue) + ') == -1 ';\n }\n out += ') || ';\n }\n out += ' (' + ($format) + ' && ' + ($formatType) + ' == \\'' + ($ruleType) + '\\' && !(typeof ' + ($format) + ' == \\'function\\' ? ';\n if (it.async) {\n out += ' (async' + ($lvl) + ' ? await ' + ($format) + '(' + ($data) + ') : ' + ($format) + '(' + ($data) + ')) ';\n } else {\n out += ' ' + ($format) + '(' + ($data) + ') ';\n }\n out += ' : ' + ($format) + '.test(' + ($data) + '))))) {';\n } else {\n var $format = it.formats[$schema];\n if (!$format) {\n if ($unknownFormats == 'ignore') {\n it.logger.warn('unknown format \"' + $schema + '\" ignored in schema at path \"' + it.errSchemaPath + '\"');\n if ($breakOnError) {\n out += ' if (true) { ';\n }\n return out;\n } else if ($allowUnknown && $unknownFormats.indexOf($schema) >= 0) {\n if ($breakOnError) {\n out += ' if (true) { ';\n }\n return out;\n } else {\n throw new Error('unknown format \"' + $schema + '\" is used in schema at path \"' + it.errSchemaPath + '\"');\n }\n }\n var $isObject = typeof $format == 'object' && !($format instanceof RegExp) && $format.validate;\n var $formatType = $isObject && $format.type || 'string';\n if ($isObject) {\n var $async = $format.async === true;\n $format = $format.validate;\n }\n if ($formatType != $ruleType) {\n if ($breakOnError) {\n out += ' if (true) { ';\n }\n return out;\n }\n if ($async) {\n if (!it.async) throw new Error('async format in sync schema');\n var $formatRef = 'formats' + it.util.getProperty($schema) + '.validate';\n out += ' if (!(await ' + ($formatRef) + '(' + ($data) + '))) { ';\n } else {\n out += ' if (! ';\n var $formatRef = 'formats' + it.util.getProperty($schema);\n if ($isObject) $formatRef += '.validate';\n if (typeof $format == 'function') {\n out += ' ' + ($formatRef) + '(' + ($data) + ') ';\n } else {\n out += ' ' + ($formatRef) + '.test(' + ($data) + ') ';\n }\n out += ') { ';\n }\n }\n var $$outStack = $$outStack || [];\n $$outStack.push(out);\n out = ''; /* istanbul ignore else */\n if (it.createErrors !== false) {\n out += ' { keyword: \\'' + ('format') + '\\' , dataPath: (dataPath || \\'\\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { format: ';\n if ($isData) {\n out += '' + ($schemaValue);\n } else {\n out += '' + (it.util.toQuotedString($schema));\n }\n out += ' } ';\n if (it.opts.messages !== false) {\n out += ' , message: \\'should match format \"';\n if ($isData) {\n out += '\\' + ' + ($schemaValue) + ' + \\'';\n } else {\n out += '' + (it.util.escapeQuotes($schema));\n }\n out += '\"\\' ';\n }\n if (it.opts.verbose) {\n out += ' , schema: ';\n if ($isData) {\n out += 'validate.schema' + ($schemaPath);\n } else {\n out += '' + (it.util.toQuotedString($schema));\n }\n out += ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' ';\n }\n out += ' } ';\n } else {\n out += ' {} ';\n }\n var __err = out;\n out = $$outStack.pop();\n if (!it.compositeRule && $breakOnError) {\n /* istanbul ignore if */\n if (it.async) {\n out += ' throw new ValidationError([' + (__err) + ']); ';\n } else {\n out += ' validate.errors = [' + (__err) + ']; return false; ';\n }\n } else {\n out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ';\n }\n out += ' } ';\n if ($breakOnError) {\n out += ' else { ';\n }\n return out;\n}\n","'use strict';\nmodule.exports = function generate_if(it, $keyword, $ruleType) {\n var out = ' ';\n var $lvl = it.level;\n var $dataLvl = it.dataLevel;\n var $schema = it.schema[$keyword];\n var $schemaPath = it.schemaPath + it.util.getProperty($keyword);\n var $errSchemaPath = it.errSchemaPath + '/' + $keyword;\n var $breakOnError = !it.opts.allErrors;\n var $data = 'data' + ($dataLvl || '');\n var $valid = 'valid' + $lvl;\n var $errs = 'errs__' + $lvl;\n var $it = it.util.copy(it);\n $it.level++;\n var $nextValid = 'valid' + $it.level;\n var $thenSch = it.schema['then'],\n $elseSch = it.schema['else'],\n $thenPresent = $thenSch !== undefined && (it.opts.strictKeywords ? (typeof $thenSch == 'object' && Object.keys($thenSch).length > 0) || $thenSch === false : it.util.schemaHasRules($thenSch, it.RULES.all)),\n $elsePresent = $elseSch !== undefined && (it.opts.strictKeywords ? (typeof $elseSch == 'object' && Object.keys($elseSch).length > 0) || $elseSch === false : it.util.schemaHasRules($elseSch, it.RULES.all)),\n $currentBaseId = $it.baseId;\n if ($thenPresent || $elsePresent) {\n var $ifClause;\n $it.createErrors = false;\n $it.schema = $schema;\n $it.schemaPath = $schemaPath;\n $it.errSchemaPath = $errSchemaPath;\n out += ' var ' + ($errs) + ' = errors; var ' + ($valid) + ' = true; ';\n var $wasComposite = it.compositeRule;\n it.compositeRule = $it.compositeRule = true;\n out += ' ' + (it.validate($it)) + ' ';\n $it.baseId = $currentBaseId;\n $it.createErrors = true;\n out += ' errors = ' + ($errs) + '; if (vErrors !== null) { if (' + ($errs) + ') vErrors.length = ' + ($errs) + '; else vErrors = null; } ';\n it.compositeRule = $it.compositeRule = $wasComposite;\n if ($thenPresent) {\n out += ' if (' + ($nextValid) + ') { ';\n $it.schema = it.schema['then'];\n $it.schemaPath = it.schemaPath + '.then';\n $it.errSchemaPath = it.errSchemaPath + '/then';\n out += ' ' + (it.validate($it)) + ' ';\n $it.baseId = $currentBaseId;\n out += ' ' + ($valid) + ' = ' + ($nextValid) + '; ';\n if ($thenPresent && $elsePresent) {\n $ifClause = 'ifClause' + $lvl;\n out += ' var ' + ($ifClause) + ' = \\'then\\'; ';\n } else {\n $ifClause = '\\'then\\'';\n }\n out += ' } ';\n if ($elsePresent) {\n out += ' else { ';\n }\n } else {\n out += ' if (!' + ($nextValid) + ') { ';\n }\n if ($elsePresent) {\n $it.schema = it.schema['else'];\n $it.schemaPath = it.schemaPath + '.else';\n $it.errSchemaPath = it.errSchemaPath + '/else';\n out += ' ' + (it.validate($it)) + ' ';\n $it.baseId = $currentBaseId;\n out += ' ' + ($valid) + ' = ' + ($nextValid) + '; ';\n if ($thenPresent && $elsePresent) {\n $ifClause = 'ifClause' + $lvl;\n out += ' var ' + ($ifClause) + ' = \\'else\\'; ';\n } else {\n $ifClause = '\\'else\\'';\n }\n out += ' } ';\n }\n out += ' if (!' + ($valid) + ') { var err = '; /* istanbul ignore else */\n if (it.createErrors !== false) {\n out += ' { keyword: \\'' + ('if') + '\\' , dataPath: (dataPath || \\'\\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { failingKeyword: ' + ($ifClause) + ' } ';\n if (it.opts.messages !== false) {\n out += ' , message: \\'should match \"\\' + ' + ($ifClause) + ' + \\'\" schema\\' ';\n }\n if (it.opts.verbose) {\n out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' ';\n }\n out += ' } ';\n } else {\n out += ' {} ';\n }\n out += '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ';\n if (!it.compositeRule && $breakOnError) {\n /* istanbul ignore if */\n if (it.async) {\n out += ' throw new ValidationError(vErrors); ';\n } else {\n out += ' validate.errors = vErrors; return false; ';\n }\n }\n out += ' } ';\n if ($breakOnError) {\n out += ' else { ';\n }\n } else {\n if ($breakOnError) {\n out += ' if (true) { ';\n }\n }\n return out;\n}\n","'use strict';\n\n//all requires must be explicit because browserify won't work with dynamic requires\nmodule.exports = {\n '$ref': require('./ref'),\n allOf: require('./allOf'),\n anyOf: require('./anyOf'),\n '$comment': require('./comment'),\n const: require('./const'),\n contains: require('./contains'),\n dependencies: require('./dependencies'),\n 'enum': require('./enum'),\n format: require('./format'),\n 'if': require('./if'),\n items: require('./items'),\n maximum: require('./_limit'),\n minimum: require('./_limit'),\n maxItems: require('./_limitItems'),\n minItems: require('./_limitItems'),\n maxLength: require('./_limitLength'),\n minLength: require('./_limitLength'),\n maxProperties: require('./_limitProperties'),\n minProperties: require('./_limitProperties'),\n multipleOf: require('./multipleOf'),\n not: require('./not'),\n oneOf: require('./oneOf'),\n pattern: require('./pattern'),\n properties: require('./properties'),\n propertyNames: require('./propertyNames'),\n required: require('./required'),\n uniqueItems: require('./uniqueItems'),\n validate: require('./validate')\n};\n","'use strict';\nmodule.exports = function generate_items(it, $keyword, $ruleType) {\n var out = ' ';\n var $lvl = it.level;\n var $dataLvl = it.dataLevel;\n var $schema = it.schema[$keyword];\n var $schemaPath = it.schemaPath + it.util.getProperty($keyword);\n var $errSchemaPath = it.errSchemaPath + '/' + $keyword;\n var $breakOnError = !it.opts.allErrors;\n var $data = 'data' + ($dataLvl || '');\n var $valid = 'valid' + $lvl;\n var $errs = 'errs__' + $lvl;\n var $it = it.util.copy(it);\n var $closingBraces = '';\n $it.level++;\n var $nextValid = 'valid' + $it.level;\n var $idx = 'i' + $lvl,\n $dataNxt = $it.dataLevel = it.dataLevel + 1,\n $nextData = 'data' + $dataNxt,\n $currentBaseId = it.baseId;\n out += 'var ' + ($errs) + ' = errors;var ' + ($valid) + ';';\n if (Array.isArray($schema)) {\n var $additionalItems = it.schema.additionalItems;\n if ($additionalItems === false) {\n out += ' ' + ($valid) + ' = ' + ($data) + '.length <= ' + ($schema.length) + '; ';\n var $currErrSchemaPath = $errSchemaPath;\n $errSchemaPath = it.errSchemaPath + '/additionalItems';\n out += ' if (!' + ($valid) + ') { ';\n var $$outStack = $$outStack || [];\n $$outStack.push(out);\n out = ''; /* istanbul ignore else */\n if (it.createErrors !== false) {\n out += ' { keyword: \\'' + ('additionalItems') + '\\' , dataPath: (dataPath || \\'\\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { limit: ' + ($schema.length) + ' } ';\n if (it.opts.messages !== false) {\n out += ' , message: \\'should NOT have more than ' + ($schema.length) + ' items\\' ';\n }\n if (it.opts.verbose) {\n out += ' , schema: false , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' ';\n }\n out += ' } ';\n } else {\n out += ' {} ';\n }\n var __err = out;\n out = $$outStack.pop();\n if (!it.compositeRule && $breakOnError) {\n /* istanbul ignore if */\n if (it.async) {\n out += ' throw new ValidationError([' + (__err) + ']); ';\n } else {\n out += ' validate.errors = [' + (__err) + ']; return false; ';\n }\n } else {\n out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ';\n }\n out += ' } ';\n $errSchemaPath = $currErrSchemaPath;\n if ($breakOnError) {\n $closingBraces += '}';\n out += ' else { ';\n }\n }\n var arr1 = $schema;\n if (arr1) {\n var $sch, $i = -1,\n l1 = arr1.length - 1;\n while ($i < l1) {\n $sch = arr1[$i += 1];\n if ((it.opts.strictKeywords ? (typeof $sch == 'object' && Object.keys($sch).length > 0) || $sch === false : it.util.schemaHasRules($sch, it.RULES.all))) {\n out += ' ' + ($nextValid) + ' = true; if (' + ($data) + '.length > ' + ($i) + ') { ';\n var $passData = $data + '[' + $i + ']';\n $it.schema = $sch;\n $it.schemaPath = $schemaPath + '[' + $i + ']';\n $it.errSchemaPath = $errSchemaPath + '/' + $i;\n $it.errorPath = it.util.getPathExpr(it.errorPath, $i, it.opts.jsonPointers, true);\n $it.dataPathArr[$dataNxt] = $i;\n var $code = it.validate($it);\n $it.baseId = $currentBaseId;\n if (it.util.varOccurences($code, $nextData) < 2) {\n out += ' ' + (it.util.varReplace($code, $nextData, $passData)) + ' ';\n } else {\n out += ' var ' + ($nextData) + ' = ' + ($passData) + '; ' + ($code) + ' ';\n }\n out += ' } ';\n if ($breakOnError) {\n out += ' if (' + ($nextValid) + ') { ';\n $closingBraces += '}';\n }\n }\n }\n }\n if (typeof $additionalItems == 'object' && (it.opts.strictKeywords ? (typeof $additionalItems == 'object' && Object.keys($additionalItems).length > 0) || $additionalItems === false : it.util.schemaHasRules($additionalItems, it.RULES.all))) {\n $it.schema = $additionalItems;\n $it.schemaPath = it.schemaPath + '.additionalItems';\n $it.errSchemaPath = it.errSchemaPath + '/additionalItems';\n out += ' ' + ($nextValid) + ' = true; if (' + ($data) + '.length > ' + ($schema.length) + ') { for (var ' + ($idx) + ' = ' + ($schema.length) + '; ' + ($idx) + ' < ' + ($data) + '.length; ' + ($idx) + '++) { ';\n $it.errorPath = it.util.getPathExpr(it.errorPath, $idx, it.opts.jsonPointers, true);\n var $passData = $data + '[' + $idx + ']';\n $it.dataPathArr[$dataNxt] = $idx;\n var $code = it.validate($it);\n $it.baseId = $currentBaseId;\n if (it.util.varOccurences($code, $nextData) < 2) {\n out += ' ' + (it.util.varReplace($code, $nextData, $passData)) + ' ';\n } else {\n out += ' var ' + ($nextData) + ' = ' + ($passData) + '; ' + ($code) + ' ';\n }\n if ($breakOnError) {\n out += ' if (!' + ($nextValid) + ') break; ';\n }\n out += ' } } ';\n if ($breakOnError) {\n out += ' if (' + ($nextValid) + ') { ';\n $closingBraces += '}';\n }\n }\n } else if ((it.opts.strictKeywords ? (typeof $schema == 'object' && Object.keys($schema).length > 0) || $schema === false : it.util.schemaHasRules($schema, it.RULES.all))) {\n $it.schema = $schema;\n $it.schemaPath = $schemaPath;\n $it.errSchemaPath = $errSchemaPath;\n out += ' for (var ' + ($idx) + ' = ' + (0) + '; ' + ($idx) + ' < ' + ($data) + '.length; ' + ($idx) + '++) { ';\n $it.errorPath = it.util.getPathExpr(it.errorPath, $idx, it.opts.jsonPointers, true);\n var $passData = $data + '[' + $idx + ']';\n $it.dataPathArr[$dataNxt] = $idx;\n var $code = it.validate($it);\n $it.baseId = $currentBaseId;\n if (it.util.varOccurences($code, $nextData) < 2) {\n out += ' ' + (it.util.varReplace($code, $nextData, $passData)) + ' ';\n } else {\n out += ' var ' + ($nextData) + ' = ' + ($passData) + '; ' + ($code) + ' ';\n }\n if ($breakOnError) {\n out += ' if (!' + ($nextValid) + ') break; ';\n }\n out += ' }';\n }\n if ($breakOnError) {\n out += ' ' + ($closingBraces) + ' if (' + ($errs) + ' == errors) {';\n }\n return out;\n}\n","'use strict';\nmodule.exports = function generate_multipleOf(it, $keyword, $ruleType) {\n var out = ' ';\n var $lvl = it.level;\n var $dataLvl = it.dataLevel;\n var $schema = it.schema[$keyword];\n var $schemaPath = it.schemaPath + it.util.getProperty($keyword);\n var $errSchemaPath = it.errSchemaPath + '/' + $keyword;\n var $breakOnError = !it.opts.allErrors;\n var $data = 'data' + ($dataLvl || '');\n var $isData = it.opts.$data && $schema && $schema.$data,\n $schemaValue;\n if ($isData) {\n out += ' var schema' + ($lvl) + ' = ' + (it.util.getData($schema.$data, $dataLvl, it.dataPathArr)) + '; ';\n $schemaValue = 'schema' + $lvl;\n } else {\n $schemaValue = $schema;\n }\n if (!($isData || typeof $schema == 'number')) {\n throw new Error($keyword + ' must be number');\n }\n out += 'var division' + ($lvl) + ';if (';\n if ($isData) {\n out += ' ' + ($schemaValue) + ' !== undefined && ( typeof ' + ($schemaValue) + ' != \\'number\\' || ';\n }\n out += ' (division' + ($lvl) + ' = ' + ($data) + ' / ' + ($schemaValue) + ', ';\n if (it.opts.multipleOfPrecision) {\n out += ' Math.abs(Math.round(division' + ($lvl) + ') - division' + ($lvl) + ') > 1e-' + (it.opts.multipleOfPrecision) + ' ';\n } else {\n out += ' division' + ($lvl) + ' !== parseInt(division' + ($lvl) + ') ';\n }\n out += ' ) ';\n if ($isData) {\n out += ' ) ';\n }\n out += ' ) { ';\n var $$outStack = $$outStack || [];\n $$outStack.push(out);\n out = ''; /* istanbul ignore else */\n if (it.createErrors !== false) {\n out += ' { keyword: \\'' + ('multipleOf') + '\\' , dataPath: (dataPath || \\'\\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { multipleOf: ' + ($schemaValue) + ' } ';\n if (it.opts.messages !== false) {\n out += ' , message: \\'should be multiple of ';\n if ($isData) {\n out += '\\' + ' + ($schemaValue);\n } else {\n out += '' + ($schemaValue) + '\\'';\n }\n }\n if (it.opts.verbose) {\n out += ' , schema: ';\n if ($isData) {\n out += 'validate.schema' + ($schemaPath);\n } else {\n out += '' + ($schema);\n }\n out += ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' ';\n }\n out += ' } ';\n } else {\n out += ' {} ';\n }\n var __err = out;\n out = $$outStack.pop();\n if (!it.compositeRule && $breakOnError) {\n /* istanbul ignore if */\n if (it.async) {\n out += ' throw new ValidationError([' + (__err) + ']); ';\n } else {\n out += ' validate.errors = [' + (__err) + ']; return false; ';\n }\n } else {\n out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ';\n }\n out += '} ';\n if ($breakOnError) {\n out += ' else { ';\n }\n return out;\n}\n","'use strict';\nmodule.exports = function generate_not(it, $keyword, $ruleType) {\n var out = ' ';\n var $lvl = it.level;\n var $dataLvl = it.dataLevel;\n var $schema = it.schema[$keyword];\n var $schemaPath = it.schemaPath + it.util.getProperty($keyword);\n var $errSchemaPath = it.errSchemaPath + '/' + $keyword;\n var $breakOnError = !it.opts.allErrors;\n var $data = 'data' + ($dataLvl || '');\n var $errs = 'errs__' + $lvl;\n var $it = it.util.copy(it);\n $it.level++;\n var $nextValid = 'valid' + $it.level;\n if ((it.opts.strictKeywords ? (typeof $schema == 'object' && Object.keys($schema).length > 0) || $schema === false : it.util.schemaHasRules($schema, it.RULES.all))) {\n $it.schema = $schema;\n $it.schemaPath = $schemaPath;\n $it.errSchemaPath = $errSchemaPath;\n out += ' var ' + ($errs) + ' = errors; ';\n var $wasComposite = it.compositeRule;\n it.compositeRule = $it.compositeRule = true;\n $it.createErrors = false;\n var $allErrorsOption;\n if ($it.opts.allErrors) {\n $allErrorsOption = $it.opts.allErrors;\n $it.opts.allErrors = false;\n }\n out += ' ' + (it.validate($it)) + ' ';\n $it.createErrors = true;\n if ($allErrorsOption) $it.opts.allErrors = $allErrorsOption;\n it.compositeRule = $it.compositeRule = $wasComposite;\n out += ' if (' + ($nextValid) + ') { ';\n var $$outStack = $$outStack || [];\n $$outStack.push(out);\n out = ''; /* istanbul ignore else */\n if (it.createErrors !== false) {\n out += ' { keyword: \\'' + ('not') + '\\' , dataPath: (dataPath || \\'\\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: {} ';\n if (it.opts.messages !== false) {\n out += ' , message: \\'should NOT be valid\\' ';\n }\n if (it.opts.verbose) {\n out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' ';\n }\n out += ' } ';\n } else {\n out += ' {} ';\n }\n var __err = out;\n out = $$outStack.pop();\n if (!it.compositeRule && $breakOnError) {\n /* istanbul ignore if */\n if (it.async) {\n out += ' throw new ValidationError([' + (__err) + ']); ';\n } else {\n out += ' validate.errors = [' + (__err) + ']; return false; ';\n }\n } else {\n out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ';\n }\n out += ' } else { errors = ' + ($errs) + '; if (vErrors !== null) { if (' + ($errs) + ') vErrors.length = ' + ($errs) + '; else vErrors = null; } ';\n if (it.opts.allErrors) {\n out += ' } ';\n }\n } else {\n out += ' var err = '; /* istanbul ignore else */\n if (it.createErrors !== false) {\n out += ' { keyword: \\'' + ('not') + '\\' , dataPath: (dataPath || \\'\\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: {} ';\n if (it.opts.messages !== false) {\n out += ' , message: \\'should NOT be valid\\' ';\n }\n if (it.opts.verbose) {\n out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' ';\n }\n out += ' } ';\n } else {\n out += ' {} ';\n }\n out += '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ';\n if ($breakOnError) {\n out += ' if (false) { ';\n }\n }\n return out;\n}\n","'use strict';\nmodule.exports = function generate_oneOf(it, $keyword, $ruleType) {\n var out = ' ';\n var $lvl = it.level;\n var $dataLvl = it.dataLevel;\n var $schema = it.schema[$keyword];\n var $schemaPath = it.schemaPath + it.util.getProperty($keyword);\n var $errSchemaPath = it.errSchemaPath + '/' + $keyword;\n var $breakOnError = !it.opts.allErrors;\n var $data = 'data' + ($dataLvl || '');\n var $valid = 'valid' + $lvl;\n var $errs = 'errs__' + $lvl;\n var $it = it.util.copy(it);\n var $closingBraces = '';\n $it.level++;\n var $nextValid = 'valid' + $it.level;\n var $currentBaseId = $it.baseId,\n $prevValid = 'prevValid' + $lvl,\n $passingSchemas = 'passingSchemas' + $lvl;\n out += 'var ' + ($errs) + ' = errors , ' + ($prevValid) + ' = false , ' + ($valid) + ' = false , ' + ($passingSchemas) + ' = null; ';\n var $wasComposite = it.compositeRule;\n it.compositeRule = $it.compositeRule = true;\n var arr1 = $schema;\n if (arr1) {\n var $sch, $i = -1,\n l1 = arr1.length - 1;\n while ($i < l1) {\n $sch = arr1[$i += 1];\n if ((it.opts.strictKeywords ? (typeof $sch == 'object' && Object.keys($sch).length > 0) || $sch === false : it.util.schemaHasRules($sch, it.RULES.all))) {\n $it.schema = $sch;\n $it.schemaPath = $schemaPath + '[' + $i + ']';\n $it.errSchemaPath = $errSchemaPath + '/' + $i;\n out += ' ' + (it.validate($it)) + ' ';\n $it.baseId = $currentBaseId;\n } else {\n out += ' var ' + ($nextValid) + ' = true; ';\n }\n if ($i) {\n out += ' if (' + ($nextValid) + ' && ' + ($prevValid) + ') { ' + ($valid) + ' = false; ' + ($passingSchemas) + ' = [' + ($passingSchemas) + ', ' + ($i) + ']; } else { ';\n $closingBraces += '}';\n }\n out += ' if (' + ($nextValid) + ') { ' + ($valid) + ' = ' + ($prevValid) + ' = true; ' + ($passingSchemas) + ' = ' + ($i) + '; }';\n }\n }\n it.compositeRule = $it.compositeRule = $wasComposite;\n out += '' + ($closingBraces) + 'if (!' + ($valid) + ') { var err = '; /* istanbul ignore else */\n if (it.createErrors !== false) {\n out += ' { keyword: \\'' + ('oneOf') + '\\' , dataPath: (dataPath || \\'\\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { passingSchemas: ' + ($passingSchemas) + ' } ';\n if (it.opts.messages !== false) {\n out += ' , message: \\'should match exactly one schema in oneOf\\' ';\n }\n if (it.opts.verbose) {\n out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' ';\n }\n out += ' } ';\n } else {\n out += ' {} ';\n }\n out += '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ';\n if (!it.compositeRule && $breakOnError) {\n /* istanbul ignore if */\n if (it.async) {\n out += ' throw new ValidationError(vErrors); ';\n } else {\n out += ' validate.errors = vErrors; return false; ';\n }\n }\n out += '} else { errors = ' + ($errs) + '; if (vErrors !== null) { if (' + ($errs) + ') vErrors.length = ' + ($errs) + '; else vErrors = null; }';\n if (it.opts.allErrors) {\n out += ' } ';\n }\n return out;\n}\n","'use strict';\nmodule.exports = function generate_pattern(it, $keyword, $ruleType) {\n var out = ' ';\n var $lvl = it.level;\n var $dataLvl = it.dataLevel;\n var $schema = it.schema[$keyword];\n var $schemaPath = it.schemaPath + it.util.getProperty($keyword);\n var $errSchemaPath = it.errSchemaPath + '/' + $keyword;\n var $breakOnError = !it.opts.allErrors;\n var $data = 'data' + ($dataLvl || '');\n var $isData = it.opts.$data && $schema && $schema.$data,\n $schemaValue;\n if ($isData) {\n out += ' var schema' + ($lvl) + ' = ' + (it.util.getData($schema.$data, $dataLvl, it.dataPathArr)) + '; ';\n $schemaValue = 'schema' + $lvl;\n } else {\n $schemaValue = $schema;\n }\n var $regexp = $isData ? '(new RegExp(' + $schemaValue + '))' : it.usePattern($schema);\n out += 'if ( ';\n if ($isData) {\n out += ' (' + ($schemaValue) + ' !== undefined && typeof ' + ($schemaValue) + ' != \\'string\\') || ';\n }\n out += ' !' + ($regexp) + '.test(' + ($data) + ') ) { ';\n var $$outStack = $$outStack || [];\n $$outStack.push(out);\n out = ''; /* istanbul ignore else */\n if (it.createErrors !== false) {\n out += ' { keyword: \\'' + ('pattern') + '\\' , dataPath: (dataPath || \\'\\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { pattern: ';\n if ($isData) {\n out += '' + ($schemaValue);\n } else {\n out += '' + (it.util.toQuotedString($schema));\n }\n out += ' } ';\n if (it.opts.messages !== false) {\n out += ' , message: \\'should match pattern \"';\n if ($isData) {\n out += '\\' + ' + ($schemaValue) + ' + \\'';\n } else {\n out += '' + (it.util.escapeQuotes($schema));\n }\n out += '\"\\' ';\n }\n if (it.opts.verbose) {\n out += ' , schema: ';\n if ($isData) {\n out += 'validate.schema' + ($schemaPath);\n } else {\n out += '' + (it.util.toQuotedString($schema));\n }\n out += ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' ';\n }\n out += ' } ';\n } else {\n out += ' {} ';\n }\n var __err = out;\n out = $$outStack.pop();\n if (!it.compositeRule && $breakOnError) {\n /* istanbul ignore if */\n if (it.async) {\n out += ' throw new ValidationError([' + (__err) + ']); ';\n } else {\n out += ' validate.errors = [' + (__err) + ']; return false; ';\n }\n } else {\n out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ';\n }\n out += '} ';\n if ($breakOnError) {\n out += ' else { ';\n }\n return out;\n}\n","'use strict';\nmodule.exports = function generate_properties(it, $keyword, $ruleType) {\n var out = ' ';\n var $lvl = it.level;\n var $dataLvl = it.dataLevel;\n var $schema = it.schema[$keyword];\n var $schemaPath = it.schemaPath + it.util.getProperty($keyword);\n var $errSchemaPath = it.errSchemaPath + '/' + $keyword;\n var $breakOnError = !it.opts.allErrors;\n var $data = 'data' + ($dataLvl || '');\n var $errs = 'errs__' + $lvl;\n var $it = it.util.copy(it);\n var $closingBraces = '';\n $it.level++;\n var $nextValid = 'valid' + $it.level;\n var $key = 'key' + $lvl,\n $idx = 'idx' + $lvl,\n $dataNxt = $it.dataLevel = it.dataLevel + 1,\n $nextData = 'data' + $dataNxt,\n $dataProperties = 'dataProperties' + $lvl;\n var $schemaKeys = Object.keys($schema || {}).filter(notProto),\n $pProperties = it.schema.patternProperties || {},\n $pPropertyKeys = Object.keys($pProperties).filter(notProto),\n $aProperties = it.schema.additionalProperties,\n $someProperties = $schemaKeys.length || $pPropertyKeys.length,\n $noAdditional = $aProperties === false,\n $additionalIsSchema = typeof $aProperties == 'object' && Object.keys($aProperties).length,\n $removeAdditional = it.opts.removeAdditional,\n $checkAdditional = $noAdditional || $additionalIsSchema || $removeAdditional,\n $ownProperties = it.opts.ownProperties,\n $currentBaseId = it.baseId;\n var $required = it.schema.required;\n if ($required && !(it.opts.$data && $required.$data) && $required.length < it.opts.loopRequired) {\n var $requiredHash = it.util.toHash($required);\n }\n\n function notProto(p) {\n return p !== '__proto__';\n }\n out += 'var ' + ($errs) + ' = errors;var ' + ($nextValid) + ' = true;';\n if ($ownProperties) {\n out += ' var ' + ($dataProperties) + ' = undefined;';\n }\n if ($checkAdditional) {\n if ($ownProperties) {\n out += ' ' + ($dataProperties) + ' = ' + ($dataProperties) + ' || Object.keys(' + ($data) + '); for (var ' + ($idx) + '=0; ' + ($idx) + '<' + ($dataProperties) + '.length; ' + ($idx) + '++) { var ' + ($key) + ' = ' + ($dataProperties) + '[' + ($idx) + ']; ';\n } else {\n out += ' for (var ' + ($key) + ' in ' + ($data) + ') { ';\n }\n if ($someProperties) {\n out += ' var isAdditional' + ($lvl) + ' = !(false ';\n if ($schemaKeys.length) {\n if ($schemaKeys.length > 8) {\n out += ' || validate.schema' + ($schemaPath) + '.hasOwnProperty(' + ($key) + ') ';\n } else {\n var arr1 = $schemaKeys;\n if (arr1) {\n var $propertyKey, i1 = -1,\n l1 = arr1.length - 1;\n while (i1 < l1) {\n $propertyKey = arr1[i1 += 1];\n out += ' || ' + ($key) + ' == ' + (it.util.toQuotedString($propertyKey)) + ' ';\n }\n }\n }\n }\n if ($pPropertyKeys.length) {\n var arr2 = $pPropertyKeys;\n if (arr2) {\n var $pProperty, $i = -1,\n l2 = arr2.length - 1;\n while ($i < l2) {\n $pProperty = arr2[$i += 1];\n out += ' || ' + (it.usePattern($pProperty)) + '.test(' + ($key) + ') ';\n }\n }\n }\n out += ' ); if (isAdditional' + ($lvl) + ') { ';\n }\n if ($removeAdditional == 'all') {\n out += ' delete ' + ($data) + '[' + ($key) + ']; ';\n } else {\n var $currentErrorPath = it.errorPath;\n var $additionalProperty = '\\' + ' + $key + ' + \\'';\n if (it.opts._errorDataPathProperty) {\n it.errorPath = it.util.getPathExpr(it.errorPath, $key, it.opts.jsonPointers);\n }\n if ($noAdditional) {\n if ($removeAdditional) {\n out += ' delete ' + ($data) + '[' + ($key) + ']; ';\n } else {\n out += ' ' + ($nextValid) + ' = false; ';\n var $currErrSchemaPath = $errSchemaPath;\n $errSchemaPath = it.errSchemaPath + '/additionalProperties';\n var $$outStack = $$outStack || [];\n $$outStack.push(out);\n out = ''; /* istanbul ignore else */\n if (it.createErrors !== false) {\n out += ' { keyword: \\'' + ('additionalProperties') + '\\' , dataPath: (dataPath || \\'\\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { additionalProperty: \\'' + ($additionalProperty) + '\\' } ';\n if (it.opts.messages !== false) {\n out += ' , message: \\'';\n if (it.opts._errorDataPathProperty) {\n out += 'is an invalid additional property';\n } else {\n out += 'should NOT have additional properties';\n }\n out += '\\' ';\n }\n if (it.opts.verbose) {\n out += ' , schema: false , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' ';\n }\n out += ' } ';\n } else {\n out += ' {} ';\n }\n var __err = out;\n out = $$outStack.pop();\n if (!it.compositeRule && $breakOnError) {\n /* istanbul ignore if */\n if (it.async) {\n out += ' throw new ValidationError([' + (__err) + ']); ';\n } else {\n out += ' validate.errors = [' + (__err) + ']; return false; ';\n }\n } else {\n out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ';\n }\n $errSchemaPath = $currErrSchemaPath;\n if ($breakOnError) {\n out += ' break; ';\n }\n }\n } else if ($additionalIsSchema) {\n if ($removeAdditional == 'failing') {\n out += ' var ' + ($errs) + ' = errors; ';\n var $wasComposite = it.compositeRule;\n it.compositeRule = $it.compositeRule = true;\n $it.schema = $aProperties;\n $it.schemaPath = it.schemaPath + '.additionalProperties';\n $it.errSchemaPath = it.errSchemaPath + '/additionalProperties';\n $it.errorPath = it.opts._errorDataPathProperty ? it.errorPath : it.util.getPathExpr(it.errorPath, $key, it.opts.jsonPointers);\n var $passData = $data + '[' + $key + ']';\n $it.dataPathArr[$dataNxt] = $key;\n var $code = it.validate($it);\n $it.baseId = $currentBaseId;\n if (it.util.varOccurences($code, $nextData) < 2) {\n out += ' ' + (it.util.varReplace($code, $nextData, $passData)) + ' ';\n } else {\n out += ' var ' + ($nextData) + ' = ' + ($passData) + '; ' + ($code) + ' ';\n }\n out += ' if (!' + ($nextValid) + ') { errors = ' + ($errs) + '; if (validate.errors !== null) { if (errors) validate.errors.length = errors; else validate.errors = null; } delete ' + ($data) + '[' + ($key) + ']; } ';\n it.compositeRule = $it.compositeRule = $wasComposite;\n } else {\n $it.schema = $aProperties;\n $it.schemaPath = it.schemaPath + '.additionalProperties';\n $it.errSchemaPath = it.errSchemaPath + '/additionalProperties';\n $it.errorPath = it.opts._errorDataPathProperty ? it.errorPath : it.util.getPathExpr(it.errorPath, $key, it.opts.jsonPointers);\n var $passData = $data + '[' + $key + ']';\n $it.dataPathArr[$dataNxt] = $key;\n var $code = it.validate($it);\n $it.baseId = $currentBaseId;\n if (it.util.varOccurences($code, $nextData) < 2) {\n out += ' ' + (it.util.varReplace($code, $nextData, $passData)) + ' ';\n } else {\n out += ' var ' + ($nextData) + ' = ' + ($passData) + '; ' + ($code) + ' ';\n }\n if ($breakOnError) {\n out += ' if (!' + ($nextValid) + ') break; ';\n }\n }\n }\n it.errorPath = $currentErrorPath;\n }\n if ($someProperties) {\n out += ' } ';\n }\n out += ' } ';\n if ($breakOnError) {\n out += ' if (' + ($nextValid) + ') { ';\n $closingBraces += '}';\n }\n }\n var $useDefaults = it.opts.useDefaults && !it.compositeRule;\n if ($schemaKeys.length) {\n var arr3 = $schemaKeys;\n if (arr3) {\n var $propertyKey, i3 = -1,\n l3 = arr3.length - 1;\n while (i3 < l3) {\n $propertyKey = arr3[i3 += 1];\n var $sch = $schema[$propertyKey];\n if ((it.opts.strictKeywords ? (typeof $sch == 'object' && Object.keys($sch).length > 0) || $sch === false : it.util.schemaHasRules($sch, it.RULES.all))) {\n var $prop = it.util.getProperty($propertyKey),\n $passData = $data + $prop,\n $hasDefault = $useDefaults && $sch.default !== undefined;\n $it.schema = $sch;\n $it.schemaPath = $schemaPath + $prop;\n $it.errSchemaPath = $errSchemaPath + '/' + it.util.escapeFragment($propertyKey);\n $it.errorPath = it.util.getPath(it.errorPath, $propertyKey, it.opts.jsonPointers);\n $it.dataPathArr[$dataNxt] = it.util.toQuotedString($propertyKey);\n var $code = it.validate($it);\n $it.baseId = $currentBaseId;\n if (it.util.varOccurences($code, $nextData) < 2) {\n $code = it.util.varReplace($code, $nextData, $passData);\n var $useData = $passData;\n } else {\n var $useData = $nextData;\n out += ' var ' + ($nextData) + ' = ' + ($passData) + '; ';\n }\n if ($hasDefault) {\n out += ' ' + ($code) + ' ';\n } else {\n if ($requiredHash && $requiredHash[$propertyKey]) {\n out += ' if ( ' + ($useData) + ' === undefined ';\n if ($ownProperties) {\n out += ' || ! Object.prototype.hasOwnProperty.call(' + ($data) + ', \\'' + (it.util.escapeQuotes($propertyKey)) + '\\') ';\n }\n out += ') { ' + ($nextValid) + ' = false; ';\n var $currentErrorPath = it.errorPath,\n $currErrSchemaPath = $errSchemaPath,\n $missingProperty = it.util.escapeQuotes($propertyKey);\n if (it.opts._errorDataPathProperty) {\n it.errorPath = it.util.getPath($currentErrorPath, $propertyKey, it.opts.jsonPointers);\n }\n $errSchemaPath = it.errSchemaPath + '/required';\n var $$outStack = $$outStack || [];\n $$outStack.push(out);\n out = ''; /* istanbul ignore else */\n if (it.createErrors !== false) {\n out += ' { keyword: \\'' + ('required') + '\\' , dataPath: (dataPath || \\'\\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { missingProperty: \\'' + ($missingProperty) + '\\' } ';\n if (it.opts.messages !== false) {\n out += ' , message: \\'';\n if (it.opts._errorDataPathProperty) {\n out += 'is a required property';\n } else {\n out += 'should have required property \\\\\\'' + ($missingProperty) + '\\\\\\'';\n }\n out += '\\' ';\n }\n if (it.opts.verbose) {\n out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' ';\n }\n out += ' } ';\n } else {\n out += ' {} ';\n }\n var __err = out;\n out = $$outStack.pop();\n if (!it.compositeRule && $breakOnError) {\n /* istanbul ignore if */\n if (it.async) {\n out += ' throw new ValidationError([' + (__err) + ']); ';\n } else {\n out += ' validate.errors = [' + (__err) + ']; return false; ';\n }\n } else {\n out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ';\n }\n $errSchemaPath = $currErrSchemaPath;\n it.errorPath = $currentErrorPath;\n out += ' } else { ';\n } else {\n if ($breakOnError) {\n out += ' if ( ' + ($useData) + ' === undefined ';\n if ($ownProperties) {\n out += ' || ! Object.prototype.hasOwnProperty.call(' + ($data) + ', \\'' + (it.util.escapeQuotes($propertyKey)) + '\\') ';\n }\n out += ') { ' + ($nextValid) + ' = true; } else { ';\n } else {\n out += ' if (' + ($useData) + ' !== undefined ';\n if ($ownProperties) {\n out += ' && Object.prototype.hasOwnProperty.call(' + ($data) + ', \\'' + (it.util.escapeQuotes($propertyKey)) + '\\') ';\n }\n out += ' ) { ';\n }\n }\n out += ' ' + ($code) + ' } ';\n }\n }\n if ($breakOnError) {\n out += ' if (' + ($nextValid) + ') { ';\n $closingBraces += '}';\n }\n }\n }\n }\n if ($pPropertyKeys.length) {\n var arr4 = $pPropertyKeys;\n if (arr4) {\n var $pProperty, i4 = -1,\n l4 = arr4.length - 1;\n while (i4 < l4) {\n $pProperty = arr4[i4 += 1];\n var $sch = $pProperties[$pProperty];\n if ((it.opts.strictKeywords ? (typeof $sch == 'object' && Object.keys($sch).length > 0) || $sch === false : it.util.schemaHasRules($sch, it.RULES.all))) {\n $it.schema = $sch;\n $it.schemaPath = it.schemaPath + '.patternProperties' + it.util.getProperty($pProperty);\n $it.errSchemaPath = it.errSchemaPath + '/patternProperties/' + it.util.escapeFragment($pProperty);\n if ($ownProperties) {\n out += ' ' + ($dataProperties) + ' = ' + ($dataProperties) + ' || Object.keys(' + ($data) + '); for (var ' + ($idx) + '=0; ' + ($idx) + '<' + ($dataProperties) + '.length; ' + ($idx) + '++) { var ' + ($key) + ' = ' + ($dataProperties) + '[' + ($idx) + ']; ';\n } else {\n out += ' for (var ' + ($key) + ' in ' + ($data) + ') { ';\n }\n out += ' if (' + (it.usePattern($pProperty)) + '.test(' + ($key) + ')) { ';\n $it.errorPath = it.util.getPathExpr(it.errorPath, $key, it.opts.jsonPointers);\n var $passData = $data + '[' + $key + ']';\n $it.dataPathArr[$dataNxt] = $key;\n var $code = it.validate($it);\n $it.baseId = $currentBaseId;\n if (it.util.varOccurences($code, $nextData) < 2) {\n out += ' ' + (it.util.varReplace($code, $nextData, $passData)) + ' ';\n } else {\n out += ' var ' + ($nextData) + ' = ' + ($passData) + '; ' + ($code) + ' ';\n }\n if ($breakOnError) {\n out += ' if (!' + ($nextValid) + ') break; ';\n }\n out += ' } ';\n if ($breakOnError) {\n out += ' else ' + ($nextValid) + ' = true; ';\n }\n out += ' } ';\n if ($breakOnError) {\n out += ' if (' + ($nextValid) + ') { ';\n $closingBraces += '}';\n }\n }\n }\n }\n }\n if ($breakOnError) {\n out += ' ' + ($closingBraces) + ' if (' + ($errs) + ' == errors) {';\n }\n return out;\n}\n","'use strict';\nmodule.exports = function generate_propertyNames(it, $keyword, $ruleType) {\n var out = ' ';\n var $lvl = it.level;\n var $dataLvl = it.dataLevel;\n var $schema = it.schema[$keyword];\n var $schemaPath = it.schemaPath + it.util.getProperty($keyword);\n var $errSchemaPath = it.errSchemaPath + '/' + $keyword;\n var $breakOnError = !it.opts.allErrors;\n var $data = 'data' + ($dataLvl || '');\n var $errs = 'errs__' + $lvl;\n var $it = it.util.copy(it);\n var $closingBraces = '';\n $it.level++;\n var $nextValid = 'valid' + $it.level;\n out += 'var ' + ($errs) + ' = errors;';\n if ((it.opts.strictKeywords ? (typeof $schema == 'object' && Object.keys($schema).length > 0) || $schema === false : it.util.schemaHasRules($schema, it.RULES.all))) {\n $it.schema = $schema;\n $it.schemaPath = $schemaPath;\n $it.errSchemaPath = $errSchemaPath;\n var $key = 'key' + $lvl,\n $idx = 'idx' + $lvl,\n $i = 'i' + $lvl,\n $invalidName = '\\' + ' + $key + ' + \\'',\n $dataNxt = $it.dataLevel = it.dataLevel + 1,\n $nextData = 'data' + $dataNxt,\n $dataProperties = 'dataProperties' + $lvl,\n $ownProperties = it.opts.ownProperties,\n $currentBaseId = it.baseId;\n if ($ownProperties) {\n out += ' var ' + ($dataProperties) + ' = undefined; ';\n }\n if ($ownProperties) {\n out += ' ' + ($dataProperties) + ' = ' + ($dataProperties) + ' || Object.keys(' + ($data) + '); for (var ' + ($idx) + '=0; ' + ($idx) + '<' + ($dataProperties) + '.length; ' + ($idx) + '++) { var ' + ($key) + ' = ' + ($dataProperties) + '[' + ($idx) + ']; ';\n } else {\n out += ' for (var ' + ($key) + ' in ' + ($data) + ') { ';\n }\n out += ' var startErrs' + ($lvl) + ' = errors; ';\n var $passData = $key;\n var $wasComposite = it.compositeRule;\n it.compositeRule = $it.compositeRule = true;\n var $code = it.validate($it);\n $it.baseId = $currentBaseId;\n if (it.util.varOccurences($code, $nextData) < 2) {\n out += ' ' + (it.util.varReplace($code, $nextData, $passData)) + ' ';\n } else {\n out += ' var ' + ($nextData) + ' = ' + ($passData) + '; ' + ($code) + ' ';\n }\n it.compositeRule = $it.compositeRule = $wasComposite;\n out += ' if (!' + ($nextValid) + ') { for (var ' + ($i) + '=startErrs' + ($lvl) + '; ' + ($i) + ' 0) || $propertySch === false : it.util.schemaHasRules($propertySch, it.RULES.all)))) {\n $required[$required.length] = $property;\n }\n }\n }\n } else {\n var $required = $schema;\n }\n }\n if ($isData || $required.length) {\n var $currentErrorPath = it.errorPath,\n $loopRequired = $isData || $required.length >= it.opts.loopRequired,\n $ownProperties = it.opts.ownProperties;\n if ($breakOnError) {\n out += ' var missing' + ($lvl) + '; ';\n if ($loopRequired) {\n if (!$isData) {\n out += ' var ' + ($vSchema) + ' = validate.schema' + ($schemaPath) + '; ';\n }\n var $i = 'i' + $lvl,\n $propertyPath = 'schema' + $lvl + '[' + $i + ']',\n $missingProperty = '\\' + ' + $propertyPath + ' + \\'';\n if (it.opts._errorDataPathProperty) {\n it.errorPath = it.util.getPathExpr($currentErrorPath, $propertyPath, it.opts.jsonPointers);\n }\n out += ' var ' + ($valid) + ' = true; ';\n if ($isData) {\n out += ' if (schema' + ($lvl) + ' === undefined) ' + ($valid) + ' = true; else if (!Array.isArray(schema' + ($lvl) + ')) ' + ($valid) + ' = false; else {';\n }\n out += ' for (var ' + ($i) + ' = 0; ' + ($i) + ' < ' + ($vSchema) + '.length; ' + ($i) + '++) { ' + ($valid) + ' = ' + ($data) + '[' + ($vSchema) + '[' + ($i) + ']] !== undefined ';\n if ($ownProperties) {\n out += ' && Object.prototype.hasOwnProperty.call(' + ($data) + ', ' + ($vSchema) + '[' + ($i) + ']) ';\n }\n out += '; if (!' + ($valid) + ') break; } ';\n if ($isData) {\n out += ' } ';\n }\n out += ' if (!' + ($valid) + ') { ';\n var $$outStack = $$outStack || [];\n $$outStack.push(out);\n out = ''; /* istanbul ignore else */\n if (it.createErrors !== false) {\n out += ' { keyword: \\'' + ('required') + '\\' , dataPath: (dataPath || \\'\\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { missingProperty: \\'' + ($missingProperty) + '\\' } ';\n if (it.opts.messages !== false) {\n out += ' , message: \\'';\n if (it.opts._errorDataPathProperty) {\n out += 'is a required property';\n } else {\n out += 'should have required property \\\\\\'' + ($missingProperty) + '\\\\\\'';\n }\n out += '\\' ';\n }\n if (it.opts.verbose) {\n out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' ';\n }\n out += ' } ';\n } else {\n out += ' {} ';\n }\n var __err = out;\n out = $$outStack.pop();\n if (!it.compositeRule && $breakOnError) {\n /* istanbul ignore if */\n if (it.async) {\n out += ' throw new ValidationError([' + (__err) + ']); ';\n } else {\n out += ' validate.errors = [' + (__err) + ']; return false; ';\n }\n } else {\n out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ';\n }\n out += ' } else { ';\n } else {\n out += ' if ( ';\n var arr2 = $required;\n if (arr2) {\n var $propertyKey, $i = -1,\n l2 = arr2.length - 1;\n while ($i < l2) {\n $propertyKey = arr2[$i += 1];\n if ($i) {\n out += ' || ';\n }\n var $prop = it.util.getProperty($propertyKey),\n $useData = $data + $prop;\n out += ' ( ( ' + ($useData) + ' === undefined ';\n if ($ownProperties) {\n out += ' || ! Object.prototype.hasOwnProperty.call(' + ($data) + ', \\'' + (it.util.escapeQuotes($propertyKey)) + '\\') ';\n }\n out += ') && (missing' + ($lvl) + ' = ' + (it.util.toQuotedString(it.opts.jsonPointers ? $propertyKey : $prop)) + ') ) ';\n }\n }\n out += ') { ';\n var $propertyPath = 'missing' + $lvl,\n $missingProperty = '\\' + ' + $propertyPath + ' + \\'';\n if (it.opts._errorDataPathProperty) {\n it.errorPath = it.opts.jsonPointers ? it.util.getPathExpr($currentErrorPath, $propertyPath, true) : $currentErrorPath + ' + ' + $propertyPath;\n }\n var $$outStack = $$outStack || [];\n $$outStack.push(out);\n out = ''; /* istanbul ignore else */\n if (it.createErrors !== false) {\n out += ' { keyword: \\'' + ('required') + '\\' , dataPath: (dataPath || \\'\\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { missingProperty: \\'' + ($missingProperty) + '\\' } ';\n if (it.opts.messages !== false) {\n out += ' , message: \\'';\n if (it.opts._errorDataPathProperty) {\n out += 'is a required property';\n } else {\n out += 'should have required property \\\\\\'' + ($missingProperty) + '\\\\\\'';\n }\n out += '\\' ';\n }\n if (it.opts.verbose) {\n out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' ';\n }\n out += ' } ';\n } else {\n out += ' {} ';\n }\n var __err = out;\n out = $$outStack.pop();\n if (!it.compositeRule && $breakOnError) {\n /* istanbul ignore if */\n if (it.async) {\n out += ' throw new ValidationError([' + (__err) + ']); ';\n } else {\n out += ' validate.errors = [' + (__err) + ']; return false; ';\n }\n } else {\n out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ';\n }\n out += ' } else { ';\n }\n } else {\n if ($loopRequired) {\n if (!$isData) {\n out += ' var ' + ($vSchema) + ' = validate.schema' + ($schemaPath) + '; ';\n }\n var $i = 'i' + $lvl,\n $propertyPath = 'schema' + $lvl + '[' + $i + ']',\n $missingProperty = '\\' + ' + $propertyPath + ' + \\'';\n if (it.opts._errorDataPathProperty) {\n it.errorPath = it.util.getPathExpr($currentErrorPath, $propertyPath, it.opts.jsonPointers);\n }\n if ($isData) {\n out += ' if (' + ($vSchema) + ' && !Array.isArray(' + ($vSchema) + ')) { var err = '; /* istanbul ignore else */\n if (it.createErrors !== false) {\n out += ' { keyword: \\'' + ('required') + '\\' , dataPath: (dataPath || \\'\\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { missingProperty: \\'' + ($missingProperty) + '\\' } ';\n if (it.opts.messages !== false) {\n out += ' , message: \\'';\n if (it.opts._errorDataPathProperty) {\n out += 'is a required property';\n } else {\n out += 'should have required property \\\\\\'' + ($missingProperty) + '\\\\\\'';\n }\n out += '\\' ';\n }\n if (it.opts.verbose) {\n out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' ';\n }\n out += ' } ';\n } else {\n out += ' {} ';\n }\n out += '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; } else if (' + ($vSchema) + ' !== undefined) { ';\n }\n out += ' for (var ' + ($i) + ' = 0; ' + ($i) + ' < ' + ($vSchema) + '.length; ' + ($i) + '++) { if (' + ($data) + '[' + ($vSchema) + '[' + ($i) + ']] === undefined ';\n if ($ownProperties) {\n out += ' || ! Object.prototype.hasOwnProperty.call(' + ($data) + ', ' + ($vSchema) + '[' + ($i) + ']) ';\n }\n out += ') { var err = '; /* istanbul ignore else */\n if (it.createErrors !== false) {\n out += ' { keyword: \\'' + ('required') + '\\' , dataPath: (dataPath || \\'\\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { missingProperty: \\'' + ($missingProperty) + '\\' } ';\n if (it.opts.messages !== false) {\n out += ' , message: \\'';\n if (it.opts._errorDataPathProperty) {\n out += 'is a required property';\n } else {\n out += 'should have required property \\\\\\'' + ($missingProperty) + '\\\\\\'';\n }\n out += '\\' ';\n }\n if (it.opts.verbose) {\n out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' ';\n }\n out += ' } ';\n } else {\n out += ' {} ';\n }\n out += '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; } } ';\n if ($isData) {\n out += ' } ';\n }\n } else {\n var arr3 = $required;\n if (arr3) {\n var $propertyKey, i3 = -1,\n l3 = arr3.length - 1;\n while (i3 < l3) {\n $propertyKey = arr3[i3 += 1];\n var $prop = it.util.getProperty($propertyKey),\n $missingProperty = it.util.escapeQuotes($propertyKey),\n $useData = $data + $prop;\n if (it.opts._errorDataPathProperty) {\n it.errorPath = it.util.getPath($currentErrorPath, $propertyKey, it.opts.jsonPointers);\n }\n out += ' if ( ' + ($useData) + ' === undefined ';\n if ($ownProperties) {\n out += ' || ! Object.prototype.hasOwnProperty.call(' + ($data) + ', \\'' + (it.util.escapeQuotes($propertyKey)) + '\\') ';\n }\n out += ') { var err = '; /* istanbul ignore else */\n if (it.createErrors !== false) {\n out += ' { keyword: \\'' + ('required') + '\\' , dataPath: (dataPath || \\'\\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { missingProperty: \\'' + ($missingProperty) + '\\' } ';\n if (it.opts.messages !== false) {\n out += ' , message: \\'';\n if (it.opts._errorDataPathProperty) {\n out += 'is a required property';\n } else {\n out += 'should have required property \\\\\\'' + ($missingProperty) + '\\\\\\'';\n }\n out += '\\' ';\n }\n if (it.opts.verbose) {\n out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' ';\n }\n out += ' } ';\n } else {\n out += ' {} ';\n }\n out += '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; } ';\n }\n }\n }\n }\n it.errorPath = $currentErrorPath;\n } else if ($breakOnError) {\n out += ' if (true) {';\n }\n return out;\n}\n","'use strict';\nmodule.exports = function generate_uniqueItems(it, $keyword, $ruleType) {\n var out = ' ';\n var $lvl = it.level;\n var $dataLvl = it.dataLevel;\n var $schema = it.schema[$keyword];\n var $schemaPath = it.schemaPath + it.util.getProperty($keyword);\n var $errSchemaPath = it.errSchemaPath + '/' + $keyword;\n var $breakOnError = !it.opts.allErrors;\n var $data = 'data' + ($dataLvl || '');\n var $valid = 'valid' + $lvl;\n var $isData = it.opts.$data && $schema && $schema.$data,\n $schemaValue;\n if ($isData) {\n out += ' var schema' + ($lvl) + ' = ' + (it.util.getData($schema.$data, $dataLvl, it.dataPathArr)) + '; ';\n $schemaValue = 'schema' + $lvl;\n } else {\n $schemaValue = $schema;\n }\n if (($schema || $isData) && it.opts.uniqueItems !== false) {\n if ($isData) {\n out += ' var ' + ($valid) + '; if (' + ($schemaValue) + ' === false || ' + ($schemaValue) + ' === undefined) ' + ($valid) + ' = true; else if (typeof ' + ($schemaValue) + ' != \\'boolean\\') ' + ($valid) + ' = false; else { ';\n }\n out += ' var i = ' + ($data) + '.length , ' + ($valid) + ' = true , j; if (i > 1) { ';\n var $itemType = it.schema.items && it.schema.items.type,\n $typeIsArray = Array.isArray($itemType);\n if (!$itemType || $itemType == 'object' || $itemType == 'array' || ($typeIsArray && ($itemType.indexOf('object') >= 0 || $itemType.indexOf('array') >= 0))) {\n out += ' outer: for (;i--;) { for (j = i; j--;) { if (equal(' + ($data) + '[i], ' + ($data) + '[j])) { ' + ($valid) + ' = false; break outer; } } } ';\n } else {\n out += ' var itemIndices = {}, item; for (;i--;) { var item = ' + ($data) + '[i]; ';\n var $method = 'checkDataType' + ($typeIsArray ? 's' : '');\n out += ' if (' + (it.util[$method]($itemType, 'item', it.opts.strictNumbers, true)) + ') continue; ';\n if ($typeIsArray) {\n out += ' if (typeof item == \\'string\\') item = \\'\"\\' + item; ';\n }\n out += ' if (typeof itemIndices[item] == \\'number\\') { ' + ($valid) + ' = false; j = itemIndices[item]; break; } itemIndices[item] = i; } ';\n }\n out += ' } ';\n if ($isData) {\n out += ' } ';\n }\n out += ' if (!' + ($valid) + ') { ';\n var $$outStack = $$outStack || [];\n $$outStack.push(out);\n out = ''; /* istanbul ignore else */\n if (it.createErrors !== false) {\n out += ' { keyword: \\'' + ('uniqueItems') + '\\' , dataPath: (dataPath || \\'\\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { i: i, j: j } ';\n if (it.opts.messages !== false) {\n out += ' , message: \\'should NOT have duplicate items (items ## \\' + j + \\' and \\' + i + \\' are identical)\\' ';\n }\n if (it.opts.verbose) {\n out += ' , schema: ';\n if ($isData) {\n out += 'validate.schema' + ($schemaPath);\n } else {\n out += '' + ($schema);\n }\n out += ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' ';\n }\n out += ' } ';\n } else {\n out += ' {} ';\n }\n var __err = out;\n out = $$outStack.pop();\n if (!it.compositeRule && $breakOnError) {\n /* istanbul ignore if */\n if (it.async) {\n out += ' throw new ValidationError([' + (__err) + ']); ';\n } else {\n out += ' validate.errors = [' + (__err) + ']; return false; ';\n }\n } else {\n out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ';\n }\n out += ' } ';\n if ($breakOnError) {\n out += ' else { ';\n }\n } else {\n if ($breakOnError) {\n out += ' if (true) { ';\n }\n }\n return out;\n}\n","'use strict';\nmodule.exports = function generate_validate(it, $keyword, $ruleType) {\n var out = '';\n var $async = it.schema.$async === true,\n $refKeywords = it.util.schemaHasRulesExcept(it.schema, it.RULES.all, '$ref'),\n $id = it.self._getId(it.schema);\n if (it.opts.strictKeywords) {\n var $unknownKwd = it.util.schemaUnknownRules(it.schema, it.RULES.keywords);\n if ($unknownKwd) {\n var $keywordsMsg = 'unknown keyword: ' + $unknownKwd;\n if (it.opts.strictKeywords === 'log') it.logger.warn($keywordsMsg);\n else throw new Error($keywordsMsg);\n }\n }\n if (it.isTop) {\n out += ' var validate = ';\n if ($async) {\n it.async = true;\n out += 'async ';\n }\n out += 'function(data, dataPath, parentData, parentDataProperty, rootData) { \\'use strict\\'; ';\n if ($id && (it.opts.sourceCode || it.opts.processCode)) {\n out += ' ' + ('/\\*# sourceURL=' + $id + ' */') + ' ';\n }\n }\n if (typeof it.schema == 'boolean' || !($refKeywords || it.schema.$ref)) {\n var $keyword = 'false schema';\n var $lvl = it.level;\n var $dataLvl = it.dataLevel;\n var $schema = it.schema[$keyword];\n var $schemaPath = it.schemaPath + it.util.getProperty($keyword);\n var $errSchemaPath = it.errSchemaPath + '/' + $keyword;\n var $breakOnError = !it.opts.allErrors;\n var $errorKeyword;\n var $data = 'data' + ($dataLvl || '');\n var $valid = 'valid' + $lvl;\n if (it.schema === false) {\n if (it.isTop) {\n $breakOnError = true;\n } else {\n out += ' var ' + ($valid) + ' = false; ';\n }\n var $$outStack = $$outStack || [];\n $$outStack.push(out);\n out = ''; /* istanbul ignore else */\n if (it.createErrors !== false) {\n out += ' { keyword: \\'' + ($errorKeyword || 'false schema') + '\\' , dataPath: (dataPath || \\'\\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: {} ';\n if (it.opts.messages !== false) {\n out += ' , message: \\'boolean schema is false\\' ';\n }\n if (it.opts.verbose) {\n out += ' , schema: false , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' ';\n }\n out += ' } ';\n } else {\n out += ' {} ';\n }\n var __err = out;\n out = $$outStack.pop();\n if (!it.compositeRule && $breakOnError) {\n /* istanbul ignore if */\n if (it.async) {\n out += ' throw new ValidationError([' + (__err) + ']); ';\n } else {\n out += ' validate.errors = [' + (__err) + ']; return false; ';\n }\n } else {\n out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ';\n }\n } else {\n if (it.isTop) {\n if ($async) {\n out += ' return data; ';\n } else {\n out += ' validate.errors = null; return true; ';\n }\n } else {\n out += ' var ' + ($valid) + ' = true; ';\n }\n }\n if (it.isTop) {\n out += ' }; return validate; ';\n }\n return out;\n }\n if (it.isTop) {\n var $top = it.isTop,\n $lvl = it.level = 0,\n $dataLvl = it.dataLevel = 0,\n $data = 'data';\n it.rootId = it.resolve.fullPath(it.self._getId(it.root.schema));\n it.baseId = it.baseId || it.rootId;\n delete it.isTop;\n it.dataPathArr = [\"\"];\n if (it.schema.default !== undefined && it.opts.useDefaults && it.opts.strictDefaults) {\n var $defaultMsg = 'default is ignored in the schema root';\n if (it.opts.strictDefaults === 'log') it.logger.warn($defaultMsg);\n else throw new Error($defaultMsg);\n }\n out += ' var vErrors = null; ';\n out += ' var errors = 0; ';\n out += ' if (rootData === undefined) rootData = data; ';\n } else {\n var $lvl = it.level,\n $dataLvl = it.dataLevel,\n $data = 'data' + ($dataLvl || '');\n if ($id) it.baseId = it.resolve.url(it.baseId, $id);\n if ($async && !it.async) throw new Error('async schema in sync schema');\n out += ' var errs_' + ($lvl) + ' = errors;';\n }\n var $valid = 'valid' + $lvl,\n $breakOnError = !it.opts.allErrors,\n $closingBraces1 = '',\n $closingBraces2 = '';\n var $errorKeyword;\n var $typeSchema = it.schema.type,\n $typeIsArray = Array.isArray($typeSchema);\n if ($typeSchema && it.opts.nullable && it.schema.nullable === true) {\n if ($typeIsArray) {\n if ($typeSchema.indexOf('null') == -1) $typeSchema = $typeSchema.concat('null');\n } else if ($typeSchema != 'null') {\n $typeSchema = [$typeSchema, 'null'];\n $typeIsArray = true;\n }\n }\n if ($typeIsArray && $typeSchema.length == 1) {\n $typeSchema = $typeSchema[0];\n $typeIsArray = false;\n }\n if (it.schema.$ref && $refKeywords) {\n if (it.opts.extendRefs == 'fail') {\n throw new Error('$ref: validation keywords used in schema at path \"' + it.errSchemaPath + '\" (see option extendRefs)');\n } else if (it.opts.extendRefs !== true) {\n $refKeywords = false;\n it.logger.warn('$ref: keywords ignored in schema at path \"' + it.errSchemaPath + '\"');\n }\n }\n if (it.schema.$comment && it.opts.$comment) {\n out += ' ' + (it.RULES.all.$comment.code(it, '$comment'));\n }\n if ($typeSchema) {\n if (it.opts.coerceTypes) {\n var $coerceToTypes = it.util.coerceToTypes(it.opts.coerceTypes, $typeSchema);\n }\n var $rulesGroup = it.RULES.types[$typeSchema];\n if ($coerceToTypes || $typeIsArray || $rulesGroup === true || ($rulesGroup && !$shouldUseGroup($rulesGroup))) {\n var $schemaPath = it.schemaPath + '.type',\n $errSchemaPath = it.errSchemaPath + '/type';\n var $schemaPath = it.schemaPath + '.type',\n $errSchemaPath = it.errSchemaPath + '/type',\n $method = $typeIsArray ? 'checkDataTypes' : 'checkDataType';\n out += ' if (' + (it.util[$method]($typeSchema, $data, it.opts.strictNumbers, true)) + ') { ';\n if ($coerceToTypes) {\n var $dataType = 'dataType' + $lvl,\n $coerced = 'coerced' + $lvl;\n out += ' var ' + ($dataType) + ' = typeof ' + ($data) + '; var ' + ($coerced) + ' = undefined; ';\n if (it.opts.coerceTypes == 'array') {\n out += ' if (' + ($dataType) + ' == \\'object\\' && Array.isArray(' + ($data) + ') && ' + ($data) + '.length == 1) { ' + ($data) + ' = ' + ($data) + '[0]; ' + ($dataType) + ' = typeof ' + ($data) + '; if (' + (it.util.checkDataType(it.schema.type, $data, it.opts.strictNumbers)) + ') ' + ($coerced) + ' = ' + ($data) + '; } ';\n }\n out += ' if (' + ($coerced) + ' !== undefined) ; ';\n var arr1 = $coerceToTypes;\n if (arr1) {\n var $type, $i = -1,\n l1 = arr1.length - 1;\n while ($i < l1) {\n $type = arr1[$i += 1];\n if ($type == 'string') {\n out += ' else if (' + ($dataType) + ' == \\'number\\' || ' + ($dataType) + ' == \\'boolean\\') ' + ($coerced) + ' = \\'\\' + ' + ($data) + '; else if (' + ($data) + ' === null) ' + ($coerced) + ' = \\'\\'; ';\n } else if ($type == 'number' || $type == 'integer') {\n out += ' else if (' + ($dataType) + ' == \\'boolean\\' || ' + ($data) + ' === null || (' + ($dataType) + ' == \\'string\\' && ' + ($data) + ' && ' + ($data) + ' == +' + ($data) + ' ';\n if ($type == 'integer') {\n out += ' && !(' + ($data) + ' % 1)';\n }\n out += ')) ' + ($coerced) + ' = +' + ($data) + '; ';\n } else if ($type == 'boolean') {\n out += ' else if (' + ($data) + ' === \\'false\\' || ' + ($data) + ' === 0 || ' + ($data) + ' === null) ' + ($coerced) + ' = false; else if (' + ($data) + ' === \\'true\\' || ' + ($data) + ' === 1) ' + ($coerced) + ' = true; ';\n } else if ($type == 'null') {\n out += ' else if (' + ($data) + ' === \\'\\' || ' + ($data) + ' === 0 || ' + ($data) + ' === false) ' + ($coerced) + ' = null; ';\n } else if (it.opts.coerceTypes == 'array' && $type == 'array') {\n out += ' else if (' + ($dataType) + ' == \\'string\\' || ' + ($dataType) + ' == \\'number\\' || ' + ($dataType) + ' == \\'boolean\\' || ' + ($data) + ' == null) ' + ($coerced) + ' = [' + ($data) + ']; ';\n }\n }\n }\n out += ' else { ';\n var $$outStack = $$outStack || [];\n $$outStack.push(out);\n out = ''; /* istanbul ignore else */\n if (it.createErrors !== false) {\n out += ' { keyword: \\'' + ($errorKeyword || 'type') + '\\' , dataPath: (dataPath || \\'\\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { type: \\'';\n if ($typeIsArray) {\n out += '' + ($typeSchema.join(\",\"));\n } else {\n out += '' + ($typeSchema);\n }\n out += '\\' } ';\n if (it.opts.messages !== false) {\n out += ' , message: \\'should be ';\n if ($typeIsArray) {\n out += '' + ($typeSchema.join(\",\"));\n } else {\n out += '' + ($typeSchema);\n }\n out += '\\' ';\n }\n if (it.opts.verbose) {\n out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' ';\n }\n out += ' } ';\n } else {\n out += ' {} ';\n }\n var __err = out;\n out = $$outStack.pop();\n if (!it.compositeRule && $breakOnError) {\n /* istanbul ignore if */\n if (it.async) {\n out += ' throw new ValidationError([' + (__err) + ']); ';\n } else {\n out += ' validate.errors = [' + (__err) + ']; return false; ';\n }\n } else {\n out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ';\n }\n out += ' } if (' + ($coerced) + ' !== undefined) { ';\n var $parentData = $dataLvl ? 'data' + (($dataLvl - 1) || '') : 'parentData',\n $parentDataProperty = $dataLvl ? it.dataPathArr[$dataLvl] : 'parentDataProperty';\n out += ' ' + ($data) + ' = ' + ($coerced) + '; ';\n if (!$dataLvl) {\n out += 'if (' + ($parentData) + ' !== undefined)';\n }\n out += ' ' + ($parentData) + '[' + ($parentDataProperty) + '] = ' + ($coerced) + '; } ';\n } else {\n var $$outStack = $$outStack || [];\n $$outStack.push(out);\n out = ''; /* istanbul ignore else */\n if (it.createErrors !== false) {\n out += ' { keyword: \\'' + ($errorKeyword || 'type') + '\\' , dataPath: (dataPath || \\'\\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { type: \\'';\n if ($typeIsArray) {\n out += '' + ($typeSchema.join(\",\"));\n } else {\n out += '' + ($typeSchema);\n }\n out += '\\' } ';\n if (it.opts.messages !== false) {\n out += ' , message: \\'should be ';\n if ($typeIsArray) {\n out += '' + ($typeSchema.join(\",\"));\n } else {\n out += '' + ($typeSchema);\n }\n out += '\\' ';\n }\n if (it.opts.verbose) {\n out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' ';\n }\n out += ' } ';\n } else {\n out += ' {} ';\n }\n var __err = out;\n out = $$outStack.pop();\n if (!it.compositeRule && $breakOnError) {\n /* istanbul ignore if */\n if (it.async) {\n out += ' throw new ValidationError([' + (__err) + ']); ';\n } else {\n out += ' validate.errors = [' + (__err) + ']; return false; ';\n }\n } else {\n out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ';\n }\n }\n out += ' } ';\n }\n }\n if (it.schema.$ref && !$refKeywords) {\n out += ' ' + (it.RULES.all.$ref.code(it, '$ref')) + ' ';\n if ($breakOnError) {\n out += ' } if (errors === ';\n if ($top) {\n out += '0';\n } else {\n out += 'errs_' + ($lvl);\n }\n out += ') { ';\n $closingBraces2 += '}';\n }\n } else {\n var arr2 = it.RULES;\n if (arr2) {\n var $rulesGroup, i2 = -1,\n l2 = arr2.length - 1;\n while (i2 < l2) {\n $rulesGroup = arr2[i2 += 1];\n if ($shouldUseGroup($rulesGroup)) {\n if ($rulesGroup.type) {\n out += ' if (' + (it.util.checkDataType($rulesGroup.type, $data, it.opts.strictNumbers)) + ') { ';\n }\n if (it.opts.useDefaults) {\n if ($rulesGroup.type == 'object' && it.schema.properties) {\n var $schema = it.schema.properties,\n $schemaKeys = Object.keys($schema);\n var arr3 = $schemaKeys;\n if (arr3) {\n var $propertyKey, i3 = -1,\n l3 = arr3.length - 1;\n while (i3 < l3) {\n $propertyKey = arr3[i3 += 1];\n var $sch = $schema[$propertyKey];\n if ($sch.default !== undefined) {\n var $passData = $data + it.util.getProperty($propertyKey);\n if (it.compositeRule) {\n if (it.opts.strictDefaults) {\n var $defaultMsg = 'default is ignored for: ' + $passData;\n if (it.opts.strictDefaults === 'log') it.logger.warn($defaultMsg);\n else throw new Error($defaultMsg);\n }\n } else {\n out += ' if (' + ($passData) + ' === undefined ';\n if (it.opts.useDefaults == 'empty') {\n out += ' || ' + ($passData) + ' === null || ' + ($passData) + ' === \\'\\' ';\n }\n out += ' ) ' + ($passData) + ' = ';\n if (it.opts.useDefaults == 'shared') {\n out += ' ' + (it.useDefault($sch.default)) + ' ';\n } else {\n out += ' ' + (JSON.stringify($sch.default)) + ' ';\n }\n out += '; ';\n }\n }\n }\n }\n } else if ($rulesGroup.type == 'array' && Array.isArray(it.schema.items)) {\n var arr4 = it.schema.items;\n if (arr4) {\n var $sch, $i = -1,\n l4 = arr4.length - 1;\n while ($i < l4) {\n $sch = arr4[$i += 1];\n if ($sch.default !== undefined) {\n var $passData = $data + '[' + $i + ']';\n if (it.compositeRule) {\n if (it.opts.strictDefaults) {\n var $defaultMsg = 'default is ignored for: ' + $passData;\n if (it.opts.strictDefaults === 'log') it.logger.warn($defaultMsg);\n else throw new Error($defaultMsg);\n }\n } else {\n out += ' if (' + ($passData) + ' === undefined ';\n if (it.opts.useDefaults == 'empty') {\n out += ' || ' + ($passData) + ' === null || ' + ($passData) + ' === \\'\\' ';\n }\n out += ' ) ' + ($passData) + ' = ';\n if (it.opts.useDefaults == 'shared') {\n out += ' ' + (it.useDefault($sch.default)) + ' ';\n } else {\n out += ' ' + (JSON.stringify($sch.default)) + ' ';\n }\n out += '; ';\n }\n }\n }\n }\n }\n }\n var arr5 = $rulesGroup.rules;\n if (arr5) {\n var $rule, i5 = -1,\n l5 = arr5.length - 1;\n while (i5 < l5) {\n $rule = arr5[i5 += 1];\n if ($shouldUseRule($rule)) {\n var $code = $rule.code(it, $rule.keyword, $rulesGroup.type);\n if ($code) {\n out += ' ' + ($code) + ' ';\n if ($breakOnError) {\n $closingBraces1 += '}';\n }\n }\n }\n }\n }\n if ($breakOnError) {\n out += ' ' + ($closingBraces1) + ' ';\n $closingBraces1 = '';\n }\n if ($rulesGroup.type) {\n out += ' } ';\n if ($typeSchema && $typeSchema === $rulesGroup.type && !$coerceToTypes) {\n out += ' else { ';\n var $schemaPath = it.schemaPath + '.type',\n $errSchemaPath = it.errSchemaPath + '/type';\n var $$outStack = $$outStack || [];\n $$outStack.push(out);\n out = ''; /* istanbul ignore else */\n if (it.createErrors !== false) {\n out += ' { keyword: \\'' + ($errorKeyword || 'type') + '\\' , dataPath: (dataPath || \\'\\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { type: \\'';\n if ($typeIsArray) {\n out += '' + ($typeSchema.join(\",\"));\n } else {\n out += '' + ($typeSchema);\n }\n out += '\\' } ';\n if (it.opts.messages !== false) {\n out += ' , message: \\'should be ';\n if ($typeIsArray) {\n out += '' + ($typeSchema.join(\",\"));\n } else {\n out += '' + ($typeSchema);\n }\n out += '\\' ';\n }\n if (it.opts.verbose) {\n out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' ';\n }\n out += ' } ';\n } else {\n out += ' {} ';\n }\n var __err = out;\n out = $$outStack.pop();\n if (!it.compositeRule && $breakOnError) {\n /* istanbul ignore if */\n if (it.async) {\n out += ' throw new ValidationError([' + (__err) + ']); ';\n } else {\n out += ' validate.errors = [' + (__err) + ']; return false; ';\n }\n } else {\n out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ';\n }\n out += ' } ';\n }\n }\n if ($breakOnError) {\n out += ' if (errors === ';\n if ($top) {\n out += '0';\n } else {\n out += 'errs_' + ($lvl);\n }\n out += ') { ';\n $closingBraces2 += '}';\n }\n }\n }\n }\n }\n if ($breakOnError) {\n out += ' ' + ($closingBraces2) + ' ';\n }\n if ($top) {\n if ($async) {\n out += ' if (errors === 0) return data; ';\n out += ' else throw new ValidationError(vErrors); ';\n } else {\n out += ' validate.errors = vErrors; ';\n out += ' return errors === 0; ';\n }\n out += ' }; return validate;';\n } else {\n out += ' var ' + ($valid) + ' = errors === errs_' + ($lvl) + ';';\n }\n\n function $shouldUseGroup($rulesGroup) {\n var rules = $rulesGroup.rules;\n for (var i = 0; i < rules.length; i++)\n if ($shouldUseRule(rules[i])) return true;\n }\n\n function $shouldUseRule($rule) {\n return it.schema[$rule.keyword] !== undefined || ($rule.implements && $ruleImplementsSomeKeyword($rule));\n }\n\n function $ruleImplementsSomeKeyword($rule) {\n var impl = $rule.implements;\n for (var i = 0; i < impl.length; i++)\n if (it.schema[impl[i]] !== undefined) return true;\n }\n return out;\n}\n","'use strict';\n\nvar IDENTIFIER = /^[a-z_$][a-z0-9_$-]*$/i;\nvar customRuleCode = require('./dotjs/custom');\nvar definitionSchema = require('./definition_schema');\n\nmodule.exports = {\n add: addKeyword,\n get: getKeyword,\n remove: removeKeyword,\n validate: validateKeyword\n};\n\n\n/**\n * Define custom keyword\n * @this Ajv\n * @param {String} keyword custom keyword, should be unique (including different from all standard, custom and macro keywords).\n * @param {Object} definition keyword definition object with properties `type` (type(s) which the keyword applies to), `validate` or `compile`.\n * @return {Ajv} this for method chaining\n */\nfunction addKeyword(keyword, definition) {\n /* jshint validthis: true */\n /* eslint no-shadow: 0 */\n var RULES = this.RULES;\n if (RULES.keywords[keyword])\n throw new Error('Keyword ' + keyword + ' is already defined');\n\n if (!IDENTIFIER.test(keyword))\n throw new Error('Keyword ' + keyword + ' is not a valid identifier');\n\n if (definition) {\n this.validateKeyword(definition, true);\n\n var dataType = definition.type;\n if (Array.isArray(dataType)) {\n for (var i=0; i All rights reserved.\n\n\nmodule.exports = {\n\n newInvalidAsn1Error: function (msg) {\n var e = new Error();\n e.name = 'InvalidAsn1Error';\n e.message = msg || '';\n return e;\n }\n\n};\n","// Copyright 2011 Mark Cavage All rights reserved.\n\nvar errors = require('./errors');\nvar types = require('./types');\n\nvar Reader = require('./reader');\nvar Writer = require('./writer');\n\n\n// --- Exports\n\nmodule.exports = {\n\n Reader: Reader,\n\n Writer: Writer\n\n};\n\nfor (var t in types) {\n if (types.hasOwnProperty(t))\n module.exports[t] = types[t];\n}\nfor (var e in errors) {\n if (errors.hasOwnProperty(e))\n module.exports[e] = errors[e];\n}\n","// Copyright 2011 Mark Cavage All rights reserved.\n\nvar assert = require('assert');\nvar Buffer = require('safer-buffer').Buffer;\n\nvar ASN1 = require('./types');\nvar errors = require('./errors');\n\n\n// --- Globals\n\nvar newInvalidAsn1Error = errors.newInvalidAsn1Error;\n\n\n\n// --- API\n\nfunction Reader(data) {\n if (!data || !Buffer.isBuffer(data))\n throw new TypeError('data must be a node Buffer');\n\n this._buf = data;\n this._size = data.length;\n\n // These hold the \"current\" state\n this._len = 0;\n this._offset = 0;\n}\n\nObject.defineProperty(Reader.prototype, 'length', {\n enumerable: true,\n get: function () { return (this._len); }\n});\n\nObject.defineProperty(Reader.prototype, 'offset', {\n enumerable: true,\n get: function () { return (this._offset); }\n});\n\nObject.defineProperty(Reader.prototype, 'remain', {\n get: function () { return (this._size - this._offset); }\n});\n\nObject.defineProperty(Reader.prototype, 'buffer', {\n get: function () { return (this._buf.slice(this._offset)); }\n});\n\n\n/**\n * Reads a single byte and advances offset; you can pass in `true` to make this\n * a \"peek\" operation (i.e., get the byte, but don't advance the offset).\n *\n * @param {Boolean} peek true means don't move offset.\n * @return {Number} the next byte, null if not enough data.\n */\nReader.prototype.readByte = function (peek) {\n if (this._size - this._offset < 1)\n return null;\n\n var b = this._buf[this._offset] & 0xff;\n\n if (!peek)\n this._offset += 1;\n\n return b;\n};\n\n\nReader.prototype.peek = function () {\n return this.readByte(true);\n};\n\n\n/**\n * Reads a (potentially) variable length off the BER buffer. This call is\n * not really meant to be called directly, as callers have to manipulate\n * the internal buffer afterwards.\n *\n * As a result of this call, you can call `Reader.length`, until the\n * next thing called that does a readLength.\n *\n * @return {Number} the amount of offset to advance the buffer.\n * @throws {InvalidAsn1Error} on bad ASN.1\n */\nReader.prototype.readLength = function (offset) {\n if (offset === undefined)\n offset = this._offset;\n\n if (offset >= this._size)\n return null;\n\n var lenB = this._buf[offset++] & 0xff;\n if (lenB === null)\n return null;\n\n if ((lenB & 0x80) === 0x80) {\n lenB &= 0x7f;\n\n if (lenB === 0)\n throw newInvalidAsn1Error('Indefinite length not supported');\n\n if (lenB > 4)\n throw newInvalidAsn1Error('encoding too long');\n\n if (this._size - offset < lenB)\n return null;\n\n this._len = 0;\n for (var i = 0; i < lenB; i++)\n this._len = (this._len << 8) + (this._buf[offset++] & 0xff);\n\n } else {\n // Wasn't a variable length\n this._len = lenB;\n }\n\n return offset;\n};\n\n\n/**\n * Parses the next sequence in this BER buffer.\n *\n * To get the length of the sequence, call `Reader.length`.\n *\n * @return {Number} the sequence's tag.\n */\nReader.prototype.readSequence = function (tag) {\n var seq = this.peek();\n if (seq === null)\n return null;\n if (tag !== undefined && tag !== seq)\n throw newInvalidAsn1Error('Expected 0x' + tag.toString(16) +\n ': got 0x' + seq.toString(16));\n\n var o = this.readLength(this._offset + 1); // stored in `length`\n if (o === null)\n return null;\n\n this._offset = o;\n return seq;\n};\n\n\nReader.prototype.readInt = function () {\n return this._readTag(ASN1.Integer);\n};\n\n\nReader.prototype.readBoolean = function () {\n return (this._readTag(ASN1.Boolean) === 0 ? false : true);\n};\n\n\nReader.prototype.readEnumeration = function () {\n return this._readTag(ASN1.Enumeration);\n};\n\n\nReader.prototype.readString = function (tag, retbuf) {\n if (!tag)\n tag = ASN1.OctetString;\n\n var b = this.peek();\n if (b === null)\n return null;\n\n if (b !== tag)\n throw newInvalidAsn1Error('Expected 0x' + tag.toString(16) +\n ': got 0x' + b.toString(16));\n\n var o = this.readLength(this._offset + 1); // stored in `length`\n\n if (o === null)\n return null;\n\n if (this.length > this._size - o)\n return null;\n\n this._offset = o;\n\n if (this.length === 0)\n return retbuf ? Buffer.alloc(0) : '';\n\n var str = this._buf.slice(this._offset, this._offset + this.length);\n this._offset += this.length;\n\n return retbuf ? str : str.toString('utf8');\n};\n\nReader.prototype.readOID = function (tag) {\n if (!tag)\n tag = ASN1.OID;\n\n var b = this.readString(tag, true);\n if (b === null)\n return null;\n\n var values = [];\n var value = 0;\n\n for (var i = 0; i < b.length; i++) {\n var byte = b[i] & 0xff;\n\n value <<= 7;\n value += byte & 0x7f;\n if ((byte & 0x80) === 0) {\n values.push(value);\n value = 0;\n }\n }\n\n value = values.shift();\n values.unshift(value % 40);\n values.unshift((value / 40) >> 0);\n\n return values.join('.');\n};\n\n\nReader.prototype._readTag = function (tag) {\n assert.ok(tag !== undefined);\n\n var b = this.peek();\n\n if (b === null)\n return null;\n\n if (b !== tag)\n throw newInvalidAsn1Error('Expected 0x' + tag.toString(16) +\n ': got 0x' + b.toString(16));\n\n var o = this.readLength(this._offset + 1); // stored in `length`\n if (o === null)\n return null;\n\n if (this.length > 4)\n throw newInvalidAsn1Error('Integer too long: ' + this.length);\n\n if (this.length > this._size - o)\n return null;\n this._offset = o;\n\n var fb = this._buf[this._offset];\n var value = 0;\n\n for (var i = 0; i < this.length; i++) {\n value <<= 8;\n value |= (this._buf[this._offset++] & 0xff);\n }\n\n if ((fb & 0x80) === 0x80 && i !== 4)\n value -= (1 << (i * 8));\n\n return value >> 0;\n};\n\n\n\n// --- Exported API\n\nmodule.exports = Reader;\n","// Copyright 2011 Mark Cavage All rights reserved.\n\n\nmodule.exports = {\n EOC: 0,\n Boolean: 1,\n Integer: 2,\n BitString: 3,\n OctetString: 4,\n Null: 5,\n OID: 6,\n ObjectDescriptor: 7,\n External: 8,\n Real: 9, // float\n Enumeration: 10,\n PDV: 11,\n Utf8String: 12,\n RelativeOID: 13,\n Sequence: 16,\n Set: 17,\n NumericString: 18,\n PrintableString: 19,\n T61String: 20,\n VideotexString: 21,\n IA5String: 22,\n UTCTime: 23,\n GeneralizedTime: 24,\n GraphicString: 25,\n VisibleString: 26,\n GeneralString: 28,\n UniversalString: 29,\n CharacterString: 30,\n BMPString: 31,\n Constructor: 32,\n Context: 128\n};\n","// Copyright 2011 Mark Cavage All rights reserved.\n\nvar assert = require('assert');\nvar Buffer = require('safer-buffer').Buffer;\nvar ASN1 = require('./types');\nvar errors = require('./errors');\n\n\n// --- Globals\n\nvar newInvalidAsn1Error = errors.newInvalidAsn1Error;\n\nvar DEFAULT_OPTS = {\n size: 1024,\n growthFactor: 8\n};\n\n\n// --- Helpers\n\nfunction merge(from, to) {\n assert.ok(from);\n assert.equal(typeof (from), 'object');\n assert.ok(to);\n assert.equal(typeof (to), 'object');\n\n var keys = Object.getOwnPropertyNames(from);\n keys.forEach(function (key) {\n if (to[key])\n return;\n\n var value = Object.getOwnPropertyDescriptor(from, key);\n Object.defineProperty(to, key, value);\n });\n\n return to;\n}\n\n\n\n// --- API\n\nfunction Writer(options) {\n options = merge(DEFAULT_OPTS, options || {});\n\n this._buf = Buffer.alloc(options.size || 1024);\n this._size = this._buf.length;\n this._offset = 0;\n this._options = options;\n\n // A list of offsets in the buffer where we need to insert\n // sequence tag/len pairs.\n this._seq = [];\n}\n\nObject.defineProperty(Writer.prototype, 'buffer', {\n get: function () {\n if (this._seq.length)\n throw newInvalidAsn1Error(this._seq.length + ' unended sequence(s)');\n\n return (this._buf.slice(0, this._offset));\n }\n});\n\nWriter.prototype.writeByte = function (b) {\n if (typeof (b) !== 'number')\n throw new TypeError('argument must be a Number');\n\n this._ensure(1);\n this._buf[this._offset++] = b;\n};\n\n\nWriter.prototype.writeInt = function (i, tag) {\n if (typeof (i) !== 'number')\n throw new TypeError('argument must be a Number');\n if (typeof (tag) !== 'number')\n tag = ASN1.Integer;\n\n var sz = 4;\n\n while ((((i & 0xff800000) === 0) || ((i & 0xff800000) === 0xff800000 >> 0)) &&\n (sz > 1)) {\n sz--;\n i <<= 8;\n }\n\n if (sz > 4)\n throw newInvalidAsn1Error('BER ints cannot be > 0xffffffff');\n\n this._ensure(2 + sz);\n this._buf[this._offset++] = tag;\n this._buf[this._offset++] = sz;\n\n while (sz-- > 0) {\n this._buf[this._offset++] = ((i & 0xff000000) >>> 24);\n i <<= 8;\n }\n\n};\n\n\nWriter.prototype.writeNull = function () {\n this.writeByte(ASN1.Null);\n this.writeByte(0x00);\n};\n\n\nWriter.prototype.writeEnumeration = function (i, tag) {\n if (typeof (i) !== 'number')\n throw new TypeError('argument must be a Number');\n if (typeof (tag) !== 'number')\n tag = ASN1.Enumeration;\n\n return this.writeInt(i, tag);\n};\n\n\nWriter.prototype.writeBoolean = function (b, tag) {\n if (typeof (b) !== 'boolean')\n throw new TypeError('argument must be a Boolean');\n if (typeof (tag) !== 'number')\n tag = ASN1.Boolean;\n\n this._ensure(3);\n this._buf[this._offset++] = tag;\n this._buf[this._offset++] = 0x01;\n this._buf[this._offset++] = b ? 0xff : 0x00;\n};\n\n\nWriter.prototype.writeString = function (s, tag) {\n if (typeof (s) !== 'string')\n throw new TypeError('argument must be a string (was: ' + typeof (s) + ')');\n if (typeof (tag) !== 'number')\n tag = ASN1.OctetString;\n\n var len = Buffer.byteLength(s);\n this.writeByte(tag);\n this.writeLength(len);\n if (len) {\n this._ensure(len);\n this._buf.write(s, this._offset);\n this._offset += len;\n }\n};\n\n\nWriter.prototype.writeBuffer = function (buf, tag) {\n if (typeof (tag) !== 'number')\n throw new TypeError('tag must be a number');\n if (!Buffer.isBuffer(buf))\n throw new TypeError('argument must be a buffer');\n\n this.writeByte(tag);\n this.writeLength(buf.length);\n this._ensure(buf.length);\n buf.copy(this._buf, this._offset, 0, buf.length);\n this._offset += buf.length;\n};\n\n\nWriter.prototype.writeStringArray = function (strings) {\n if ((!strings instanceof Array))\n throw new TypeError('argument must be an Array[String]');\n\n var self = this;\n strings.forEach(function (s) {\n self.writeString(s);\n });\n};\n\n// This is really to solve DER cases, but whatever for now\nWriter.prototype.writeOID = function (s, tag) {\n if (typeof (s) !== 'string')\n throw new TypeError('argument must be a string');\n if (typeof (tag) !== 'number')\n tag = ASN1.OID;\n\n if (!/^([0-9]+\\.){3,}[0-9]+$/.test(s))\n throw new Error('argument is not a valid OID string');\n\n function encodeOctet(bytes, octet) {\n if (octet < 128) {\n bytes.push(octet);\n } else if (octet < 16384) {\n bytes.push((octet >>> 7) | 0x80);\n bytes.push(octet & 0x7F);\n } else if (octet < 2097152) {\n bytes.push((octet >>> 14) | 0x80);\n bytes.push(((octet >>> 7) | 0x80) & 0xFF);\n bytes.push(octet & 0x7F);\n } else if (octet < 268435456) {\n bytes.push((octet >>> 21) | 0x80);\n bytes.push(((octet >>> 14) | 0x80) & 0xFF);\n bytes.push(((octet >>> 7) | 0x80) & 0xFF);\n bytes.push(octet & 0x7F);\n } else {\n bytes.push(((octet >>> 28) | 0x80) & 0xFF);\n bytes.push(((octet >>> 21) | 0x80) & 0xFF);\n bytes.push(((octet >>> 14) | 0x80) & 0xFF);\n bytes.push(((octet >>> 7) | 0x80) & 0xFF);\n bytes.push(octet & 0x7F);\n }\n }\n\n var tmp = s.split('.');\n var bytes = [];\n bytes.push(parseInt(tmp[0], 10) * 40 + parseInt(tmp[1], 10));\n tmp.slice(2).forEach(function (b) {\n encodeOctet(bytes, parseInt(b, 10));\n });\n\n var self = this;\n this._ensure(2 + bytes.length);\n this.writeByte(tag);\n this.writeLength(bytes.length);\n bytes.forEach(function (b) {\n self.writeByte(b);\n });\n};\n\n\nWriter.prototype.writeLength = function (len) {\n if (typeof (len) !== 'number')\n throw new TypeError('argument must be a Number');\n\n this._ensure(4);\n\n if (len <= 0x7f) {\n this._buf[this._offset++] = len;\n } else if (len <= 0xff) {\n this._buf[this._offset++] = 0x81;\n this._buf[this._offset++] = len;\n } else if (len <= 0xffff) {\n this._buf[this._offset++] = 0x82;\n this._buf[this._offset++] = len >> 8;\n this._buf[this._offset++] = len;\n } else if (len <= 0xffffff) {\n this._buf[this._offset++] = 0x83;\n this._buf[this._offset++] = len >> 16;\n this._buf[this._offset++] = len >> 8;\n this._buf[this._offset++] = len;\n } else {\n throw newInvalidAsn1Error('Length too long (> 4 bytes)');\n }\n};\n\nWriter.prototype.startSequence = function (tag) {\n if (typeof (tag) !== 'number')\n tag = ASN1.Sequence | ASN1.Constructor;\n\n this.writeByte(tag);\n this._seq.push(this._offset);\n this._ensure(3);\n this._offset += 3;\n};\n\n\nWriter.prototype.endSequence = function () {\n var seq = this._seq.pop();\n var start = seq + 3;\n var len = this._offset - start;\n\n if (len <= 0x7f) {\n this._shift(start, len, -2);\n this._buf[seq] = len;\n } else if (len <= 0xff) {\n this._shift(start, len, -1);\n this._buf[seq] = 0x81;\n this._buf[seq + 1] = len;\n } else if (len <= 0xffff) {\n this._buf[seq] = 0x82;\n this._buf[seq + 1] = len >> 8;\n this._buf[seq + 2] = len;\n } else if (len <= 0xffffff) {\n this._shift(start, len, 1);\n this._buf[seq] = 0x83;\n this._buf[seq + 1] = len >> 16;\n this._buf[seq + 2] = len >> 8;\n this._buf[seq + 3] = len;\n } else {\n throw newInvalidAsn1Error('Sequence too long');\n }\n};\n\n\nWriter.prototype._shift = function (start, len, shift) {\n assert.ok(start !== undefined);\n assert.ok(len !== undefined);\n assert.ok(shift);\n\n this._buf.copy(this._buf, start + shift, start, start + len);\n this._offset += shift;\n};\n\nWriter.prototype._ensure = function (len) {\n assert.ok(len);\n\n if (this._size - this._offset < len) {\n var sz = this._size * this._options.growthFactor;\n if (sz - this._offset < len)\n sz += len;\n\n var buf = Buffer.alloc(sz);\n\n this._buf.copy(buf, 0, 0, this._offset);\n this._buf = buf;\n this._size = sz;\n }\n};\n\n\n\n// --- Exported API\n\nmodule.exports = Writer;\n","// Copyright 2011 Mark Cavage All rights reserved.\n\n// If you have no idea what ASN.1 or BER is, see this:\n// ftp://ftp.rsa.com/pub/pkcs/ascii/layman.asc\n\nvar Ber = require('./ber/index');\n\n\n\n// --- Exported API\n\nmodule.exports = {\n\n Ber: Ber,\n\n BerReader: Ber.Reader,\n\n BerWriter: Ber.Writer\n\n};\n","// Copyright (c) 2012, Mark Cavage. All rights reserved.\n// Copyright 2015 Joyent, Inc.\n\nvar assert = require('assert');\nvar Stream = require('stream').Stream;\nvar util = require('util');\n\n\n///--- Globals\n\n/* JSSTYLED */\nvar UUID_REGEXP = /^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$/;\n\n\n///--- Internal\n\nfunction _capitalize(str) {\n return (str.charAt(0).toUpperCase() + str.slice(1));\n}\n\nfunction _toss(name, expected, oper, arg, actual) {\n throw new assert.AssertionError({\n message: util.format('%s (%s) is required', name, expected),\n actual: (actual === undefined) ? typeof (arg) : actual(arg),\n expected: expected,\n operator: oper || '===',\n stackStartFunction: _toss.caller\n });\n}\n\nfunction _getClass(arg) {\n return (Object.prototype.toString.call(arg).slice(8, -1));\n}\n\nfunction noop() {\n // Why even bother with asserts?\n}\n\n\n///--- Exports\n\nvar types = {\n bool: {\n check: function (arg) { return typeof (arg) === 'boolean'; }\n },\n func: {\n check: function (arg) { return typeof (arg) === 'function'; }\n },\n string: {\n check: function (arg) { return typeof (arg) === 'string'; }\n },\n object: {\n check: function (arg) {\n return typeof (arg) === 'object' && arg !== null;\n }\n },\n number: {\n check: function (arg) {\n return typeof (arg) === 'number' && !isNaN(arg);\n }\n },\n finite: {\n check: function (arg) {\n return typeof (arg) === 'number' && !isNaN(arg) && isFinite(arg);\n }\n },\n buffer: {\n check: function (arg) { return Buffer.isBuffer(arg); },\n operator: 'Buffer.isBuffer'\n },\n array: {\n check: function (arg) { return Array.isArray(arg); },\n operator: 'Array.isArray'\n },\n stream: {\n check: function (arg) { return arg instanceof Stream; },\n operator: 'instanceof',\n actual: _getClass\n },\n date: {\n check: function (arg) { return arg instanceof Date; },\n operator: 'instanceof',\n actual: _getClass\n },\n regexp: {\n check: function (arg) { return arg instanceof RegExp; },\n operator: 'instanceof',\n actual: _getClass\n },\n uuid: {\n check: function (arg) {\n return typeof (arg) === 'string' && UUID_REGEXP.test(arg);\n },\n operator: 'isUUID'\n }\n};\n\nfunction _setExports(ndebug) {\n var keys = Object.keys(types);\n var out;\n\n /* re-export standard assert */\n if (process.env.NODE_NDEBUG) {\n out = noop;\n } else {\n out = function (arg, msg) {\n if (!arg) {\n _toss(msg, 'true', arg);\n }\n };\n }\n\n /* standard checks */\n keys.forEach(function (k) {\n if (ndebug) {\n out[k] = noop;\n return;\n }\n var type = types[k];\n out[k] = function (arg, msg) {\n if (!type.check(arg)) {\n _toss(msg, k, type.operator, arg, type.actual);\n }\n };\n });\n\n /* optional checks */\n keys.forEach(function (k) {\n var name = 'optional' + _capitalize(k);\n if (ndebug) {\n out[name] = noop;\n return;\n }\n var type = types[k];\n out[name] = function (arg, msg) {\n if (arg === undefined || arg === null) {\n return;\n }\n if (!type.check(arg)) {\n _toss(msg, k, type.operator, arg, type.actual);\n }\n };\n });\n\n /* arrayOf checks */\n keys.forEach(function (k) {\n var name = 'arrayOf' + _capitalize(k);\n if (ndebug) {\n out[name] = noop;\n return;\n }\n var type = types[k];\n var expected = '[' + k + ']';\n out[name] = function (arg, msg) {\n if (!Array.isArray(arg)) {\n _toss(msg, expected, type.operator, arg, type.actual);\n }\n var i;\n for (i = 0; i < arg.length; i++) {\n if (!type.check(arg[i])) {\n _toss(msg, expected, type.operator, arg, type.actual);\n }\n }\n };\n });\n\n /* optionalArrayOf checks */\n keys.forEach(function (k) {\n var name = 'optionalArrayOf' + _capitalize(k);\n if (ndebug) {\n out[name] = noop;\n return;\n }\n var type = types[k];\n var expected = '[' + k + ']';\n out[name] = function (arg, msg) {\n if (arg === undefined || arg === null) {\n return;\n }\n if (!Array.isArray(arg)) {\n _toss(msg, expected, type.operator, arg, type.actual);\n }\n var i;\n for (i = 0; i < arg.length; i++) {\n if (!type.check(arg[i])) {\n _toss(msg, expected, type.operator, arg, type.actual);\n }\n }\n };\n });\n\n /* re-export built-in assertions */\n Object.keys(assert).forEach(function (k) {\n if (k === 'AssertionError') {\n out[k] = assert[k];\n return;\n }\n if (ndebug) {\n out[k] = noop;\n return;\n }\n out[k] = assert[k];\n });\n\n /* export ourselves (for unit tests _only_) */\n out._setExports = _setExports;\n\n return out;\n}\n\nmodule.exports = _setExports(process.env.NODE_NDEBUG);\n","'use strict';\n\nfunction Queue(options) {\n if (!(this instanceof Queue)) {\n return new Queue(options);\n }\n\n options = options || {};\n this.concurrency = options.concurrency || Infinity;\n this.pending = 0;\n this.jobs = [];\n this.cbs = [];\n this._done = done.bind(this);\n}\n\nvar arrayAddMethods = [\n 'push',\n 'unshift',\n 'splice'\n];\n\narrayAddMethods.forEach(function(method) {\n Queue.prototype[method] = function() {\n var methodResult = Array.prototype[method].apply(this.jobs, arguments);\n this._run();\n return methodResult;\n };\n});\n\nObject.defineProperty(Queue.prototype, 'length', {\n get: function() {\n return this.pending + this.jobs.length;\n }\n});\n\nQueue.prototype._run = function() {\n if (this.pending === this.concurrency) {\n return;\n }\n if (this.jobs.length) {\n var job = this.jobs.shift();\n this.pending++;\n job(this._done);\n this._run();\n }\n\n if (this.pending === 0) {\n while (this.cbs.length !== 0) {\n var cb = this.cbs.pop();\n process.nextTick(cb);\n }\n }\n};\n\nQueue.prototype.onDone = function(cb) {\n if (typeof cb === 'function') {\n this.cbs.push(cb);\n this._run();\n }\n};\n\nfunction done() {\n this.pending--;\n this._run();\n}\n\nmodule.exports = Queue;\n","module.exports =\n{\n parallel : require('./parallel.js'),\n serial : require('./serial.js'),\n serialOrdered : require('./serialOrdered.js')\n};\n","// API\nmodule.exports = abort;\n\n/**\n * Aborts leftover active jobs\n *\n * @param {object} state - current state object\n */\nfunction abort(state)\n{\n Object.keys(state.jobs).forEach(clean.bind(state));\n\n // reset leftover jobs\n state.jobs = {};\n}\n\n/**\n * Cleans up leftover job by invoking abort function for the provided job id\n *\n * @this state\n * @param {string|number} key - job id to abort\n */\nfunction clean(key)\n{\n if (typeof this.jobs[key] == 'function')\n {\n this.jobs[key]();\n }\n}\n","var defer = require('./defer.js');\n\n// API\nmodule.exports = async;\n\n/**\n * Runs provided callback asynchronously\n * even if callback itself is not\n *\n * @param {function} callback - callback to invoke\n * @returns {function} - augmented callback\n */\nfunction async(callback)\n{\n var isAsync = false;\n\n // check if async happened\n defer(function() { isAsync = true; });\n\n return function async_callback(err, result)\n {\n if (isAsync)\n {\n callback(err, result);\n }\n else\n {\n defer(function nextTick_callback()\n {\n callback(err, result);\n });\n }\n };\n}\n","module.exports = defer;\n\n/**\n * Runs provided function on next iteration of the event loop\n *\n * @param {function} fn - function to run\n */\nfunction defer(fn)\n{\n var nextTick = typeof setImmediate == 'function'\n ? setImmediate\n : (\n typeof process == 'object' && typeof process.nextTick == 'function'\n ? process.nextTick\n : null\n );\n\n if (nextTick)\n {\n nextTick(fn);\n }\n else\n {\n setTimeout(fn, 0);\n }\n}\n","var async = require('./async.js')\n , abort = require('./abort.js')\n ;\n\n// API\nmodule.exports = iterate;\n\n/**\n * Iterates over each job object\n *\n * @param {array|object} list - array or object (named list) to iterate over\n * @param {function} iterator - iterator to run\n * @param {object} state - current job status\n * @param {function} callback - invoked when all elements processed\n */\nfunction iterate(list, iterator, state, callback)\n{\n // store current index\n var key = state['keyedList'] ? state['keyedList'][state.index] : state.index;\n\n state.jobs[key] = runJob(iterator, key, list[key], function(error, output)\n {\n // don't repeat yourself\n // skip secondary callbacks\n if (!(key in state.jobs))\n {\n return;\n }\n\n // clean up jobs\n delete state.jobs[key];\n\n if (error)\n {\n // don't process rest of the results\n // stop still active jobs\n // and reset the list\n abort(state);\n }\n else\n {\n state.results[key] = output;\n }\n\n // return salvaged results\n callback(error, state.results);\n });\n}\n\n/**\n * Runs iterator over provided job element\n *\n * @param {function} iterator - iterator to invoke\n * @param {string|number} key - key/index of the element in the list of jobs\n * @param {mixed} item - job description\n * @param {function} callback - invoked after iterator is done with the job\n * @returns {function|mixed} - job abort function or something else\n */\nfunction runJob(iterator, key, item, callback)\n{\n var aborter;\n\n // allow shortcut if iterator expects only two arguments\n if (iterator.length == 2)\n {\n aborter = iterator(item, async(callback));\n }\n // otherwise go with full three arguments\n else\n {\n aborter = iterator(item, key, async(callback));\n }\n\n return aborter;\n}\n","// API\nmodule.exports = state;\n\n/**\n * Creates initial state object\n * for iteration over list\n *\n * @param {array|object} list - list to iterate over\n * @param {function|null} sortMethod - function to use for keys sort,\n * or `null` to keep them as is\n * @returns {object} - initial state object\n */\nfunction state(list, sortMethod)\n{\n var isNamedList = !Array.isArray(list)\n , initState =\n {\n index : 0,\n keyedList: isNamedList || sortMethod ? Object.keys(list) : null,\n jobs : {},\n results : isNamedList ? {} : [],\n size : isNamedList ? Object.keys(list).length : list.length\n }\n ;\n\n if (sortMethod)\n {\n // sort array keys based on it's values\n // sort object's keys just on own merit\n initState.keyedList.sort(isNamedList ? sortMethod : function(a, b)\n {\n return sortMethod(list[a], list[b]);\n });\n }\n\n return initState;\n}\n","var abort = require('./abort.js')\n , async = require('./async.js')\n ;\n\n// API\nmodule.exports = terminator;\n\n/**\n * Terminates jobs in the attached state context\n *\n * @this AsyncKitState#\n * @param {function} callback - final callback to invoke after termination\n */\nfunction terminator(callback)\n{\n if (!Object.keys(this.jobs).length)\n {\n return;\n }\n\n // fast forward iteration index\n this.index = this.size;\n\n // abort jobs\n abort(this);\n\n // send back results we have so far\n async(callback)(null, this.results);\n}\n","var iterate = require('./lib/iterate.js')\n , initState = require('./lib/state.js')\n , terminator = require('./lib/terminator.js')\n ;\n\n// Public API\nmodule.exports = parallel;\n\n/**\n * Runs iterator over provided array elements in parallel\n *\n * @param {array|object} list - array or object (named list) to iterate over\n * @param {function} iterator - iterator to run\n * @param {function} callback - invoked when all elements processed\n * @returns {function} - jobs terminator\n */\nfunction parallel(list, iterator, callback)\n{\n var state = initState(list);\n\n while (state.index < (state['keyedList'] || list).length)\n {\n iterate(list, iterator, state, function(error, result)\n {\n if (error)\n {\n callback(error, result);\n return;\n }\n\n // looks like it's the last one\n if (Object.keys(state.jobs).length === 0)\n {\n callback(null, state.results);\n return;\n }\n });\n\n state.index++;\n }\n\n return terminator.bind(state, callback);\n}\n","var serialOrdered = require('./serialOrdered.js');\n\n// Public API\nmodule.exports = serial;\n\n/**\n * Runs iterator over provided array elements in series\n *\n * @param {array|object} list - array or object (named list) to iterate over\n * @param {function} iterator - iterator to run\n * @param {function} callback - invoked when all elements processed\n * @returns {function} - jobs terminator\n */\nfunction serial(list, iterator, callback)\n{\n return serialOrdered(list, iterator, null, callback);\n}\n","var iterate = require('./lib/iterate.js')\n , initState = require('./lib/state.js')\n , terminator = require('./lib/terminator.js')\n ;\n\n// Public API\nmodule.exports = serialOrdered;\n// sorting helpers\nmodule.exports.ascending = ascending;\nmodule.exports.descending = descending;\n\n/**\n * Runs iterator over provided sorted array elements in series\n *\n * @param {array|object} list - array or object (named list) to iterate over\n * @param {function} iterator - iterator to run\n * @param {function} sortMethod - custom sort function\n * @param {function} callback - invoked when all elements processed\n * @returns {function} - jobs terminator\n */\nfunction serialOrdered(list, iterator, sortMethod, callback)\n{\n var state = initState(list, sortMethod);\n\n iterate(list, iterator, state, function iteratorHandler(error, result)\n {\n if (error)\n {\n callback(error, result);\n return;\n }\n\n state.index++;\n\n // are we there yet?\n if (state.index < (state['keyedList'] || list).length)\n {\n iterate(list, iterator, state, iteratorHandler);\n return;\n }\n\n // done here\n callback(null, state.results);\n });\n\n return terminator.bind(state, callback);\n}\n\n/*\n * -- Sort methods\n */\n\n/**\n * sort helper to sort array elements in ascending order\n *\n * @param {mixed} a - an item to compare\n * @param {mixed} b - an item to compare\n * @returns {number} - comparison result\n */\nfunction ascending(a, b)\n{\n return a < b ? -1 : a > b ? 1 : 0;\n}\n\n/**\n * sort helper to sort array elements in descending order\n *\n * @param {mixed} a - an item to compare\n * @param {mixed} b - an item to compare\n * @returns {number} - comparison result\n */\nfunction descending(a, b)\n{\n return -1 * ascending(a, b);\n}\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['accessanalyzer'] = {};\nAWS.AccessAnalyzer = Service.defineService('accessanalyzer', ['2019-11-01']);\nObject.defineProperty(apiLoader.services['accessanalyzer'], '2019-11-01', {\n get: function get() {\n var model = require('../apis/accessanalyzer-2019-11-01.min.json');\n model.paginators = require('../apis/accessanalyzer-2019-11-01.paginators.json').pagination;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.AccessAnalyzer;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['acm'] = {};\nAWS.ACM = Service.defineService('acm', ['2015-12-08']);\nObject.defineProperty(apiLoader.services['acm'], '2015-12-08', {\n get: function get() {\n var model = require('../apis/acm-2015-12-08.min.json');\n model.paginators = require('../apis/acm-2015-12-08.paginators.json').pagination;\n model.waiters = require('../apis/acm-2015-12-08.waiters2.json').waiters;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.ACM;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['acmpca'] = {};\nAWS.ACMPCA = Service.defineService('acmpca', ['2017-08-22']);\nObject.defineProperty(apiLoader.services['acmpca'], '2017-08-22', {\n get: function get() {\n var model = require('../apis/acm-pca-2017-08-22.min.json');\n model.paginators = require('../apis/acm-pca-2017-08-22.paginators.json').pagination;\n model.waiters = require('../apis/acm-pca-2017-08-22.waiters2.json').waiters;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.ACMPCA;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['alexaforbusiness'] = {};\nAWS.AlexaForBusiness = Service.defineService('alexaforbusiness', ['2017-11-09']);\nObject.defineProperty(apiLoader.services['alexaforbusiness'], '2017-11-09', {\n get: function get() {\n var model = require('../apis/alexaforbusiness-2017-11-09.min.json');\n model.paginators = require('../apis/alexaforbusiness-2017-11-09.paginators.json').pagination;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.AlexaForBusiness;\n","require('../lib/node_loader');\nmodule.exports = {\n ACM: require('./acm'),\n APIGateway: require('./apigateway'),\n ApplicationAutoScaling: require('./applicationautoscaling'),\n AppStream: require('./appstream'),\n AutoScaling: require('./autoscaling'),\n Batch: require('./batch'),\n Budgets: require('./budgets'),\n CloudDirectory: require('./clouddirectory'),\n CloudFormation: require('./cloudformation'),\n CloudFront: require('./cloudfront'),\n CloudHSM: require('./cloudhsm'),\n CloudSearch: require('./cloudsearch'),\n CloudSearchDomain: require('./cloudsearchdomain'),\n CloudTrail: require('./cloudtrail'),\n CloudWatch: require('./cloudwatch'),\n CloudWatchEvents: require('./cloudwatchevents'),\n CloudWatchLogs: require('./cloudwatchlogs'),\n CodeBuild: require('./codebuild'),\n CodeCommit: require('./codecommit'),\n CodeDeploy: require('./codedeploy'),\n CodePipeline: require('./codepipeline'),\n CognitoIdentity: require('./cognitoidentity'),\n CognitoIdentityServiceProvider: require('./cognitoidentityserviceprovider'),\n CognitoSync: require('./cognitosync'),\n ConfigService: require('./configservice'),\n CUR: require('./cur'),\n DataPipeline: require('./datapipeline'),\n DeviceFarm: require('./devicefarm'),\n DirectConnect: require('./directconnect'),\n DirectoryService: require('./directoryservice'),\n Discovery: require('./discovery'),\n DMS: require('./dms'),\n DynamoDB: require('./dynamodb'),\n DynamoDBStreams: require('./dynamodbstreams'),\n EC2: require('./ec2'),\n ECR: require('./ecr'),\n ECS: require('./ecs'),\n EFS: require('./efs'),\n ElastiCache: require('./elasticache'),\n ElasticBeanstalk: require('./elasticbeanstalk'),\n ELB: require('./elb'),\n ELBv2: require('./elbv2'),\n EMR: require('./emr'),\n ES: require('./es'),\n ElasticTranscoder: require('./elastictranscoder'),\n Firehose: require('./firehose'),\n GameLift: require('./gamelift'),\n Glacier: require('./glacier'),\n Health: require('./health'),\n IAM: require('./iam'),\n ImportExport: require('./importexport'),\n Inspector: require('./inspector'),\n Iot: require('./iot'),\n IotData: require('./iotdata'),\n Kinesis: require('./kinesis'),\n KinesisAnalytics: require('./kinesisanalytics'),\n KMS: require('./kms'),\n Lambda: require('./lambda'),\n LexRuntime: require('./lexruntime'),\n Lightsail: require('./lightsail'),\n MachineLearning: require('./machinelearning'),\n MarketplaceCommerceAnalytics: require('./marketplacecommerceanalytics'),\n MarketplaceMetering: require('./marketplacemetering'),\n MTurk: require('./mturk'),\n MobileAnalytics: require('./mobileanalytics'),\n OpsWorks: require('./opsworks'),\n OpsWorksCM: require('./opsworkscm'),\n Organizations: require('./organizations'),\n Pinpoint: require('./pinpoint'),\n Polly: require('./polly'),\n RDS: require('./rds'),\n Redshift: require('./redshift'),\n Rekognition: require('./rekognition'),\n ResourceGroupsTaggingAPI: require('./resourcegroupstaggingapi'),\n Route53: require('./route53'),\n Route53Domains: require('./route53domains'),\n S3: require('./s3'),\n S3Control: require('./s3control'),\n ServiceCatalog: require('./servicecatalog'),\n SES: require('./ses'),\n Shield: require('./shield'),\n SimpleDB: require('./simpledb'),\n SMS: require('./sms'),\n Snowball: require('./snowball'),\n SNS: require('./sns'),\n SQS: require('./sqs'),\n SSM: require('./ssm'),\n StorageGateway: require('./storagegateway'),\n StepFunctions: require('./stepfunctions'),\n STS: require('./sts'),\n Support: require('./support'),\n SWF: require('./swf'),\n XRay: require('./xray'),\n WAF: require('./waf'),\n WAFRegional: require('./wafregional'),\n WorkDocs: require('./workdocs'),\n WorkSpaces: require('./workspaces'),\n CodeStar: require('./codestar'),\n LexModelBuildingService: require('./lexmodelbuildingservice'),\n MarketplaceEntitlementService: require('./marketplaceentitlementservice'),\n Athena: require('./athena'),\n Greengrass: require('./greengrass'),\n DAX: require('./dax'),\n MigrationHub: require('./migrationhub'),\n CloudHSMV2: require('./cloudhsmv2'),\n Glue: require('./glue'),\n Mobile: require('./mobile'),\n Pricing: require('./pricing'),\n CostExplorer: require('./costexplorer'),\n MediaConvert: require('./mediaconvert'),\n MediaLive: require('./medialive'),\n MediaPackage: require('./mediapackage'),\n MediaStore: require('./mediastore'),\n MediaStoreData: require('./mediastoredata'),\n AppSync: require('./appsync'),\n GuardDuty: require('./guardduty'),\n MQ: require('./mq'),\n Comprehend: require('./comprehend'),\n IoTJobsDataPlane: require('./iotjobsdataplane'),\n KinesisVideoArchivedMedia: require('./kinesisvideoarchivedmedia'),\n KinesisVideoMedia: require('./kinesisvideomedia'),\n KinesisVideo: require('./kinesisvideo'),\n SageMakerRuntime: require('./sagemakerruntime'),\n SageMaker: require('./sagemaker'),\n Translate: require('./translate'),\n ResourceGroups: require('./resourcegroups'),\n AlexaForBusiness: require('./alexaforbusiness'),\n Cloud9: require('./cloud9'),\n ServerlessApplicationRepository: require('./serverlessapplicationrepository'),\n ServiceDiscovery: require('./servicediscovery'),\n WorkMail: require('./workmail'),\n AutoScalingPlans: require('./autoscalingplans'),\n TranscribeService: require('./transcribeservice'),\n Connect: require('./connect'),\n ACMPCA: require('./acmpca'),\n FMS: require('./fms'),\n SecretsManager: require('./secretsmanager'),\n IoTAnalytics: require('./iotanalytics'),\n IoT1ClickDevicesService: require('./iot1clickdevicesservice'),\n IoT1ClickProjects: require('./iot1clickprojects'),\n PI: require('./pi'),\n Neptune: require('./neptune'),\n MediaTailor: require('./mediatailor'),\n EKS: require('./eks'),\n Macie: require('./macie'),\n DLM: require('./dlm'),\n Signer: require('./signer'),\n Chime: require('./chime'),\n PinpointEmail: require('./pinpointemail'),\n RAM: require('./ram'),\n Route53Resolver: require('./route53resolver'),\n PinpointSMSVoice: require('./pinpointsmsvoice'),\n QuickSight: require('./quicksight'),\n RDSDataService: require('./rdsdataservice'),\n Amplify: require('./amplify'),\n DataSync: require('./datasync'),\n RoboMaker: require('./robomaker'),\n Transfer: require('./transfer'),\n GlobalAccelerator: require('./globalaccelerator'),\n ComprehendMedical: require('./comprehendmedical'),\n KinesisAnalyticsV2: require('./kinesisanalyticsv2'),\n MediaConnect: require('./mediaconnect'),\n FSx: require('./fsx'),\n SecurityHub: require('./securityhub'),\n AppMesh: require('./appmesh'),\n LicenseManager: require('./licensemanager'),\n Kafka: require('./kafka'),\n ApiGatewayManagementApi: require('./apigatewaymanagementapi'),\n ApiGatewayV2: require('./apigatewayv2'),\n DocDB: require('./docdb'),\n Backup: require('./backup'),\n WorkLink: require('./worklink'),\n Textract: require('./textract'),\n ManagedBlockchain: require('./managedblockchain'),\n MediaPackageVod: require('./mediapackagevod'),\n GroundStation: require('./groundstation'),\n IoTThingsGraph: require('./iotthingsgraph'),\n IoTEvents: require('./iotevents'),\n IoTEventsData: require('./ioteventsdata'),\n Personalize: require('./personalize'),\n PersonalizeEvents: require('./personalizeevents'),\n PersonalizeRuntime: require('./personalizeruntime'),\n ApplicationInsights: require('./applicationinsights'),\n ServiceQuotas: require('./servicequotas'),\n EC2InstanceConnect: require('./ec2instanceconnect'),\n EventBridge: require('./eventbridge'),\n LakeFormation: require('./lakeformation'),\n ForecastService: require('./forecastservice'),\n ForecastQueryService: require('./forecastqueryservice'),\n QLDB: require('./qldb'),\n QLDBSession: require('./qldbsession'),\n WorkMailMessageFlow: require('./workmailmessageflow'),\n CodeStarNotifications: require('./codestarnotifications'),\n SavingsPlans: require('./savingsplans'),\n SSO: require('./sso'),\n SSOOIDC: require('./ssooidc'),\n MarketplaceCatalog: require('./marketplacecatalog'),\n DataExchange: require('./dataexchange'),\n SESV2: require('./sesv2'),\n MigrationHubConfig: require('./migrationhubconfig'),\n ConnectParticipant: require('./connectparticipant'),\n AppConfig: require('./appconfig'),\n IoTSecureTunneling: require('./iotsecuretunneling'),\n WAFV2: require('./wafv2'),\n ElasticInference: require('./elasticinference'),\n Imagebuilder: require('./imagebuilder'),\n Schemas: require('./schemas'),\n AccessAnalyzer: require('./accessanalyzer'),\n CodeGuruReviewer: require('./codegurureviewer'),\n CodeGuruProfiler: require('./codeguruprofiler'),\n ComputeOptimizer: require('./computeoptimizer'),\n FraudDetector: require('./frauddetector'),\n Kendra: require('./kendra'),\n NetworkManager: require('./networkmanager'),\n Outposts: require('./outposts'),\n AugmentedAIRuntime: require('./augmentedairuntime'),\n EBS: require('./ebs'),\n KinesisVideoSignalingChannels: require('./kinesisvideosignalingchannels'),\n Detective: require('./detective'),\n CodeStarconnections: require('./codestarconnections'),\n Synthetics: require('./synthetics'),\n IoTSiteWise: require('./iotsitewise'),\n Macie2: require('./macie2'),\n CodeArtifact: require('./codeartifact'),\n Honeycode: require('./honeycode'),\n IVS: require('./ivs'),\n Braket: require('./braket'),\n IdentityStore: require('./identitystore'),\n Appflow: require('./appflow'),\n RedshiftData: require('./redshiftdata'),\n SSOAdmin: require('./ssoadmin'),\n TimestreamQuery: require('./timestreamquery'),\n TimestreamWrite: require('./timestreamwrite'),\n S3Outposts: require('./s3outposts'),\n DataBrew: require('./databrew'),\n ServiceCatalogAppRegistry: require('./servicecatalogappregistry'),\n NetworkFirewall: require('./networkfirewall'),\n MWAA: require('./mwaa'),\n AmplifyBackend: require('./amplifybackend'),\n AppIntegrations: require('./appintegrations'),\n ConnectContactLens: require('./connectcontactlens'),\n DevOpsGuru: require('./devopsguru'),\n ECRPUBLIC: require('./ecrpublic'),\n LookoutVision: require('./lookoutvision'),\n SageMakerFeatureStoreRuntime: require('./sagemakerfeaturestoreruntime'),\n CustomerProfiles: require('./customerprofiles'),\n AuditManager: require('./auditmanager'),\n EMRcontainers: require('./emrcontainers'),\n HealthLake: require('./healthlake'),\n SagemakerEdge: require('./sagemakeredge'),\n Amp: require('./amp'),\n GreengrassV2: require('./greengrassv2'),\n IotDeviceAdvisor: require('./iotdeviceadvisor'),\n IoTFleetHub: require('./iotfleethub'),\n IoTWireless: require('./iotwireless'),\n Location: require('./location'),\n WellArchitected: require('./wellarchitected'),\n LexModelsV2: require('./lexmodelsv2'),\n LexRuntimeV2: require('./lexruntimev2'),\n Fis: require('./fis'),\n LookoutMetrics: require('./lookoutmetrics'),\n Mgn: require('./mgn'),\n LookoutEquipment: require('./lookoutequipment')\n};","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['amp'] = {};\nAWS.Amp = Service.defineService('amp', ['2020-08-01']);\nObject.defineProperty(apiLoader.services['amp'], '2020-08-01', {\n get: function get() {\n var model = require('../apis/amp-2020-08-01.min.json');\n model.paginators = require('../apis/amp-2020-08-01.paginators.json').pagination;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.Amp;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['amplify'] = {};\nAWS.Amplify = Service.defineService('amplify', ['2017-07-25']);\nObject.defineProperty(apiLoader.services['amplify'], '2017-07-25', {\n get: function get() {\n var model = require('../apis/amplify-2017-07-25.min.json');\n model.paginators = require('../apis/amplify-2017-07-25.paginators.json').pagination;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.Amplify;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['amplifybackend'] = {};\nAWS.AmplifyBackend = Service.defineService('amplifybackend', ['2020-08-11']);\nObject.defineProperty(apiLoader.services['amplifybackend'], '2020-08-11', {\n get: function get() {\n var model = require('../apis/amplifybackend-2020-08-11.min.json');\n model.paginators = require('../apis/amplifybackend-2020-08-11.paginators.json').pagination;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.AmplifyBackend;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['apigateway'] = {};\nAWS.APIGateway = Service.defineService('apigateway', ['2015-07-09']);\nrequire('../lib/services/apigateway');\nObject.defineProperty(apiLoader.services['apigateway'], '2015-07-09', {\n get: function get() {\n var model = require('../apis/apigateway-2015-07-09.min.json');\n model.paginators = require('../apis/apigateway-2015-07-09.paginators.json').pagination;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.APIGateway;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['apigatewaymanagementapi'] = {};\nAWS.ApiGatewayManagementApi = Service.defineService('apigatewaymanagementapi', ['2018-11-29']);\nObject.defineProperty(apiLoader.services['apigatewaymanagementapi'], '2018-11-29', {\n get: function get() {\n var model = require('../apis/apigatewaymanagementapi-2018-11-29.min.json');\n model.paginators = require('../apis/apigatewaymanagementapi-2018-11-29.paginators.json').pagination;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.ApiGatewayManagementApi;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['apigatewayv2'] = {};\nAWS.ApiGatewayV2 = Service.defineService('apigatewayv2', ['2018-11-29']);\nObject.defineProperty(apiLoader.services['apigatewayv2'], '2018-11-29', {\n get: function get() {\n var model = require('../apis/apigatewayv2-2018-11-29.min.json');\n model.paginators = require('../apis/apigatewayv2-2018-11-29.paginators.json').pagination;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.ApiGatewayV2;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['appconfig'] = {};\nAWS.AppConfig = Service.defineService('appconfig', ['2019-10-09']);\nObject.defineProperty(apiLoader.services['appconfig'], '2019-10-09', {\n get: function get() {\n var model = require('../apis/appconfig-2019-10-09.min.json');\n model.paginators = require('../apis/appconfig-2019-10-09.paginators.json').pagination;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.AppConfig;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['appflow'] = {};\nAWS.Appflow = Service.defineService('appflow', ['2020-08-23']);\nObject.defineProperty(apiLoader.services['appflow'], '2020-08-23', {\n get: function get() {\n var model = require('../apis/appflow-2020-08-23.min.json');\n model.paginators = require('../apis/appflow-2020-08-23.paginators.json').pagination;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.Appflow;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['appintegrations'] = {};\nAWS.AppIntegrations = Service.defineService('appintegrations', ['2020-07-29']);\nObject.defineProperty(apiLoader.services['appintegrations'], '2020-07-29', {\n get: function get() {\n var model = require('../apis/appintegrations-2020-07-29.min.json');\n model.paginators = require('../apis/appintegrations-2020-07-29.paginators.json').pagination;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.AppIntegrations;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['applicationautoscaling'] = {};\nAWS.ApplicationAutoScaling = Service.defineService('applicationautoscaling', ['2016-02-06']);\nObject.defineProperty(apiLoader.services['applicationautoscaling'], '2016-02-06', {\n get: function get() {\n var model = require('../apis/application-autoscaling-2016-02-06.min.json');\n model.paginators = require('../apis/application-autoscaling-2016-02-06.paginators.json').pagination;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.ApplicationAutoScaling;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['applicationinsights'] = {};\nAWS.ApplicationInsights = Service.defineService('applicationinsights', ['2018-11-25']);\nObject.defineProperty(apiLoader.services['applicationinsights'], '2018-11-25', {\n get: function get() {\n var model = require('../apis/application-insights-2018-11-25.min.json');\n model.paginators = require('../apis/application-insights-2018-11-25.paginators.json').pagination;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.ApplicationInsights;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['appmesh'] = {};\nAWS.AppMesh = Service.defineService('appmesh', ['2018-10-01', '2018-10-01*', '2019-01-25']);\nObject.defineProperty(apiLoader.services['appmesh'], '2018-10-01', {\n get: function get() {\n var model = require('../apis/appmesh-2018-10-01.min.json');\n model.paginators = require('../apis/appmesh-2018-10-01.paginators.json').pagination;\n return model;\n },\n enumerable: true,\n configurable: true\n});\nObject.defineProperty(apiLoader.services['appmesh'], '2019-01-25', {\n get: function get() {\n var model = require('../apis/appmesh-2019-01-25.min.json');\n model.paginators = require('../apis/appmesh-2019-01-25.paginators.json').pagination;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.AppMesh;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['appstream'] = {};\nAWS.AppStream = Service.defineService('appstream', ['2016-12-01']);\nObject.defineProperty(apiLoader.services['appstream'], '2016-12-01', {\n get: function get() {\n var model = require('../apis/appstream-2016-12-01.min.json');\n model.paginators = require('../apis/appstream-2016-12-01.paginators.json').pagination;\n model.waiters = require('../apis/appstream-2016-12-01.waiters2.json').waiters;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.AppStream;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['appsync'] = {};\nAWS.AppSync = Service.defineService('appsync', ['2017-07-25']);\nObject.defineProperty(apiLoader.services['appsync'], '2017-07-25', {\n get: function get() {\n var model = require('../apis/appsync-2017-07-25.min.json');\n model.paginators = require('../apis/appsync-2017-07-25.paginators.json').pagination;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.AppSync;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['athena'] = {};\nAWS.Athena = Service.defineService('athena', ['2017-05-18']);\nObject.defineProperty(apiLoader.services['athena'], '2017-05-18', {\n get: function get() {\n var model = require('../apis/athena-2017-05-18.min.json');\n model.paginators = require('../apis/athena-2017-05-18.paginators.json').pagination;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.Athena;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['auditmanager'] = {};\nAWS.AuditManager = Service.defineService('auditmanager', ['2017-07-25']);\nObject.defineProperty(apiLoader.services['auditmanager'], '2017-07-25', {\n get: function get() {\n var model = require('../apis/auditmanager-2017-07-25.min.json');\n model.paginators = require('../apis/auditmanager-2017-07-25.paginators.json').pagination;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.AuditManager;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['augmentedairuntime'] = {};\nAWS.AugmentedAIRuntime = Service.defineService('augmentedairuntime', ['2019-11-07']);\nObject.defineProperty(apiLoader.services['augmentedairuntime'], '2019-11-07', {\n get: function get() {\n var model = require('../apis/sagemaker-a2i-runtime-2019-11-07.min.json');\n model.paginators = require('../apis/sagemaker-a2i-runtime-2019-11-07.paginators.json').pagination;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.AugmentedAIRuntime;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['autoscaling'] = {};\nAWS.AutoScaling = Service.defineService('autoscaling', ['2011-01-01']);\nObject.defineProperty(apiLoader.services['autoscaling'], '2011-01-01', {\n get: function get() {\n var model = require('../apis/autoscaling-2011-01-01.min.json');\n model.paginators = require('../apis/autoscaling-2011-01-01.paginators.json').pagination;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.AutoScaling;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['autoscalingplans'] = {};\nAWS.AutoScalingPlans = Service.defineService('autoscalingplans', ['2018-01-06']);\nObject.defineProperty(apiLoader.services['autoscalingplans'], '2018-01-06', {\n get: function get() {\n var model = require('../apis/autoscaling-plans-2018-01-06.min.json');\n model.paginators = require('../apis/autoscaling-plans-2018-01-06.paginators.json').pagination;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.AutoScalingPlans;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['backup'] = {};\nAWS.Backup = Service.defineService('backup', ['2018-11-15']);\nObject.defineProperty(apiLoader.services['backup'], '2018-11-15', {\n get: function get() {\n var model = require('../apis/backup-2018-11-15.min.json');\n model.paginators = require('../apis/backup-2018-11-15.paginators.json').pagination;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.Backup;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['batch'] = {};\nAWS.Batch = Service.defineService('batch', ['2016-08-10']);\nObject.defineProperty(apiLoader.services['batch'], '2016-08-10', {\n get: function get() {\n var model = require('../apis/batch-2016-08-10.min.json');\n model.paginators = require('../apis/batch-2016-08-10.paginators.json').pagination;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.Batch;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['braket'] = {};\nAWS.Braket = Service.defineService('braket', ['2019-09-01']);\nObject.defineProperty(apiLoader.services['braket'], '2019-09-01', {\n get: function get() {\n var model = require('../apis/braket-2019-09-01.min.json');\n model.paginators = require('../apis/braket-2019-09-01.paginators.json').pagination;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.Braket;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['budgets'] = {};\nAWS.Budgets = Service.defineService('budgets', ['2016-10-20']);\nObject.defineProperty(apiLoader.services['budgets'], '2016-10-20', {\n get: function get() {\n var model = require('../apis/budgets-2016-10-20.min.json');\n model.paginators = require('../apis/budgets-2016-10-20.paginators.json').pagination;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.Budgets;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['chime'] = {};\nAWS.Chime = Service.defineService('chime', ['2018-05-01']);\nObject.defineProperty(apiLoader.services['chime'], '2018-05-01', {\n get: function get() {\n var model = require('../apis/chime-2018-05-01.min.json');\n model.paginators = require('../apis/chime-2018-05-01.paginators.json').pagination;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.Chime;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['cloud9'] = {};\nAWS.Cloud9 = Service.defineService('cloud9', ['2017-09-23']);\nObject.defineProperty(apiLoader.services['cloud9'], '2017-09-23', {\n get: function get() {\n var model = require('../apis/cloud9-2017-09-23.min.json');\n model.paginators = require('../apis/cloud9-2017-09-23.paginators.json').pagination;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.Cloud9;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['clouddirectory'] = {};\nAWS.CloudDirectory = Service.defineService('clouddirectory', ['2016-05-10', '2016-05-10*', '2017-01-11']);\nObject.defineProperty(apiLoader.services['clouddirectory'], '2016-05-10', {\n get: function get() {\n var model = require('../apis/clouddirectory-2016-05-10.min.json');\n model.paginators = require('../apis/clouddirectory-2016-05-10.paginators.json').pagination;\n return model;\n },\n enumerable: true,\n configurable: true\n});\nObject.defineProperty(apiLoader.services['clouddirectory'], '2017-01-11', {\n get: function get() {\n var model = require('../apis/clouddirectory-2017-01-11.min.json');\n model.paginators = require('../apis/clouddirectory-2017-01-11.paginators.json').pagination;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.CloudDirectory;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['cloudformation'] = {};\nAWS.CloudFormation = Service.defineService('cloudformation', ['2010-05-15']);\nObject.defineProperty(apiLoader.services['cloudformation'], '2010-05-15', {\n get: function get() {\n var model = require('../apis/cloudformation-2010-05-15.min.json');\n model.paginators = require('../apis/cloudformation-2010-05-15.paginators.json').pagination;\n model.waiters = require('../apis/cloudformation-2010-05-15.waiters2.json').waiters;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.CloudFormation;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['cloudfront'] = {};\nAWS.CloudFront = Service.defineService('cloudfront', ['2013-05-12*', '2013-11-11*', '2014-05-31*', '2014-10-21*', '2014-11-06*', '2015-04-17*', '2015-07-27*', '2015-09-17*', '2016-01-13*', '2016-01-28*', '2016-08-01*', '2016-08-20*', '2016-09-07*', '2016-09-29*', '2016-11-25', '2016-11-25*', '2017-03-25', '2017-03-25*', '2017-10-30', '2017-10-30*', '2018-06-18', '2018-06-18*', '2018-11-05', '2018-11-05*', '2019-03-26', '2019-03-26*', '2020-05-31']);\nrequire('../lib/services/cloudfront');\nObject.defineProperty(apiLoader.services['cloudfront'], '2016-11-25', {\n get: function get() {\n var model = require('../apis/cloudfront-2016-11-25.min.json');\n model.paginators = require('../apis/cloudfront-2016-11-25.paginators.json').pagination;\n model.waiters = require('../apis/cloudfront-2016-11-25.waiters2.json').waiters;\n return model;\n },\n enumerable: true,\n configurable: true\n});\nObject.defineProperty(apiLoader.services['cloudfront'], '2017-03-25', {\n get: function get() {\n var model = require('../apis/cloudfront-2017-03-25.min.json');\n model.paginators = require('../apis/cloudfront-2017-03-25.paginators.json').pagination;\n model.waiters = require('../apis/cloudfront-2017-03-25.waiters2.json').waiters;\n return model;\n },\n enumerable: true,\n configurable: true\n});\nObject.defineProperty(apiLoader.services['cloudfront'], '2017-10-30', {\n get: function get() {\n var model = require('../apis/cloudfront-2017-10-30.min.json');\n model.paginators = require('../apis/cloudfront-2017-10-30.paginators.json').pagination;\n model.waiters = require('../apis/cloudfront-2017-10-30.waiters2.json').waiters;\n return model;\n },\n enumerable: true,\n configurable: true\n});\nObject.defineProperty(apiLoader.services['cloudfront'], '2018-06-18', {\n get: function get() {\n var model = require('../apis/cloudfront-2018-06-18.min.json');\n model.paginators = require('../apis/cloudfront-2018-06-18.paginators.json').pagination;\n model.waiters = require('../apis/cloudfront-2018-06-18.waiters2.json').waiters;\n return model;\n },\n enumerable: true,\n configurable: true\n});\nObject.defineProperty(apiLoader.services['cloudfront'], '2018-11-05', {\n get: function get() {\n var model = require('../apis/cloudfront-2018-11-05.min.json');\n model.paginators = require('../apis/cloudfront-2018-11-05.paginators.json').pagination;\n model.waiters = require('../apis/cloudfront-2018-11-05.waiters2.json').waiters;\n return model;\n },\n enumerable: true,\n configurable: true\n});\nObject.defineProperty(apiLoader.services['cloudfront'], '2019-03-26', {\n get: function get() {\n var model = require('../apis/cloudfront-2019-03-26.min.json');\n model.paginators = require('../apis/cloudfront-2019-03-26.paginators.json').pagination;\n model.waiters = require('../apis/cloudfront-2019-03-26.waiters2.json').waiters;\n return model;\n },\n enumerable: true,\n configurable: true\n});\nObject.defineProperty(apiLoader.services['cloudfront'], '2020-05-31', {\n get: function get() {\n var model = require('../apis/cloudfront-2020-05-31.min.json');\n model.paginators = require('../apis/cloudfront-2020-05-31.paginators.json').pagination;\n model.waiters = require('../apis/cloudfront-2020-05-31.waiters2.json').waiters;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.CloudFront;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['cloudhsm'] = {};\nAWS.CloudHSM = Service.defineService('cloudhsm', ['2014-05-30']);\nObject.defineProperty(apiLoader.services['cloudhsm'], '2014-05-30', {\n get: function get() {\n var model = require('../apis/cloudhsm-2014-05-30.min.json');\n model.paginators = require('../apis/cloudhsm-2014-05-30.paginators.json').pagination;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.CloudHSM;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['cloudhsmv2'] = {};\nAWS.CloudHSMV2 = Service.defineService('cloudhsmv2', ['2017-04-28']);\nObject.defineProperty(apiLoader.services['cloudhsmv2'], '2017-04-28', {\n get: function get() {\n var model = require('../apis/cloudhsmv2-2017-04-28.min.json');\n model.paginators = require('../apis/cloudhsmv2-2017-04-28.paginators.json').pagination;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.CloudHSMV2;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['cloudsearch'] = {};\nAWS.CloudSearch = Service.defineService('cloudsearch', ['2011-02-01', '2013-01-01']);\nObject.defineProperty(apiLoader.services['cloudsearch'], '2011-02-01', {\n get: function get() {\n var model = require('../apis/cloudsearch-2011-02-01.min.json');\n model.paginators = require('../apis/cloudsearch-2011-02-01.paginators.json').pagination;\n return model;\n },\n enumerable: true,\n configurable: true\n});\nObject.defineProperty(apiLoader.services['cloudsearch'], '2013-01-01', {\n get: function get() {\n var model = require('../apis/cloudsearch-2013-01-01.min.json');\n model.paginators = require('../apis/cloudsearch-2013-01-01.paginators.json').pagination;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.CloudSearch;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['cloudsearchdomain'] = {};\nAWS.CloudSearchDomain = Service.defineService('cloudsearchdomain', ['2013-01-01']);\nrequire('../lib/services/cloudsearchdomain');\nObject.defineProperty(apiLoader.services['cloudsearchdomain'], '2013-01-01', {\n get: function get() {\n var model = require('../apis/cloudsearchdomain-2013-01-01.min.json');\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.CloudSearchDomain;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['cloudtrail'] = {};\nAWS.CloudTrail = Service.defineService('cloudtrail', ['2013-11-01']);\nObject.defineProperty(apiLoader.services['cloudtrail'], '2013-11-01', {\n get: function get() {\n var model = require('../apis/cloudtrail-2013-11-01.min.json');\n model.paginators = require('../apis/cloudtrail-2013-11-01.paginators.json').pagination;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.CloudTrail;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['cloudwatch'] = {};\nAWS.CloudWatch = Service.defineService('cloudwatch', ['2010-08-01']);\nObject.defineProperty(apiLoader.services['cloudwatch'], '2010-08-01', {\n get: function get() {\n var model = require('../apis/monitoring-2010-08-01.min.json');\n model.paginators = require('../apis/monitoring-2010-08-01.paginators.json').pagination;\n model.waiters = require('../apis/monitoring-2010-08-01.waiters2.json').waiters;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.CloudWatch;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['cloudwatchevents'] = {};\nAWS.CloudWatchEvents = Service.defineService('cloudwatchevents', ['2014-02-03*', '2015-10-07']);\nObject.defineProperty(apiLoader.services['cloudwatchevents'], '2015-10-07', {\n get: function get() {\n var model = require('../apis/events-2015-10-07.min.json');\n model.paginators = require('../apis/events-2015-10-07.paginators.json').pagination;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.CloudWatchEvents;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['cloudwatchlogs'] = {};\nAWS.CloudWatchLogs = Service.defineService('cloudwatchlogs', ['2014-03-28']);\nObject.defineProperty(apiLoader.services['cloudwatchlogs'], '2014-03-28', {\n get: function get() {\n var model = require('../apis/logs-2014-03-28.min.json');\n model.paginators = require('../apis/logs-2014-03-28.paginators.json').pagination;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.CloudWatchLogs;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['codeartifact'] = {};\nAWS.CodeArtifact = Service.defineService('codeartifact', ['2018-09-22']);\nObject.defineProperty(apiLoader.services['codeartifact'], '2018-09-22', {\n get: function get() {\n var model = require('../apis/codeartifact-2018-09-22.min.json');\n model.paginators = require('../apis/codeartifact-2018-09-22.paginators.json').pagination;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.CodeArtifact;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['codebuild'] = {};\nAWS.CodeBuild = Service.defineService('codebuild', ['2016-10-06']);\nObject.defineProperty(apiLoader.services['codebuild'], '2016-10-06', {\n get: function get() {\n var model = require('../apis/codebuild-2016-10-06.min.json');\n model.paginators = require('../apis/codebuild-2016-10-06.paginators.json').pagination;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.CodeBuild;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['codecommit'] = {};\nAWS.CodeCommit = Service.defineService('codecommit', ['2015-04-13']);\nObject.defineProperty(apiLoader.services['codecommit'], '2015-04-13', {\n get: function get() {\n var model = require('../apis/codecommit-2015-04-13.min.json');\n model.paginators = require('../apis/codecommit-2015-04-13.paginators.json').pagination;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.CodeCommit;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['codedeploy'] = {};\nAWS.CodeDeploy = Service.defineService('codedeploy', ['2014-10-06']);\nObject.defineProperty(apiLoader.services['codedeploy'], '2014-10-06', {\n get: function get() {\n var model = require('../apis/codedeploy-2014-10-06.min.json');\n model.paginators = require('../apis/codedeploy-2014-10-06.paginators.json').pagination;\n model.waiters = require('../apis/codedeploy-2014-10-06.waiters2.json').waiters;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.CodeDeploy;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['codeguruprofiler'] = {};\nAWS.CodeGuruProfiler = Service.defineService('codeguruprofiler', ['2019-07-18']);\nObject.defineProperty(apiLoader.services['codeguruprofiler'], '2019-07-18', {\n get: function get() {\n var model = require('../apis/codeguruprofiler-2019-07-18.min.json');\n model.paginators = require('../apis/codeguruprofiler-2019-07-18.paginators.json').pagination;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.CodeGuruProfiler;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['codegurureviewer'] = {};\nAWS.CodeGuruReviewer = Service.defineService('codegurureviewer', ['2019-09-19']);\nObject.defineProperty(apiLoader.services['codegurureviewer'], '2019-09-19', {\n get: function get() {\n var model = require('../apis/codeguru-reviewer-2019-09-19.min.json');\n model.paginators = require('../apis/codeguru-reviewer-2019-09-19.paginators.json').pagination;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.CodeGuruReviewer;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['codepipeline'] = {};\nAWS.CodePipeline = Service.defineService('codepipeline', ['2015-07-09']);\nObject.defineProperty(apiLoader.services['codepipeline'], '2015-07-09', {\n get: function get() {\n var model = require('../apis/codepipeline-2015-07-09.min.json');\n model.paginators = require('../apis/codepipeline-2015-07-09.paginators.json').pagination;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.CodePipeline;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['codestar'] = {};\nAWS.CodeStar = Service.defineService('codestar', ['2017-04-19']);\nObject.defineProperty(apiLoader.services['codestar'], '2017-04-19', {\n get: function get() {\n var model = require('../apis/codestar-2017-04-19.min.json');\n model.paginators = require('../apis/codestar-2017-04-19.paginators.json').pagination;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.CodeStar;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['codestarconnections'] = {};\nAWS.CodeStarconnections = Service.defineService('codestarconnections', ['2019-12-01']);\nObject.defineProperty(apiLoader.services['codestarconnections'], '2019-12-01', {\n get: function get() {\n var model = require('../apis/codestar-connections-2019-12-01.min.json');\n model.paginators = require('../apis/codestar-connections-2019-12-01.paginators.json').pagination;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.CodeStarconnections;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['codestarnotifications'] = {};\nAWS.CodeStarNotifications = Service.defineService('codestarnotifications', ['2019-10-15']);\nObject.defineProperty(apiLoader.services['codestarnotifications'], '2019-10-15', {\n get: function get() {\n var model = require('../apis/codestar-notifications-2019-10-15.min.json');\n model.paginators = require('../apis/codestar-notifications-2019-10-15.paginators.json').pagination;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.CodeStarNotifications;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['cognitoidentity'] = {};\nAWS.CognitoIdentity = Service.defineService('cognitoidentity', ['2014-06-30']);\nObject.defineProperty(apiLoader.services['cognitoidentity'], '2014-06-30', {\n get: function get() {\n var model = require('../apis/cognito-identity-2014-06-30.min.json');\n model.paginators = require('../apis/cognito-identity-2014-06-30.paginators.json').pagination;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.CognitoIdentity;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['cognitoidentityserviceprovider'] = {};\nAWS.CognitoIdentityServiceProvider = Service.defineService('cognitoidentityserviceprovider', ['2016-04-18']);\nObject.defineProperty(apiLoader.services['cognitoidentityserviceprovider'], '2016-04-18', {\n get: function get() {\n var model = require('../apis/cognito-idp-2016-04-18.min.json');\n model.paginators = require('../apis/cognito-idp-2016-04-18.paginators.json').pagination;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.CognitoIdentityServiceProvider;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['cognitosync'] = {};\nAWS.CognitoSync = Service.defineService('cognitosync', ['2014-06-30']);\nObject.defineProperty(apiLoader.services['cognitosync'], '2014-06-30', {\n get: function get() {\n var model = require('../apis/cognito-sync-2014-06-30.min.json');\n model.paginators = require('../apis/cognito-sync-2014-06-30.paginators.json').pagination;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.CognitoSync;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['comprehend'] = {};\nAWS.Comprehend = Service.defineService('comprehend', ['2017-11-27']);\nObject.defineProperty(apiLoader.services['comprehend'], '2017-11-27', {\n get: function get() {\n var model = require('../apis/comprehend-2017-11-27.min.json');\n model.paginators = require('../apis/comprehend-2017-11-27.paginators.json').pagination;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.Comprehend;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['comprehendmedical'] = {};\nAWS.ComprehendMedical = Service.defineService('comprehendmedical', ['2018-10-30']);\nObject.defineProperty(apiLoader.services['comprehendmedical'], '2018-10-30', {\n get: function get() {\n var model = require('../apis/comprehendmedical-2018-10-30.min.json');\n model.paginators = require('../apis/comprehendmedical-2018-10-30.paginators.json').pagination;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.ComprehendMedical;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['computeoptimizer'] = {};\nAWS.ComputeOptimizer = Service.defineService('computeoptimizer', ['2019-11-01']);\nObject.defineProperty(apiLoader.services['computeoptimizer'], '2019-11-01', {\n get: function get() {\n var model = require('../apis/compute-optimizer-2019-11-01.min.json');\n model.paginators = require('../apis/compute-optimizer-2019-11-01.paginators.json').pagination;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.ComputeOptimizer;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['configservice'] = {};\nAWS.ConfigService = Service.defineService('configservice', ['2014-11-12']);\nObject.defineProperty(apiLoader.services['configservice'], '2014-11-12', {\n get: function get() {\n var model = require('../apis/config-2014-11-12.min.json');\n model.paginators = require('../apis/config-2014-11-12.paginators.json').pagination;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.ConfigService;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['connect'] = {};\nAWS.Connect = Service.defineService('connect', ['2017-08-08']);\nObject.defineProperty(apiLoader.services['connect'], '2017-08-08', {\n get: function get() {\n var model = require('../apis/connect-2017-08-08.min.json');\n model.paginators = require('../apis/connect-2017-08-08.paginators.json').pagination;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.Connect;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['connectcontactlens'] = {};\nAWS.ConnectContactLens = Service.defineService('connectcontactlens', ['2020-08-21']);\nObject.defineProperty(apiLoader.services['connectcontactlens'], '2020-08-21', {\n get: function get() {\n var model = require('../apis/connect-contact-lens-2020-08-21.min.json');\n model.paginators = require('../apis/connect-contact-lens-2020-08-21.paginators.json').pagination;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.ConnectContactLens;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['connectparticipant'] = {};\nAWS.ConnectParticipant = Service.defineService('connectparticipant', ['2018-09-07']);\nObject.defineProperty(apiLoader.services['connectparticipant'], '2018-09-07', {\n get: function get() {\n var model = require('../apis/connectparticipant-2018-09-07.min.json');\n model.paginators = require('../apis/connectparticipant-2018-09-07.paginators.json').pagination;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.ConnectParticipant;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['costexplorer'] = {};\nAWS.CostExplorer = Service.defineService('costexplorer', ['2017-10-25']);\nObject.defineProperty(apiLoader.services['costexplorer'], '2017-10-25', {\n get: function get() {\n var model = require('../apis/ce-2017-10-25.min.json');\n model.paginators = require('../apis/ce-2017-10-25.paginators.json').pagination;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.CostExplorer;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['cur'] = {};\nAWS.CUR = Service.defineService('cur', ['2017-01-06']);\nObject.defineProperty(apiLoader.services['cur'], '2017-01-06', {\n get: function get() {\n var model = require('../apis/cur-2017-01-06.min.json');\n model.paginators = require('../apis/cur-2017-01-06.paginators.json').pagination;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.CUR;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['customerprofiles'] = {};\nAWS.CustomerProfiles = Service.defineService('customerprofiles', ['2020-08-15']);\nObject.defineProperty(apiLoader.services['customerprofiles'], '2020-08-15', {\n get: function get() {\n var model = require('../apis/customer-profiles-2020-08-15.min.json');\n model.paginators = require('../apis/customer-profiles-2020-08-15.paginators.json').pagination;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.CustomerProfiles;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['databrew'] = {};\nAWS.DataBrew = Service.defineService('databrew', ['2017-07-25']);\nObject.defineProperty(apiLoader.services['databrew'], '2017-07-25', {\n get: function get() {\n var model = require('../apis/databrew-2017-07-25.min.json');\n model.paginators = require('../apis/databrew-2017-07-25.paginators.json').pagination;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.DataBrew;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['dataexchange'] = {};\nAWS.DataExchange = Service.defineService('dataexchange', ['2017-07-25']);\nObject.defineProperty(apiLoader.services['dataexchange'], '2017-07-25', {\n get: function get() {\n var model = require('../apis/dataexchange-2017-07-25.min.json');\n model.paginators = require('../apis/dataexchange-2017-07-25.paginators.json').pagination;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.DataExchange;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['datapipeline'] = {};\nAWS.DataPipeline = Service.defineService('datapipeline', ['2012-10-29']);\nObject.defineProperty(apiLoader.services['datapipeline'], '2012-10-29', {\n get: function get() {\n var model = require('../apis/datapipeline-2012-10-29.min.json');\n model.paginators = require('../apis/datapipeline-2012-10-29.paginators.json').pagination;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.DataPipeline;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['datasync'] = {};\nAWS.DataSync = Service.defineService('datasync', ['2018-11-09']);\nObject.defineProperty(apiLoader.services['datasync'], '2018-11-09', {\n get: function get() {\n var model = require('../apis/datasync-2018-11-09.min.json');\n model.paginators = require('../apis/datasync-2018-11-09.paginators.json').pagination;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.DataSync;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['dax'] = {};\nAWS.DAX = Service.defineService('dax', ['2017-04-19']);\nObject.defineProperty(apiLoader.services['dax'], '2017-04-19', {\n get: function get() {\n var model = require('../apis/dax-2017-04-19.min.json');\n model.paginators = require('../apis/dax-2017-04-19.paginators.json').pagination;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.DAX;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['detective'] = {};\nAWS.Detective = Service.defineService('detective', ['2018-10-26']);\nObject.defineProperty(apiLoader.services['detective'], '2018-10-26', {\n get: function get() {\n var model = require('../apis/detective-2018-10-26.min.json');\n model.paginators = require('../apis/detective-2018-10-26.paginators.json').pagination;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.Detective;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['devicefarm'] = {};\nAWS.DeviceFarm = Service.defineService('devicefarm', ['2015-06-23']);\nObject.defineProperty(apiLoader.services['devicefarm'], '2015-06-23', {\n get: function get() {\n var model = require('../apis/devicefarm-2015-06-23.min.json');\n model.paginators = require('../apis/devicefarm-2015-06-23.paginators.json').pagination;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.DeviceFarm;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['devopsguru'] = {};\nAWS.DevOpsGuru = Service.defineService('devopsguru', ['2020-12-01']);\nObject.defineProperty(apiLoader.services['devopsguru'], '2020-12-01', {\n get: function get() {\n var model = require('../apis/devops-guru-2020-12-01.min.json');\n model.paginators = require('../apis/devops-guru-2020-12-01.paginators.json').pagination;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.DevOpsGuru;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['directconnect'] = {};\nAWS.DirectConnect = Service.defineService('directconnect', ['2012-10-25']);\nObject.defineProperty(apiLoader.services['directconnect'], '2012-10-25', {\n get: function get() {\n var model = require('../apis/directconnect-2012-10-25.min.json');\n model.paginators = require('../apis/directconnect-2012-10-25.paginators.json').pagination;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.DirectConnect;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['directoryservice'] = {};\nAWS.DirectoryService = Service.defineService('directoryservice', ['2015-04-16']);\nObject.defineProperty(apiLoader.services['directoryservice'], '2015-04-16', {\n get: function get() {\n var model = require('../apis/ds-2015-04-16.min.json');\n model.paginators = require('../apis/ds-2015-04-16.paginators.json').pagination;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.DirectoryService;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['discovery'] = {};\nAWS.Discovery = Service.defineService('discovery', ['2015-11-01']);\nObject.defineProperty(apiLoader.services['discovery'], '2015-11-01', {\n get: function get() {\n var model = require('../apis/discovery-2015-11-01.min.json');\n model.paginators = require('../apis/discovery-2015-11-01.paginators.json').pagination;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.Discovery;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['dlm'] = {};\nAWS.DLM = Service.defineService('dlm', ['2018-01-12']);\nObject.defineProperty(apiLoader.services['dlm'], '2018-01-12', {\n get: function get() {\n var model = require('../apis/dlm-2018-01-12.min.json');\n model.paginators = require('../apis/dlm-2018-01-12.paginators.json').pagination;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.DLM;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['dms'] = {};\nAWS.DMS = Service.defineService('dms', ['2016-01-01']);\nObject.defineProperty(apiLoader.services['dms'], '2016-01-01', {\n get: function get() {\n var model = require('../apis/dms-2016-01-01.min.json');\n model.paginators = require('../apis/dms-2016-01-01.paginators.json').pagination;\n model.waiters = require('../apis/dms-2016-01-01.waiters2.json').waiters;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.DMS;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['docdb'] = {};\nAWS.DocDB = Service.defineService('docdb', ['2014-10-31']);\nrequire('../lib/services/docdb');\nObject.defineProperty(apiLoader.services['docdb'], '2014-10-31', {\n get: function get() {\n var model = require('../apis/docdb-2014-10-31.min.json');\n model.paginators = require('../apis/docdb-2014-10-31.paginators.json').pagination;\n model.waiters = require('../apis/docdb-2014-10-31.waiters2.json').waiters;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.DocDB;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['dynamodb'] = {};\nAWS.DynamoDB = Service.defineService('dynamodb', ['2011-12-05', '2012-08-10']);\nrequire('../lib/services/dynamodb');\nObject.defineProperty(apiLoader.services['dynamodb'], '2011-12-05', {\n get: function get() {\n var model = require('../apis/dynamodb-2011-12-05.min.json');\n model.paginators = require('../apis/dynamodb-2011-12-05.paginators.json').pagination;\n model.waiters = require('../apis/dynamodb-2011-12-05.waiters2.json').waiters;\n return model;\n },\n enumerable: true,\n configurable: true\n});\nObject.defineProperty(apiLoader.services['dynamodb'], '2012-08-10', {\n get: function get() {\n var model = require('../apis/dynamodb-2012-08-10.min.json');\n model.paginators = require('../apis/dynamodb-2012-08-10.paginators.json').pagination;\n model.waiters = require('../apis/dynamodb-2012-08-10.waiters2.json').waiters;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.DynamoDB;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['dynamodbstreams'] = {};\nAWS.DynamoDBStreams = Service.defineService('dynamodbstreams', ['2012-08-10']);\nObject.defineProperty(apiLoader.services['dynamodbstreams'], '2012-08-10', {\n get: function get() {\n var model = require('../apis/streams.dynamodb-2012-08-10.min.json');\n model.paginators = require('../apis/streams.dynamodb-2012-08-10.paginators.json').pagination;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.DynamoDBStreams;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['ebs'] = {};\nAWS.EBS = Service.defineService('ebs', ['2019-11-02']);\nObject.defineProperty(apiLoader.services['ebs'], '2019-11-02', {\n get: function get() {\n var model = require('../apis/ebs-2019-11-02.min.json');\n model.paginators = require('../apis/ebs-2019-11-02.paginators.json').pagination;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.EBS;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['ec2'] = {};\nAWS.EC2 = Service.defineService('ec2', ['2013-06-15*', '2013-10-15*', '2014-02-01*', '2014-05-01*', '2014-06-15*', '2014-09-01*', '2014-10-01*', '2015-03-01*', '2015-04-15*', '2015-10-01*', '2016-04-01*', '2016-09-15*', '2016-11-15']);\nrequire('../lib/services/ec2');\nObject.defineProperty(apiLoader.services['ec2'], '2016-11-15', {\n get: function get() {\n var model = require('../apis/ec2-2016-11-15.min.json');\n model.paginators = require('../apis/ec2-2016-11-15.paginators.json').pagination;\n model.waiters = require('../apis/ec2-2016-11-15.waiters2.json').waiters;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.EC2;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['ec2instanceconnect'] = {};\nAWS.EC2InstanceConnect = Service.defineService('ec2instanceconnect', ['2018-04-02']);\nObject.defineProperty(apiLoader.services['ec2instanceconnect'], '2018-04-02', {\n get: function get() {\n var model = require('../apis/ec2-instance-connect-2018-04-02.min.json');\n model.paginators = require('../apis/ec2-instance-connect-2018-04-02.paginators.json').pagination;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.EC2InstanceConnect;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['ecr'] = {};\nAWS.ECR = Service.defineService('ecr', ['2015-09-21']);\nObject.defineProperty(apiLoader.services['ecr'], '2015-09-21', {\n get: function get() {\n var model = require('../apis/ecr-2015-09-21.min.json');\n model.paginators = require('../apis/ecr-2015-09-21.paginators.json').pagination;\n model.waiters = require('../apis/ecr-2015-09-21.waiters2.json').waiters;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.ECR;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['ecrpublic'] = {};\nAWS.ECRPUBLIC = Service.defineService('ecrpublic', ['2020-10-30']);\nObject.defineProperty(apiLoader.services['ecrpublic'], '2020-10-30', {\n get: function get() {\n var model = require('../apis/ecr-public-2020-10-30.min.json');\n model.paginators = require('../apis/ecr-public-2020-10-30.paginators.json').pagination;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.ECRPUBLIC;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['ecs'] = {};\nAWS.ECS = Service.defineService('ecs', ['2014-11-13']);\nObject.defineProperty(apiLoader.services['ecs'], '2014-11-13', {\n get: function get() {\n var model = require('../apis/ecs-2014-11-13.min.json');\n model.paginators = require('../apis/ecs-2014-11-13.paginators.json').pagination;\n model.waiters = require('../apis/ecs-2014-11-13.waiters2.json').waiters;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.ECS;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['efs'] = {};\nAWS.EFS = Service.defineService('efs', ['2015-02-01']);\nObject.defineProperty(apiLoader.services['efs'], '2015-02-01', {\n get: function get() {\n var model = require('../apis/elasticfilesystem-2015-02-01.min.json');\n model.paginators = require('../apis/elasticfilesystem-2015-02-01.paginators.json').pagination;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.EFS;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['eks'] = {};\nAWS.EKS = Service.defineService('eks', ['2017-11-01']);\nObject.defineProperty(apiLoader.services['eks'], '2017-11-01', {\n get: function get() {\n var model = require('../apis/eks-2017-11-01.min.json');\n model.paginators = require('../apis/eks-2017-11-01.paginators.json').pagination;\n model.waiters = require('../apis/eks-2017-11-01.waiters2.json').waiters;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.EKS;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['elasticache'] = {};\nAWS.ElastiCache = Service.defineService('elasticache', ['2012-11-15*', '2014-03-24*', '2014-07-15*', '2014-09-30*', '2015-02-02']);\nObject.defineProperty(apiLoader.services['elasticache'], '2015-02-02', {\n get: function get() {\n var model = require('../apis/elasticache-2015-02-02.min.json');\n model.paginators = require('../apis/elasticache-2015-02-02.paginators.json').pagination;\n model.waiters = require('../apis/elasticache-2015-02-02.waiters2.json').waiters;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.ElastiCache;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['elasticbeanstalk'] = {};\nAWS.ElasticBeanstalk = Service.defineService('elasticbeanstalk', ['2010-12-01']);\nObject.defineProperty(apiLoader.services['elasticbeanstalk'], '2010-12-01', {\n get: function get() {\n var model = require('../apis/elasticbeanstalk-2010-12-01.min.json');\n model.paginators = require('../apis/elasticbeanstalk-2010-12-01.paginators.json').pagination;\n model.waiters = require('../apis/elasticbeanstalk-2010-12-01.waiters2.json').waiters;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.ElasticBeanstalk;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['elasticinference'] = {};\nAWS.ElasticInference = Service.defineService('elasticinference', ['2017-07-25']);\nObject.defineProperty(apiLoader.services['elasticinference'], '2017-07-25', {\n get: function get() {\n var model = require('../apis/elastic-inference-2017-07-25.min.json');\n model.paginators = require('../apis/elastic-inference-2017-07-25.paginators.json').pagination;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.ElasticInference;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['elastictranscoder'] = {};\nAWS.ElasticTranscoder = Service.defineService('elastictranscoder', ['2012-09-25']);\nObject.defineProperty(apiLoader.services['elastictranscoder'], '2012-09-25', {\n get: function get() {\n var model = require('../apis/elastictranscoder-2012-09-25.min.json');\n model.paginators = require('../apis/elastictranscoder-2012-09-25.paginators.json').pagination;\n model.waiters = require('../apis/elastictranscoder-2012-09-25.waiters2.json').waiters;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.ElasticTranscoder;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['elb'] = {};\nAWS.ELB = Service.defineService('elb', ['2012-06-01']);\nObject.defineProperty(apiLoader.services['elb'], '2012-06-01', {\n get: function get() {\n var model = require('../apis/elasticloadbalancing-2012-06-01.min.json');\n model.paginators = require('../apis/elasticloadbalancing-2012-06-01.paginators.json').pagination;\n model.waiters = require('../apis/elasticloadbalancing-2012-06-01.waiters2.json').waiters;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.ELB;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['elbv2'] = {};\nAWS.ELBv2 = Service.defineService('elbv2', ['2015-12-01']);\nObject.defineProperty(apiLoader.services['elbv2'], '2015-12-01', {\n get: function get() {\n var model = require('../apis/elasticloadbalancingv2-2015-12-01.min.json');\n model.paginators = require('../apis/elasticloadbalancingv2-2015-12-01.paginators.json').pagination;\n model.waiters = require('../apis/elasticloadbalancingv2-2015-12-01.waiters2.json').waiters;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.ELBv2;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['emr'] = {};\nAWS.EMR = Service.defineService('emr', ['2009-03-31']);\nObject.defineProperty(apiLoader.services['emr'], '2009-03-31', {\n get: function get() {\n var model = require('../apis/elasticmapreduce-2009-03-31.min.json');\n model.paginators = require('../apis/elasticmapreduce-2009-03-31.paginators.json').pagination;\n model.waiters = require('../apis/elasticmapreduce-2009-03-31.waiters2.json').waiters;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.EMR;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['emrcontainers'] = {};\nAWS.EMRcontainers = Service.defineService('emrcontainers', ['2020-10-01']);\nObject.defineProperty(apiLoader.services['emrcontainers'], '2020-10-01', {\n get: function get() {\n var model = require('../apis/emr-containers-2020-10-01.min.json');\n model.paginators = require('../apis/emr-containers-2020-10-01.paginators.json').pagination;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.EMRcontainers;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['es'] = {};\nAWS.ES = Service.defineService('es', ['2015-01-01']);\nObject.defineProperty(apiLoader.services['es'], '2015-01-01', {\n get: function get() {\n var model = require('../apis/es-2015-01-01.min.json');\n model.paginators = require('../apis/es-2015-01-01.paginators.json').pagination;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.ES;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['eventbridge'] = {};\nAWS.EventBridge = Service.defineService('eventbridge', ['2015-10-07']);\nObject.defineProperty(apiLoader.services['eventbridge'], '2015-10-07', {\n get: function get() {\n var model = require('../apis/eventbridge-2015-10-07.min.json');\n model.paginators = require('../apis/eventbridge-2015-10-07.paginators.json').pagination;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.EventBridge;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['firehose'] = {};\nAWS.Firehose = Service.defineService('firehose', ['2015-08-04']);\nObject.defineProperty(apiLoader.services['firehose'], '2015-08-04', {\n get: function get() {\n var model = require('../apis/firehose-2015-08-04.min.json');\n model.paginators = require('../apis/firehose-2015-08-04.paginators.json').pagination;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.Firehose;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['fis'] = {};\nAWS.Fis = Service.defineService('fis', ['2020-12-01']);\nObject.defineProperty(apiLoader.services['fis'], '2020-12-01', {\n get: function get() {\n var model = require('../apis/fis-2020-12-01.min.json');\n model.paginators = require('../apis/fis-2020-12-01.paginators.json').pagination;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.Fis;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['fms'] = {};\nAWS.FMS = Service.defineService('fms', ['2018-01-01']);\nObject.defineProperty(apiLoader.services['fms'], '2018-01-01', {\n get: function get() {\n var model = require('../apis/fms-2018-01-01.min.json');\n model.paginators = require('../apis/fms-2018-01-01.paginators.json').pagination;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.FMS;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['forecastqueryservice'] = {};\nAWS.ForecastQueryService = Service.defineService('forecastqueryservice', ['2018-06-26']);\nObject.defineProperty(apiLoader.services['forecastqueryservice'], '2018-06-26', {\n get: function get() {\n var model = require('../apis/forecastquery-2018-06-26.min.json');\n model.paginators = require('../apis/forecastquery-2018-06-26.paginators.json').pagination;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.ForecastQueryService;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['forecastservice'] = {};\nAWS.ForecastService = Service.defineService('forecastservice', ['2018-06-26']);\nObject.defineProperty(apiLoader.services['forecastservice'], '2018-06-26', {\n get: function get() {\n var model = require('../apis/forecast-2018-06-26.min.json');\n model.paginators = require('../apis/forecast-2018-06-26.paginators.json').pagination;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.ForecastService;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['frauddetector'] = {};\nAWS.FraudDetector = Service.defineService('frauddetector', ['2019-11-15']);\nObject.defineProperty(apiLoader.services['frauddetector'], '2019-11-15', {\n get: function get() {\n var model = require('../apis/frauddetector-2019-11-15.min.json');\n model.paginators = require('../apis/frauddetector-2019-11-15.paginators.json').pagination;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.FraudDetector;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['fsx'] = {};\nAWS.FSx = Service.defineService('fsx', ['2018-03-01']);\nObject.defineProperty(apiLoader.services['fsx'], '2018-03-01', {\n get: function get() {\n var model = require('../apis/fsx-2018-03-01.min.json');\n model.paginators = require('../apis/fsx-2018-03-01.paginators.json').pagination;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.FSx;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['gamelift'] = {};\nAWS.GameLift = Service.defineService('gamelift', ['2015-10-01']);\nObject.defineProperty(apiLoader.services['gamelift'], '2015-10-01', {\n get: function get() {\n var model = require('../apis/gamelift-2015-10-01.min.json');\n model.paginators = require('../apis/gamelift-2015-10-01.paginators.json').pagination;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.GameLift;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['glacier'] = {};\nAWS.Glacier = Service.defineService('glacier', ['2012-06-01']);\nrequire('../lib/services/glacier');\nObject.defineProperty(apiLoader.services['glacier'], '2012-06-01', {\n get: function get() {\n var model = require('../apis/glacier-2012-06-01.min.json');\n model.paginators = require('../apis/glacier-2012-06-01.paginators.json').pagination;\n model.waiters = require('../apis/glacier-2012-06-01.waiters2.json').waiters;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.Glacier;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['globalaccelerator'] = {};\nAWS.GlobalAccelerator = Service.defineService('globalaccelerator', ['2018-08-08']);\nObject.defineProperty(apiLoader.services['globalaccelerator'], '2018-08-08', {\n get: function get() {\n var model = require('../apis/globalaccelerator-2018-08-08.min.json');\n model.paginators = require('../apis/globalaccelerator-2018-08-08.paginators.json').pagination;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.GlobalAccelerator;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['glue'] = {};\nAWS.Glue = Service.defineService('glue', ['2017-03-31']);\nObject.defineProperty(apiLoader.services['glue'], '2017-03-31', {\n get: function get() {\n var model = require('../apis/glue-2017-03-31.min.json');\n model.paginators = require('../apis/glue-2017-03-31.paginators.json').pagination;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.Glue;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['greengrass'] = {};\nAWS.Greengrass = Service.defineService('greengrass', ['2017-06-07']);\nObject.defineProperty(apiLoader.services['greengrass'], '2017-06-07', {\n get: function get() {\n var model = require('../apis/greengrass-2017-06-07.min.json');\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.Greengrass;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['greengrassv2'] = {};\nAWS.GreengrassV2 = Service.defineService('greengrassv2', ['2020-11-30']);\nObject.defineProperty(apiLoader.services['greengrassv2'], '2020-11-30', {\n get: function get() {\n var model = require('../apis/greengrassv2-2020-11-30.min.json');\n model.paginators = require('../apis/greengrassv2-2020-11-30.paginators.json').pagination;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.GreengrassV2;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['groundstation'] = {};\nAWS.GroundStation = Service.defineService('groundstation', ['2019-05-23']);\nObject.defineProperty(apiLoader.services['groundstation'], '2019-05-23', {\n get: function get() {\n var model = require('../apis/groundstation-2019-05-23.min.json');\n model.paginators = require('../apis/groundstation-2019-05-23.paginators.json').pagination;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.GroundStation;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['guardduty'] = {};\nAWS.GuardDuty = Service.defineService('guardduty', ['2017-11-28']);\nObject.defineProperty(apiLoader.services['guardduty'], '2017-11-28', {\n get: function get() {\n var model = require('../apis/guardduty-2017-11-28.min.json');\n model.paginators = require('../apis/guardduty-2017-11-28.paginators.json').pagination;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.GuardDuty;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['health'] = {};\nAWS.Health = Service.defineService('health', ['2016-08-04']);\nObject.defineProperty(apiLoader.services['health'], '2016-08-04', {\n get: function get() {\n var model = require('../apis/health-2016-08-04.min.json');\n model.paginators = require('../apis/health-2016-08-04.paginators.json').pagination;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.Health;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['healthlake'] = {};\nAWS.HealthLake = Service.defineService('healthlake', ['2017-07-01']);\nObject.defineProperty(apiLoader.services['healthlake'], '2017-07-01', {\n get: function get() {\n var model = require('../apis/healthlake-2017-07-01.min.json');\n model.paginators = require('../apis/healthlake-2017-07-01.paginators.json').pagination;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.HealthLake;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['honeycode'] = {};\nAWS.Honeycode = Service.defineService('honeycode', ['2020-03-01']);\nObject.defineProperty(apiLoader.services['honeycode'], '2020-03-01', {\n get: function get() {\n var model = require('../apis/honeycode-2020-03-01.min.json');\n model.paginators = require('../apis/honeycode-2020-03-01.paginators.json').pagination;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.Honeycode;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['iam'] = {};\nAWS.IAM = Service.defineService('iam', ['2010-05-08']);\nObject.defineProperty(apiLoader.services['iam'], '2010-05-08', {\n get: function get() {\n var model = require('../apis/iam-2010-05-08.min.json');\n model.paginators = require('../apis/iam-2010-05-08.paginators.json').pagination;\n model.waiters = require('../apis/iam-2010-05-08.waiters2.json').waiters;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.IAM;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['identitystore'] = {};\nAWS.IdentityStore = Service.defineService('identitystore', ['2020-06-15']);\nObject.defineProperty(apiLoader.services['identitystore'], '2020-06-15', {\n get: function get() {\n var model = require('../apis/identitystore-2020-06-15.min.json');\n model.paginators = require('../apis/identitystore-2020-06-15.paginators.json').pagination;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.IdentityStore;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['imagebuilder'] = {};\nAWS.Imagebuilder = Service.defineService('imagebuilder', ['2019-12-02']);\nObject.defineProperty(apiLoader.services['imagebuilder'], '2019-12-02', {\n get: function get() {\n var model = require('../apis/imagebuilder-2019-12-02.min.json');\n model.paginators = require('../apis/imagebuilder-2019-12-02.paginators.json').pagination;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.Imagebuilder;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['importexport'] = {};\nAWS.ImportExport = Service.defineService('importexport', ['2010-06-01']);\nObject.defineProperty(apiLoader.services['importexport'], '2010-06-01', {\n get: function get() {\n var model = require('../apis/importexport-2010-06-01.min.json');\n model.paginators = require('../apis/importexport-2010-06-01.paginators.json').pagination;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.ImportExport;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['inspector'] = {};\nAWS.Inspector = Service.defineService('inspector', ['2015-08-18*', '2016-02-16']);\nObject.defineProperty(apiLoader.services['inspector'], '2016-02-16', {\n get: function get() {\n var model = require('../apis/inspector-2016-02-16.min.json');\n model.paginators = require('../apis/inspector-2016-02-16.paginators.json').pagination;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.Inspector;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['iot'] = {};\nAWS.Iot = Service.defineService('iot', ['2015-05-28']);\nObject.defineProperty(apiLoader.services['iot'], '2015-05-28', {\n get: function get() {\n var model = require('../apis/iot-2015-05-28.min.json');\n model.paginators = require('../apis/iot-2015-05-28.paginators.json').pagination;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.Iot;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['iot1clickdevicesservice'] = {};\nAWS.IoT1ClickDevicesService = Service.defineService('iot1clickdevicesservice', ['2018-05-14']);\nObject.defineProperty(apiLoader.services['iot1clickdevicesservice'], '2018-05-14', {\n get: function get() {\n var model = require('../apis/iot1click-devices-2018-05-14.min.json');\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.IoT1ClickDevicesService;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['iot1clickprojects'] = {};\nAWS.IoT1ClickProjects = Service.defineService('iot1clickprojects', ['2018-05-14']);\nObject.defineProperty(apiLoader.services['iot1clickprojects'], '2018-05-14', {\n get: function get() {\n var model = require('../apis/iot1click-projects-2018-05-14.min.json');\n model.paginators = require('../apis/iot1click-projects-2018-05-14.paginators.json').pagination;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.IoT1ClickProjects;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['iotanalytics'] = {};\nAWS.IoTAnalytics = Service.defineService('iotanalytics', ['2017-11-27']);\nObject.defineProperty(apiLoader.services['iotanalytics'], '2017-11-27', {\n get: function get() {\n var model = require('../apis/iotanalytics-2017-11-27.min.json');\n model.paginators = require('../apis/iotanalytics-2017-11-27.paginators.json').pagination;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.IoTAnalytics;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['iotdata'] = {};\nAWS.IotData = Service.defineService('iotdata', ['2015-05-28']);\nrequire('../lib/services/iotdata');\nObject.defineProperty(apiLoader.services['iotdata'], '2015-05-28', {\n get: function get() {\n var model = require('../apis/iot-data-2015-05-28.min.json');\n model.paginators = require('../apis/iot-data-2015-05-28.paginators.json').pagination;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.IotData;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['iotdeviceadvisor'] = {};\nAWS.IotDeviceAdvisor = Service.defineService('iotdeviceadvisor', ['2020-09-18']);\nObject.defineProperty(apiLoader.services['iotdeviceadvisor'], '2020-09-18', {\n get: function get() {\n var model = require('../apis/iotdeviceadvisor-2020-09-18.min.json');\n model.paginators = require('../apis/iotdeviceadvisor-2020-09-18.paginators.json').pagination;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.IotDeviceAdvisor;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['iotevents'] = {};\nAWS.IoTEvents = Service.defineService('iotevents', ['2018-07-27']);\nObject.defineProperty(apiLoader.services['iotevents'], '2018-07-27', {\n get: function get() {\n var model = require('../apis/iotevents-2018-07-27.min.json');\n model.paginators = require('../apis/iotevents-2018-07-27.paginators.json').pagination;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.IoTEvents;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['ioteventsdata'] = {};\nAWS.IoTEventsData = Service.defineService('ioteventsdata', ['2018-10-23']);\nObject.defineProperty(apiLoader.services['ioteventsdata'], '2018-10-23', {\n get: function get() {\n var model = require('../apis/iotevents-data-2018-10-23.min.json');\n model.paginators = require('../apis/iotevents-data-2018-10-23.paginators.json').pagination;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.IoTEventsData;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['iotfleethub'] = {};\nAWS.IoTFleetHub = Service.defineService('iotfleethub', ['2020-11-03']);\nObject.defineProperty(apiLoader.services['iotfleethub'], '2020-11-03', {\n get: function get() {\n var model = require('../apis/iotfleethub-2020-11-03.min.json');\n model.paginators = require('../apis/iotfleethub-2020-11-03.paginators.json').pagination;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.IoTFleetHub;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['iotjobsdataplane'] = {};\nAWS.IoTJobsDataPlane = Service.defineService('iotjobsdataplane', ['2017-09-29']);\nObject.defineProperty(apiLoader.services['iotjobsdataplane'], '2017-09-29', {\n get: function get() {\n var model = require('../apis/iot-jobs-data-2017-09-29.min.json');\n model.paginators = require('../apis/iot-jobs-data-2017-09-29.paginators.json').pagination;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.IoTJobsDataPlane;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['iotsecuretunneling'] = {};\nAWS.IoTSecureTunneling = Service.defineService('iotsecuretunneling', ['2018-10-05']);\nObject.defineProperty(apiLoader.services['iotsecuretunneling'], '2018-10-05', {\n get: function get() {\n var model = require('../apis/iotsecuretunneling-2018-10-05.min.json');\n model.paginators = require('../apis/iotsecuretunneling-2018-10-05.paginators.json').pagination;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.IoTSecureTunneling;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['iotsitewise'] = {};\nAWS.IoTSiteWise = Service.defineService('iotsitewise', ['2019-12-02']);\nObject.defineProperty(apiLoader.services['iotsitewise'], '2019-12-02', {\n get: function get() {\n var model = require('../apis/iotsitewise-2019-12-02.min.json');\n model.paginators = require('../apis/iotsitewise-2019-12-02.paginators.json').pagination;\n model.waiters = require('../apis/iotsitewise-2019-12-02.waiters2.json').waiters;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.IoTSiteWise;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['iotthingsgraph'] = {};\nAWS.IoTThingsGraph = Service.defineService('iotthingsgraph', ['2018-09-06']);\nObject.defineProperty(apiLoader.services['iotthingsgraph'], '2018-09-06', {\n get: function get() {\n var model = require('../apis/iotthingsgraph-2018-09-06.min.json');\n model.paginators = require('../apis/iotthingsgraph-2018-09-06.paginators.json').pagination;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.IoTThingsGraph;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['iotwireless'] = {};\nAWS.IoTWireless = Service.defineService('iotwireless', ['2020-11-22']);\nObject.defineProperty(apiLoader.services['iotwireless'], '2020-11-22', {\n get: function get() {\n var model = require('../apis/iotwireless-2020-11-22.min.json');\n model.paginators = require('../apis/iotwireless-2020-11-22.paginators.json').pagination;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.IoTWireless;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['ivs'] = {};\nAWS.IVS = Service.defineService('ivs', ['2020-07-14']);\nObject.defineProperty(apiLoader.services['ivs'], '2020-07-14', {\n get: function get() {\n var model = require('../apis/ivs-2020-07-14.min.json');\n model.paginators = require('../apis/ivs-2020-07-14.paginators.json').pagination;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.IVS;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['kafka'] = {};\nAWS.Kafka = Service.defineService('kafka', ['2018-11-14']);\nObject.defineProperty(apiLoader.services['kafka'], '2018-11-14', {\n get: function get() {\n var model = require('../apis/kafka-2018-11-14.min.json');\n model.paginators = require('../apis/kafka-2018-11-14.paginators.json').pagination;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.Kafka;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['kendra'] = {};\nAWS.Kendra = Service.defineService('kendra', ['2019-02-03']);\nObject.defineProperty(apiLoader.services['kendra'], '2019-02-03', {\n get: function get() {\n var model = require('../apis/kendra-2019-02-03.min.json');\n model.paginators = require('../apis/kendra-2019-02-03.paginators.json').pagination;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.Kendra;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['kinesis'] = {};\nAWS.Kinesis = Service.defineService('kinesis', ['2013-12-02']);\nObject.defineProperty(apiLoader.services['kinesis'], '2013-12-02', {\n get: function get() {\n var model = require('../apis/kinesis-2013-12-02.min.json');\n model.paginators = require('../apis/kinesis-2013-12-02.paginators.json').pagination;\n model.waiters = require('../apis/kinesis-2013-12-02.waiters2.json').waiters;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.Kinesis;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['kinesisanalytics'] = {};\nAWS.KinesisAnalytics = Service.defineService('kinesisanalytics', ['2015-08-14']);\nObject.defineProperty(apiLoader.services['kinesisanalytics'], '2015-08-14', {\n get: function get() {\n var model = require('../apis/kinesisanalytics-2015-08-14.min.json');\n model.paginators = require('../apis/kinesisanalytics-2015-08-14.paginators.json').pagination;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.KinesisAnalytics;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['kinesisanalyticsv2'] = {};\nAWS.KinesisAnalyticsV2 = Service.defineService('kinesisanalyticsv2', ['2018-05-23']);\nObject.defineProperty(apiLoader.services['kinesisanalyticsv2'], '2018-05-23', {\n get: function get() {\n var model = require('../apis/kinesisanalyticsv2-2018-05-23.min.json');\n model.paginators = require('../apis/kinesisanalyticsv2-2018-05-23.paginators.json').pagination;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.KinesisAnalyticsV2;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['kinesisvideo'] = {};\nAWS.KinesisVideo = Service.defineService('kinesisvideo', ['2017-09-30']);\nObject.defineProperty(apiLoader.services['kinesisvideo'], '2017-09-30', {\n get: function get() {\n var model = require('../apis/kinesisvideo-2017-09-30.min.json');\n model.paginators = require('../apis/kinesisvideo-2017-09-30.paginators.json').pagination;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.KinesisVideo;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['kinesisvideoarchivedmedia'] = {};\nAWS.KinesisVideoArchivedMedia = Service.defineService('kinesisvideoarchivedmedia', ['2017-09-30']);\nObject.defineProperty(apiLoader.services['kinesisvideoarchivedmedia'], '2017-09-30', {\n get: function get() {\n var model = require('../apis/kinesis-video-archived-media-2017-09-30.min.json');\n model.paginators = require('../apis/kinesis-video-archived-media-2017-09-30.paginators.json').pagination;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.KinesisVideoArchivedMedia;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['kinesisvideomedia'] = {};\nAWS.KinesisVideoMedia = Service.defineService('kinesisvideomedia', ['2017-09-30']);\nObject.defineProperty(apiLoader.services['kinesisvideomedia'], '2017-09-30', {\n get: function get() {\n var model = require('../apis/kinesis-video-media-2017-09-30.min.json');\n model.paginators = require('../apis/kinesis-video-media-2017-09-30.paginators.json').pagination;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.KinesisVideoMedia;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['kinesisvideosignalingchannels'] = {};\nAWS.KinesisVideoSignalingChannels = Service.defineService('kinesisvideosignalingchannels', ['2019-12-04']);\nObject.defineProperty(apiLoader.services['kinesisvideosignalingchannels'], '2019-12-04', {\n get: function get() {\n var model = require('../apis/kinesis-video-signaling-2019-12-04.min.json');\n model.paginators = require('../apis/kinesis-video-signaling-2019-12-04.paginators.json').pagination;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.KinesisVideoSignalingChannels;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['kms'] = {};\nAWS.KMS = Service.defineService('kms', ['2014-11-01']);\nObject.defineProperty(apiLoader.services['kms'], '2014-11-01', {\n get: function get() {\n var model = require('../apis/kms-2014-11-01.min.json');\n model.paginators = require('../apis/kms-2014-11-01.paginators.json').pagination;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.KMS;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['lakeformation'] = {};\nAWS.LakeFormation = Service.defineService('lakeformation', ['2017-03-31']);\nObject.defineProperty(apiLoader.services['lakeformation'], '2017-03-31', {\n get: function get() {\n var model = require('../apis/lakeformation-2017-03-31.min.json');\n model.paginators = require('../apis/lakeformation-2017-03-31.paginators.json').pagination;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.LakeFormation;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['lambda'] = {};\nAWS.Lambda = Service.defineService('lambda', ['2014-11-11', '2015-03-31']);\nrequire('../lib/services/lambda');\nObject.defineProperty(apiLoader.services['lambda'], '2014-11-11', {\n get: function get() {\n var model = require('../apis/lambda-2014-11-11.min.json');\n model.paginators = require('../apis/lambda-2014-11-11.paginators.json').pagination;\n return model;\n },\n enumerable: true,\n configurable: true\n});\nObject.defineProperty(apiLoader.services['lambda'], '2015-03-31', {\n get: function get() {\n var model = require('../apis/lambda-2015-03-31.min.json');\n model.paginators = require('../apis/lambda-2015-03-31.paginators.json').pagination;\n model.waiters = require('../apis/lambda-2015-03-31.waiters2.json').waiters;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.Lambda;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['lexmodelbuildingservice'] = {};\nAWS.LexModelBuildingService = Service.defineService('lexmodelbuildingservice', ['2017-04-19']);\nObject.defineProperty(apiLoader.services['lexmodelbuildingservice'], '2017-04-19', {\n get: function get() {\n var model = require('../apis/lex-models-2017-04-19.min.json');\n model.paginators = require('../apis/lex-models-2017-04-19.paginators.json').pagination;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.LexModelBuildingService;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['lexmodelsv2'] = {};\nAWS.LexModelsV2 = Service.defineService('lexmodelsv2', ['2020-08-07']);\nrequire('../lib/services/lexmodelsv2');\nObject.defineProperty(apiLoader.services['lexmodelsv2'], '2020-08-07', {\n get: function get() {\n var model = require('../apis/models.lex.v2-2020-08-07.min.json');\n model.paginators = require('../apis/models.lex.v2-2020-08-07.paginators.json').pagination;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.LexModelsV2;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['lexruntime'] = {};\nAWS.LexRuntime = Service.defineService('lexruntime', ['2016-11-28']);\nObject.defineProperty(apiLoader.services['lexruntime'], '2016-11-28', {\n get: function get() {\n var model = require('../apis/runtime.lex-2016-11-28.min.json');\n model.paginators = require('../apis/runtime.lex-2016-11-28.paginators.json').pagination;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.LexRuntime;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['lexruntimev2'] = {};\nAWS.LexRuntimeV2 = Service.defineService('lexruntimev2', ['2020-08-07']);\nObject.defineProperty(apiLoader.services['lexruntimev2'], '2020-08-07', {\n get: function get() {\n var model = require('../apis/runtime.lex.v2-2020-08-07.min.json');\n model.paginators = require('../apis/runtime.lex.v2-2020-08-07.paginators.json').pagination;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.LexRuntimeV2;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['licensemanager'] = {};\nAWS.LicenseManager = Service.defineService('licensemanager', ['2018-08-01']);\nObject.defineProperty(apiLoader.services['licensemanager'], '2018-08-01', {\n get: function get() {\n var model = require('../apis/license-manager-2018-08-01.min.json');\n model.paginators = require('../apis/license-manager-2018-08-01.paginators.json').pagination;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.LicenseManager;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['lightsail'] = {};\nAWS.Lightsail = Service.defineService('lightsail', ['2016-11-28']);\nObject.defineProperty(apiLoader.services['lightsail'], '2016-11-28', {\n get: function get() {\n var model = require('../apis/lightsail-2016-11-28.min.json');\n model.paginators = require('../apis/lightsail-2016-11-28.paginators.json').pagination;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.Lightsail;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['location'] = {};\nAWS.Location = Service.defineService('location', ['2020-11-19']);\nObject.defineProperty(apiLoader.services['location'], '2020-11-19', {\n get: function get() {\n var model = require('../apis/location-2020-11-19.min.json');\n model.paginators = require('../apis/location-2020-11-19.paginators.json').pagination;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.Location;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['lookoutequipment'] = {};\nAWS.LookoutEquipment = Service.defineService('lookoutequipment', ['2020-12-15']);\nObject.defineProperty(apiLoader.services['lookoutequipment'], '2020-12-15', {\n get: function get() {\n var model = require('../apis/lookoutequipment-2020-12-15.min.json');\n model.paginators = require('../apis/lookoutequipment-2020-12-15.paginators.json').pagination;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.LookoutEquipment;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['lookoutmetrics'] = {};\nAWS.LookoutMetrics = Service.defineService('lookoutmetrics', ['2017-07-25']);\nrequire('../lib/services/lookoutmetrics');\nObject.defineProperty(apiLoader.services['lookoutmetrics'], '2017-07-25', {\n get: function get() {\n var model = require('../apis/lookoutmetrics-2017-07-25.min.json');\n model.paginators = require('../apis/lookoutmetrics-2017-07-25.paginators.json').pagination;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.LookoutMetrics;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['lookoutvision'] = {};\nAWS.LookoutVision = Service.defineService('lookoutvision', ['2020-11-20']);\nObject.defineProperty(apiLoader.services['lookoutvision'], '2020-11-20', {\n get: function get() {\n var model = require('../apis/lookoutvision-2020-11-20.min.json');\n model.paginators = require('../apis/lookoutvision-2020-11-20.paginators.json').pagination;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.LookoutVision;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['machinelearning'] = {};\nAWS.MachineLearning = Service.defineService('machinelearning', ['2014-12-12']);\nrequire('../lib/services/machinelearning');\nObject.defineProperty(apiLoader.services['machinelearning'], '2014-12-12', {\n get: function get() {\n var model = require('../apis/machinelearning-2014-12-12.min.json');\n model.paginators = require('../apis/machinelearning-2014-12-12.paginators.json').pagination;\n model.waiters = require('../apis/machinelearning-2014-12-12.waiters2.json').waiters;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.MachineLearning;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['macie'] = {};\nAWS.Macie = Service.defineService('macie', ['2017-12-19']);\nObject.defineProperty(apiLoader.services['macie'], '2017-12-19', {\n get: function get() {\n var model = require('../apis/macie-2017-12-19.min.json');\n model.paginators = require('../apis/macie-2017-12-19.paginators.json').pagination;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.Macie;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['macie2'] = {};\nAWS.Macie2 = Service.defineService('macie2', ['2020-01-01']);\nObject.defineProperty(apiLoader.services['macie2'], '2020-01-01', {\n get: function get() {\n var model = require('../apis/macie2-2020-01-01.min.json');\n model.paginators = require('../apis/macie2-2020-01-01.paginators.json').pagination;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.Macie2;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['managedblockchain'] = {};\nAWS.ManagedBlockchain = Service.defineService('managedblockchain', ['2018-09-24']);\nObject.defineProperty(apiLoader.services['managedblockchain'], '2018-09-24', {\n get: function get() {\n var model = require('../apis/managedblockchain-2018-09-24.min.json');\n model.paginators = require('../apis/managedblockchain-2018-09-24.paginators.json').pagination;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.ManagedBlockchain;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['marketplacecatalog'] = {};\nAWS.MarketplaceCatalog = Service.defineService('marketplacecatalog', ['2018-09-17']);\nObject.defineProperty(apiLoader.services['marketplacecatalog'], '2018-09-17', {\n get: function get() {\n var model = require('../apis/marketplace-catalog-2018-09-17.min.json');\n model.paginators = require('../apis/marketplace-catalog-2018-09-17.paginators.json').pagination;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.MarketplaceCatalog;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['marketplacecommerceanalytics'] = {};\nAWS.MarketplaceCommerceAnalytics = Service.defineService('marketplacecommerceanalytics', ['2015-07-01']);\nObject.defineProperty(apiLoader.services['marketplacecommerceanalytics'], '2015-07-01', {\n get: function get() {\n var model = require('../apis/marketplacecommerceanalytics-2015-07-01.min.json');\n model.paginators = require('../apis/marketplacecommerceanalytics-2015-07-01.paginators.json').pagination;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.MarketplaceCommerceAnalytics;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['marketplaceentitlementservice'] = {};\nAWS.MarketplaceEntitlementService = Service.defineService('marketplaceentitlementservice', ['2017-01-11']);\nObject.defineProperty(apiLoader.services['marketplaceentitlementservice'], '2017-01-11', {\n get: function get() {\n var model = require('../apis/entitlement.marketplace-2017-01-11.min.json');\n model.paginators = require('../apis/entitlement.marketplace-2017-01-11.paginators.json').pagination;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.MarketplaceEntitlementService;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['marketplacemetering'] = {};\nAWS.MarketplaceMetering = Service.defineService('marketplacemetering', ['2016-01-14']);\nObject.defineProperty(apiLoader.services['marketplacemetering'], '2016-01-14', {\n get: function get() {\n var model = require('../apis/meteringmarketplace-2016-01-14.min.json');\n model.paginators = require('../apis/meteringmarketplace-2016-01-14.paginators.json').pagination;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.MarketplaceMetering;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['mediaconnect'] = {};\nAWS.MediaConnect = Service.defineService('mediaconnect', ['2018-11-14']);\nObject.defineProperty(apiLoader.services['mediaconnect'], '2018-11-14', {\n get: function get() {\n var model = require('../apis/mediaconnect-2018-11-14.min.json');\n model.paginators = require('../apis/mediaconnect-2018-11-14.paginators.json').pagination;\n model.waiters = require('../apis/mediaconnect-2018-11-14.waiters2.json').waiters;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.MediaConnect;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['mediaconvert'] = {};\nAWS.MediaConvert = Service.defineService('mediaconvert', ['2017-08-29']);\nObject.defineProperty(apiLoader.services['mediaconvert'], '2017-08-29', {\n get: function get() {\n var model = require('../apis/mediaconvert-2017-08-29.min.json');\n model.paginators = require('../apis/mediaconvert-2017-08-29.paginators.json').pagination;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.MediaConvert;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['medialive'] = {};\nAWS.MediaLive = Service.defineService('medialive', ['2017-10-14']);\nObject.defineProperty(apiLoader.services['medialive'], '2017-10-14', {\n get: function get() {\n var model = require('../apis/medialive-2017-10-14.min.json');\n model.paginators = require('../apis/medialive-2017-10-14.paginators.json').pagination;\n model.waiters = require('../apis/medialive-2017-10-14.waiters2.json').waiters;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.MediaLive;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['mediapackage'] = {};\nAWS.MediaPackage = Service.defineService('mediapackage', ['2017-10-12']);\nObject.defineProperty(apiLoader.services['mediapackage'], '2017-10-12', {\n get: function get() {\n var model = require('../apis/mediapackage-2017-10-12.min.json');\n model.paginators = require('../apis/mediapackage-2017-10-12.paginators.json').pagination;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.MediaPackage;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['mediapackagevod'] = {};\nAWS.MediaPackageVod = Service.defineService('mediapackagevod', ['2018-11-07']);\nObject.defineProperty(apiLoader.services['mediapackagevod'], '2018-11-07', {\n get: function get() {\n var model = require('../apis/mediapackage-vod-2018-11-07.min.json');\n model.paginators = require('../apis/mediapackage-vod-2018-11-07.paginators.json').pagination;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.MediaPackageVod;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['mediastore'] = {};\nAWS.MediaStore = Service.defineService('mediastore', ['2017-09-01']);\nObject.defineProperty(apiLoader.services['mediastore'], '2017-09-01', {\n get: function get() {\n var model = require('../apis/mediastore-2017-09-01.min.json');\n model.paginators = require('../apis/mediastore-2017-09-01.paginators.json').pagination;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.MediaStore;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['mediastoredata'] = {};\nAWS.MediaStoreData = Service.defineService('mediastoredata', ['2017-09-01']);\nObject.defineProperty(apiLoader.services['mediastoredata'], '2017-09-01', {\n get: function get() {\n var model = require('../apis/mediastore-data-2017-09-01.min.json');\n model.paginators = require('../apis/mediastore-data-2017-09-01.paginators.json').pagination;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.MediaStoreData;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['mediatailor'] = {};\nAWS.MediaTailor = Service.defineService('mediatailor', ['2018-04-23']);\nObject.defineProperty(apiLoader.services['mediatailor'], '2018-04-23', {\n get: function get() {\n var model = require('../apis/mediatailor-2018-04-23.min.json');\n model.paginators = require('../apis/mediatailor-2018-04-23.paginators.json').pagination;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.MediaTailor;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['mgn'] = {};\nAWS.Mgn = Service.defineService('mgn', ['2020-02-26']);\nObject.defineProperty(apiLoader.services['mgn'], '2020-02-26', {\n get: function get() {\n var model = require('../apis/mgn-2020-02-26.min.json');\n model.paginators = require('../apis/mgn-2020-02-26.paginators.json').pagination;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.Mgn;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['migrationhub'] = {};\nAWS.MigrationHub = Service.defineService('migrationhub', ['2017-05-31']);\nObject.defineProperty(apiLoader.services['migrationhub'], '2017-05-31', {\n get: function get() {\n var model = require('../apis/AWSMigrationHub-2017-05-31.min.json');\n model.paginators = require('../apis/AWSMigrationHub-2017-05-31.paginators.json').pagination;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.MigrationHub;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['migrationhubconfig'] = {};\nAWS.MigrationHubConfig = Service.defineService('migrationhubconfig', ['2019-06-30']);\nObject.defineProperty(apiLoader.services['migrationhubconfig'], '2019-06-30', {\n get: function get() {\n var model = require('../apis/migrationhub-config-2019-06-30.min.json');\n model.paginators = require('../apis/migrationhub-config-2019-06-30.paginators.json').pagination;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.MigrationHubConfig;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['mobile'] = {};\nAWS.Mobile = Service.defineService('mobile', ['2017-07-01']);\nObject.defineProperty(apiLoader.services['mobile'], '2017-07-01', {\n get: function get() {\n var model = require('../apis/mobile-2017-07-01.min.json');\n model.paginators = require('../apis/mobile-2017-07-01.paginators.json').pagination;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.Mobile;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['mobileanalytics'] = {};\nAWS.MobileAnalytics = Service.defineService('mobileanalytics', ['2014-06-05']);\nObject.defineProperty(apiLoader.services['mobileanalytics'], '2014-06-05', {\n get: function get() {\n var model = require('../apis/mobileanalytics-2014-06-05.min.json');\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.MobileAnalytics;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['mq'] = {};\nAWS.MQ = Service.defineService('mq', ['2017-11-27']);\nObject.defineProperty(apiLoader.services['mq'], '2017-11-27', {\n get: function get() {\n var model = require('../apis/mq-2017-11-27.min.json');\n model.paginators = require('../apis/mq-2017-11-27.paginators.json').pagination;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.MQ;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['mturk'] = {};\nAWS.MTurk = Service.defineService('mturk', ['2017-01-17']);\nObject.defineProperty(apiLoader.services['mturk'], '2017-01-17', {\n get: function get() {\n var model = require('../apis/mturk-requester-2017-01-17.min.json');\n model.paginators = require('../apis/mturk-requester-2017-01-17.paginators.json').pagination;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.MTurk;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['mwaa'] = {};\nAWS.MWAA = Service.defineService('mwaa', ['2020-07-01']);\nObject.defineProperty(apiLoader.services['mwaa'], '2020-07-01', {\n get: function get() {\n var model = require('../apis/mwaa-2020-07-01.min.json');\n model.paginators = require('../apis/mwaa-2020-07-01.paginators.json').pagination;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.MWAA;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['neptune'] = {};\nAWS.Neptune = Service.defineService('neptune', ['2014-10-31']);\nrequire('../lib/services/neptune');\nObject.defineProperty(apiLoader.services['neptune'], '2014-10-31', {\n get: function get() {\n var model = require('../apis/neptune-2014-10-31.min.json');\n model.paginators = require('../apis/neptune-2014-10-31.paginators.json').pagination;\n model.waiters = require('../apis/neptune-2014-10-31.waiters2.json').waiters;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.Neptune;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['networkfirewall'] = {};\nAWS.NetworkFirewall = Service.defineService('networkfirewall', ['2020-11-12']);\nObject.defineProperty(apiLoader.services['networkfirewall'], '2020-11-12', {\n get: function get() {\n var model = require('../apis/network-firewall-2020-11-12.min.json');\n model.paginators = require('../apis/network-firewall-2020-11-12.paginators.json').pagination;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.NetworkFirewall;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['networkmanager'] = {};\nAWS.NetworkManager = Service.defineService('networkmanager', ['2019-07-05']);\nObject.defineProperty(apiLoader.services['networkmanager'], '2019-07-05', {\n get: function get() {\n var model = require('../apis/networkmanager-2019-07-05.min.json');\n model.paginators = require('../apis/networkmanager-2019-07-05.paginators.json').pagination;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.NetworkManager;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['opsworks'] = {};\nAWS.OpsWorks = Service.defineService('opsworks', ['2013-02-18']);\nObject.defineProperty(apiLoader.services['opsworks'], '2013-02-18', {\n get: function get() {\n var model = require('../apis/opsworks-2013-02-18.min.json');\n model.paginators = require('../apis/opsworks-2013-02-18.paginators.json').pagination;\n model.waiters = require('../apis/opsworks-2013-02-18.waiters2.json').waiters;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.OpsWorks;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['opsworkscm'] = {};\nAWS.OpsWorksCM = Service.defineService('opsworkscm', ['2016-11-01']);\nObject.defineProperty(apiLoader.services['opsworkscm'], '2016-11-01', {\n get: function get() {\n var model = require('../apis/opsworkscm-2016-11-01.min.json');\n model.paginators = require('../apis/opsworkscm-2016-11-01.paginators.json').pagination;\n model.waiters = require('../apis/opsworkscm-2016-11-01.waiters2.json').waiters;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.OpsWorksCM;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['organizations'] = {};\nAWS.Organizations = Service.defineService('organizations', ['2016-11-28']);\nObject.defineProperty(apiLoader.services['organizations'], '2016-11-28', {\n get: function get() {\n var model = require('../apis/organizations-2016-11-28.min.json');\n model.paginators = require('../apis/organizations-2016-11-28.paginators.json').pagination;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.Organizations;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['outposts'] = {};\nAWS.Outposts = Service.defineService('outposts', ['2019-12-03']);\nObject.defineProperty(apiLoader.services['outposts'], '2019-12-03', {\n get: function get() {\n var model = require('../apis/outposts-2019-12-03.min.json');\n model.paginators = require('../apis/outposts-2019-12-03.paginators.json').pagination;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.Outposts;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['personalize'] = {};\nAWS.Personalize = Service.defineService('personalize', ['2018-05-22']);\nObject.defineProperty(apiLoader.services['personalize'], '2018-05-22', {\n get: function get() {\n var model = require('../apis/personalize-2018-05-22.min.json');\n model.paginators = require('../apis/personalize-2018-05-22.paginators.json').pagination;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.Personalize;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['personalizeevents'] = {};\nAWS.PersonalizeEvents = Service.defineService('personalizeevents', ['2018-03-22']);\nObject.defineProperty(apiLoader.services['personalizeevents'], '2018-03-22', {\n get: function get() {\n var model = require('../apis/personalize-events-2018-03-22.min.json');\n model.paginators = require('../apis/personalize-events-2018-03-22.paginators.json').pagination;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.PersonalizeEvents;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['personalizeruntime'] = {};\nAWS.PersonalizeRuntime = Service.defineService('personalizeruntime', ['2018-05-22']);\nObject.defineProperty(apiLoader.services['personalizeruntime'], '2018-05-22', {\n get: function get() {\n var model = require('../apis/personalize-runtime-2018-05-22.min.json');\n model.paginators = require('../apis/personalize-runtime-2018-05-22.paginators.json').pagination;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.PersonalizeRuntime;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['pi'] = {};\nAWS.PI = Service.defineService('pi', ['2018-02-27']);\nObject.defineProperty(apiLoader.services['pi'], '2018-02-27', {\n get: function get() {\n var model = require('../apis/pi-2018-02-27.min.json');\n model.paginators = require('../apis/pi-2018-02-27.paginators.json').pagination;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.PI;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['pinpoint'] = {};\nAWS.Pinpoint = Service.defineService('pinpoint', ['2016-12-01']);\nObject.defineProperty(apiLoader.services['pinpoint'], '2016-12-01', {\n get: function get() {\n var model = require('../apis/pinpoint-2016-12-01.min.json');\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.Pinpoint;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['pinpointemail'] = {};\nAWS.PinpointEmail = Service.defineService('pinpointemail', ['2018-07-26']);\nObject.defineProperty(apiLoader.services['pinpointemail'], '2018-07-26', {\n get: function get() {\n var model = require('../apis/pinpoint-email-2018-07-26.min.json');\n model.paginators = require('../apis/pinpoint-email-2018-07-26.paginators.json').pagination;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.PinpointEmail;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['pinpointsmsvoice'] = {};\nAWS.PinpointSMSVoice = Service.defineService('pinpointsmsvoice', ['2018-09-05']);\nObject.defineProperty(apiLoader.services['pinpointsmsvoice'], '2018-09-05', {\n get: function get() {\n var model = require('../apis/sms-voice-2018-09-05.min.json');\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.PinpointSMSVoice;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['polly'] = {};\nAWS.Polly = Service.defineService('polly', ['2016-06-10']);\nrequire('../lib/services/polly');\nObject.defineProperty(apiLoader.services['polly'], '2016-06-10', {\n get: function get() {\n var model = require('../apis/polly-2016-06-10.min.json');\n model.paginators = require('../apis/polly-2016-06-10.paginators.json').pagination;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.Polly;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['pricing'] = {};\nAWS.Pricing = Service.defineService('pricing', ['2017-10-15']);\nObject.defineProperty(apiLoader.services['pricing'], '2017-10-15', {\n get: function get() {\n var model = require('../apis/pricing-2017-10-15.min.json');\n model.paginators = require('../apis/pricing-2017-10-15.paginators.json').pagination;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.Pricing;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['qldb'] = {};\nAWS.QLDB = Service.defineService('qldb', ['2019-01-02']);\nObject.defineProperty(apiLoader.services['qldb'], '2019-01-02', {\n get: function get() {\n var model = require('../apis/qldb-2019-01-02.min.json');\n model.paginators = require('../apis/qldb-2019-01-02.paginators.json').pagination;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.QLDB;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['qldbsession'] = {};\nAWS.QLDBSession = Service.defineService('qldbsession', ['2019-07-11']);\nObject.defineProperty(apiLoader.services['qldbsession'], '2019-07-11', {\n get: function get() {\n var model = require('../apis/qldb-session-2019-07-11.min.json');\n model.paginators = require('../apis/qldb-session-2019-07-11.paginators.json').pagination;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.QLDBSession;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['quicksight'] = {};\nAWS.QuickSight = Service.defineService('quicksight', ['2018-04-01']);\nObject.defineProperty(apiLoader.services['quicksight'], '2018-04-01', {\n get: function get() {\n var model = require('../apis/quicksight-2018-04-01.min.json');\n model.paginators = require('../apis/quicksight-2018-04-01.paginators.json').pagination;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.QuickSight;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['ram'] = {};\nAWS.RAM = Service.defineService('ram', ['2018-01-04']);\nObject.defineProperty(apiLoader.services['ram'], '2018-01-04', {\n get: function get() {\n var model = require('../apis/ram-2018-01-04.min.json');\n model.paginators = require('../apis/ram-2018-01-04.paginators.json').pagination;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.RAM;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['rds'] = {};\nAWS.RDS = Service.defineService('rds', ['2013-01-10', '2013-02-12', '2013-09-09', '2014-09-01', '2014-09-01*', '2014-10-31']);\nrequire('../lib/services/rds');\nObject.defineProperty(apiLoader.services['rds'], '2013-01-10', {\n get: function get() {\n var model = require('../apis/rds-2013-01-10.min.json');\n model.paginators = require('../apis/rds-2013-01-10.paginators.json').pagination;\n return model;\n },\n enumerable: true,\n configurable: true\n});\nObject.defineProperty(apiLoader.services['rds'], '2013-02-12', {\n get: function get() {\n var model = require('../apis/rds-2013-02-12.min.json');\n model.paginators = require('../apis/rds-2013-02-12.paginators.json').pagination;\n return model;\n },\n enumerable: true,\n configurable: true\n});\nObject.defineProperty(apiLoader.services['rds'], '2013-09-09', {\n get: function get() {\n var model = require('../apis/rds-2013-09-09.min.json');\n model.paginators = require('../apis/rds-2013-09-09.paginators.json').pagination;\n model.waiters = require('../apis/rds-2013-09-09.waiters2.json').waiters;\n return model;\n },\n enumerable: true,\n configurable: true\n});\nObject.defineProperty(apiLoader.services['rds'], '2014-09-01', {\n get: function get() {\n var model = require('../apis/rds-2014-09-01.min.json');\n model.paginators = require('../apis/rds-2014-09-01.paginators.json').pagination;\n return model;\n },\n enumerable: true,\n configurable: true\n});\nObject.defineProperty(apiLoader.services['rds'], '2014-10-31', {\n get: function get() {\n var model = require('../apis/rds-2014-10-31.min.json');\n model.paginators = require('../apis/rds-2014-10-31.paginators.json').pagination;\n model.waiters = require('../apis/rds-2014-10-31.waiters2.json').waiters;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.RDS;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['rdsdataservice'] = {};\nAWS.RDSDataService = Service.defineService('rdsdataservice', ['2018-08-01']);\nrequire('../lib/services/rdsdataservice');\nObject.defineProperty(apiLoader.services['rdsdataservice'], '2018-08-01', {\n get: function get() {\n var model = require('../apis/rds-data-2018-08-01.min.json');\n model.paginators = require('../apis/rds-data-2018-08-01.paginators.json').pagination;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.RDSDataService;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['redshift'] = {};\nAWS.Redshift = Service.defineService('redshift', ['2012-12-01']);\nObject.defineProperty(apiLoader.services['redshift'], '2012-12-01', {\n get: function get() {\n var model = require('../apis/redshift-2012-12-01.min.json');\n model.paginators = require('../apis/redshift-2012-12-01.paginators.json').pagination;\n model.waiters = require('../apis/redshift-2012-12-01.waiters2.json').waiters;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.Redshift;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['redshiftdata'] = {};\nAWS.RedshiftData = Service.defineService('redshiftdata', ['2019-12-20']);\nObject.defineProperty(apiLoader.services['redshiftdata'], '2019-12-20', {\n get: function get() {\n var model = require('../apis/redshift-data-2019-12-20.min.json');\n model.paginators = require('../apis/redshift-data-2019-12-20.paginators.json').pagination;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.RedshiftData;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['rekognition'] = {};\nAWS.Rekognition = Service.defineService('rekognition', ['2016-06-27']);\nObject.defineProperty(apiLoader.services['rekognition'], '2016-06-27', {\n get: function get() {\n var model = require('../apis/rekognition-2016-06-27.min.json');\n model.paginators = require('../apis/rekognition-2016-06-27.paginators.json').pagination;\n model.waiters = require('../apis/rekognition-2016-06-27.waiters2.json').waiters;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.Rekognition;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['resourcegroups'] = {};\nAWS.ResourceGroups = Service.defineService('resourcegroups', ['2017-11-27']);\nObject.defineProperty(apiLoader.services['resourcegroups'], '2017-11-27', {\n get: function get() {\n var model = require('../apis/resource-groups-2017-11-27.min.json');\n model.paginators = require('../apis/resource-groups-2017-11-27.paginators.json').pagination;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.ResourceGroups;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['resourcegroupstaggingapi'] = {};\nAWS.ResourceGroupsTaggingAPI = Service.defineService('resourcegroupstaggingapi', ['2017-01-26']);\nObject.defineProperty(apiLoader.services['resourcegroupstaggingapi'], '2017-01-26', {\n get: function get() {\n var model = require('../apis/resourcegroupstaggingapi-2017-01-26.min.json');\n model.paginators = require('../apis/resourcegroupstaggingapi-2017-01-26.paginators.json').pagination;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.ResourceGroupsTaggingAPI;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['robomaker'] = {};\nAWS.RoboMaker = Service.defineService('robomaker', ['2018-06-29']);\nObject.defineProperty(apiLoader.services['robomaker'], '2018-06-29', {\n get: function get() {\n var model = require('../apis/robomaker-2018-06-29.min.json');\n model.paginators = require('../apis/robomaker-2018-06-29.paginators.json').pagination;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.RoboMaker;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['route53'] = {};\nAWS.Route53 = Service.defineService('route53', ['2013-04-01']);\nrequire('../lib/services/route53');\nObject.defineProperty(apiLoader.services['route53'], '2013-04-01', {\n get: function get() {\n var model = require('../apis/route53-2013-04-01.min.json');\n model.paginators = require('../apis/route53-2013-04-01.paginators.json').pagination;\n model.waiters = require('../apis/route53-2013-04-01.waiters2.json').waiters;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.Route53;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['route53domains'] = {};\nAWS.Route53Domains = Service.defineService('route53domains', ['2014-05-15']);\nObject.defineProperty(apiLoader.services['route53domains'], '2014-05-15', {\n get: function get() {\n var model = require('../apis/route53domains-2014-05-15.min.json');\n model.paginators = require('../apis/route53domains-2014-05-15.paginators.json').pagination;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.Route53Domains;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['route53resolver'] = {};\nAWS.Route53Resolver = Service.defineService('route53resolver', ['2018-04-01']);\nObject.defineProperty(apiLoader.services['route53resolver'], '2018-04-01', {\n get: function get() {\n var model = require('../apis/route53resolver-2018-04-01.min.json');\n model.paginators = require('../apis/route53resolver-2018-04-01.paginators.json').pagination;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.Route53Resolver;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['s3'] = {};\nAWS.S3 = Service.defineService('s3', ['2006-03-01']);\nrequire('../lib/services/s3');\nObject.defineProperty(apiLoader.services['s3'], '2006-03-01', {\n get: function get() {\n var model = require('../apis/s3-2006-03-01.min.json');\n model.paginators = require('../apis/s3-2006-03-01.paginators.json').pagination;\n model.waiters = require('../apis/s3-2006-03-01.waiters2.json').waiters;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.S3;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['s3control'] = {};\nAWS.S3Control = Service.defineService('s3control', ['2018-08-20']);\nrequire('../lib/services/s3control');\nObject.defineProperty(apiLoader.services['s3control'], '2018-08-20', {\n get: function get() {\n var model = require('../apis/s3control-2018-08-20.min.json');\n model.paginators = require('../apis/s3control-2018-08-20.paginators.json').pagination;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.S3Control;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['s3outposts'] = {};\nAWS.S3Outposts = Service.defineService('s3outposts', ['2017-07-25']);\nObject.defineProperty(apiLoader.services['s3outposts'], '2017-07-25', {\n get: function get() {\n var model = require('../apis/s3outposts-2017-07-25.min.json');\n model.paginators = require('../apis/s3outposts-2017-07-25.paginators.json').pagination;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.S3Outposts;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['sagemaker'] = {};\nAWS.SageMaker = Service.defineService('sagemaker', ['2017-07-24']);\nObject.defineProperty(apiLoader.services['sagemaker'], '2017-07-24', {\n get: function get() {\n var model = require('../apis/sagemaker-2017-07-24.min.json');\n model.paginators = require('../apis/sagemaker-2017-07-24.paginators.json').pagination;\n model.waiters = require('../apis/sagemaker-2017-07-24.waiters2.json').waiters;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.SageMaker;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['sagemakeredge'] = {};\nAWS.SagemakerEdge = Service.defineService('sagemakeredge', ['2020-09-23']);\nObject.defineProperty(apiLoader.services['sagemakeredge'], '2020-09-23', {\n get: function get() {\n var model = require('../apis/sagemaker-edge-2020-09-23.min.json');\n model.paginators = require('../apis/sagemaker-edge-2020-09-23.paginators.json').pagination;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.SagemakerEdge;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['sagemakerfeaturestoreruntime'] = {};\nAWS.SageMakerFeatureStoreRuntime = Service.defineService('sagemakerfeaturestoreruntime', ['2020-07-01']);\nObject.defineProperty(apiLoader.services['sagemakerfeaturestoreruntime'], '2020-07-01', {\n get: function get() {\n var model = require('../apis/sagemaker-featurestore-runtime-2020-07-01.min.json');\n model.paginators = require('../apis/sagemaker-featurestore-runtime-2020-07-01.paginators.json').pagination;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.SageMakerFeatureStoreRuntime;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['sagemakerruntime'] = {};\nAWS.SageMakerRuntime = Service.defineService('sagemakerruntime', ['2017-05-13']);\nObject.defineProperty(apiLoader.services['sagemakerruntime'], '2017-05-13', {\n get: function get() {\n var model = require('../apis/runtime.sagemaker-2017-05-13.min.json');\n model.paginators = require('../apis/runtime.sagemaker-2017-05-13.paginators.json').pagination;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.SageMakerRuntime;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['savingsplans'] = {};\nAWS.SavingsPlans = Service.defineService('savingsplans', ['2019-06-28']);\nObject.defineProperty(apiLoader.services['savingsplans'], '2019-06-28', {\n get: function get() {\n var model = require('../apis/savingsplans-2019-06-28.min.json');\n model.paginators = require('../apis/savingsplans-2019-06-28.paginators.json').pagination;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.SavingsPlans;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['schemas'] = {};\nAWS.Schemas = Service.defineService('schemas', ['2019-12-02']);\nObject.defineProperty(apiLoader.services['schemas'], '2019-12-02', {\n get: function get() {\n var model = require('../apis/schemas-2019-12-02.min.json');\n model.paginators = require('../apis/schemas-2019-12-02.paginators.json').pagination;\n model.waiters = require('../apis/schemas-2019-12-02.waiters2.json').waiters;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.Schemas;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['secretsmanager'] = {};\nAWS.SecretsManager = Service.defineService('secretsmanager', ['2017-10-17']);\nObject.defineProperty(apiLoader.services['secretsmanager'], '2017-10-17', {\n get: function get() {\n var model = require('../apis/secretsmanager-2017-10-17.min.json');\n model.paginators = require('../apis/secretsmanager-2017-10-17.paginators.json').pagination;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.SecretsManager;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['securityhub'] = {};\nAWS.SecurityHub = Service.defineService('securityhub', ['2018-10-26']);\nObject.defineProperty(apiLoader.services['securityhub'], '2018-10-26', {\n get: function get() {\n var model = require('../apis/securityhub-2018-10-26.min.json');\n model.paginators = require('../apis/securityhub-2018-10-26.paginators.json').pagination;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.SecurityHub;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['serverlessapplicationrepository'] = {};\nAWS.ServerlessApplicationRepository = Service.defineService('serverlessapplicationrepository', ['2017-09-08']);\nObject.defineProperty(apiLoader.services['serverlessapplicationrepository'], '2017-09-08', {\n get: function get() {\n var model = require('../apis/serverlessrepo-2017-09-08.min.json');\n model.paginators = require('../apis/serverlessrepo-2017-09-08.paginators.json').pagination;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.ServerlessApplicationRepository;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['servicecatalog'] = {};\nAWS.ServiceCatalog = Service.defineService('servicecatalog', ['2015-12-10']);\nObject.defineProperty(apiLoader.services['servicecatalog'], '2015-12-10', {\n get: function get() {\n var model = require('../apis/servicecatalog-2015-12-10.min.json');\n model.paginators = require('../apis/servicecatalog-2015-12-10.paginators.json').pagination;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.ServiceCatalog;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['servicecatalogappregistry'] = {};\nAWS.ServiceCatalogAppRegistry = Service.defineService('servicecatalogappregistry', ['2020-06-24']);\nObject.defineProperty(apiLoader.services['servicecatalogappregistry'], '2020-06-24', {\n get: function get() {\n var model = require('../apis/servicecatalog-appregistry-2020-06-24.min.json');\n model.paginators = require('../apis/servicecatalog-appregistry-2020-06-24.paginators.json').pagination;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.ServiceCatalogAppRegistry;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['servicediscovery'] = {};\nAWS.ServiceDiscovery = Service.defineService('servicediscovery', ['2017-03-14']);\nObject.defineProperty(apiLoader.services['servicediscovery'], '2017-03-14', {\n get: function get() {\n var model = require('../apis/servicediscovery-2017-03-14.min.json');\n model.paginators = require('../apis/servicediscovery-2017-03-14.paginators.json').pagination;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.ServiceDiscovery;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['servicequotas'] = {};\nAWS.ServiceQuotas = Service.defineService('servicequotas', ['2019-06-24']);\nObject.defineProperty(apiLoader.services['servicequotas'], '2019-06-24', {\n get: function get() {\n var model = require('../apis/service-quotas-2019-06-24.min.json');\n model.paginators = require('../apis/service-quotas-2019-06-24.paginators.json').pagination;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.ServiceQuotas;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['ses'] = {};\nAWS.SES = Service.defineService('ses', ['2010-12-01']);\nObject.defineProperty(apiLoader.services['ses'], '2010-12-01', {\n get: function get() {\n var model = require('../apis/email-2010-12-01.min.json');\n model.paginators = require('../apis/email-2010-12-01.paginators.json').pagination;\n model.waiters = require('../apis/email-2010-12-01.waiters2.json').waiters;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.SES;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['sesv2'] = {};\nAWS.SESV2 = Service.defineService('sesv2', ['2019-09-27']);\nObject.defineProperty(apiLoader.services['sesv2'], '2019-09-27', {\n get: function get() {\n var model = require('../apis/sesv2-2019-09-27.min.json');\n model.paginators = require('../apis/sesv2-2019-09-27.paginators.json').pagination;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.SESV2;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['shield'] = {};\nAWS.Shield = Service.defineService('shield', ['2016-06-02']);\nObject.defineProperty(apiLoader.services['shield'], '2016-06-02', {\n get: function get() {\n var model = require('../apis/shield-2016-06-02.min.json');\n model.paginators = require('../apis/shield-2016-06-02.paginators.json').pagination;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.Shield;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['signer'] = {};\nAWS.Signer = Service.defineService('signer', ['2017-08-25']);\nObject.defineProperty(apiLoader.services['signer'], '2017-08-25', {\n get: function get() {\n var model = require('../apis/signer-2017-08-25.min.json');\n model.paginators = require('../apis/signer-2017-08-25.paginators.json').pagination;\n model.waiters = require('../apis/signer-2017-08-25.waiters2.json').waiters;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.Signer;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['simpledb'] = {};\nAWS.SimpleDB = Service.defineService('simpledb', ['2009-04-15']);\nObject.defineProperty(apiLoader.services['simpledb'], '2009-04-15', {\n get: function get() {\n var model = require('../apis/sdb-2009-04-15.min.json');\n model.paginators = require('../apis/sdb-2009-04-15.paginators.json').pagination;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.SimpleDB;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['sms'] = {};\nAWS.SMS = Service.defineService('sms', ['2016-10-24']);\nObject.defineProperty(apiLoader.services['sms'], '2016-10-24', {\n get: function get() {\n var model = require('../apis/sms-2016-10-24.min.json');\n model.paginators = require('../apis/sms-2016-10-24.paginators.json').pagination;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.SMS;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['snowball'] = {};\nAWS.Snowball = Service.defineService('snowball', ['2016-06-30']);\nObject.defineProperty(apiLoader.services['snowball'], '2016-06-30', {\n get: function get() {\n var model = require('../apis/snowball-2016-06-30.min.json');\n model.paginators = require('../apis/snowball-2016-06-30.paginators.json').pagination;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.Snowball;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['sns'] = {};\nAWS.SNS = Service.defineService('sns', ['2010-03-31']);\nObject.defineProperty(apiLoader.services['sns'], '2010-03-31', {\n get: function get() {\n var model = require('../apis/sns-2010-03-31.min.json');\n model.paginators = require('../apis/sns-2010-03-31.paginators.json').pagination;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.SNS;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['sqs'] = {};\nAWS.SQS = Service.defineService('sqs', ['2012-11-05']);\nrequire('../lib/services/sqs');\nObject.defineProperty(apiLoader.services['sqs'], '2012-11-05', {\n get: function get() {\n var model = require('../apis/sqs-2012-11-05.min.json');\n model.paginators = require('../apis/sqs-2012-11-05.paginators.json').pagination;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.SQS;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['ssm'] = {};\nAWS.SSM = Service.defineService('ssm', ['2014-11-06']);\nObject.defineProperty(apiLoader.services['ssm'], '2014-11-06', {\n get: function get() {\n var model = require('../apis/ssm-2014-11-06.min.json');\n model.paginators = require('../apis/ssm-2014-11-06.paginators.json').pagination;\n model.waiters = require('../apis/ssm-2014-11-06.waiters2.json').waiters;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.SSM;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['sso'] = {};\nAWS.SSO = Service.defineService('sso', ['2019-06-10']);\nObject.defineProperty(apiLoader.services['sso'], '2019-06-10', {\n get: function get() {\n var model = require('../apis/sso-2019-06-10.min.json');\n model.paginators = require('../apis/sso-2019-06-10.paginators.json').pagination;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.SSO;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['ssoadmin'] = {};\nAWS.SSOAdmin = Service.defineService('ssoadmin', ['2020-07-20']);\nObject.defineProperty(apiLoader.services['ssoadmin'], '2020-07-20', {\n get: function get() {\n var model = require('../apis/sso-admin-2020-07-20.min.json');\n model.paginators = require('../apis/sso-admin-2020-07-20.paginators.json').pagination;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.SSOAdmin;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['ssooidc'] = {};\nAWS.SSOOIDC = Service.defineService('ssooidc', ['2019-06-10']);\nObject.defineProperty(apiLoader.services['ssooidc'], '2019-06-10', {\n get: function get() {\n var model = require('../apis/sso-oidc-2019-06-10.min.json');\n model.paginators = require('../apis/sso-oidc-2019-06-10.paginators.json').pagination;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.SSOOIDC;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['stepfunctions'] = {};\nAWS.StepFunctions = Service.defineService('stepfunctions', ['2016-11-23']);\nObject.defineProperty(apiLoader.services['stepfunctions'], '2016-11-23', {\n get: function get() {\n var model = require('../apis/states-2016-11-23.min.json');\n model.paginators = require('../apis/states-2016-11-23.paginators.json').pagination;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.StepFunctions;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['storagegateway'] = {};\nAWS.StorageGateway = Service.defineService('storagegateway', ['2013-06-30']);\nObject.defineProperty(apiLoader.services['storagegateway'], '2013-06-30', {\n get: function get() {\n var model = require('../apis/storagegateway-2013-06-30.min.json');\n model.paginators = require('../apis/storagegateway-2013-06-30.paginators.json').pagination;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.StorageGateway;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['sts'] = {};\nAWS.STS = Service.defineService('sts', ['2011-06-15']);\nrequire('../lib/services/sts');\nObject.defineProperty(apiLoader.services['sts'], '2011-06-15', {\n get: function get() {\n var model = require('../apis/sts-2011-06-15.min.json');\n model.paginators = require('../apis/sts-2011-06-15.paginators.json').pagination;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.STS;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['support'] = {};\nAWS.Support = Service.defineService('support', ['2013-04-15']);\nObject.defineProperty(apiLoader.services['support'], '2013-04-15', {\n get: function get() {\n var model = require('../apis/support-2013-04-15.min.json');\n model.paginators = require('../apis/support-2013-04-15.paginators.json').pagination;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.Support;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['swf'] = {};\nAWS.SWF = Service.defineService('swf', ['2012-01-25']);\nrequire('../lib/services/swf');\nObject.defineProperty(apiLoader.services['swf'], '2012-01-25', {\n get: function get() {\n var model = require('../apis/swf-2012-01-25.min.json');\n model.paginators = require('../apis/swf-2012-01-25.paginators.json').pagination;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.SWF;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['synthetics'] = {};\nAWS.Synthetics = Service.defineService('synthetics', ['2017-10-11']);\nObject.defineProperty(apiLoader.services['synthetics'], '2017-10-11', {\n get: function get() {\n var model = require('../apis/synthetics-2017-10-11.min.json');\n model.paginators = require('../apis/synthetics-2017-10-11.paginators.json').pagination;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.Synthetics;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['textract'] = {};\nAWS.Textract = Service.defineService('textract', ['2018-06-27']);\nObject.defineProperty(apiLoader.services['textract'], '2018-06-27', {\n get: function get() {\n var model = require('../apis/textract-2018-06-27.min.json');\n model.paginators = require('../apis/textract-2018-06-27.paginators.json').pagination;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.Textract;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['timestreamquery'] = {};\nAWS.TimestreamQuery = Service.defineService('timestreamquery', ['2018-11-01']);\nObject.defineProperty(apiLoader.services['timestreamquery'], '2018-11-01', {\n get: function get() {\n var model = require('../apis/timestream-query-2018-11-01.min.json');\n model.paginators = require('../apis/timestream-query-2018-11-01.paginators.json').pagination;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.TimestreamQuery;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['timestreamwrite'] = {};\nAWS.TimestreamWrite = Service.defineService('timestreamwrite', ['2018-11-01']);\nObject.defineProperty(apiLoader.services['timestreamwrite'], '2018-11-01', {\n get: function get() {\n var model = require('../apis/timestream-write-2018-11-01.min.json');\n model.paginators = require('../apis/timestream-write-2018-11-01.paginators.json').pagination;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.TimestreamWrite;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['transcribeservice'] = {};\nAWS.TranscribeService = Service.defineService('transcribeservice', ['2017-10-26']);\nObject.defineProperty(apiLoader.services['transcribeservice'], '2017-10-26', {\n get: function get() {\n var model = require('../apis/transcribe-2017-10-26.min.json');\n model.paginators = require('../apis/transcribe-2017-10-26.paginators.json').pagination;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.TranscribeService;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['transfer'] = {};\nAWS.Transfer = Service.defineService('transfer', ['2018-11-05']);\nObject.defineProperty(apiLoader.services['transfer'], '2018-11-05', {\n get: function get() {\n var model = require('../apis/transfer-2018-11-05.min.json');\n model.paginators = require('../apis/transfer-2018-11-05.paginators.json').pagination;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.Transfer;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['translate'] = {};\nAWS.Translate = Service.defineService('translate', ['2017-07-01']);\nObject.defineProperty(apiLoader.services['translate'], '2017-07-01', {\n get: function get() {\n var model = require('../apis/translate-2017-07-01.min.json');\n model.paginators = require('../apis/translate-2017-07-01.paginators.json').pagination;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.Translate;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['waf'] = {};\nAWS.WAF = Service.defineService('waf', ['2015-08-24']);\nObject.defineProperty(apiLoader.services['waf'], '2015-08-24', {\n get: function get() {\n var model = require('../apis/waf-2015-08-24.min.json');\n model.paginators = require('../apis/waf-2015-08-24.paginators.json').pagination;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.WAF;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['wafregional'] = {};\nAWS.WAFRegional = Service.defineService('wafregional', ['2016-11-28']);\nObject.defineProperty(apiLoader.services['wafregional'], '2016-11-28', {\n get: function get() {\n var model = require('../apis/waf-regional-2016-11-28.min.json');\n model.paginators = require('../apis/waf-regional-2016-11-28.paginators.json').pagination;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.WAFRegional;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['wafv2'] = {};\nAWS.WAFV2 = Service.defineService('wafv2', ['2019-07-29']);\nObject.defineProperty(apiLoader.services['wafv2'], '2019-07-29', {\n get: function get() {\n var model = require('../apis/wafv2-2019-07-29.min.json');\n model.paginators = require('../apis/wafv2-2019-07-29.paginators.json').pagination;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.WAFV2;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['wellarchitected'] = {};\nAWS.WellArchitected = Service.defineService('wellarchitected', ['2020-03-31']);\nObject.defineProperty(apiLoader.services['wellarchitected'], '2020-03-31', {\n get: function get() {\n var model = require('../apis/wellarchitected-2020-03-31.min.json');\n model.paginators = require('../apis/wellarchitected-2020-03-31.paginators.json').pagination;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.WellArchitected;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['workdocs'] = {};\nAWS.WorkDocs = Service.defineService('workdocs', ['2016-05-01']);\nObject.defineProperty(apiLoader.services['workdocs'], '2016-05-01', {\n get: function get() {\n var model = require('../apis/workdocs-2016-05-01.min.json');\n model.paginators = require('../apis/workdocs-2016-05-01.paginators.json').pagination;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.WorkDocs;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['worklink'] = {};\nAWS.WorkLink = Service.defineService('worklink', ['2018-09-25']);\nObject.defineProperty(apiLoader.services['worklink'], '2018-09-25', {\n get: function get() {\n var model = require('../apis/worklink-2018-09-25.min.json');\n model.paginators = require('../apis/worklink-2018-09-25.paginators.json').pagination;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.WorkLink;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['workmail'] = {};\nAWS.WorkMail = Service.defineService('workmail', ['2017-10-01']);\nObject.defineProperty(apiLoader.services['workmail'], '2017-10-01', {\n get: function get() {\n var model = require('../apis/workmail-2017-10-01.min.json');\n model.paginators = require('../apis/workmail-2017-10-01.paginators.json').pagination;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.WorkMail;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['workmailmessageflow'] = {};\nAWS.WorkMailMessageFlow = Service.defineService('workmailmessageflow', ['2019-05-01']);\nObject.defineProperty(apiLoader.services['workmailmessageflow'], '2019-05-01', {\n get: function get() {\n var model = require('../apis/workmailmessageflow-2019-05-01.min.json');\n model.paginators = require('../apis/workmailmessageflow-2019-05-01.paginators.json').pagination;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.WorkMailMessageFlow;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['workspaces'] = {};\nAWS.WorkSpaces = Service.defineService('workspaces', ['2015-04-08']);\nObject.defineProperty(apiLoader.services['workspaces'], '2015-04-08', {\n get: function get() {\n var model = require('../apis/workspaces-2015-04-08.min.json');\n model.paginators = require('../apis/workspaces-2015-04-08.paginators.json').pagination;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.WorkSpaces;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['xray'] = {};\nAWS.XRay = Service.defineService('xray', ['2016-04-12']);\nObject.defineProperty(apiLoader.services['xray'], '2016-04-12', {\n get: function get() {\n var model = require('../apis/xray-2016-04-12.min.json');\n model.paginators = require('../apis/xray-2016-04-12.paginators.json').pagination;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.XRay;\n","function apiLoader(svc, version) {\n if (!apiLoader.services.hasOwnProperty(svc)) {\n throw new Error('InvalidService: Failed to load api for ' + svc);\n }\n return apiLoader.services[svc][version];\n}\n\n/**\n * @api private\n *\n * This member of AWS.apiLoader is private, but changing it will necessitate a\n * change to ../scripts/services-table-generator.ts\n */\napiLoader.services = {};\n\n/**\n * @api private\n */\nmodule.exports = apiLoader;\n","require('./node_loader');\n\nvar AWS = require('./core');\n\n// Load all service classes\nrequire('../clients/all');\n\n/**\n * @api private\n */\nmodule.exports = AWS;\n","var AWS = require('../core'),\n url = AWS.util.url,\n crypto = AWS.util.crypto.lib,\n base64Encode = AWS.util.base64.encode,\n inherit = AWS.util.inherit;\n\nvar queryEncode = function (string) {\n var replacements = {\n '+': '-',\n '=': '_',\n '/': '~'\n };\n return string.replace(/[\\+=\\/]/g, function (match) {\n return replacements[match];\n });\n};\n\nvar signPolicy = function (policy, privateKey) {\n var sign = crypto.createSign('RSA-SHA1');\n sign.write(policy);\n return queryEncode(sign.sign(privateKey, 'base64'));\n};\n\nvar signWithCannedPolicy = function (url, expires, keyPairId, privateKey) {\n var policy = JSON.stringify({\n Statement: [\n {\n Resource: url,\n Condition: { DateLessThan: { 'AWS:EpochTime': expires } }\n }\n ]\n });\n\n return {\n Expires: expires,\n 'Key-Pair-Id': keyPairId,\n Signature: signPolicy(policy.toString(), privateKey)\n };\n};\n\nvar signWithCustomPolicy = function (policy, keyPairId, privateKey) {\n policy = policy.replace(/\\s/mg, '');\n\n return {\n Policy: queryEncode(base64Encode(policy)),\n 'Key-Pair-Id': keyPairId,\n Signature: signPolicy(policy, privateKey)\n };\n};\n\nvar determineScheme = function (url) {\n var parts = url.split('://');\n if (parts.length < 2) {\n throw new Error('Invalid URL.');\n }\n\n return parts[0].replace('*', '');\n};\n\nvar getRtmpUrl = function (rtmpUrl) {\n var parsed = url.parse(rtmpUrl);\n return parsed.path.replace(/^\\//, '') + (parsed.hash || '');\n};\n\nvar getResource = function (url) {\n switch (determineScheme(url)) {\n case 'http':\n case 'https':\n return url;\n case 'rtmp':\n return getRtmpUrl(url);\n default:\n throw new Error('Invalid URI scheme. Scheme must be one of'\n + ' http, https, or rtmp');\n }\n};\n\nvar handleError = function (err, callback) {\n if (!callback || typeof callback !== 'function') {\n throw err;\n }\n\n callback(err);\n};\n\nvar handleSuccess = function (result, callback) {\n if (!callback || typeof callback !== 'function') {\n return result;\n }\n\n callback(null, result);\n};\n\nAWS.CloudFront.Signer = inherit({\n /**\n * A signer object can be used to generate signed URLs and cookies for granting\n * access to content on restricted CloudFront distributions.\n *\n * @see http://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/PrivateContent.html\n *\n * @param keyPairId [String] (Required) The ID of the CloudFront key pair\n * being used.\n * @param privateKey [String] (Required) A private key in RSA format.\n */\n constructor: function Signer(keyPairId, privateKey) {\n if (keyPairId === void 0 || privateKey === void 0) {\n throw new Error('A key pair ID and private key are required');\n }\n\n this.keyPairId = keyPairId;\n this.privateKey = privateKey;\n },\n\n /**\n * Create a signed Amazon CloudFront Cookie.\n *\n * @param options [Object] The options to create a signed cookie.\n * @option options url [String] The URL to which the signature will grant\n * access. Required unless you pass in a full\n * policy.\n * @option options expires [Number] A Unix UTC timestamp indicating when the\n * signature should expire. Required unless you\n * pass in a full policy.\n * @option options policy [String] A CloudFront JSON policy. Required unless\n * you pass in a url and an expiry time.\n *\n * @param cb [Function] if a callback is provided, this function will\n * pass the hash as the second parameter (after the error parameter) to\n * the callback function.\n *\n * @return [Object] if called synchronously (with no callback), returns the\n * signed cookie parameters.\n * @return [null] nothing is returned if a callback is provided.\n */\n getSignedCookie: function (options, cb) {\n var signatureHash = 'policy' in options\n ? signWithCustomPolicy(options.policy, this.keyPairId, this.privateKey)\n : signWithCannedPolicy(options.url, options.expires, this.keyPairId, this.privateKey);\n\n var cookieHash = {};\n for (var key in signatureHash) {\n if (Object.prototype.hasOwnProperty.call(signatureHash, key)) {\n cookieHash['CloudFront-' + key] = signatureHash[key];\n }\n }\n\n return handleSuccess(cookieHash, cb);\n },\n\n /**\n * Create a signed Amazon CloudFront URL.\n *\n * Keep in mind that URLs meant for use in media/flash players may have\n * different requirements for URL formats (e.g. some require that the\n * extension be removed, some require the file name to be prefixed\n * - mp4:, some require you to add \"/cfx/st\" into your URL).\n *\n * @param options [Object] The options to create a signed URL.\n * @option options url [String] The URL to which the signature will grant\n * access. Any query params included with\n * the URL should be encoded. Required.\n * @option options expires [Number] A Unix UTC timestamp indicating when the\n * signature should expire. Required unless you\n * pass in a full policy.\n * @option options policy [String] A CloudFront JSON policy. Required unless\n * you pass in a url and an expiry time.\n *\n * @param cb [Function] if a callback is provided, this function will\n * pass the URL as the second parameter (after the error parameter) to\n * the callback function.\n *\n * @return [String] if called synchronously (with no callback), returns the\n * signed URL.\n * @return [null] nothing is returned if a callback is provided.\n */\n getSignedUrl: function (options, cb) {\n try {\n var resource = getResource(options.url);\n } catch (err) {\n return handleError(err, cb);\n }\n\n var parsedUrl = url.parse(options.url, true),\n signatureHash = Object.prototype.hasOwnProperty.call(options, 'policy')\n ? signWithCustomPolicy(options.policy, this.keyPairId, this.privateKey)\n : signWithCannedPolicy(resource, options.expires, this.keyPairId, this.privateKey);\n\n parsedUrl.search = null;\n for (var key in signatureHash) {\n if (Object.prototype.hasOwnProperty.call(signatureHash, key)) {\n parsedUrl.query[key] = signatureHash[key];\n }\n }\n\n try {\n var signedUrl = determineScheme(options.url) === 'rtmp'\n ? getRtmpUrl(url.format(parsedUrl))\n : url.format(parsedUrl);\n } catch (err) {\n return handleError(err, cb);\n }\n\n return handleSuccess(signedUrl, cb);\n }\n});\n\n/**\n * @api private\n */\nmodule.exports = AWS.CloudFront.Signer;\n","var AWS = require('./core');\nrequire('./credentials');\nrequire('./credentials/credential_provider_chain');\nvar PromisesDependency;\n\n/**\n * The main configuration class used by all service objects to set\n * the region, credentials, and other options for requests.\n *\n * By default, credentials and region settings are left unconfigured.\n * This should be configured by the application before using any\n * AWS service APIs.\n *\n * In order to set global configuration options, properties should\n * be assigned to the global {AWS.config} object.\n *\n * @see AWS.config\n *\n * @!group General Configuration Options\n *\n * @!attribute credentials\n * @return [AWS.Credentials] the AWS credentials to sign requests with.\n *\n * @!attribute region\n * @example Set the global region setting to us-west-2\n * AWS.config.update({region: 'us-west-2'});\n * @return [AWS.Credentials] The region to send service requests to.\n * @see http://docs.amazonwebservices.com/general/latest/gr/rande.html\n * A list of available endpoints for each AWS service\n *\n * @!attribute maxRetries\n * @return [Integer] the maximum amount of retries to perform for a\n * service request. By default this value is calculated by the specific\n * service object that the request is being made to.\n *\n * @!attribute maxRedirects\n * @return [Integer] the maximum amount of redirects to follow for a\n * service request. Defaults to 10.\n *\n * @!attribute paramValidation\n * @return [Boolean|map] whether input parameters should be validated against\n * the operation description before sending the request. Defaults to true.\n * Pass a map to enable any of the following specific validation features:\n *\n * * **min** [Boolean] — Validates that a value meets the min\n * constraint. This is enabled by default when paramValidation is set\n * to `true`.\n * * **max** [Boolean] — Validates that a value meets the max\n * constraint.\n * * **pattern** [Boolean] — Validates that a string value matches a\n * regular expression.\n * * **enum** [Boolean] — Validates that a string value matches one\n * of the allowable enum values.\n *\n * @!attribute computeChecksums\n * @return [Boolean] whether to compute checksums for payload bodies when\n * the service accepts it (currently supported in S3 only).\n *\n * @!attribute convertResponseTypes\n * @return [Boolean] whether types are converted when parsing response data.\n * Currently only supported for JSON based services. Turning this off may\n * improve performance on large response payloads. Defaults to `true`.\n *\n * @!attribute correctClockSkew\n * @return [Boolean] whether to apply a clock skew correction and retry\n * requests that fail because of an skewed client clock. Defaults to\n * `false`.\n *\n * @!attribute sslEnabled\n * @return [Boolean] whether SSL is enabled for requests\n *\n * @!attribute s3ForcePathStyle\n * @return [Boolean] whether to force path style URLs for S3 objects\n *\n * @!attribute s3BucketEndpoint\n * @note Setting this configuration option requires an `endpoint` to be\n * provided explicitly to the service constructor.\n * @return [Boolean] whether the provided endpoint addresses an individual\n * bucket (false if it addresses the root API endpoint).\n *\n * @!attribute s3DisableBodySigning\n * @return [Boolean] whether to disable S3 body signing when using signature version `v4`.\n * Body signing can only be disabled when using https. Defaults to `true`.\n *\n * @!attribute s3UsEast1RegionalEndpoint\n * @return ['legacy'|'regional'] when region is set to 'us-east-1', whether to send s3\n * request to global endpoints or 'us-east-1' regional endpoints. This config is only\n * applicable to S3 client;\n * Defaults to 'legacy'\n * @!attribute s3UseArnRegion\n * @return [Boolean] whether to override the request region with the region inferred\n * from requested resource's ARN. Only available for S3 buckets\n * Defaults to `true`\n *\n * @!attribute useAccelerateEndpoint\n * @note This configuration option is only compatible with S3 while accessing\n * dns-compatible buckets.\n * @return [Boolean] Whether to use the Accelerate endpoint with the S3 service.\n * Defaults to `false`.\n *\n * @!attribute retryDelayOptions\n * @example Set the base retry delay for all services to 300 ms\n * AWS.config.update({retryDelayOptions: {base: 300}});\n * // Delays with maxRetries = 3: 300, 600, 1200\n * @example Set a custom backoff function to provide delay values on retries\n * AWS.config.update({retryDelayOptions: {customBackoff: function(retryCount, err) {\n * // returns delay in ms\n * }}});\n * @return [map] A set of options to configure the retry delay on retryable errors.\n * Currently supported options are:\n *\n * * **base** [Integer] — The base number of milliseconds to use in the\n * exponential backoff for operation retries. Defaults to 100 ms for all services except\n * DynamoDB, where it defaults to 50ms.\n *\n * * **customBackoff ** [function] — A custom function that accepts a\n * retry count and error and returns the amount of time to delay in\n * milliseconds. If the result is a non-zero negative value, no further\n * retry attempts will be made. The `base` option will be ignored if this\n * option is supplied. The function is only called for retryable errors.\n *\n * @!attribute httpOptions\n * @return [map] A set of options to pass to the low-level HTTP request.\n * Currently supported options are:\n *\n * * **proxy** [String] — the URL to proxy requests through\n * * **agent** [http.Agent, https.Agent] — the Agent object to perform\n * HTTP requests with. Used for connection pooling. Note that for\n * SSL connections, a special Agent object is used in order to enable\n * peer certificate verification. This feature is only supported in the\n * Node.js environment.\n * * **connectTimeout** [Integer] — Sets the socket to timeout after\n * failing to establish a connection with the server after\n * `connectTimeout` milliseconds. This timeout has no effect once a socket\n * connection has been established.\n * * **timeout** [Integer] — The number of milliseconds a request can\n * take before automatically being terminated.\n * Defaults to two minutes (120000).\n * * **xhrAsync** [Boolean] — Whether the SDK will send asynchronous\n * HTTP requests. Used in the browser environment only. Set to false to\n * send requests synchronously. Defaults to true (async on).\n * * **xhrWithCredentials** [Boolean] — Sets the \"withCredentials\"\n * property of an XMLHttpRequest object. Used in the browser environment\n * only. Defaults to false.\n * @!attribute logger\n * @return [#write,#log] an object that responds to .write() (like a stream)\n * or .log() (like the console object) in order to log information about\n * requests\n *\n * @!attribute systemClockOffset\n * @return [Number] an offset value in milliseconds to apply to all signing\n * times. Use this to compensate for clock skew when your system may be\n * out of sync with the service time. Note that this configuration option\n * can only be applied to the global `AWS.config` object and cannot be\n * overridden in service-specific configuration. Defaults to 0 milliseconds.\n *\n * @!attribute signatureVersion\n * @return [String] the signature version to sign requests with (overriding\n * the API configuration). Possible values are: 'v2', 'v3', 'v4'.\n *\n * @!attribute signatureCache\n * @return [Boolean] whether the signature to sign requests with (overriding\n * the API configuration) is cached. Only applies to the signature version 'v4'.\n * Defaults to `true`.\n *\n * @!attribute endpointDiscoveryEnabled\n * @return [Boolean|undefined] whether to call operations with endpoints\n * given by service dynamically. Setting this config to `true` will enable\n * endpoint discovery for all applicable operations. Setting it to `false`\n * will explicitly disable endpoint discovery even though operations that\n * require endpoint discovery will presumably fail. Leaving it to\n * `undefined` means SDK only do endpoint discovery when it's required.\n * Defaults to `undefined`\n *\n * @!attribute endpointCacheSize\n * @return [Number] the size of the global cache storing endpoints from endpoint\n * discovery operations. Once endpoint cache is created, updating this setting\n * cannot change existing cache size.\n * Defaults to 1000\n *\n * @!attribute hostPrefixEnabled\n * @return [Boolean] whether to marshal request parameters to the prefix of\n * hostname. Defaults to `true`.\n *\n * @!attribute stsRegionalEndpoints\n * @return ['legacy'|'regional'] whether to send sts request to global endpoints or\n * regional endpoints.\n * Defaults to 'legacy'\n */\nAWS.Config = AWS.util.inherit({\n /**\n * @!endgroup\n */\n\n /**\n * Creates a new configuration object. This is the object that passes\n * option data along to service requests, including credentials, security,\n * region information, and some service specific settings.\n *\n * @example Creating a new configuration object with credentials and region\n * var config = new AWS.Config({\n * accessKeyId: 'AKID', secretAccessKey: 'SECRET', region: 'us-west-2'\n * });\n * @option options accessKeyId [String] your AWS access key ID.\n * @option options secretAccessKey [String] your AWS secret access key.\n * @option options sessionToken [AWS.Credentials] the optional AWS\n * session token to sign requests with.\n * @option options credentials [AWS.Credentials] the AWS credentials\n * to sign requests with. You can either specify this object, or\n * specify the accessKeyId and secretAccessKey options directly.\n * @option options credentialProvider [AWS.CredentialProviderChain] the\n * provider chain used to resolve credentials if no static `credentials`\n * property is set.\n * @option options region [String] the region to send service requests to.\n * See {region} for more information.\n * @option options maxRetries [Integer] the maximum amount of retries to\n * attempt with a request. See {maxRetries} for more information.\n * @option options maxRedirects [Integer] the maximum amount of redirects to\n * follow with a request. See {maxRedirects} for more information.\n * @option options sslEnabled [Boolean] whether to enable SSL for\n * requests.\n * @option options paramValidation [Boolean|map] whether input parameters\n * should be validated against the operation description before sending\n * the request. Defaults to true. Pass a map to enable any of the\n * following specific validation features:\n *\n * * **min** [Boolean] — Validates that a value meets the min\n * constraint. This is enabled by default when paramValidation is set\n * to `true`.\n * * **max** [Boolean] — Validates that a value meets the max\n * constraint.\n * * **pattern** [Boolean] — Validates that a string value matches a\n * regular expression.\n * * **enum** [Boolean] — Validates that a string value matches one\n * of the allowable enum values.\n * @option options computeChecksums [Boolean] whether to compute checksums\n * for payload bodies when the service accepts it (currently supported\n * in S3 only)\n * @option options convertResponseTypes [Boolean] whether types are converted\n * when parsing response data. Currently only supported for JSON based\n * services. Turning this off may improve performance on large response\n * payloads. Defaults to `true`.\n * @option options correctClockSkew [Boolean] whether to apply a clock skew\n * correction and retry requests that fail because of an skewed client\n * clock. Defaults to `false`.\n * @option options s3ForcePathStyle [Boolean] whether to force path\n * style URLs for S3 objects.\n * @option options s3BucketEndpoint [Boolean] whether the provided endpoint\n * addresses an individual bucket (false if it addresses the root API\n * endpoint). Note that setting this configuration option requires an\n * `endpoint` to be provided explicitly to the service constructor.\n * @option options s3DisableBodySigning [Boolean] whether S3 body signing\n * should be disabled when using signature version `v4`. Body signing\n * can only be disabled when using https. Defaults to `true`.\n * @option options s3UsEast1RegionalEndpoint ['legacy'|'regional'] when region\n * is set to 'us-east-1', whether to send s3 request to global endpoints or\n * 'us-east-1' regional endpoints. This config is only applicable to S3 client.\n * Defaults to `legacy`\n * @option options s3UseArnRegion [Boolean] whether to override the request region\n * with the region inferred from requested resource's ARN. Only available for S3 buckets\n * Defaults to `true`\n *\n * @option options retryDelayOptions [map] A set of options to configure\n * the retry delay on retryable errors. Currently supported options are:\n *\n * * **base** [Integer] — The base number of milliseconds to use in the\n * exponential backoff for operation retries. Defaults to 100 ms for all\n * services except DynamoDB, where it defaults to 50ms.\n * * **customBackoff ** [function] — A custom function that accepts a\n * retry count and error and returns the amount of time to delay in\n * milliseconds. If the result is a non-zero negative value, no further\n * retry attempts will be made. The `base` option will be ignored if this\n * option is supplied. The function is only called for retryable errors.\n * @option options httpOptions [map] A set of options to pass to the low-level\n * HTTP request. Currently supported options are:\n *\n * * **proxy** [String] — the URL to proxy requests through\n * * **agent** [http.Agent, https.Agent] — the Agent object to perform\n * HTTP requests with. Used for connection pooling. Defaults to the global\n * agent (`http.globalAgent`) for non-SSL connections. Note that for\n * SSL connections, a special Agent object is used in order to enable\n * peer certificate verification. This feature is only available in the\n * Node.js environment.\n * * **connectTimeout** [Integer] — Sets the socket to timeout after\n * failing to establish a connection with the server after\n * `connectTimeout` milliseconds. This timeout has no effect once a socket\n * connection has been established.\n * * **timeout** [Integer] — Sets the socket to timeout after timeout\n * milliseconds of inactivity on the socket. Defaults to two minutes\n * (120000).\n * * **xhrAsync** [Boolean] — Whether the SDK will send asynchronous\n * HTTP requests. Used in the browser environment only. Set to false to\n * send requests synchronously. Defaults to true (async on).\n * * **xhrWithCredentials** [Boolean] — Sets the \"withCredentials\"\n * property of an XMLHttpRequest object. Used in the browser environment\n * only. Defaults to false.\n * @option options apiVersion [String, Date] a String in YYYY-MM-DD format\n * (or a date) that represents the latest possible API version that can be\n * used in all services (unless overridden by `apiVersions`). Specify\n * 'latest' to use the latest possible version.\n * @option options apiVersions [map] a map of service\n * identifiers (the lowercase service class name) with the API version to\n * use when instantiating a service. Specify 'latest' for each individual\n * that can use the latest available version.\n * @option options logger [#write,#log] an object that responds to .write()\n * (like a stream) or .log() (like the console object) in order to log\n * information about requests\n * @option options systemClockOffset [Number] an offset value in milliseconds\n * to apply to all signing times. Use this to compensate for clock skew\n * when your system may be out of sync with the service time. Note that\n * this configuration option can only be applied to the global `AWS.config`\n * object and cannot be overridden in service-specific configuration.\n * Defaults to 0 milliseconds.\n * @option options signatureVersion [String] the signature version to sign\n * requests with (overriding the API configuration). Possible values are:\n * 'v2', 'v3', 'v4'.\n * @option options signatureCache [Boolean] whether the signature to sign\n * requests with (overriding the API configuration) is cached. Only applies\n * to the signature version 'v4'. Defaults to `true`.\n * @option options dynamoDbCrc32 [Boolean] whether to validate the CRC32\n * checksum of HTTP response bodies returned by DynamoDB. Default: `true`.\n * @option options useAccelerateEndpoint [Boolean] Whether to use the\n * S3 Transfer Acceleration endpoint with the S3 service. Default: `false`.\n * @option options clientSideMonitoring [Boolean] whether to collect and\n * publish this client's performance metrics of all its API requests.\n * @option options endpointDiscoveryEnabled [Boolean|undefined] whether to\n * call operations with endpoints given by service dynamically. Setting this\n * config to `true` will enable endpoint discovery for all applicable operations.\n * Setting it to `false` will explicitly disable endpoint discovery even though\n * operations that require endpoint discovery will presumably fail. Leaving it\n * to `undefined` means SDK will only do endpoint discovery when it's required.\n * Defaults to `undefined`\n * @option options endpointCacheSize [Number] the size of the global cache storing\n * endpoints from endpoint discovery operations. Once endpoint cache is created,\n * updating this setting cannot change existing cache size.\n * Defaults to 1000\n * @option options hostPrefixEnabled [Boolean] whether to marshal request\n * parameters to the prefix of hostname.\n * Defaults to `true`.\n * @option options stsRegionalEndpoints ['legacy'|'regional'] whether to send sts request\n * to global endpoints or regional endpoints.\n * Defaults to 'legacy'.\n */\n constructor: function Config(options) {\n if (options === undefined) options = {};\n options = this.extractCredentials(options);\n\n AWS.util.each.call(this, this.keys, function (key, value) {\n this.set(key, options[key], value);\n });\n },\n\n /**\n * @!group Managing Credentials\n */\n\n /**\n * Loads credentials from the configuration object. This is used internally\n * by the SDK to ensure that refreshable {Credentials} objects are properly\n * refreshed and loaded when sending a request. If you want to ensure that\n * your credentials are loaded prior to a request, you can use this method\n * directly to provide accurate credential data stored in the object.\n *\n * @note If you configure the SDK with static or environment credentials,\n * the credential data should already be present in {credentials} attribute.\n * This method is primarily necessary to load credentials from asynchronous\n * sources, or sources that can refresh credentials periodically.\n * @example Getting your access key\n * AWS.config.getCredentials(function(err) {\n * if (err) console.log(err.stack); // credentials not loaded\n * else console.log(\"Access Key:\", AWS.config.credentials.accessKeyId);\n * })\n * @callback callback function(err)\n * Called when the {credentials} have been properly set on the configuration\n * object.\n *\n * @param err [Error] if this is set, credentials were not successfully\n * loaded and this error provides information why.\n * @see credentials\n * @see Credentials\n */\n getCredentials: function getCredentials(callback) {\n var self = this;\n\n function finish(err) {\n callback(err, err ? null : self.credentials);\n }\n\n function credError(msg, err) {\n return new AWS.util.error(err || new Error(), {\n code: 'CredentialsError',\n message: msg,\n name: 'CredentialsError'\n });\n }\n\n function getAsyncCredentials() {\n self.credentials.get(function(err) {\n if (err) {\n var msg = 'Could not load credentials from ' +\n self.credentials.constructor.name;\n err = credError(msg, err);\n }\n finish(err);\n });\n }\n\n function getStaticCredentials() {\n var err = null;\n if (!self.credentials.accessKeyId || !self.credentials.secretAccessKey) {\n err = credError('Missing credentials');\n }\n finish(err);\n }\n\n if (self.credentials) {\n if (typeof self.credentials.get === 'function') {\n getAsyncCredentials();\n } else { // static credentials\n getStaticCredentials();\n }\n } else if (self.credentialProvider) {\n self.credentialProvider.resolve(function(err, creds) {\n if (err) {\n err = credError('Could not load credentials from any providers', err);\n }\n self.credentials = creds;\n finish(err);\n });\n } else {\n finish(credError('No credentials to load'));\n }\n },\n\n /**\n * @!group Loading and Setting Configuration Options\n */\n\n /**\n * @overload update(options, allowUnknownKeys = false)\n * Updates the current configuration object with new options.\n *\n * @example Update maxRetries property of a configuration object\n * config.update({maxRetries: 10});\n * @param [Object] options a map of option keys and values.\n * @param [Boolean] allowUnknownKeys whether unknown keys can be set on\n * the configuration object. Defaults to `false`.\n * @see constructor\n */\n update: function update(options, allowUnknownKeys) {\n allowUnknownKeys = allowUnknownKeys || false;\n options = this.extractCredentials(options);\n AWS.util.each.call(this, options, function (key, value) {\n if (allowUnknownKeys || Object.prototype.hasOwnProperty.call(this.keys, key) ||\n AWS.Service.hasService(key)) {\n this.set(key, value);\n }\n });\n },\n\n /**\n * Loads configuration data from a JSON file into this config object.\n * @note Loading configuration will reset all existing configuration\n * on the object.\n * @!macro nobrowser\n * @param path [String] the path relative to your process's current\n * working directory to load configuration from.\n * @return [AWS.Config] the same configuration object\n */\n loadFromPath: function loadFromPath(path) {\n this.clear();\n\n var options = JSON.parse(AWS.util.readFileSync(path));\n var fileSystemCreds = new AWS.FileSystemCredentials(path);\n var chain = new AWS.CredentialProviderChain();\n chain.providers.unshift(fileSystemCreds);\n chain.resolve(function (err, creds) {\n if (err) throw err;\n else options.credentials = creds;\n });\n\n this.constructor(options);\n\n return this;\n },\n\n /**\n * Clears configuration data on this object\n *\n * @api private\n */\n clear: function clear() {\n /*jshint forin:false */\n AWS.util.each.call(this, this.keys, function (key) {\n delete this[key];\n });\n\n // reset credential provider\n this.set('credentials', undefined);\n this.set('credentialProvider', undefined);\n },\n\n /**\n * Sets a property on the configuration object, allowing for a\n * default value\n * @api private\n */\n set: function set(property, value, defaultValue) {\n if (value === undefined) {\n if (defaultValue === undefined) {\n defaultValue = this.keys[property];\n }\n if (typeof defaultValue === 'function') {\n this[property] = defaultValue.call(this);\n } else {\n this[property] = defaultValue;\n }\n } else if (property === 'httpOptions' && this[property]) {\n // deep merge httpOptions\n this[property] = AWS.util.merge(this[property], value);\n } else {\n this[property] = value;\n }\n },\n\n /**\n * All of the keys with their default values.\n *\n * @constant\n * @api private\n */\n keys: {\n credentials: null,\n credentialProvider: null,\n region: null,\n logger: null,\n apiVersions: {},\n apiVersion: null,\n endpoint: undefined,\n httpOptions: {\n timeout: 120000\n },\n maxRetries: undefined,\n maxRedirects: 10,\n paramValidation: true,\n sslEnabled: true,\n s3ForcePathStyle: false,\n s3BucketEndpoint: false,\n s3DisableBodySigning: true,\n s3UsEast1RegionalEndpoint: 'legacy',\n s3UseArnRegion: undefined,\n computeChecksums: true,\n convertResponseTypes: true,\n correctClockSkew: false,\n customUserAgent: null,\n dynamoDbCrc32: true,\n systemClockOffset: 0,\n signatureVersion: null,\n signatureCache: true,\n retryDelayOptions: {},\n useAccelerateEndpoint: false,\n clientSideMonitoring: false,\n endpointDiscoveryEnabled: undefined,\n endpointCacheSize: 1000,\n hostPrefixEnabled: true,\n stsRegionalEndpoints: 'legacy'\n },\n\n /**\n * Extracts accessKeyId, secretAccessKey and sessionToken\n * from a configuration hash.\n *\n * @api private\n */\n extractCredentials: function extractCredentials(options) {\n if (options.accessKeyId && options.secretAccessKey) {\n options = AWS.util.copy(options);\n options.credentials = new AWS.Credentials(options);\n }\n return options;\n },\n\n /**\n * Sets the promise dependency the SDK will use wherever Promises are returned.\n * Passing `null` will force the SDK to use native Promises if they are available.\n * If native Promises are not available, passing `null` will have no effect.\n * @param [Constructor] dep A reference to a Promise constructor\n */\n setPromisesDependency: function setPromisesDependency(dep) {\n PromisesDependency = dep;\n // if null was passed in, we should try to use native promises\n if (dep === null && typeof Promise === 'function') {\n PromisesDependency = Promise;\n }\n var constructors = [AWS.Request, AWS.Credentials, AWS.CredentialProviderChain];\n if (AWS.S3) {\n constructors.push(AWS.S3);\n if (AWS.S3.ManagedUpload) {\n constructors.push(AWS.S3.ManagedUpload);\n }\n }\n AWS.util.addPromises(constructors, PromisesDependency);\n },\n\n /**\n * Gets the promise dependency set by `AWS.config.setPromisesDependency`.\n */\n getPromisesDependency: function getPromisesDependency() {\n return PromisesDependency;\n }\n});\n\n/**\n * @return [AWS.Config] The global configuration object singleton instance\n * @readonly\n * @see AWS.Config\n */\nAWS.config = new AWS.Config();\n","var AWS = require('./core');\n/**\n * @api private\n */\nfunction validateRegionalEndpointsFlagValue(configValue, errorOptions) {\n if (typeof configValue !== 'string') return undefined;\n else if (['legacy', 'regional'].indexOf(configValue.toLowerCase()) >= 0) {\n return configValue.toLowerCase();\n } else {\n throw AWS.util.error(new Error(), errorOptions);\n }\n}\n\n/**\n * Resolve the configuration value for regional endpoint from difference sources: client\n * config, environmental variable, shared config file. Value can be case-insensitive\n * 'legacy' or 'reginal'.\n * @param originalConfig user-supplied config object to resolve\n * @param options a map of config property names from individual configuration source\n * - env: name of environmental variable that refers to the config\n * - sharedConfig: name of shared configuration file property that refers to the config\n * - clientConfig: name of client configuration property that refers to the config\n *\n * @api private\n */\nfunction resolveRegionalEndpointsFlag(originalConfig, options) {\n originalConfig = originalConfig || {};\n //validate config value\n var resolved;\n if (originalConfig[options.clientConfig]) {\n resolved = validateRegionalEndpointsFlagValue(originalConfig[options.clientConfig], {\n code: 'InvalidConfiguration',\n message: 'invalid \"' + options.clientConfig + '\" configuration. Expect \"legacy\" ' +\n ' or \"regional\". Got \"' + originalConfig[options.clientConfig] + '\".'\n });\n if (resolved) return resolved;\n }\n if (!AWS.util.isNode()) return resolved;\n //validate environmental variable\n if (Object.prototype.hasOwnProperty.call(process.env, options.env)) {\n var envFlag = process.env[options.env];\n resolved = validateRegionalEndpointsFlagValue(envFlag, {\n code: 'InvalidEnvironmentalVariable',\n message: 'invalid ' + options.env + ' environmental variable. Expect \"legacy\" ' +\n ' or \"regional\". Got \"' + process.env[options.env] + '\".'\n });\n if (resolved) return resolved;\n }\n //validate shared config file\n var profile = {};\n try {\n var profiles = AWS.util.getProfilesFromSharedConfig(AWS.util.iniLoader);\n profile = profiles[process.env.AWS_PROFILE || AWS.util.defaultProfile];\n } catch (e) {};\n if (profile && Object.prototype.hasOwnProperty.call(profile, options.sharedConfig)) {\n var fileFlag = profile[options.sharedConfig];\n resolved = validateRegionalEndpointsFlagValue(fileFlag, {\n code: 'InvalidConfiguration',\n message: 'invalid ' + options.sharedConfig + ' profile config. Expect \"legacy\" ' +\n ' or \"regional\". Got \"' + profile[options.sharedConfig] + '\".'\n });\n if (resolved) return resolved;\n }\n return resolved;\n}\n\nmodule.exports = resolveRegionalEndpointsFlag;\n","/**\n * The main AWS namespace\n */\nvar AWS = { util: require('./util') };\n\n/**\n * @api private\n * @!macro [new] nobrowser\n * @note This feature is not supported in the browser environment of the SDK.\n */\nvar _hidden = {}; _hidden.toString(); // hack to parse macro\n\n/**\n * @api private\n */\nmodule.exports = AWS;\n\nAWS.util.update(AWS, {\n\n /**\n * @constant\n */\n VERSION: '2.889.0',\n\n /**\n * @api private\n */\n Signers: {},\n\n /**\n * @api private\n */\n Protocol: {\n Json: require('./protocol/json'),\n Query: require('./protocol/query'),\n Rest: require('./protocol/rest'),\n RestJson: require('./protocol/rest_json'),\n RestXml: require('./protocol/rest_xml')\n },\n\n /**\n * @api private\n */\n XML: {\n Builder: require('./xml/builder'),\n Parser: null // conditionally set based on environment\n },\n\n /**\n * @api private\n */\n JSON: {\n Builder: require('./json/builder'),\n Parser: require('./json/parser')\n },\n\n /**\n * @api private\n */\n Model: {\n Api: require('./model/api'),\n Operation: require('./model/operation'),\n Shape: require('./model/shape'),\n Paginator: require('./model/paginator'),\n ResourceWaiter: require('./model/resource_waiter')\n },\n\n /**\n * @api private\n */\n apiLoader: require('./api_loader'),\n\n /**\n * @api private\n */\n EndpointCache: require('../vendor/endpoint-cache').EndpointCache\n});\nrequire('./sequential_executor');\nrequire('./service');\nrequire('./config');\nrequire('./http');\nrequire('./event_listeners');\nrequire('./request');\nrequire('./response');\nrequire('./resource_waiter');\nrequire('./signers/request_signer');\nrequire('./param_validator');\n\n/**\n * @readonly\n * @return [AWS.SequentialExecutor] a collection of global event listeners that\n * are attached to every sent request.\n * @see AWS.Request AWS.Request for a list of events to listen for\n * @example Logging the time taken to send a request\n * AWS.events.on('send', function startSend(resp) {\n * resp.startTime = new Date().getTime();\n * }).on('complete', function calculateTime(resp) {\n * var time = (new Date().getTime() - resp.startTime) / 1000;\n * console.log('Request took ' + time + ' seconds');\n * });\n *\n * new AWS.S3().listBuckets(); // prints 'Request took 0.285 seconds'\n */\nAWS.events = new AWS.SequentialExecutor();\n\n//create endpoint cache lazily\nAWS.util.memoizedProperty(AWS, 'endpointCache', function() {\n return new AWS.EndpointCache(AWS.config.endpointCacheSize);\n}, true);\n","var AWS = require('./core');\n\n/**\n * Represents your AWS security credentials, specifically the\n * {accessKeyId}, {secretAccessKey}, and optional {sessionToken}.\n * Creating a `Credentials` object allows you to pass around your\n * security information to configuration and service objects.\n *\n * Note that this class typically does not need to be constructed manually,\n * as the {AWS.Config} and {AWS.Service} classes both accept simple\n * options hashes with the three keys. These structures will be converted\n * into Credentials objects automatically.\n *\n * ## Expiring and Refreshing Credentials\n *\n * Occasionally credentials can expire in the middle of a long-running\n * application. In this case, the SDK will automatically attempt to\n * refresh the credentials from the storage location if the Credentials\n * class implements the {refresh} method.\n *\n * If you are implementing a credential storage location, you\n * will want to create a subclass of the `Credentials` class and\n * override the {refresh} method. This method allows credentials to be\n * retrieved from the backing store, be it a file system, database, or\n * some network storage. The method should reset the credential attributes\n * on the object.\n *\n * @!attribute expired\n * @return [Boolean] whether the credentials have been expired and\n * require a refresh. Used in conjunction with {expireTime}.\n * @!attribute expireTime\n * @return [Date] a time when credentials should be considered expired. Used\n * in conjunction with {expired}.\n * @!attribute accessKeyId\n * @return [String] the AWS access key ID\n * @!attribute secretAccessKey\n * @return [String] the AWS secret access key\n * @!attribute sessionToken\n * @return [String] an optional AWS session token\n */\nAWS.Credentials = AWS.util.inherit({\n /**\n * A credentials object can be created using positional arguments or an options\n * hash.\n *\n * @overload AWS.Credentials(accessKeyId, secretAccessKey, sessionToken=null)\n * Creates a Credentials object with a given set of credential information\n * as positional arguments.\n * @param accessKeyId [String] the AWS access key ID\n * @param secretAccessKey [String] the AWS secret access key\n * @param sessionToken [String] the optional AWS session token\n * @example Create a credentials object with AWS credentials\n * var creds = new AWS.Credentials('akid', 'secret', 'session');\n * @overload AWS.Credentials(options)\n * Creates a Credentials object with a given set of credential information\n * as an options hash.\n * @option options accessKeyId [String] the AWS access key ID\n * @option options secretAccessKey [String] the AWS secret access key\n * @option options sessionToken [String] the optional AWS session token\n * @example Create a credentials object with AWS credentials\n * var creds = new AWS.Credentials({\n * accessKeyId: 'akid', secretAccessKey: 'secret', sessionToken: 'session'\n * });\n */\n constructor: function Credentials() {\n // hide secretAccessKey from being displayed with util.inspect\n AWS.util.hideProperties(this, ['secretAccessKey']);\n\n this.expired = false;\n this.expireTime = null;\n this.refreshCallbacks = [];\n if (arguments.length === 1 && typeof arguments[0] === 'object') {\n var creds = arguments[0].credentials || arguments[0];\n this.accessKeyId = creds.accessKeyId;\n this.secretAccessKey = creds.secretAccessKey;\n this.sessionToken = creds.sessionToken;\n } else {\n this.accessKeyId = arguments[0];\n this.secretAccessKey = arguments[1];\n this.sessionToken = arguments[2];\n }\n },\n\n /**\n * @return [Integer] the number of seconds before {expireTime} during which\n * the credentials will be considered expired.\n */\n expiryWindow: 15,\n\n /**\n * @return [Boolean] whether the credentials object should call {refresh}\n * @note Subclasses should override this method to provide custom refresh\n * logic.\n */\n needsRefresh: function needsRefresh() {\n var currentTime = AWS.util.date.getDate().getTime();\n var adjustedTime = new Date(currentTime + this.expiryWindow * 1000);\n\n if (this.expireTime && adjustedTime > this.expireTime) {\n return true;\n } else {\n return this.expired || !this.accessKeyId || !this.secretAccessKey;\n }\n },\n\n /**\n * Gets the existing credentials, refreshing them if they are not yet loaded\n * or have expired. Users should call this method before using {refresh},\n * as this will not attempt to reload credentials when they are already\n * loaded into the object.\n *\n * @callback callback function(err)\n * When this callback is called with no error, it means either credentials\n * do not need to be refreshed or refreshed credentials information has\n * been loaded into the object (as the `accessKeyId`, `secretAccessKey`,\n * and `sessionToken` properties).\n * @param err [Error] if an error occurred, this value will be filled\n */\n get: function get(callback) {\n var self = this;\n if (this.needsRefresh()) {\n this.refresh(function(err) {\n if (!err) self.expired = false; // reset expired flag\n if (callback) callback(err);\n });\n } else if (callback) {\n callback();\n }\n },\n\n /**\n * @!method getPromise()\n * Returns a 'thenable' promise.\n * Gets the existing credentials, refreshing them if they are not yet loaded\n * or have expired. Users should call this method before using {refresh},\n * as this will not attempt to reload credentials when they are already\n * loaded into the object.\n *\n * Two callbacks can be provided to the `then` method on the returned promise.\n * The first callback will be called if the promise is fulfilled, and the second\n * callback will be called if the promise is rejected.\n * @callback fulfilledCallback function()\n * Called if the promise is fulfilled. When this callback is called, it\n * means either credentials do not need to be refreshed or refreshed\n * credentials information has been loaded into the object (as the\n * `accessKeyId`, `secretAccessKey`, and `sessionToken` properties).\n * @callback rejectedCallback function(err)\n * Called if the promise is rejected.\n * @param err [Error] if an error occurred, this value will be filled\n * @return [Promise] A promise that represents the state of the `get` call.\n * @example Calling the `getPromise` method.\n * var promise = credProvider.getPromise();\n * promise.then(function() { ... }, function(err) { ... });\n */\n\n /**\n * @!method refreshPromise()\n * Returns a 'thenable' promise.\n * Refreshes the credentials. Users should call {get} before attempting\n * to forcibly refresh credentials.\n *\n * Two callbacks can be provided to the `then` method on the returned promise.\n * The first callback will be called if the promise is fulfilled, and the second\n * callback will be called if the promise is rejected.\n * @callback fulfilledCallback function()\n * Called if the promise is fulfilled. When this callback is called, it\n * means refreshed credentials information has been loaded into the object\n * (as the `accessKeyId`, `secretAccessKey`, and `sessionToken` properties).\n * @callback rejectedCallback function(err)\n * Called if the promise is rejected.\n * @param err [Error] if an error occurred, this value will be filled\n * @return [Promise] A promise that represents the state of the `refresh` call.\n * @example Calling the `refreshPromise` method.\n * var promise = credProvider.refreshPromise();\n * promise.then(function() { ... }, function(err) { ... });\n */\n\n /**\n * Refreshes the credentials. Users should call {get} before attempting\n * to forcibly refresh credentials.\n *\n * @callback callback function(err)\n * When this callback is called with no error, it means refreshed\n * credentials information has been loaded into the object (as the\n * `accessKeyId`, `secretAccessKey`, and `sessionToken` properties).\n * @param err [Error] if an error occurred, this value will be filled\n * @note Subclasses should override this class to reset the\n * {accessKeyId}, {secretAccessKey} and optional {sessionToken}\n * on the credentials object and then call the callback with\n * any error information.\n * @see get\n */\n refresh: function refresh(callback) {\n this.expired = false;\n callback();\n },\n\n /**\n * @api private\n * @param callback\n */\n coalesceRefresh: function coalesceRefresh(callback, sync) {\n var self = this;\n if (self.refreshCallbacks.push(callback) === 1) {\n self.load(function onLoad(err) {\n AWS.util.arrayEach(self.refreshCallbacks, function(callback) {\n if (sync) {\n callback(err);\n } else {\n // callback could throw, so defer to ensure all callbacks are notified\n AWS.util.defer(function () {\n callback(err);\n });\n }\n });\n self.refreshCallbacks.length = 0;\n });\n }\n },\n\n /**\n * @api private\n * @param callback\n */\n load: function load(callback) {\n callback();\n }\n});\n\n/**\n * @api private\n */\nAWS.Credentials.addPromisesToClass = function addPromisesToClass(PromiseDependency) {\n this.prototype.getPromise = AWS.util.promisifyMethod('get', PromiseDependency);\n this.prototype.refreshPromise = AWS.util.promisifyMethod('refresh', PromiseDependency);\n};\n\n/**\n * @api private\n */\nAWS.Credentials.deletePromisesFromClass = function deletePromisesFromClass() {\n delete this.prototype.getPromise;\n delete this.prototype.refreshPromise;\n};\n\nAWS.util.addPromises(AWS.Credentials);\n","var AWS = require('../core');\nvar STS = require('../../clients/sts');\n\n/**\n * Represents temporary credentials retrieved from {AWS.STS}. Without any\n * extra parameters, credentials will be fetched from the\n * {AWS.STS.getSessionToken} operation. If an IAM role is provided, the\n * {AWS.STS.assumeRole} operation will be used to fetch credentials for the\n * role instead.\n *\n * AWS.ChainableTemporaryCredentials differs from AWS.TemporaryCredentials in\n * the way masterCredentials and refreshes are handled.\n * AWS.ChainableTemporaryCredentials refreshes expired credentials using the\n * masterCredentials passed by the user to support chaining of STS credentials.\n * However, AWS.TemporaryCredentials recursively collapses the masterCredentials\n * during instantiation, precluding the ability to refresh credentials which\n * require intermediate, temporary credentials.\n *\n * For example, if the application should use RoleA, which must be assumed from\n * RoleB, and the environment provides credentials which can assume RoleB, then\n * AWS.ChainableTemporaryCredentials must be used to support refreshing the\n * temporary credentials for RoleA:\n *\n * ```javascript\n * var roleACreds = new AWS.ChainableTemporaryCredentials({\n * params: {RoleArn: 'RoleA'},\n * masterCredentials: new AWS.ChainableTemporaryCredentials({\n * params: {RoleArn: 'RoleB'},\n * masterCredentials: new AWS.EnvironmentCredentials('AWS')\n * })\n * });\n * ```\n *\n * If AWS.TemporaryCredentials had been used in the previous example,\n * `roleACreds` would fail to refresh because `roleACreds` would\n * use the environment credentials for the AssumeRole request.\n *\n * Another difference is that AWS.ChainableTemporaryCredentials creates the STS\n * service instance during instantiation while AWS.TemporaryCredentials creates\n * the STS service instance during the first refresh. Creating the service\n * instance during instantiation effectively captures the master credentials\n * from the global config, so that subsequent changes to the global config do\n * not affect the master credentials used to refresh the temporary credentials.\n *\n * This allows an instance of AWS.ChainableTemporaryCredentials to be assigned\n * to AWS.config.credentials:\n *\n * ```javascript\n * var envCreds = new AWS.EnvironmentCredentials('AWS');\n * AWS.config.credentials = envCreds;\n * // masterCredentials will be envCreds\n * AWS.config.credentials = new AWS.ChainableTemporaryCredentials({\n * params: {RoleArn: '...'}\n * });\n * ```\n *\n * Similarly, to use the CredentialProviderChain's default providers as the\n * master credentials, simply create a new instance of\n * AWS.ChainableTemporaryCredentials:\n *\n * ```javascript\n * AWS.config.credentials = new ChainableTemporaryCredentials({\n * params: {RoleArn: '...'}\n * });\n * ```\n *\n * @!attribute service\n * @return [AWS.STS] the STS service instance used to\n * get and refresh temporary credentials from AWS STS.\n * @note (see constructor)\n */\nAWS.ChainableTemporaryCredentials = AWS.util.inherit(AWS.Credentials, {\n /**\n * Creates a new temporary credentials object.\n *\n * @param options [map] a set of options\n * @option options params [map] ({}) a map of options that are passed to the\n * {AWS.STS.assumeRole} or {AWS.STS.getSessionToken} operations.\n * If a `RoleArn` parameter is passed in, credentials will be based on the\n * IAM role. If a `SerialNumber` parameter is passed in, {tokenCodeFn} must\n * also be passed in or an error will be thrown.\n * @option options masterCredentials [AWS.Credentials] the master credentials\n * used to get and refresh temporary credentials from AWS STS. By default,\n * AWS.config.credentials or AWS.config.credentialProvider will be used.\n * @option options tokenCodeFn [Function] (null) Function to provide\n * `TokenCode`, if `SerialNumber` is provided for profile in {params}. Function\n * is called with value of `SerialNumber` and `callback`, and should provide\n * the `TokenCode` or an error to the callback in the format\n * `callback(err, token)`.\n * @example Creating a new credentials object for generic temporary credentials\n * AWS.config.credentials = new AWS.ChainableTemporaryCredentials();\n * @example Creating a new credentials object for an IAM role\n * AWS.config.credentials = new AWS.ChainableTemporaryCredentials({\n * params: {\n * RoleArn: 'arn:aws:iam::1234567890:role/TemporaryCredentials'\n * }\n * });\n * @see AWS.STS.assumeRole\n * @see AWS.STS.getSessionToken\n */\n constructor: function ChainableTemporaryCredentials(options) {\n AWS.Credentials.call(this);\n options = options || {};\n this.errorCode = 'ChainableTemporaryCredentialsProviderFailure';\n this.expired = true;\n this.tokenCodeFn = null;\n\n var params = AWS.util.copy(options.params) || {};\n if (params.RoleArn) {\n params.RoleSessionName = params.RoleSessionName || 'temporary-credentials';\n }\n if (params.SerialNumber) {\n if (!options.tokenCodeFn || (typeof options.tokenCodeFn !== 'function')) {\n throw new AWS.util.error(\n new Error('tokenCodeFn must be a function when params.SerialNumber is given'),\n {code: this.errorCode}\n );\n } else {\n this.tokenCodeFn = options.tokenCodeFn;\n }\n }\n var config = AWS.util.merge(\n {\n params: params,\n credentials: options.masterCredentials || AWS.config.credentials\n },\n options.stsConfig || {}\n );\n this.service = new STS(config);\n },\n\n /**\n * Refreshes credentials using {AWS.STS.assumeRole} or\n * {AWS.STS.getSessionToken}, depending on whether an IAM role ARN was passed\n * to the credentials {constructor}.\n *\n * @callback callback function(err)\n * Called when the STS service responds (or fails). When\n * this callback is called with no error, it means that the credentials\n * information has been loaded into the object (as the `accessKeyId`,\n * `secretAccessKey`, and `sessionToken` properties).\n * @param err [Error] if an error occurred, this value will be filled\n * @see AWS.Credentials.get\n */\n refresh: function refresh(callback) {\n this.coalesceRefresh(callback || AWS.util.fn.callback);\n },\n\n /**\n * @api private\n * @param callback\n */\n load: function load(callback) {\n var self = this;\n var operation = self.service.config.params.RoleArn ? 'assumeRole' : 'getSessionToken';\n this.getTokenCode(function (err, tokenCode) {\n var params = {};\n if (err) {\n callback(err);\n return;\n }\n if (tokenCode) {\n params.TokenCode = tokenCode;\n }\n self.service[operation](params, function (err, data) {\n if (!err) {\n self.service.credentialsFrom(data, self);\n }\n callback(err);\n });\n });\n },\n\n /**\n * @api private\n */\n getTokenCode: function getTokenCode(callback) {\n var self = this;\n if (this.tokenCodeFn) {\n this.tokenCodeFn(this.service.config.params.SerialNumber, function (err, token) {\n if (err) {\n var message = err;\n if (err instanceof Error) {\n message = err.message;\n }\n callback(\n AWS.util.error(\n new Error('Error fetching MFA token: ' + message),\n { code: self.errorCode}\n )\n );\n return;\n }\n callback(null, token);\n });\n } else {\n callback(null);\n }\n }\n});\n","var AWS = require('../core');\nvar CognitoIdentity = require('../../clients/cognitoidentity');\nvar STS = require('../../clients/sts');\n\n/**\n * Represents credentials retrieved from STS Web Identity Federation using\n * the Amazon Cognito Identity service.\n *\n * By default this provider gets credentials using the\n * {AWS.CognitoIdentity.getCredentialsForIdentity} service operation, which\n * requires either an `IdentityId` or an `IdentityPoolId` (Amazon Cognito\n * Identity Pool ID), which is used to call {AWS.CognitoIdentity.getId} to\n * obtain an `IdentityId`. If the identity or identity pool is not configured in\n * the Amazon Cognito Console to use IAM roles with the appropriate permissions,\n * then additionally a `RoleArn` is required containing the ARN of the IAM trust\n * policy for the Amazon Cognito role that the user will log into. If a `RoleArn`\n * is provided, then this provider gets credentials using the\n * {AWS.STS.assumeRoleWithWebIdentity} service operation, after first getting an\n * Open ID token from {AWS.CognitoIdentity.getOpenIdToken}.\n *\n * In addition, if this credential provider is used to provide authenticated\n * login, the `Logins` map may be set to the tokens provided by the respective\n * identity providers. See {constructor} for an example on creating a credentials\n * object with proper property values.\n *\n * ## Refreshing Credentials from Identity Service\n *\n * In addition to AWS credentials expiring after a given amount of time, the\n * login token from the identity provider will also expire. Once this token\n * expires, it will not be usable to refresh AWS credentials, and another\n * token will be needed. The SDK does not manage refreshing of the token value,\n * but this can be done through a \"refresh token\" supported by most identity\n * providers. Consult the documentation for the identity provider for refreshing\n * tokens. Once the refreshed token is acquired, you should make sure to update\n * this new token in the credentials object's {params} property. The following\n * code will update the WebIdentityToken, assuming you have retrieved an updated\n * token from the identity provider:\n *\n * ```javascript\n * AWS.config.credentials.params.Logins['graph.facebook.com'] = updatedToken;\n * ```\n *\n * Future calls to `credentials.refresh()` will now use the new token.\n *\n * @!attribute params\n * @return [map] the map of params passed to\n * {AWS.CognitoIdentity.getId},\n * {AWS.CognitoIdentity.getOpenIdToken}, and\n * {AWS.STS.assumeRoleWithWebIdentity}. To update the token, set the\n * `params.WebIdentityToken` property.\n * @!attribute data\n * @return [map] the raw data response from the call to\n * {AWS.CognitoIdentity.getCredentialsForIdentity}, or\n * {AWS.STS.assumeRoleWithWebIdentity}. Use this if you want to get\n * access to other properties from the response.\n * @!attribute identityId\n * @return [String] the Cognito ID returned by the last call to\n * {AWS.CognitoIdentity.getOpenIdToken}. This ID represents the actual\n * final resolved identity ID from Amazon Cognito.\n */\nAWS.CognitoIdentityCredentials = AWS.util.inherit(AWS.Credentials, {\n /**\n * @api private\n */\n localStorageKey: {\n id: 'aws.cognito.identity-id.',\n providers: 'aws.cognito.identity-providers.'\n },\n\n /**\n * Creates a new credentials object.\n * @example Creating a new credentials object\n * AWS.config.credentials = new AWS.CognitoIdentityCredentials({\n *\n * // either IdentityPoolId or IdentityId is required\n * // See the IdentityPoolId param for AWS.CognitoIdentity.getID (linked below)\n * // See the IdentityId param for AWS.CognitoIdentity.getCredentialsForIdentity\n * // or AWS.CognitoIdentity.getOpenIdToken (linked below)\n * IdentityPoolId: 'us-east-1:1699ebc0-7900-4099-b910-2df94f52a030',\n * IdentityId: 'us-east-1:128d0a74-c82f-4553-916d-90053e4a8b0f'\n *\n * // optional, only necessary when the identity pool is not configured\n * // to use IAM roles in the Amazon Cognito Console\n * // See the RoleArn param for AWS.STS.assumeRoleWithWebIdentity (linked below)\n * RoleArn: 'arn:aws:iam::1234567890:role/MYAPP-CognitoIdentity',\n *\n * // optional tokens, used for authenticated login\n * // See the Logins param for AWS.CognitoIdentity.getID (linked below)\n * Logins: {\n * 'graph.facebook.com': 'FBTOKEN',\n * 'www.amazon.com': 'AMAZONTOKEN',\n * 'accounts.google.com': 'GOOGLETOKEN',\n * 'api.twitter.com': 'TWITTERTOKEN',\n * 'www.digits.com': 'DIGITSTOKEN'\n * },\n *\n * // optional name, defaults to web-identity\n * // See the RoleSessionName param for AWS.STS.assumeRoleWithWebIdentity (linked below)\n * RoleSessionName: 'web',\n *\n * // optional, only necessary when application runs in a browser\n * // and multiple users are signed in at once, used for caching\n * LoginId: 'example@gmail.com'\n *\n * }, {\n * // optionally provide configuration to apply to the underlying service clients\n * // if configuration is not provided, then configuration will be pulled from AWS.config\n *\n * // region should match the region your identity pool is located in\n * region: 'us-east-1',\n *\n * // specify timeout options\n * httpOptions: {\n * timeout: 100\n * }\n * });\n * @see AWS.CognitoIdentity.getId\n * @see AWS.CognitoIdentity.getCredentialsForIdentity\n * @see AWS.STS.assumeRoleWithWebIdentity\n * @see AWS.CognitoIdentity.getOpenIdToken\n * @see AWS.Config\n * @note If a region is not provided in the global AWS.config, or\n * specified in the `clientConfig` to the CognitoIdentityCredentials\n * constructor, you may encounter a 'Missing credentials in config' error\n * when calling making a service call.\n */\n constructor: function CognitoIdentityCredentials(params, clientConfig) {\n AWS.Credentials.call(this);\n this.expired = true;\n this.params = params;\n this.data = null;\n this._identityId = null;\n this._clientConfig = AWS.util.copy(clientConfig || {});\n this.loadCachedId();\n var self = this;\n Object.defineProperty(this, 'identityId', {\n get: function() {\n self.loadCachedId();\n return self._identityId || self.params.IdentityId;\n },\n set: function(identityId) {\n self._identityId = identityId;\n }\n });\n },\n\n /**\n * Refreshes credentials using {AWS.CognitoIdentity.getCredentialsForIdentity},\n * or {AWS.STS.assumeRoleWithWebIdentity}.\n *\n * @callback callback function(err)\n * Called when the STS service responds (or fails). When\n * this callback is called with no error, it means that the credentials\n * information has been loaded into the object (as the `accessKeyId`,\n * `secretAccessKey`, and `sessionToken` properties).\n * @param err [Error] if an error occurred, this value will be filled\n * @see AWS.Credentials.get\n */\n refresh: function refresh(callback) {\n this.coalesceRefresh(callback || AWS.util.fn.callback);\n },\n\n /**\n * @api private\n * @param callback\n */\n load: function load(callback) {\n var self = this;\n self.createClients();\n self.data = null;\n self._identityId = null;\n self.getId(function(err) {\n if (!err) {\n if (!self.params.RoleArn) {\n self.getCredentialsForIdentity(callback);\n } else {\n self.getCredentialsFromSTS(callback);\n }\n } else {\n self.clearIdOnNotAuthorized(err);\n callback(err);\n }\n });\n },\n\n /**\n * Clears the cached Cognito ID associated with the currently configured\n * identity pool ID. Use this to manually invalidate your cache if\n * the identity pool ID was deleted.\n */\n clearCachedId: function clearCache() {\n this._identityId = null;\n delete this.params.IdentityId;\n\n var poolId = this.params.IdentityPoolId;\n var loginId = this.params.LoginId || '';\n delete this.storage[this.localStorageKey.id + poolId + loginId];\n delete this.storage[this.localStorageKey.providers + poolId + loginId];\n },\n\n /**\n * @api private\n */\n clearIdOnNotAuthorized: function clearIdOnNotAuthorized(err) {\n var self = this;\n if (err.code == 'NotAuthorizedException') {\n self.clearCachedId();\n }\n },\n\n /**\n * Retrieves a Cognito ID, loading from cache if it was already retrieved\n * on this device.\n *\n * @callback callback function(err, identityId)\n * @param err [Error, null] an error object if the call failed or null if\n * it succeeded.\n * @param identityId [String, null] if successful, the callback will return\n * the Cognito ID.\n * @note If not loaded explicitly, the Cognito ID is loaded and stored in\n * localStorage in the browser environment of a device.\n * @api private\n */\n getId: function getId(callback) {\n var self = this;\n if (typeof self.params.IdentityId === 'string') {\n return callback(null, self.params.IdentityId);\n }\n\n self.cognito.getId(function(err, data) {\n if (!err && data.IdentityId) {\n self.params.IdentityId = data.IdentityId;\n callback(null, data.IdentityId);\n } else {\n callback(err);\n }\n });\n },\n\n\n /**\n * @api private\n */\n loadCredentials: function loadCredentials(data, credentials) {\n if (!data || !credentials) return;\n credentials.expired = false;\n credentials.accessKeyId = data.Credentials.AccessKeyId;\n credentials.secretAccessKey = data.Credentials.SecretKey;\n credentials.sessionToken = data.Credentials.SessionToken;\n credentials.expireTime = data.Credentials.Expiration;\n },\n\n /**\n * @api private\n */\n getCredentialsForIdentity: function getCredentialsForIdentity(callback) {\n var self = this;\n self.cognito.getCredentialsForIdentity(function(err, data) {\n if (!err) {\n self.cacheId(data);\n self.data = data;\n self.loadCredentials(self.data, self);\n } else {\n self.clearIdOnNotAuthorized(err);\n }\n callback(err);\n });\n },\n\n /**\n * @api private\n */\n getCredentialsFromSTS: function getCredentialsFromSTS(callback) {\n var self = this;\n self.cognito.getOpenIdToken(function(err, data) {\n if (!err) {\n self.cacheId(data);\n self.params.WebIdentityToken = data.Token;\n self.webIdentityCredentials.refresh(function(webErr) {\n if (!webErr) {\n self.data = self.webIdentityCredentials.data;\n self.sts.credentialsFrom(self.data, self);\n }\n callback(webErr);\n });\n } else {\n self.clearIdOnNotAuthorized(err);\n callback(err);\n }\n });\n },\n\n /**\n * @api private\n */\n loadCachedId: function loadCachedId() {\n var self = this;\n\n // in the browser we source default IdentityId from localStorage\n if (AWS.util.isBrowser() && !self.params.IdentityId) {\n var id = self.getStorage('id');\n if (id && self.params.Logins) {\n var actualProviders = Object.keys(self.params.Logins);\n var cachedProviders =\n (self.getStorage('providers') || '').split(',');\n\n // only load ID if at least one provider used this ID before\n var intersect = cachedProviders.filter(function(n) {\n return actualProviders.indexOf(n) !== -1;\n });\n if (intersect.length !== 0) {\n self.params.IdentityId = id;\n }\n } else if (id) {\n self.params.IdentityId = id;\n }\n }\n },\n\n /**\n * @api private\n */\n createClients: function() {\n var clientConfig = this._clientConfig;\n this.webIdentityCredentials = this.webIdentityCredentials ||\n new AWS.WebIdentityCredentials(this.params, clientConfig);\n if (!this.cognito) {\n var cognitoConfig = AWS.util.merge({}, clientConfig);\n cognitoConfig.params = this.params;\n this.cognito = new CognitoIdentity(cognitoConfig);\n }\n this.sts = this.sts || new STS(clientConfig);\n },\n\n /**\n * @api private\n */\n cacheId: function cacheId(data) {\n this._identityId = data.IdentityId;\n this.params.IdentityId = this._identityId;\n\n // cache this IdentityId in browser localStorage if possible\n if (AWS.util.isBrowser()) {\n this.setStorage('id', data.IdentityId);\n\n if (this.params.Logins) {\n this.setStorage('providers', Object.keys(this.params.Logins).join(','));\n }\n }\n },\n\n /**\n * @api private\n */\n getStorage: function getStorage(key) {\n return this.storage[this.localStorageKey[key] + this.params.IdentityPoolId + (this.params.LoginId || '')];\n },\n\n /**\n * @api private\n */\n setStorage: function setStorage(key, val) {\n try {\n this.storage[this.localStorageKey[key] + this.params.IdentityPoolId + (this.params.LoginId || '')] = val;\n } catch (_) {}\n },\n\n /**\n * @api private\n */\n storage: (function() {\n try {\n var storage = AWS.util.isBrowser() && window.localStorage !== null && typeof window.localStorage === 'object' ?\n window.localStorage : {};\n\n // Test set/remove which would throw an error in Safari's private browsing\n storage['aws.test-storage'] = 'foobar';\n delete storage['aws.test-storage'];\n\n return storage;\n } catch (_) {\n return {};\n }\n })()\n});\n","var AWS = require('../core');\n\n/**\n * Creates a credential provider chain that searches for AWS credentials\n * in a list of credential providers specified by the {providers} property.\n *\n * By default, the chain will use the {defaultProviders} to resolve credentials.\n * These providers will look in the environment using the\n * {AWS.EnvironmentCredentials} class with the 'AWS' and 'AMAZON' prefixes.\n *\n * ## Setting Providers\n *\n * Each provider in the {providers} list should be a function that returns\n * a {AWS.Credentials} object, or a hardcoded credentials object. The function\n * form allows for delayed execution of the credential construction.\n *\n * ## Resolving Credentials from a Chain\n *\n * Call {resolve} to return the first valid credential object that can be\n * loaded by the provider chain.\n *\n * For example, to resolve a chain with a custom provider that checks a file\n * on disk after the set of {defaultProviders}:\n *\n * ```javascript\n * var diskProvider = new AWS.FileSystemCredentials('./creds.json');\n * var chain = new AWS.CredentialProviderChain();\n * chain.providers.push(diskProvider);\n * chain.resolve();\n * ```\n *\n * The above code will return the `diskProvider` object if the\n * file contains credentials and the `defaultProviders` do not contain\n * any credential settings.\n *\n * @!attribute providers\n * @return [Array]\n * a list of credentials objects or functions that return credentials\n * objects. If the provider is a function, the function will be\n * executed lazily when the provider needs to be checked for valid\n * credentials. By default, this object will be set to the\n * {defaultProviders}.\n * @see defaultProviders\n */\nAWS.CredentialProviderChain = AWS.util.inherit(AWS.Credentials, {\n\n /**\n * Creates a new CredentialProviderChain with a default set of providers\n * specified by {defaultProviders}.\n */\n constructor: function CredentialProviderChain(providers) {\n if (providers) {\n this.providers = providers;\n } else {\n this.providers = AWS.CredentialProviderChain.defaultProviders.slice(0);\n }\n this.resolveCallbacks = [];\n },\n\n /**\n * @!method resolvePromise()\n * Returns a 'thenable' promise.\n * Resolves the provider chain by searching for the first set of\n * credentials in {providers}.\n *\n * Two callbacks can be provided to the `then` method on the returned promise.\n * The first callback will be called if the promise is fulfilled, and the second\n * callback will be called if the promise is rejected.\n * @callback fulfilledCallback function(credentials)\n * Called if the promise is fulfilled and the provider resolves the chain\n * to a credentials object\n * @param credentials [AWS.Credentials] the credentials object resolved\n * by the provider chain.\n * @callback rejectedCallback function(error)\n * Called if the promise is rejected.\n * @param err [Error] the error object returned if no credentials are found.\n * @return [Promise] A promise that represents the state of the `resolve` method call.\n * @example Calling the `resolvePromise` method.\n * var promise = chain.resolvePromise();\n * promise.then(function(credentials) { ... }, function(err) { ... });\n */\n\n /**\n * Resolves the provider chain by searching for the first set of\n * credentials in {providers}.\n *\n * @callback callback function(err, credentials)\n * Called when the provider resolves the chain to a credentials object\n * or null if no credentials can be found.\n *\n * @param err [Error] the error object returned if no credentials are\n * found.\n * @param credentials [AWS.Credentials] the credentials object resolved\n * by the provider chain.\n * @return [AWS.CredentialProviderChain] the provider, for chaining.\n */\n resolve: function resolve(callback) {\n var self = this;\n if (self.providers.length === 0) {\n callback(new Error('No providers'));\n return self;\n }\n\n if (self.resolveCallbacks.push(callback) === 1) {\n var index = 0;\n var providers = self.providers.slice(0);\n\n function resolveNext(err, creds) {\n if ((!err && creds) || index === providers.length) {\n AWS.util.arrayEach(self.resolveCallbacks, function (callback) {\n callback(err, creds);\n });\n self.resolveCallbacks.length = 0;\n return;\n }\n\n var provider = providers[index++];\n if (typeof provider === 'function') {\n creds = provider.call();\n } else {\n creds = provider;\n }\n\n if (creds.get) {\n creds.get(function (getErr) {\n resolveNext(getErr, getErr ? null : creds);\n });\n } else {\n resolveNext(null, creds);\n }\n }\n\n resolveNext();\n }\n\n return self;\n }\n});\n\n/**\n * The default set of providers used by a vanilla CredentialProviderChain.\n *\n * In the browser:\n *\n * ```javascript\n * AWS.CredentialProviderChain.defaultProviders = []\n * ```\n *\n * In Node.js:\n *\n * ```javascript\n * AWS.CredentialProviderChain.defaultProviders = [\n * function () { return new AWS.EnvironmentCredentials('AWS'); },\n * function () { return new AWS.EnvironmentCredentials('AMAZON'); },\n * function () { return new AWS.SharedIniFileCredentials(); },\n * function () { return new AWS.ECSCredentials(); },\n * function () { return new AWS.ProcessCredentials(); },\n * function () { return new AWS.TokenFileWebIdentityCredentials(); },\n * function () { return new AWS.EC2MetadataCredentials() }\n * ]\n * ```\n */\nAWS.CredentialProviderChain.defaultProviders = [];\n\n/**\n * @api private\n */\nAWS.CredentialProviderChain.addPromisesToClass = function addPromisesToClass(PromiseDependency) {\n this.prototype.resolvePromise = AWS.util.promisifyMethod('resolve', PromiseDependency);\n};\n\n/**\n * @api private\n */\nAWS.CredentialProviderChain.deletePromisesFromClass = function deletePromisesFromClass() {\n delete this.prototype.resolvePromise;\n};\n\nAWS.util.addPromises(AWS.CredentialProviderChain);\n","var AWS = require('../core');\nrequire('../metadata_service');\n\n/**\n * Represents credentials received from the metadata service on an EC2 instance.\n *\n * By default, this class will connect to the metadata service using\n * {AWS.MetadataService} and attempt to load any available credentials. If it\n * can connect, and credentials are available, these will be used with zero\n * configuration.\n *\n * This credentials class will by default timeout after 1 second of inactivity\n * and retry 3 times.\n * If your requests to the EC2 metadata service are timing out, you can increase\n * these values by configuring them directly:\n *\n * ```javascript\n * AWS.config.credentials = new AWS.EC2MetadataCredentials({\n * httpOptions: { timeout: 5000 }, // 5 second timeout\n * maxRetries: 10, // retry 10 times\n * retryDelayOptions: { base: 200 } // see AWS.Config for information\n * });\n *\n * If your requests are timing out in connecting to the metadata service, such\n * as when testing on a development machine, you can use the connectTimeout\n * option, specified in milliseconds, which also defaults to 1 second.\n * ```\n *\n * @see AWS.Config.retryDelayOptions\n *\n * @!macro nobrowser\n */\nAWS.EC2MetadataCredentials = AWS.util.inherit(AWS.Credentials, {\n constructor: function EC2MetadataCredentials(options) {\n AWS.Credentials.call(this);\n\n options = options ? AWS.util.copy(options) : {};\n options = AWS.util.merge(\n {maxRetries: this.defaultMaxRetries}, options);\n if (!options.httpOptions) options.httpOptions = {};\n options.httpOptions = AWS.util.merge(\n {timeout: this.defaultTimeout,\n connectTimeout: this.defaultConnectTimeout},\n options.httpOptions);\n\n this.metadataService = new AWS.MetadataService(options);\n this.metadata = {};\n },\n\n /**\n * @api private\n */\n defaultTimeout: 1000,\n\n /**\n * @api private\n */\n defaultConnectTimeout: 1000,\n\n /**\n * @api private\n */\n defaultMaxRetries: 3,\n\n /**\n * Loads the credentials from the instance metadata service\n *\n * @callback callback function(err)\n * Called when the instance metadata service responds (or fails). When\n * this callback is called with no error, it means that the credentials\n * information has been loaded into the object (as the `accessKeyId`,\n * `secretAccessKey`, and `sessionToken` properties).\n * @param err [Error] if an error occurred, this value will be filled\n * @see get\n */\n refresh: function refresh(callback) {\n this.coalesceRefresh(callback || AWS.util.fn.callback);\n },\n\n /**\n * @api private\n * @param callback\n */\n load: function load(callback) {\n var self = this;\n self.metadataService.loadCredentials(function(err, creds) {\n if (!err) {\n var currentTime = AWS.util.date.getDate();\n var expireTime = new Date(creds.Expiration);\n if (expireTime < currentTime) {\n err = AWS.util.error(\n new Error('EC2 Instance Metadata Serivce provided expired credentials'),\n { code: 'EC2MetadataCredentialsProviderFailure' }\n );\n } else {\n self.expired = false;\n self.metadata = creds;\n self.accessKeyId = creds.AccessKeyId;\n self.secretAccessKey = creds.SecretAccessKey;\n self.sessionToken = creds.Token;\n self.expireTime = expireTime;\n }\n }\n callback(err);\n });\n }\n});\n","var AWS = require('../core');\n\n/**\n * Represents credentials received from relative URI specified in the ECS container.\n *\n * This class will request refreshable credentials from the relative URI\n * specified by the AWS_CONTAINER_CREDENTIALS_RELATIVE_URI or the\n * AWS_CONTAINER_CREDENTIALS_FULL_URI environment variable. If valid credentials\n * are returned in the response, these will be used with zero configuration.\n *\n * This credentials class will by default timeout after 1 second of inactivity\n * and retry 3 times.\n * If your requests to the relative URI are timing out, you can increase\n * the value by configuring them directly:\n *\n * ```javascript\n * AWS.config.credentials = new AWS.ECSCredentials({\n * httpOptions: { timeout: 5000 }, // 5 second timeout\n * maxRetries: 10, // retry 10 times\n * retryDelayOptions: { base: 200 } // see AWS.Config for information\n * });\n * ```\n *\n * @see AWS.Config.retryDelayOptions\n *\n * @!macro nobrowser\n */\nAWS.ECSCredentials = AWS.RemoteCredentials;\n","var AWS = require('../core');\n\n/**\n * Represents credentials from the environment.\n *\n * By default, this class will look for the matching environment variables\n * prefixed by a given {envPrefix}. The un-prefixed environment variable names\n * for each credential value is listed below:\n *\n * ```javascript\n * accessKeyId: ACCESS_KEY_ID\n * secretAccessKey: SECRET_ACCESS_KEY\n * sessionToken: SESSION_TOKEN\n * ```\n *\n * With the default prefix of 'AWS', the environment variables would be:\n *\n * AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY, AWS_SESSION_TOKEN\n *\n * @!attribute envPrefix\n * @readonly\n * @return [String] the prefix for the environment variable names excluding\n * the separating underscore ('_').\n */\nAWS.EnvironmentCredentials = AWS.util.inherit(AWS.Credentials, {\n\n /**\n * Creates a new EnvironmentCredentials class with a given variable\n * prefix {envPrefix}. For example, to load credentials using the 'AWS'\n * prefix:\n *\n * ```javascript\n * var creds = new AWS.EnvironmentCredentials('AWS');\n * creds.accessKeyId == 'AKID' // from AWS_ACCESS_KEY_ID env var\n * ```\n *\n * @param envPrefix [String] the prefix to use (e.g., 'AWS') for environment\n * variables. Do not include the separating underscore.\n */\n constructor: function EnvironmentCredentials(envPrefix) {\n AWS.Credentials.call(this);\n this.envPrefix = envPrefix;\n this.get(function() {});\n },\n\n /**\n * Loads credentials from the environment using the prefixed\n * environment variables.\n *\n * @callback callback function(err)\n * Called after the (prefixed) ACCESS_KEY_ID, SECRET_ACCESS_KEY, and\n * SESSION_TOKEN environment variables are read. When this callback is\n * called with no error, it means that the credentials information has\n * been loaded into the object (as the `accessKeyId`, `secretAccessKey`,\n * and `sessionToken` properties).\n * @param err [Error] if an error occurred, this value will be filled\n * @see get\n */\n refresh: function refresh(callback) {\n if (!callback) callback = AWS.util.fn.callback;\n\n if (!process || !process.env) {\n callback(AWS.util.error(\n new Error('No process info or environment variables available'),\n { code: 'EnvironmentCredentialsProviderFailure' }\n ));\n return;\n }\n\n var keys = ['ACCESS_KEY_ID', 'SECRET_ACCESS_KEY', 'SESSION_TOKEN'];\n var values = [];\n\n for (var i = 0; i < keys.length; i++) {\n var prefix = '';\n if (this.envPrefix) prefix = this.envPrefix + '_';\n values[i] = process.env[prefix + keys[i]];\n if (!values[i] && keys[i] !== 'SESSION_TOKEN') {\n callback(AWS.util.error(\n new Error('Variable ' + prefix + keys[i] + ' not set.'),\n { code: 'EnvironmentCredentialsProviderFailure' }\n ));\n return;\n }\n }\n\n this.expired = false;\n AWS.Credentials.apply(this, values);\n callback();\n }\n\n});\n","var AWS = require('../core');\n\n/**\n * Represents credentials from a JSON file on disk.\n * If the credentials expire, the SDK can {refresh} the credentials\n * from the file.\n *\n * The format of the file should be similar to the options passed to\n * {AWS.Config}:\n *\n * ```javascript\n * {accessKeyId: 'akid', secretAccessKey: 'secret', sessionToken: 'optional'}\n * ```\n *\n * @example Loading credentials from disk\n * var creds = new AWS.FileSystemCredentials('./configuration.json');\n * creds.accessKeyId == 'AKID'\n *\n * @!attribute filename\n * @readonly\n * @return [String] the path to the JSON file on disk containing the\n * credentials.\n * @!macro nobrowser\n */\nAWS.FileSystemCredentials = AWS.util.inherit(AWS.Credentials, {\n\n /**\n * @overload AWS.FileSystemCredentials(filename)\n * Creates a new FileSystemCredentials object from a filename\n *\n * @param filename [String] the path on disk to the JSON file to load.\n */\n constructor: function FileSystemCredentials(filename) {\n AWS.Credentials.call(this);\n this.filename = filename;\n this.get(function() {});\n },\n\n /**\n * Loads the credentials from the {filename} on disk.\n *\n * @callback callback function(err)\n * Called after the JSON file on disk is read and parsed. When this callback\n * is called with no error, it means that the credentials information\n * has been loaded into the object (as the `accessKeyId`, `secretAccessKey`,\n * and `sessionToken` properties).\n * @param err [Error] if an error occurred, this value will be filled\n * @see get\n */\n refresh: function refresh(callback) {\n if (!callback) callback = AWS.util.fn.callback;\n try {\n var creds = JSON.parse(AWS.util.readFileSync(this.filename));\n AWS.Credentials.call(this, creds);\n if (!this.accessKeyId || !this.secretAccessKey) {\n throw AWS.util.error(\n new Error('Credentials not set in ' + this.filename),\n { code: 'FileSystemCredentialsProviderFailure' }\n );\n }\n this.expired = false;\n callback();\n } catch (err) {\n callback(err);\n }\n }\n\n});\n","var AWS = require('../core');\nvar proc = require('child_process');\nvar iniLoader = AWS.util.iniLoader;\n\n/**\n * Represents credentials loaded from shared credentials file\n * (defaulting to ~/.aws/credentials or defined by the\n * `AWS_SHARED_CREDENTIALS_FILE` environment variable).\n *\n * ## Using process credentials\n *\n * The credentials file can specify a credential provider that executes\n * a given process and attempts to read its stdout to recieve a JSON payload\n * containing the credentials:\n *\n * [default]\n * credential_process = /usr/bin/credential_proc\n *\n * Automatically handles refreshing credentials if an Expiration time is\n * provided in the credentials payload. Credentials supplied in the same profile\n * will take precedence over the credential_process.\n *\n * Sourcing credentials from an external process can potentially be dangerous,\n * so proceed with caution. Other credential providers should be preferred if\n * at all possible. If using this option, you should make sure that the shared\n * credentials file is as locked down as possible using security best practices\n * for your operating system.\n *\n * ## Using custom profiles\n *\n * The SDK supports loading credentials for separate profiles. This can be done\n * in two ways:\n *\n * 1. Set the `AWS_PROFILE` environment variable in your process prior to\n * loading the SDK.\n * 2. Directly load the AWS.ProcessCredentials provider:\n *\n * ```javascript\n * var creds = new AWS.ProcessCredentials({profile: 'myprofile'});\n * AWS.config.credentials = creds;\n * ```\n *\n * @!macro nobrowser\n */\nAWS.ProcessCredentials = AWS.util.inherit(AWS.Credentials, {\n /**\n * Creates a new ProcessCredentials object.\n *\n * @param options [map] a set of options\n * @option options profile [String] (AWS_PROFILE env var or 'default')\n * the name of the profile to load.\n * @option options filename [String] ('~/.aws/credentials' or defined by\n * AWS_SHARED_CREDENTIALS_FILE process env var)\n * the filename to use when loading credentials.\n * @option options callback [Function] (err) Credentials are eagerly loaded\n * by the constructor. When the callback is called with no error, the\n * credentials have been loaded successfully.\n */\n constructor: function ProcessCredentials(options) {\n AWS.Credentials.call(this);\n\n options = options || {};\n\n this.filename = options.filename;\n this.profile = options.profile || process.env.AWS_PROFILE || AWS.util.defaultProfile;\n this.get(options.callback || AWS.util.fn.noop);\n },\n\n /**\n * @api private\n */\n load: function load(callback) {\n var self = this;\n try {\n var profiles = AWS.util.getProfilesFromSharedConfig(iniLoader, this.filename);\n var profile = profiles[this.profile] || {};\n\n if (Object.keys(profile).length === 0) {\n throw AWS.util.error(\n new Error('Profile ' + this.profile + ' not found'),\n { code: 'ProcessCredentialsProviderFailure' }\n );\n }\n\n if (profile['credential_process']) {\n this.loadViaCredentialProcess(profile, function(err, data) {\n if (err) {\n callback(err, null);\n } else {\n self.expired = false;\n self.accessKeyId = data.AccessKeyId;\n self.secretAccessKey = data.SecretAccessKey;\n self.sessionToken = data.SessionToken;\n if (data.Expiration) {\n self.expireTime = new Date(data.Expiration);\n }\n callback(null);\n }\n });\n } else {\n throw AWS.util.error(\n new Error('Profile ' + this.profile + ' did not include credential process'),\n { code: 'ProcessCredentialsProviderFailure' }\n );\n }\n } catch (err) {\n callback(err);\n }\n },\n\n /**\n * Executes the credential_process and retrieves\n * credentials from the output\n * @api private\n * @param profile [map] credentials profile\n * @throws ProcessCredentialsProviderFailure\n */\n loadViaCredentialProcess: function loadViaCredentialProcess(profile, callback) {\n proc.exec(profile['credential_process'], function(err, stdOut, stdErr) {\n if (err) {\n callback(AWS.util.error(\n new Error('credential_process returned error'),\n { code: 'ProcessCredentialsProviderFailure'}\n ), null);\n } else {\n try {\n var credData = JSON.parse(stdOut);\n if (credData.Expiration) {\n var currentTime = AWS.util.date.getDate();\n var expireTime = new Date(credData.Expiration);\n if (expireTime < currentTime) {\n throw Error('credential_process returned expired credentials');\n }\n }\n\n if (credData.Version !== 1) {\n throw Error('credential_process does not return Version == 1');\n }\n callback(null, credData);\n } catch (err) {\n callback(AWS.util.error(\n new Error(err.message),\n { code: 'ProcessCredentialsProviderFailure'}\n ), null);\n }\n }\n });\n },\n\n /**\n * Loads the credentials from the credential process\n *\n * @callback callback function(err)\n * Called after the credential process has been executed. When this\n * callback is called with no error, it means that the credentials\n * information has been loaded into the object (as the `accessKeyId`,\n * `secretAccessKey`, and `sessionToken` properties).\n * @param err [Error] if an error occurred, this value will be filled\n * @see get\n */\n refresh: function refresh(callback) {\n iniLoader.clearCachedFiles();\n this.coalesceRefresh(callback || AWS.util.fn.callback);\n }\n});\n","var AWS = require('../core'),\n ENV_RELATIVE_URI = 'AWS_CONTAINER_CREDENTIALS_RELATIVE_URI',\n ENV_FULL_URI = 'AWS_CONTAINER_CREDENTIALS_FULL_URI',\n ENV_AUTH_TOKEN = 'AWS_CONTAINER_AUTHORIZATION_TOKEN',\n FULL_URI_UNRESTRICTED_PROTOCOLS = ['https:'],\n FULL_URI_ALLOWED_PROTOCOLS = ['http:', 'https:'],\n FULL_URI_ALLOWED_HOSTNAMES = ['localhost', '127.0.0.1'],\n RELATIVE_URI_HOST = '169.254.170.2';\n\n/**\n * Represents credentials received from specified URI.\n *\n * This class will request refreshable credentials from the relative URI\n * specified by the AWS_CONTAINER_CREDENTIALS_RELATIVE_URI or the\n * AWS_CONTAINER_CREDENTIALS_FULL_URI environment variable. If valid credentials\n * are returned in the response, these will be used with zero configuration.\n *\n * This credentials class will by default timeout after 1 second of inactivity\n * and retry 3 times.\n * If your requests to the relative URI are timing out, you can increase\n * the value by configuring them directly:\n *\n * ```javascript\n * AWS.config.credentials = new AWS.RemoteCredentials({\n * httpOptions: { timeout: 5000 }, // 5 second timeout\n * maxRetries: 10, // retry 10 times\n * retryDelayOptions: { base: 200 } // see AWS.Config for information\n * });\n * ```\n *\n * @see AWS.Config.retryDelayOptions\n *\n * @!macro nobrowser\n */\nAWS.RemoteCredentials = AWS.util.inherit(AWS.Credentials, {\n constructor: function RemoteCredentials(options) {\n AWS.Credentials.call(this);\n options = options ? AWS.util.copy(options) : {};\n if (!options.httpOptions) options.httpOptions = {};\n options.httpOptions = AWS.util.merge(\n this.httpOptions, options.httpOptions);\n AWS.util.update(this, options);\n },\n\n /**\n * @api private\n */\n httpOptions: { timeout: 1000 },\n\n /**\n * @api private\n */\n maxRetries: 3,\n\n /**\n * @api private\n */\n isConfiguredForEcsCredentials: function isConfiguredForEcsCredentials() {\n return Boolean(\n process &&\n process.env &&\n (process.env[ENV_RELATIVE_URI] || process.env[ENV_FULL_URI])\n );\n },\n\n /**\n * @api private\n */\n getECSFullUri: function getECSFullUri() {\n if (process && process.env) {\n var relative = process.env[ENV_RELATIVE_URI],\n full = process.env[ENV_FULL_URI];\n if (relative) {\n return 'http://' + RELATIVE_URI_HOST + relative;\n } else if (full) {\n var parsed = AWS.util.urlParse(full);\n if (FULL_URI_ALLOWED_PROTOCOLS.indexOf(parsed.protocol) < 0) {\n throw AWS.util.error(\n new Error('Unsupported protocol: AWS.RemoteCredentials supports '\n + FULL_URI_ALLOWED_PROTOCOLS.join(',') + ' only; '\n + parsed.protocol + ' requested.'),\n { code: 'ECSCredentialsProviderFailure' }\n );\n }\n\n if (FULL_URI_UNRESTRICTED_PROTOCOLS.indexOf(parsed.protocol) < 0 &&\n FULL_URI_ALLOWED_HOSTNAMES.indexOf(parsed.hostname) < 0) {\n throw AWS.util.error(\n new Error('Unsupported hostname: AWS.RemoteCredentials only supports '\n + FULL_URI_ALLOWED_HOSTNAMES.join(',') + ' for ' + parsed.protocol + '; '\n + parsed.protocol + '//' + parsed.hostname + ' requested.'),\n { code: 'ECSCredentialsProviderFailure' }\n );\n }\n\n return full;\n } else {\n throw AWS.util.error(\n new Error('Variable ' + ENV_RELATIVE_URI + ' or ' + ENV_FULL_URI +\n ' must be set to use AWS.RemoteCredentials.'),\n { code: 'ECSCredentialsProviderFailure' }\n );\n }\n } else {\n throw AWS.util.error(\n new Error('No process info available'),\n { code: 'ECSCredentialsProviderFailure' }\n );\n }\n },\n\n /**\n * @api private\n */\n getECSAuthToken: function getECSAuthToken() {\n if (process && process.env && process.env[ENV_FULL_URI]) {\n return process.env[ENV_AUTH_TOKEN];\n }\n },\n\n /**\n * @api private\n */\n credsFormatIsValid: function credsFormatIsValid(credData) {\n return (!!credData.accessKeyId && !!credData.secretAccessKey &&\n !!credData.sessionToken && !!credData.expireTime);\n },\n\n /**\n * @api private\n */\n formatCreds: function formatCreds(credData) {\n if (!!credData.credentials) {\n credData = credData.credentials;\n }\n\n return {\n expired: false,\n accessKeyId: credData.accessKeyId || credData.AccessKeyId,\n secretAccessKey: credData.secretAccessKey || credData.SecretAccessKey,\n sessionToken: credData.sessionToken || credData.Token,\n expireTime: new Date(credData.expiration || credData.Expiration)\n };\n },\n\n /**\n * @api private\n */\n request: function request(url, callback) {\n var httpRequest = new AWS.HttpRequest(url);\n httpRequest.method = 'GET';\n httpRequest.headers.Accept = 'application/json';\n var token = this.getECSAuthToken();\n if (token) {\n httpRequest.headers.Authorization = token;\n }\n AWS.util.handleRequestWithRetries(httpRequest, this, callback);\n },\n\n /**\n * Loads the credentials from the relative URI specified by container\n *\n * @callback callback function(err)\n * Called when the request to the relative URI responds (or fails). When\n * this callback is called with no error, it means that the credentials\n * information has been loaded into the object (as the `accessKeyId`,\n * `secretAccessKey`, `sessionToken`, and `expireTime` properties).\n * @param err [Error] if an error occurred, this value will be filled\n * @see get\n */\n refresh: function refresh(callback) {\n this.coalesceRefresh(callback || AWS.util.fn.callback);\n },\n\n /**\n * @api private\n */\n load: function load(callback) {\n var self = this;\n var fullUri;\n\n try {\n fullUri = this.getECSFullUri();\n } catch (err) {\n callback(err);\n return;\n }\n\n this.request(fullUri, function(err, data) {\n if (!err) {\n try {\n data = JSON.parse(data);\n var creds = self.formatCreds(data);\n if (!self.credsFormatIsValid(creds)) {\n throw AWS.util.error(\n new Error('Response data is not in valid format'),\n { code: 'ECSCredentialsProviderFailure' }\n );\n }\n AWS.util.update(self, creds);\n } catch (dataError) {\n err = dataError;\n }\n }\n callback(err, creds);\n });\n }\n});\n","var AWS = require('../core');\nvar STS = require('../../clients/sts');\n\n/**\n * Represents credentials retrieved from STS SAML support.\n *\n * By default this provider gets credentials using the\n * {AWS.STS.assumeRoleWithSAML} service operation. This operation\n * requires a `RoleArn` containing the ARN of the IAM trust policy for the\n * application for which credentials will be given, as well as a `PrincipalArn`\n * representing the ARN for the SAML identity provider. In addition, the\n * `SAMLAssertion` must be set to the token provided by the identity\n * provider. See {constructor} for an example on creating a credentials\n * object with proper `RoleArn`, `PrincipalArn`, and `SAMLAssertion` values.\n *\n * ## Refreshing Credentials from Identity Service\n *\n * In addition to AWS credentials expiring after a given amount of time, the\n * login token from the identity provider will also expire. Once this token\n * expires, it will not be usable to refresh AWS credentials, and another\n * token will be needed. The SDK does not manage refreshing of the token value,\n * but this can be done through a \"refresh token\" supported by most identity\n * providers. Consult the documentation for the identity provider for refreshing\n * tokens. Once the refreshed token is acquired, you should make sure to update\n * this new token in the credentials object's {params} property. The following\n * code will update the SAMLAssertion, assuming you have retrieved an updated\n * token from the identity provider:\n *\n * ```javascript\n * AWS.config.credentials.params.SAMLAssertion = updatedToken;\n * ```\n *\n * Future calls to `credentials.refresh()` will now use the new token.\n *\n * @!attribute params\n * @return [map] the map of params passed to\n * {AWS.STS.assumeRoleWithSAML}. To update the token, set the\n * `params.SAMLAssertion` property.\n */\nAWS.SAMLCredentials = AWS.util.inherit(AWS.Credentials, {\n /**\n * Creates a new credentials object.\n * @param (see AWS.STS.assumeRoleWithSAML)\n * @example Creating a new credentials object\n * AWS.config.credentials = new AWS.SAMLCredentials({\n * RoleArn: 'arn:aws:iam::1234567890:role/SAMLRole',\n * PrincipalArn: 'arn:aws:iam::1234567890:role/SAMLPrincipal',\n * SAMLAssertion: 'base64-token', // base64-encoded token from IdP\n * });\n * @see AWS.STS.assumeRoleWithSAML\n */\n constructor: function SAMLCredentials(params) {\n AWS.Credentials.call(this);\n this.expired = true;\n this.params = params;\n },\n\n /**\n * Refreshes credentials using {AWS.STS.assumeRoleWithSAML}\n *\n * @callback callback function(err)\n * Called when the STS service responds (or fails). When\n * this callback is called with no error, it means that the credentials\n * information has been loaded into the object (as the `accessKeyId`,\n * `secretAccessKey`, and `sessionToken` properties).\n * @param err [Error] if an error occurred, this value will be filled\n * @see get\n */\n refresh: function refresh(callback) {\n this.coalesceRefresh(callback || AWS.util.fn.callback);\n },\n\n /**\n * @api private\n */\n load: function load(callback) {\n var self = this;\n self.createClients();\n self.service.assumeRoleWithSAML(function (err, data) {\n if (!err) {\n self.service.credentialsFrom(data, self);\n }\n callback(err);\n });\n },\n\n /**\n * @api private\n */\n createClients: function() {\n this.service = this.service || new STS({params: this.params});\n }\n\n});\n","var AWS = require('../core');\nvar STS = require('../../clients/sts');\nvar iniLoader = AWS.util.iniLoader;\n\nvar ASSUME_ROLE_DEFAULT_REGION = 'us-east-1';\n\n/**\n * Represents credentials loaded from shared credentials file\n * (defaulting to ~/.aws/credentials or defined by the\n * `AWS_SHARED_CREDENTIALS_FILE` environment variable).\n *\n * ## Using the shared credentials file\n *\n * This provider is checked by default in the Node.js environment. To use the\n * credentials file provider, simply add your access and secret keys to the\n * ~/.aws/credentials file in the following format:\n *\n * [default]\n * aws_access_key_id = AKID...\n * aws_secret_access_key = YOUR_SECRET_KEY\n *\n * ## Using custom profiles\n *\n * The SDK supports loading credentials for separate profiles. This can be done\n * in two ways:\n *\n * 1. Set the `AWS_PROFILE` environment variable in your process prior to\n * loading the SDK.\n * 2. Directly load the AWS.SharedIniFileCredentials provider:\n *\n * ```javascript\n * var creds = new AWS.SharedIniFileCredentials({profile: 'myprofile'});\n * AWS.config.credentials = creds;\n * ```\n *\n * @!macro nobrowser\n */\nAWS.SharedIniFileCredentials = AWS.util.inherit(AWS.Credentials, {\n /**\n * Creates a new SharedIniFileCredentials object.\n *\n * @param options [map] a set of options\n * @option options profile [String] (AWS_PROFILE env var or 'default')\n * the name of the profile to load.\n * @option options filename [String] ('~/.aws/credentials' or defined by\n * AWS_SHARED_CREDENTIALS_FILE process env var)\n * the filename to use when loading credentials.\n * @option options disableAssumeRole [Boolean] (false) True to disable\n * support for profiles that assume an IAM role. If true, and an assume\n * role profile is selected, an error is raised.\n * @option options preferStaticCredentials [Boolean] (false) True to\n * prefer static credentials to role_arn if both are present.\n * @option options tokenCodeFn [Function] (null) Function to provide\n * STS Assume Role TokenCode, if mfa_serial is provided for profile in ini\n * file. Function is called with value of mfa_serial and callback, and\n * should provide the TokenCode or an error to the callback in the format\n * callback(err, token)\n * @option options callback [Function] (err) Credentials are eagerly loaded\n * by the constructor. When the callback is called with no error, the\n * credentials have been loaded successfully.\n * @option options httpOptions [map] A set of options to pass to the low-level\n * HTTP request. Currently supported options are:\n * * **proxy** [String] — the URL to proxy requests through\n * * **agent** [http.Agent, https.Agent] — the Agent object to perform\n * HTTP requests with. Used for connection pooling. Defaults to the global\n * agent (`http.globalAgent`) for non-SSL connections. Note that for\n * SSL connections, a special Agent object is used in order to enable\n * peer certificate verification. This feature is only available in the\n * Node.js environment.\n * * **connectTimeout** [Integer] — Sets the socket to timeout after\n * failing to establish a connection with the server after\n * `connectTimeout` milliseconds. This timeout has no effect once a socket\n * connection has been established.\n * * **timeout** [Integer] — The number of milliseconds a request can\n * take before automatically being terminated.\n * Defaults to two minutes (120000).\n */\n constructor: function SharedIniFileCredentials(options) {\n AWS.Credentials.call(this);\n\n options = options || {};\n\n this.filename = options.filename;\n this.profile = options.profile || process.env.AWS_PROFILE || AWS.util.defaultProfile;\n this.disableAssumeRole = Boolean(options.disableAssumeRole);\n this.preferStaticCredentials = Boolean(options.preferStaticCredentials);\n this.tokenCodeFn = options.tokenCodeFn || null;\n this.httpOptions = options.httpOptions || null;\n this.get(options.callback || AWS.util.fn.noop);\n },\n\n /**\n * @api private\n */\n load: function load(callback) {\n var self = this;\n try {\n var profiles = AWS.util.getProfilesFromSharedConfig(iniLoader, this.filename);\n var profile = profiles[this.profile] || {};\n\n if (Object.keys(profile).length === 0) {\n throw AWS.util.error(\n new Error('Profile ' + this.profile + ' not found'),\n { code: 'SharedIniFileCredentialsProviderFailure' }\n );\n }\n\n /*\n In the CLI, the presence of both a role_arn and static credentials have\n different meanings depending on how many profiles have been visited. For\n the first profile processed, role_arn takes precedence over any static\n credentials, but for all subsequent profiles, static credentials are\n used if present, and only in their absence will the profile's\n source_profile and role_arn keys be used to load another set of\n credentials. This var is intended to yield compatible behaviour in this\n sdk.\n */\n var preferStaticCredentialsToRoleArn = Boolean(\n this.preferStaticCredentials\n && profile['aws_access_key_id']\n && profile['aws_secret_access_key']\n );\n\n if (profile['role_arn'] && !preferStaticCredentialsToRoleArn) {\n this.loadRoleProfile(profiles, profile, function(err, data) {\n if (err) {\n callback(err);\n } else {\n self.expired = false;\n self.accessKeyId = data.Credentials.AccessKeyId;\n self.secretAccessKey = data.Credentials.SecretAccessKey;\n self.sessionToken = data.Credentials.SessionToken;\n self.expireTime = data.Credentials.Expiration;\n callback(null);\n }\n });\n return;\n }\n\n this.accessKeyId = profile['aws_access_key_id'];\n this.secretAccessKey = profile['aws_secret_access_key'];\n this.sessionToken = profile['aws_session_token'];\n\n if (!this.accessKeyId || !this.secretAccessKey) {\n throw AWS.util.error(\n new Error('Credentials not set for profile ' + this.profile),\n { code: 'SharedIniFileCredentialsProviderFailure' }\n );\n }\n this.expired = false;\n callback(null);\n } catch (err) {\n callback(err);\n }\n },\n\n /**\n * Loads the credentials from the shared credentials file\n *\n * @callback callback function(err)\n * Called after the shared INI file on disk is read and parsed. When this\n * callback is called with no error, it means that the credentials\n * information has been loaded into the object (as the `accessKeyId`,\n * `secretAccessKey`, and `sessionToken` properties).\n * @param err [Error] if an error occurred, this value will be filled\n * @see get\n */\n refresh: function refresh(callback) {\n iniLoader.clearCachedFiles();\n this.coalesceRefresh(\n callback || AWS.util.fn.callback,\n this.disableAssumeRole\n );\n },\n\n /**\n * @api private\n */\n loadRoleProfile: function loadRoleProfile(creds, roleProfile, callback) {\n if (this.disableAssumeRole) {\n throw AWS.util.error(\n new Error('Role assumption profiles are disabled. ' +\n 'Failed to load profile ' + this.profile +\n ' from ' + creds.filename),\n { code: 'SharedIniFileCredentialsProviderFailure' }\n );\n }\n\n var self = this;\n var roleArn = roleProfile['role_arn'];\n var roleSessionName = roleProfile['role_session_name'];\n var externalId = roleProfile['external_id'];\n var mfaSerial = roleProfile['mfa_serial'];\n var sourceProfileName = roleProfile['source_profile'];\n\n // From experimentation, the following behavior mimics the AWS CLI:\n //\n // 1. Use region from the profile if present.\n // 2. Otherwise fall back to N. Virginia (global endpoint).\n //\n // It is necessary to do the fallback explicitly, because if\n // 'AWS_STS_REGIONAL_ENDPOINTS=regional', the underlying STS client will\n // otherwise throw an error if region is left 'undefined'.\n //\n // Experimentation shows that the AWS CLI (tested at version 1.18.136)\n // ignores the following potential sources of a region for the purposes of\n // this AssumeRole call:\n //\n // - The [default] profile\n // - The AWS_REGION environment variable\n //\n // Ignoring the [default] profile for the purposes of AssumeRole is arguably\n // a bug in the CLI since it does use the [default] region for service\n // calls... but right now we're matching behavior of the other tool.\n var profileRegion = roleProfile['region'] || ASSUME_ROLE_DEFAULT_REGION;\n\n if (!sourceProfileName) {\n throw AWS.util.error(\n new Error('source_profile is not set using profile ' + this.profile),\n { code: 'SharedIniFileCredentialsProviderFailure' }\n );\n }\n\n var sourceProfileExistanceTest = creds[sourceProfileName];\n\n if (typeof sourceProfileExistanceTest !== 'object') {\n throw AWS.util.error(\n new Error('source_profile ' + sourceProfileName + ' using profile '\n + this.profile + ' does not exist'),\n { code: 'SharedIniFileCredentialsProviderFailure' }\n );\n }\n\n var sourceCredentials = new AWS.SharedIniFileCredentials(\n AWS.util.merge(this.options || {}, {\n profile: sourceProfileName,\n preferStaticCredentials: true\n })\n );\n\n this.roleArn = roleArn;\n var sts = new STS({\n credentials: sourceCredentials,\n region: profileRegion,\n httpOptions: this.httpOptions\n });\n\n var roleParams = {\n RoleArn: roleArn,\n RoleSessionName: roleSessionName || 'aws-sdk-js-' + Date.now()\n };\n\n if (externalId) {\n roleParams.ExternalId = externalId;\n }\n\n if (mfaSerial && self.tokenCodeFn) {\n roleParams.SerialNumber = mfaSerial;\n self.tokenCodeFn(mfaSerial, function(err, token) {\n if (err) {\n var message;\n if (err instanceof Error) {\n message = err.message;\n } else {\n message = err;\n }\n callback(\n AWS.util.error(\n new Error('Error fetching MFA token: ' + message),\n { code: 'SharedIniFileCredentialsProviderFailure' }\n ));\n return;\n }\n\n roleParams.TokenCode = token;\n sts.assumeRole(roleParams, callback);\n });\n return;\n }\n sts.assumeRole(roleParams, callback);\n }\n});\n","var AWS = require('../core');\nvar STS = require('../../clients/sts');\n\n/**\n * Represents temporary credentials retrieved from {AWS.STS}. Without any\n * extra parameters, credentials will be fetched from the\n * {AWS.STS.getSessionToken} operation. If an IAM role is provided, the\n * {AWS.STS.assumeRole} operation will be used to fetch credentials for the\n * role instead.\n *\n * @note AWS.TemporaryCredentials is deprecated, but remains available for\n * backwards compatibility. {AWS.ChainableTemporaryCredentials} is the\n * preferred class for temporary credentials.\n *\n * To setup temporary credentials, configure a set of master credentials\n * using the standard credentials providers (environment, EC2 instance metadata,\n * or from the filesystem), then set the global credentials to a new\n * temporary credentials object:\n *\n * ```javascript\n * // Note that environment credentials are loaded by default,\n * // the following line is shown for clarity:\n * AWS.config.credentials = new AWS.EnvironmentCredentials('AWS');\n *\n * // Now set temporary credentials seeded from the master credentials\n * AWS.config.credentials = new AWS.TemporaryCredentials();\n *\n * // subsequent requests will now use temporary credentials from AWS STS.\n * new AWS.S3().listBucket(function(err, data) { ... });\n * ```\n *\n * @!attribute masterCredentials\n * @return [AWS.Credentials] the master (non-temporary) credentials used to\n * get and refresh temporary credentials from AWS STS.\n * @note (see constructor)\n */\nAWS.TemporaryCredentials = AWS.util.inherit(AWS.Credentials, {\n /**\n * Creates a new temporary credentials object.\n *\n * @note In order to create temporary credentials, you first need to have\n * \"master\" credentials configured in {AWS.Config.credentials}. These\n * master credentials are necessary to retrieve the temporary credentials,\n * as well as refresh the credentials when they expire.\n * @param params [map] a map of options that are passed to the\n * {AWS.STS.assumeRole} or {AWS.STS.getSessionToken} operations.\n * If a `RoleArn` parameter is passed in, credentials will be based on the\n * IAM role.\n * @param masterCredentials [AWS.Credentials] the master (non-temporary) credentials\n * used to get and refresh temporary credentials from AWS STS.\n * @example Creating a new credentials object for generic temporary credentials\n * AWS.config.credentials = new AWS.TemporaryCredentials();\n * @example Creating a new credentials object for an IAM role\n * AWS.config.credentials = new AWS.TemporaryCredentials({\n * RoleArn: 'arn:aws:iam::1234567890:role/TemporaryCredentials',\n * });\n * @see AWS.STS.assumeRole\n * @see AWS.STS.getSessionToken\n */\n constructor: function TemporaryCredentials(params, masterCredentials) {\n AWS.Credentials.call(this);\n this.loadMasterCredentials(masterCredentials);\n this.expired = true;\n\n this.params = params || {};\n if (this.params.RoleArn) {\n this.params.RoleSessionName =\n this.params.RoleSessionName || 'temporary-credentials';\n }\n },\n\n /**\n * Refreshes credentials using {AWS.STS.assumeRole} or\n * {AWS.STS.getSessionToken}, depending on whether an IAM role ARN was passed\n * to the credentials {constructor}.\n *\n * @callback callback function(err)\n * Called when the STS service responds (or fails). When\n * this callback is called with no error, it means that the credentials\n * information has been loaded into the object (as the `accessKeyId`,\n * `secretAccessKey`, and `sessionToken` properties).\n * @param err [Error] if an error occurred, this value will be filled\n * @see get\n */\n refresh: function refresh (callback) {\n this.coalesceRefresh(callback || AWS.util.fn.callback);\n },\n\n /**\n * @api private\n */\n load: function load (callback) {\n var self = this;\n self.createClients();\n self.masterCredentials.get(function () {\n self.service.config.credentials = self.masterCredentials;\n var operation = self.params.RoleArn ?\n self.service.assumeRole : self.service.getSessionToken;\n operation.call(self.service, function (err, data) {\n if (!err) {\n self.service.credentialsFrom(data, self);\n }\n callback(err);\n });\n });\n },\n\n /**\n * @api private\n */\n loadMasterCredentials: function loadMasterCredentials (masterCredentials) {\n this.masterCredentials = masterCredentials || AWS.config.credentials;\n while (this.masterCredentials.masterCredentials) {\n this.masterCredentials = this.masterCredentials.masterCredentials;\n }\n\n if (typeof this.masterCredentials.get !== 'function') {\n this.masterCredentials = new AWS.Credentials(this.masterCredentials);\n }\n },\n\n /**\n * @api private\n */\n createClients: function () {\n this.service = this.service || new STS({params: this.params});\n }\n\n});\n","var AWS = require('../core');\nvar fs = require('fs');\nvar STS = require('../../clients/sts');\nvar iniLoader = AWS.util.iniLoader;\n\n/**\n * Represents OIDC credentials from a file on disk\n * If the credentials expire, the SDK can {refresh} the credentials\n * from the file.\n *\n * ## Using the web identity token file\n *\n * This provider is checked by default in the Node.js environment. To use\n * the provider simply add your OIDC token to a file (ASCII encoding) and\n * share the filename in either AWS_WEB_IDENTITY_TOKEN_FILE environment\n * variable or web_identity_token_file shared config variable\n *\n * The file contains encoded OIDC token and the characters are\n * ASCII encoded. OIDC tokens are JSON Web Tokens (JWT).\n * JWT's are 3 base64 encoded strings joined by the '.' character.\n *\n * This class will read filename from AWS_WEB_IDENTITY_TOKEN_FILE\n * environment variable or web_identity_token_file shared config variable,\n * and get the OIDC token from filename.\n * It will also read IAM role to be assumed from AWS_ROLE_ARN\n * environment variable or role_arn shared config variable.\n * This provider gets credetials using the {AWS.STS.assumeRoleWithWebIdentity}\n * service operation\n *\n * @!macro nobrowser\n */\nAWS.TokenFileWebIdentityCredentials = AWS.util.inherit(AWS.Credentials, {\n\n /**\n * @example Creating a new credentials object\n * AWS.config.credentials = new AWS.TokenFileWebIdentityCredentials(\n * // optionally provide configuration to apply to the underlying AWS.STS service client\n * // if configuration is not provided, then configuration will be pulled from AWS.config\n * {\n * // specify timeout options\n * httpOptions: {\n * timeout: 100\n * }\n * });\n * @see AWS.Config\n */\n constructor: function TokenFileWebIdentityCredentials(clientConfig) {\n AWS.Credentials.call(this);\n this.data = null;\n this.clientConfig = AWS.util.copy(clientConfig || {});\n },\n\n /**\n * Returns params from environment variables\n *\n * @api private\n */\n getParamsFromEnv: function getParamsFromEnv() {\n var ENV_TOKEN_FILE = 'AWS_WEB_IDENTITY_TOKEN_FILE',\n ENV_ROLE_ARN = 'AWS_ROLE_ARN';\n if (process.env[ENV_TOKEN_FILE] && process.env[ENV_ROLE_ARN]) {\n return [{\n envTokenFile: process.env[ENV_TOKEN_FILE],\n roleArn: process.env[ENV_ROLE_ARN],\n roleSessionName: process.env['AWS_ROLE_SESSION_NAME']\n }];\n }\n },\n\n /**\n * Returns params from shared config variables\n *\n * @api private\n */\n getParamsFromSharedConfig: function getParamsFromSharedConfig() {\n var profiles = AWS.util.getProfilesFromSharedConfig(iniLoader);\n var profileName = process.env.AWS_PROFILE || AWS.util.defaultProfile;\n var profile = profiles[profileName] || {};\n\n if (Object.keys(profile).length === 0) {\n throw AWS.util.error(\n new Error('Profile ' + profileName + ' not found'),\n { code: 'TokenFileWebIdentityCredentialsProviderFailure' }\n );\n }\n\n var paramsArray = [];\n\n while (!profile['web_identity_token_file'] && profile['source_profile']) {\n paramsArray.unshift({\n roleArn: profile['role_arn'],\n roleSessionName: profile['role_session_name']\n });\n var sourceProfile = profile['source_profile'];\n profile = profiles[sourceProfile];\n }\n\n paramsArray.unshift({\n envTokenFile: profile['web_identity_token_file'],\n roleArn: profile['role_arn'],\n roleSessionName: profile['role_session_name']\n });\n\n return paramsArray;\n },\n\n /**\n * Refreshes credentials using {AWS.STS.assumeRoleWithWebIdentity}\n *\n * @callback callback function(err)\n * Called when the STS service responds (or fails). When\n * this callback is called with no error, it means that the credentials\n * information has been loaded into the object (as the `accessKeyId`,\n * `secretAccessKey`, and `sessionToken` properties).\n * @param err [Error] if an error occurred, this value will be filled\n * @see AWS.Credentials.get\n */\n refresh: function refresh(callback) {\n this.coalesceRefresh(callback || AWS.util.fn.callback);\n },\n\n /**\n * @api private\n */\n assumeRoleChaining: function assumeRoleChaining(paramsArray, callback) {\n var self = this;\n if (paramsArray.length === 0) {\n self.service.credentialsFrom(self.data, self);\n callback();\n } else {\n var params = paramsArray.shift();\n self.service.config.credentials = self.service.credentialsFrom(self.data, self);\n self.service.assumeRole(\n {\n RoleArn: params.roleArn,\n RoleSessionName: params.roleSessionName || 'token-file-web-identity'\n },\n function (err, data) {\n self.data = null;\n if (err) {\n callback(err);\n } else {\n self.data = data;\n self.assumeRoleChaining(paramsArray, callback);\n }\n }\n );\n }\n },\n\n /**\n * @api private\n */\n load: function load(callback) {\n var self = this;\n try {\n var paramsArray = self.getParamsFromEnv();\n if (!paramsArray) {\n paramsArray = self.getParamsFromSharedConfig();\n }\n if (paramsArray) {\n var params = paramsArray.shift();\n var oidcToken = fs.readFileSync(params.envTokenFile, {encoding: 'ascii'});\n if (!self.service) {\n self.createClients();\n }\n self.service.assumeRoleWithWebIdentity(\n {\n WebIdentityToken: oidcToken,\n RoleArn: params.roleArn,\n RoleSessionName: params.roleSessionName || 'token-file-web-identity'\n },\n function (err, data) {\n self.data = null;\n if (err) {\n callback(err);\n } else {\n self.data = data;\n self.assumeRoleChaining(paramsArray, callback);\n }\n }\n );\n }\n } catch (err) {\n callback(err);\n }\n },\n\n /**\n * @api private\n */\n createClients: function() {\n if (!this.service) {\n var stsConfig = AWS.util.merge({}, this.clientConfig);\n this.service = new STS(stsConfig);\n\n // Retry in case of IDPCommunicationErrorException or InvalidIdentityToken\n this.service.retryableError = function(error) {\n if (error.code === 'IDPCommunicationErrorException' || error.code === 'InvalidIdentityToken') {\n return true;\n } else {\n return AWS.Service.prototype.retryableError.call(this, error);\n }\n };\n }\n }\n});\n","var AWS = require('../core');\nvar STS = require('../../clients/sts');\n\n/**\n * Represents credentials retrieved from STS Web Identity Federation support.\n *\n * By default this provider gets credentials using the\n * {AWS.STS.assumeRoleWithWebIdentity} service operation. This operation\n * requires a `RoleArn` containing the ARN of the IAM trust policy for the\n * application for which credentials will be given. In addition, the\n * `WebIdentityToken` must be set to the token provided by the identity\n * provider. See {constructor} for an example on creating a credentials\n * object with proper `RoleArn` and `WebIdentityToken` values.\n *\n * ## Refreshing Credentials from Identity Service\n *\n * In addition to AWS credentials expiring after a given amount of time, the\n * login token from the identity provider will also expire. Once this token\n * expires, it will not be usable to refresh AWS credentials, and another\n * token will be needed. The SDK does not manage refreshing of the token value,\n * but this can be done through a \"refresh token\" supported by most identity\n * providers. Consult the documentation for the identity provider for refreshing\n * tokens. Once the refreshed token is acquired, you should make sure to update\n * this new token in the credentials object's {params} property. The following\n * code will update the WebIdentityToken, assuming you have retrieved an updated\n * token from the identity provider:\n *\n * ```javascript\n * AWS.config.credentials.params.WebIdentityToken = updatedToken;\n * ```\n *\n * Future calls to `credentials.refresh()` will now use the new token.\n *\n * @!attribute params\n * @return [map] the map of params passed to\n * {AWS.STS.assumeRoleWithWebIdentity}. To update the token, set the\n * `params.WebIdentityToken` property.\n * @!attribute data\n * @return [map] the raw data response from the call to\n * {AWS.STS.assumeRoleWithWebIdentity}. Use this if you want to get\n * access to other properties from the response.\n */\nAWS.WebIdentityCredentials = AWS.util.inherit(AWS.Credentials, {\n /**\n * Creates a new credentials object.\n * @param (see AWS.STS.assumeRoleWithWebIdentity)\n * @example Creating a new credentials object\n * AWS.config.credentials = new AWS.WebIdentityCredentials({\n * RoleArn: 'arn:aws:iam::1234567890:role/WebIdentity',\n * WebIdentityToken: 'ABCDEFGHIJKLMNOP', // token from identity service\n * RoleSessionName: 'web' // optional name, defaults to web-identity\n * }, {\n * // optionally provide configuration to apply to the underlying AWS.STS service client\n * // if configuration is not provided, then configuration will be pulled from AWS.config\n *\n * // specify timeout options\n * httpOptions: {\n * timeout: 100\n * }\n * });\n * @see AWS.STS.assumeRoleWithWebIdentity\n * @see AWS.Config\n */\n constructor: function WebIdentityCredentials(params, clientConfig) {\n AWS.Credentials.call(this);\n this.expired = true;\n this.params = params;\n this.params.RoleSessionName = this.params.RoleSessionName || 'web-identity';\n this.data = null;\n this._clientConfig = AWS.util.copy(clientConfig || {});\n },\n\n /**\n * Refreshes credentials using {AWS.STS.assumeRoleWithWebIdentity}\n *\n * @callback callback function(err)\n * Called when the STS service responds (or fails). When\n * this callback is called with no error, it means that the credentials\n * information has been loaded into the object (as the `accessKeyId`,\n * `secretAccessKey`, and `sessionToken` properties).\n * @param err [Error] if an error occurred, this value will be filled\n * @see get\n */\n refresh: function refresh(callback) {\n this.coalesceRefresh(callback || AWS.util.fn.callback);\n },\n\n /**\n * @api private\n */\n load: function load(callback) {\n var self = this;\n self.createClients();\n self.service.assumeRoleWithWebIdentity(function (err, data) {\n self.data = null;\n if (!err) {\n self.data = data;\n self.service.credentialsFrom(data, self);\n }\n callback(err);\n });\n },\n\n /**\n * @api private\n */\n createClients: function() {\n if (!this.service) {\n var stsConfig = AWS.util.merge({}, this._clientConfig);\n stsConfig.params = this.params;\n this.service = new STS(stsConfig);\n }\n }\n\n});\n","var AWS = require('./core');\nvar util = require('./util');\nvar endpointDiscoveryEnabledEnvs = ['AWS_ENABLE_ENDPOINT_DISCOVERY', 'AWS_ENDPOINT_DISCOVERY_ENABLED'];\n\n/**\n * Generate key (except resources and operation part) to index the endpoints in the cache\n * If input shape has endpointdiscoveryid trait then use\n * accessKey + operation + resources + region + service as cache key\n * If input shape doesn't have endpointdiscoveryid trait then use\n * accessKey + region + service as cache key\n * @return [map] object with keys to index endpoints.\n * @api private\n */\nfunction getCacheKey(request) {\n var service = request.service;\n var api = service.api || {};\n var operations = api.operations;\n var identifiers = {};\n if (service.config.region) {\n identifiers.region = service.config.region;\n }\n if (api.serviceId) {\n identifiers.serviceId = api.serviceId;\n }\n if (service.config.credentials.accessKeyId) {\n identifiers.accessKeyId = service.config.credentials.accessKeyId;\n }\n return identifiers;\n}\n\n/**\n * Recursive helper for marshallCustomIdentifiers().\n * Looks for required string input members that have 'endpointdiscoveryid' trait.\n * @api private\n */\nfunction marshallCustomIdentifiersHelper(result, params, shape) {\n if (!shape || params === undefined || params === null) return;\n if (shape.type === 'structure' && shape.required && shape.required.length > 0) {\n util.arrayEach(shape.required, function(name) {\n var memberShape = shape.members[name];\n if (memberShape.endpointDiscoveryId === true) {\n var locationName = memberShape.isLocationName ? memberShape.name : name;\n result[locationName] = String(params[name]);\n } else {\n marshallCustomIdentifiersHelper(result, params[name], memberShape);\n }\n });\n }\n}\n\n/**\n * Get custom identifiers for cache key.\n * Identifies custom identifiers by checking each shape's `endpointDiscoveryId` trait.\n * @param [object] request object\n * @param [object] input shape of the given operation's api\n * @api private\n */\nfunction marshallCustomIdentifiers(request, shape) {\n var identifiers = {};\n marshallCustomIdentifiersHelper(identifiers, request.params, shape);\n return identifiers;\n}\n\n/**\n * Call endpoint discovery operation when it's optional.\n * When endpoint is available in cache then use the cached endpoints. If endpoints\n * are unavailable then use regional endpoints and call endpoint discovery operation\n * asynchronously. This is turned off by default.\n * @param [object] request object\n * @api private\n */\nfunction optionalDiscoverEndpoint(request) {\n var service = request.service;\n var api = service.api;\n var operationModel = api.operations ? api.operations[request.operation] : undefined;\n var inputShape = operationModel ? operationModel.input : undefined;\n\n var identifiers = marshallCustomIdentifiers(request, inputShape);\n var cacheKey = getCacheKey(request);\n if (Object.keys(identifiers).length > 0) {\n cacheKey = util.update(cacheKey, identifiers);\n if (operationModel) cacheKey.operation = operationModel.name;\n }\n var endpoints = AWS.endpointCache.get(cacheKey);\n if (endpoints && endpoints.length === 1 && endpoints[0].Address === '') {\n //endpoint operation is being made but response not yet received\n //or endpoint operation just failed in 1 minute\n return;\n } else if (endpoints && endpoints.length > 0) {\n //found endpoint record from cache\n request.httpRequest.updateEndpoint(endpoints[0].Address);\n } else {\n //endpoint record not in cache or outdated. make discovery operation\n var endpointRequest = service.makeRequest(api.endpointOperation, {\n Operation: operationModel.name,\n Identifiers: identifiers,\n });\n addApiVersionHeader(endpointRequest);\n endpointRequest.removeListener('validate', AWS.EventListeners.Core.VALIDATE_PARAMETERS);\n endpointRequest.removeListener('retry', AWS.EventListeners.Core.RETRY_CHECK);\n //put in a placeholder for endpoints already requested, prevent\n //too much in-flight calls\n AWS.endpointCache.put(cacheKey, [{\n Address: '',\n CachePeriodInMinutes: 1\n }]);\n endpointRequest.send(function(err, data) {\n if (data && data.Endpoints) {\n AWS.endpointCache.put(cacheKey, data.Endpoints);\n } else if (err) {\n AWS.endpointCache.put(cacheKey, [{\n Address: '',\n CachePeriodInMinutes: 1 //not to make more endpoint operation in next 1 minute\n }]);\n }\n });\n }\n}\n\nvar requestQueue = {};\n\n/**\n * Call endpoint discovery operation when it's required.\n * When endpoint is available in cache then use cached ones. If endpoints are\n * unavailable then SDK should call endpoint operation then use returned new\n * endpoint for the api call. SDK will automatically attempt to do endpoint\n * discovery. This is turned off by default\n * @param [object] request object\n * @api private\n */\nfunction requiredDiscoverEndpoint(request, done) {\n var service = request.service;\n var api = service.api;\n var operationModel = api.operations ? api.operations[request.operation] : undefined;\n var inputShape = operationModel ? operationModel.input : undefined;\n\n var identifiers = marshallCustomIdentifiers(request, inputShape);\n var cacheKey = getCacheKey(request);\n if (Object.keys(identifiers).length > 0) {\n cacheKey = util.update(cacheKey, identifiers);\n if (operationModel) cacheKey.operation = operationModel.name;\n }\n var cacheKeyStr = AWS.EndpointCache.getKeyString(cacheKey);\n var endpoints = AWS.endpointCache.get(cacheKeyStr); //endpoint cache also accepts string keys\n if (endpoints && endpoints.length === 1 && endpoints[0].Address === '') {\n //endpoint operation is being made but response not yet received\n //push request object to a pending queue\n if (!requestQueue[cacheKeyStr]) requestQueue[cacheKeyStr] = [];\n requestQueue[cacheKeyStr].push({request: request, callback: done});\n return;\n } else if (endpoints && endpoints.length > 0) {\n request.httpRequest.updateEndpoint(endpoints[0].Address);\n done();\n } else {\n var endpointRequest = service.makeRequest(api.endpointOperation, {\n Operation: operationModel.name,\n Identifiers: identifiers,\n });\n endpointRequest.removeListener('validate', AWS.EventListeners.Core.VALIDATE_PARAMETERS);\n addApiVersionHeader(endpointRequest);\n\n //put in a placeholder for endpoints already requested, prevent\n //too much in-flight calls\n AWS.endpointCache.put(cacheKeyStr, [{\n Address: '',\n CachePeriodInMinutes: 60 //long-live cache\n }]);\n endpointRequest.send(function(err, data) {\n if (err) {\n request.response.error = util.error(err, { retryable: false });\n AWS.endpointCache.remove(cacheKey);\n\n //fail all the pending requests in batch\n if (requestQueue[cacheKeyStr]) {\n var pendingRequests = requestQueue[cacheKeyStr];\n util.arrayEach(pendingRequests, function(requestContext) {\n requestContext.request.response.error = util.error(err, { retryable: false });\n requestContext.callback();\n });\n delete requestQueue[cacheKeyStr];\n }\n } else if (data) {\n AWS.endpointCache.put(cacheKeyStr, data.Endpoints);\n request.httpRequest.updateEndpoint(data.Endpoints[0].Address);\n\n //update the endpoint for all the pending requests in batch\n if (requestQueue[cacheKeyStr]) {\n var pendingRequests = requestQueue[cacheKeyStr];\n util.arrayEach(pendingRequests, function(requestContext) {\n requestContext.request.httpRequest.updateEndpoint(data.Endpoints[0].Address);\n requestContext.callback();\n });\n delete requestQueue[cacheKeyStr];\n }\n }\n done();\n });\n }\n}\n\n/**\n * add api version header to endpoint operation\n * @api private\n */\nfunction addApiVersionHeader(endpointRequest) {\n var api = endpointRequest.service.api;\n var apiVersion = api.apiVersion;\n if (apiVersion && !endpointRequest.httpRequest.headers['x-amz-api-version']) {\n endpointRequest.httpRequest.headers['x-amz-api-version'] = apiVersion;\n }\n}\n\n/**\n * If api call gets invalid endpoint exception, SDK should attempt to remove the invalid\n * endpoint from cache.\n * @api private\n */\nfunction invalidateCachedEndpoints(response) {\n var error = response.error;\n var httpResponse = response.httpResponse;\n if (error &&\n (error.code === 'InvalidEndpointException' || httpResponse.statusCode === 421)\n ) {\n var request = response.request;\n var operations = request.service.api.operations || {};\n var inputShape = operations[request.operation] ? operations[request.operation].input : undefined;\n var identifiers = marshallCustomIdentifiers(request, inputShape);\n var cacheKey = getCacheKey(request);\n if (Object.keys(identifiers).length > 0) {\n cacheKey = util.update(cacheKey, identifiers);\n if (operations[request.operation]) cacheKey.operation = operations[request.operation].name;\n }\n AWS.endpointCache.remove(cacheKey);\n }\n}\n\n/**\n * If endpoint is explicitly configured, SDK should not do endpoint discovery in anytime.\n * @param [object] client Service client object.\n * @api private\n */\nfunction hasCustomEndpoint(client) {\n //if set endpoint is set for specific client, enable endpoint discovery will raise an error.\n if (client._originalConfig && client._originalConfig.endpoint && client._originalConfig.endpointDiscoveryEnabled === true) {\n throw util.error(new Error(), {\n code: 'ConfigurationException',\n message: 'Custom endpoint is supplied; endpointDiscoveryEnabled must not be true.'\n });\n };\n var svcConfig = AWS.config[client.serviceIdentifier] || {};\n return Boolean(AWS.config.endpoint || svcConfig.endpoint || (client._originalConfig && client._originalConfig.endpoint));\n}\n\n/**\n * @api private\n */\nfunction isFalsy(value) {\n return ['false', '0'].indexOf(value) >= 0;\n}\n\n/**\n * If endpoint discovery should perform for this request when no operation requires endpoint\n * discovery for the given service.\n * SDK performs config resolution in order like below:\n * 1. If set in client configuration.\n * 2. If set in env AWS_ENABLE_ENDPOINT_DISCOVERY.\n * 3. If set in shared ini config file with key 'endpoint_discovery_enabled'.\n * @param [object] request request object.\n * @returns [boolean|undefined] if endpoint discovery config is not set in any source, this\n * function returns undefined\n * @api private\n */\nfunction resolveEndpointDiscoveryConfig(request) {\n var service = request.service || {};\n if (service.config.endpointDiscoveryEnabled !== undefined) {\n return service.config.endpointDiscoveryEnabled;\n }\n\n //shared ini file is only available in Node\n //not to check env in browser\n if (util.isBrowser()) return undefined;\n\n // If any of recognized endpoint discovery config env is set\n for (var i = 0; i < endpointDiscoveryEnabledEnvs.length; i++) {\n var env = endpointDiscoveryEnabledEnvs[i];\n if (Object.prototype.hasOwnProperty.call(process.env, env)) {\n if (process.env[env] === '' || process.env[env] === undefined) {\n throw util.error(new Error(), {\n code: 'ConfigurationException',\n message: 'environmental variable ' + env + ' cannot be set to nothing'\n });\n }\n return !isFalsy(process.env[env]);\n }\n }\n\n var configFile = {};\n try {\n configFile = AWS.util.iniLoader ? AWS.util.iniLoader.loadFrom({\n isConfig: true,\n filename: process.env[AWS.util.sharedConfigFileEnv]\n }) : {};\n } catch (e) {}\n var sharedFileConfig = configFile[\n process.env.AWS_PROFILE || AWS.util.defaultProfile\n ] || {};\n if (Object.prototype.hasOwnProperty.call(sharedFileConfig, 'endpoint_discovery_enabled')) {\n if (sharedFileConfig.endpoint_discovery_enabled === undefined) {\n throw util.error(new Error(), {\n code: 'ConfigurationException',\n message: 'config file entry \\'endpoint_discovery_enabled\\' cannot be set to nothing'\n });\n }\n return !isFalsy(sharedFileConfig.endpoint_discovery_enabled);\n }\n return undefined;\n}\n\n/**\n * attach endpoint discovery logic to request object\n * @param [object] request\n * @api private\n */\nfunction discoverEndpoint(request, done) {\n var service = request.service || {};\n if (hasCustomEndpoint(service) || request.isPresigned()) return done();\n\n var operations = service.api.operations || {};\n var operationModel = operations[request.operation];\n var isEndpointDiscoveryRequired = operationModel ? operationModel.endpointDiscoveryRequired : 'NULL';\n var isEnabled = resolveEndpointDiscoveryConfig(request);\n var hasRequiredEndpointDiscovery = service.api.hasRequiredEndpointDiscovery;\n if (isEnabled || hasRequiredEndpointDiscovery) {\n // Once a customer enables endpoint discovery, the SDK should start appending\n // the string endpoint-discovery to the user-agent on all requests.\n request.httpRequest.appendToUserAgent('endpoint-discovery');\n }\n switch (isEndpointDiscoveryRequired) {\n case 'OPTIONAL':\n if (isEnabled || hasRequiredEndpointDiscovery) {\n // For a given service; if at least one operation requires endpoint discovery then the SDK must enable endpoint discovery\n // by default for all operations of that service, including operations where endpoint discovery is optional.\n optionalDiscoverEndpoint(request);\n request.addNamedListener('INVALIDATE_CACHED_ENDPOINTS', 'extractError', invalidateCachedEndpoints);\n }\n done();\n break;\n case 'REQUIRED':\n if (isEnabled === false) {\n // For a given operation; if endpoint discovery is required and it has been disabled on the SDK client,\n // then the SDK must return a clear and actionable exception.\n request.response.error = util.error(new Error(), {\n code: 'ConfigurationException',\n message: 'Endpoint Discovery is disabled but ' + service.api.className + '.' + request.operation +\n '() requires it. Please check your configurations.'\n });\n done();\n break;\n }\n request.addNamedListener('INVALIDATE_CACHED_ENDPOINTS', 'extractError', invalidateCachedEndpoints);\n requiredDiscoverEndpoint(request, done);\n break;\n case 'NULL':\n default:\n done();\n break;\n }\n}\n\nmodule.exports = {\n discoverEndpoint: discoverEndpoint,\n requiredDiscoverEndpoint: requiredDiscoverEndpoint,\n optionalDiscoverEndpoint: optionalDiscoverEndpoint,\n marshallCustomIdentifiers: marshallCustomIdentifiers,\n getCacheKey: getCacheKey,\n invalidateCachedEndpoint: invalidateCachedEndpoints,\n};\n","var AWS = require('../core');\nvar util = AWS.util;\nvar typeOf = require('./types').typeOf;\nvar DynamoDBSet = require('./set');\nvar NumberValue = require('./numberValue');\n\nAWS.DynamoDB.Converter = {\n /**\n * Convert a JavaScript value to its equivalent DynamoDB AttributeValue type\n *\n * @param data [any] The data to convert to a DynamoDB AttributeValue\n * @param options [map]\n * @option options convertEmptyValues [Boolean] Whether to automatically\n * convert empty strings, blobs,\n * and sets to `null`\n * @option options wrapNumbers [Boolean] Whether to return numbers as a\n * NumberValue object instead of\n * converting them to native JavaScript\n * numbers. This allows for the safe\n * round-trip transport of numbers of\n * arbitrary size.\n * @return [map] An object in the Amazon DynamoDB AttributeValue format\n *\n * @see AWS.DynamoDB.Converter.marshall AWS.DynamoDB.Converter.marshall to\n * convert entire records (rather than individual attributes)\n */\n input: function convertInput(data, options) {\n options = options || {};\n var type = typeOf(data);\n if (type === 'Object') {\n return formatMap(data, options);\n } else if (type === 'Array') {\n return formatList(data, options);\n } else if (type === 'Set') {\n return formatSet(data, options);\n } else if (type === 'String') {\n if (data.length === 0 && options.convertEmptyValues) {\n return convertInput(null);\n }\n return { S: data };\n } else if (type === 'Number' || type === 'NumberValue') {\n return { N: data.toString() };\n } else if (type === 'Binary') {\n if (data.length === 0 && options.convertEmptyValues) {\n return convertInput(null);\n }\n return { B: data };\n } else if (type === 'Boolean') {\n return { BOOL: data };\n } else if (type === 'null') {\n return { NULL: true };\n } else if (type !== 'undefined' && type !== 'Function') {\n // this value has a custom constructor\n return formatMap(data, options);\n }\n },\n\n /**\n * Convert a JavaScript object into a DynamoDB record.\n *\n * @param data [any] The data to convert to a DynamoDB record\n * @param options [map]\n * @option options convertEmptyValues [Boolean] Whether to automatically\n * convert empty strings, blobs,\n * and sets to `null`\n * @option options wrapNumbers [Boolean] Whether to return numbers as a\n * NumberValue object instead of\n * converting them to native JavaScript\n * numbers. This allows for the safe\n * round-trip transport of numbers of\n * arbitrary size.\n *\n * @return [map] An object in the DynamoDB record format.\n *\n * @example Convert a JavaScript object into a DynamoDB record\n * var marshalled = AWS.DynamoDB.Converter.marshall({\n * string: 'foo',\n * list: ['fizz', 'buzz', 'pop'],\n * map: {\n * nestedMap: {\n * key: 'value',\n * }\n * },\n * number: 123,\n * nullValue: null,\n * boolValue: true,\n * stringSet: new DynamoDBSet(['foo', 'bar', 'baz'])\n * });\n */\n marshall: function marshallItem(data, options) {\n return AWS.DynamoDB.Converter.input(data, options).M;\n },\n\n /**\n * Convert a DynamoDB AttributeValue object to its equivalent JavaScript type.\n *\n * @param data [map] An object in the Amazon DynamoDB AttributeValue format\n * @param options [map]\n * @option options convertEmptyValues [Boolean] Whether to automatically\n * convert empty strings, blobs,\n * and sets to `null`\n * @option options wrapNumbers [Boolean] Whether to return numbers as a\n * NumberValue object instead of\n * converting them to native JavaScript\n * numbers. This allows for the safe\n * round-trip transport of numbers of\n * arbitrary size.\n *\n * @return [Object|Array|String|Number|Boolean|null]\n *\n * @see AWS.DynamoDB.Converter.unmarshall AWS.DynamoDB.Converter.unmarshall to\n * convert entire records (rather than individual attributes)\n */\n output: function convertOutput(data, options) {\n options = options || {};\n var list, map, i;\n for (var type in data) {\n var values = data[type];\n if (type === 'M') {\n map = {};\n for (var key in values) {\n map[key] = convertOutput(values[key], options);\n }\n return map;\n } else if (type === 'L') {\n list = [];\n for (i = 0; i < values.length; i++) {\n list.push(convertOutput(values[i], options));\n }\n return list;\n } else if (type === 'SS') {\n list = [];\n for (i = 0; i < values.length; i++) {\n list.push(values[i] + '');\n }\n return new DynamoDBSet(list);\n } else if (type === 'NS') {\n list = [];\n for (i = 0; i < values.length; i++) {\n list.push(convertNumber(values[i], options.wrapNumbers));\n }\n return new DynamoDBSet(list);\n } else if (type === 'BS') {\n list = [];\n for (i = 0; i < values.length; i++) {\n list.push(AWS.util.buffer.toBuffer(values[i]));\n }\n return new DynamoDBSet(list);\n } else if (type === 'S') {\n return values + '';\n } else if (type === 'N') {\n return convertNumber(values, options.wrapNumbers);\n } else if (type === 'B') {\n return util.buffer.toBuffer(values);\n } else if (type === 'BOOL') {\n return (values === 'true' || values === 'TRUE' || values === true);\n } else if (type === 'NULL') {\n return null;\n }\n }\n },\n\n /**\n * Convert a DynamoDB record into a JavaScript object.\n *\n * @param data [any] The DynamoDB record\n * @param options [map]\n * @option options convertEmptyValues [Boolean] Whether to automatically\n * convert empty strings, blobs,\n * and sets to `null`\n * @option options wrapNumbers [Boolean] Whether to return numbers as a\n * NumberValue object instead of\n * converting them to native JavaScript\n * numbers. This allows for the safe\n * round-trip transport of numbers of\n * arbitrary size.\n *\n * @return [map] An object whose properties have been converted from\n * DynamoDB's AttributeValue format into their corresponding native\n * JavaScript types.\n *\n * @example Convert a record received from a DynamoDB stream\n * var unmarshalled = AWS.DynamoDB.Converter.unmarshall({\n * string: {S: 'foo'},\n * list: {L: [{S: 'fizz'}, {S: 'buzz'}, {S: 'pop'}]},\n * map: {\n * M: {\n * nestedMap: {\n * M: {\n * key: {S: 'value'}\n * }\n * }\n * }\n * },\n * number: {N: '123'},\n * nullValue: {NULL: true},\n * boolValue: {BOOL: true}\n * });\n */\n unmarshall: function unmarshall(data, options) {\n return AWS.DynamoDB.Converter.output({M: data}, options);\n }\n};\n\n/**\n * @api private\n * @param data [Array]\n * @param options [map]\n */\nfunction formatList(data, options) {\n var list = {L: []};\n for (var i = 0; i < data.length; i++) {\n list['L'].push(AWS.DynamoDB.Converter.input(data[i], options));\n }\n return list;\n}\n\n/**\n * @api private\n * @param value [String]\n * @param wrapNumbers [Boolean]\n */\nfunction convertNumber(value, wrapNumbers) {\n return wrapNumbers ? new NumberValue(value) : Number(value);\n}\n\n/**\n * @api private\n * @param data [map]\n * @param options [map]\n */\nfunction formatMap(data, options) {\n var map = {M: {}};\n for (var key in data) {\n var formatted = AWS.DynamoDB.Converter.input(data[key], options);\n if (formatted !== void 0) {\n map['M'][key] = formatted;\n }\n }\n return map;\n}\n\n/**\n * @api private\n */\nfunction formatSet(data, options) {\n options = options || {};\n var values = data.values;\n if (options.convertEmptyValues) {\n values = filterEmptySetValues(data);\n if (values.length === 0) {\n return AWS.DynamoDB.Converter.input(null);\n }\n }\n\n var map = {};\n switch (data.type) {\n case 'String': map['SS'] = values; break;\n case 'Binary': map['BS'] = values; break;\n case 'Number': map['NS'] = values.map(function (value) {\n return value.toString();\n });\n }\n return map;\n}\n\n/**\n * @api private\n */\nfunction filterEmptySetValues(set) {\n var nonEmptyValues = [];\n var potentiallyEmptyTypes = {\n String: true,\n Binary: true,\n Number: false\n };\n if (potentiallyEmptyTypes[set.type]) {\n for (var i = 0; i < set.values.length; i++) {\n if (set.values[i].length === 0) {\n continue;\n }\n nonEmptyValues.push(set.values[i]);\n }\n\n return nonEmptyValues;\n }\n\n return set.values;\n}\n\n/**\n * @api private\n */\nmodule.exports = AWS.DynamoDB.Converter;\n","var AWS = require('../core');\nvar Translator = require('./translator');\nvar DynamoDBSet = require('./set');\n\n/**\n * The document client simplifies working with items in Amazon DynamoDB\n * by abstracting away the notion of attribute values. This abstraction\n * annotates native JavaScript types supplied as input parameters, as well\n * as converts annotated response data to native JavaScript types.\n *\n * ## Marshalling Input and Unmarshalling Response Data\n *\n * The document client affords developers the use of native JavaScript types\n * instead of `AttributeValue`s to simplify the JavaScript development\n * experience with Amazon DynamoDB. JavaScript objects passed in as parameters\n * are marshalled into `AttributeValue` shapes required by Amazon DynamoDB.\n * Responses from DynamoDB are unmarshalled into plain JavaScript objects\n * by the `DocumentClient`. The `DocumentClient`, does not accept\n * `AttributeValue`s in favor of native JavaScript types.\n *\n * | JavaScript Type | DynamoDB AttributeValue |\n * |:----------------------------------------------------------------------:|-------------------------|\n * | String | S |\n * | Number | N |\n * | Boolean | BOOL |\n * | null | NULL |\n * | Array | L |\n * | Object | M |\n * | Buffer, File, Blob, ArrayBuffer, DataView, and JavaScript typed arrays | B |\n *\n * ## Support for Sets\n *\n * The `DocumentClient` offers a convenient way to create sets from\n * JavaScript Arrays. The type of set is inferred from the first element\n * in the array. DynamoDB supports string, number, and binary sets. To\n * learn more about supported types see the\n * [Amazon DynamoDB Data Model Documentation](http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/DataModel.html)\n * For more information see {AWS.DynamoDB.DocumentClient.createSet}\n *\n */\nAWS.DynamoDB.DocumentClient = AWS.util.inherit({\n\n /**\n * Creates a DynamoDB document client with a set of configuration options.\n *\n * @option options params [map] An optional map of parameters to bind to every\n * request sent by this service object.\n * @option options service [AWS.DynamoDB] An optional pre-configured instance\n * of the AWS.DynamoDB service object to use for requests. The object may\n * bound parameters used by the document client.\n * @option options convertEmptyValues [Boolean] set to true if you would like\n * the document client to convert empty values (0-length strings, binary\n * buffers, and sets) to be converted to NULL types when persisting to\n * DynamoDB.\n * @option options wrapNumbers [Boolean] Set to true to return numbers as a\n * NumberValue object instead of converting them to native JavaScript numbers.\n * This allows for the safe round-trip transport of numbers of arbitrary size.\n * @see AWS.DynamoDB.constructor\n *\n */\n constructor: function DocumentClient(options) {\n var self = this;\n self.options = options || {};\n self.configure(self.options);\n },\n\n /**\n * @api private\n */\n configure: function configure(options) {\n var self = this;\n self.service = options.service;\n self.bindServiceObject(options);\n self.attrValue = options.attrValue =\n self.service.api.operations.putItem.input.members.Item.value.shape;\n },\n\n /**\n * @api private\n */\n bindServiceObject: function bindServiceObject(options) {\n var self = this;\n options = options || {};\n\n if (!self.service) {\n self.service = new AWS.DynamoDB(options);\n } else {\n var config = AWS.util.copy(self.service.config);\n self.service = new self.service.constructor.__super__(config);\n self.service.config.params =\n AWS.util.merge(self.service.config.params || {}, options.params);\n }\n },\n\n /**\n * @api private\n */\n makeServiceRequest: function(operation, params, callback) {\n var self = this;\n var request = self.service[operation](params);\n self.setupRequest(request);\n self.setupResponse(request);\n if (typeof callback === 'function') {\n request.send(callback);\n }\n return request;\n },\n\n /**\n * @api private\n */\n serviceClientOperationsMap: {\n batchGet: 'batchGetItem',\n batchWrite: 'batchWriteItem',\n delete: 'deleteItem',\n get: 'getItem',\n put: 'putItem',\n query: 'query',\n scan: 'scan',\n update: 'updateItem',\n transactGet: 'transactGetItems',\n transactWrite: 'transactWriteItems'\n },\n\n /**\n * Returns the attributes of one or more items from one or more tables\n * by delegating to `AWS.DynamoDB.batchGetItem()`.\n *\n * Supply the same parameters as {AWS.DynamoDB.batchGetItem} with\n * `AttributeValue`s substituted by native JavaScript types.\n *\n * @see AWS.DynamoDB.batchGetItem\n * @example Get items from multiple tables\n * var params = {\n * RequestItems: {\n * 'Table-1': {\n * Keys: [\n * {\n * HashKey: 'haskey',\n * NumberRangeKey: 1\n * }\n * ]\n * },\n * 'Table-2': {\n * Keys: [\n * { foo: 'bar' },\n * ]\n * }\n * }\n * };\n *\n * var documentClient = new AWS.DynamoDB.DocumentClient();\n *\n * documentClient.batchGet(params, function(err, data) {\n * if (err) console.log(err);\n * else console.log(data);\n * });\n *\n */\n batchGet: function(params, callback) {\n var operation = this.serviceClientOperationsMap['batchGet'];\n return this.makeServiceRequest(operation, params, callback);\n },\n\n /**\n * Puts or deletes multiple items in one or more tables by delegating\n * to `AWS.DynamoDB.batchWriteItem()`.\n *\n * Supply the same parameters as {AWS.DynamoDB.batchWriteItem} with\n * `AttributeValue`s substituted by native JavaScript types.\n *\n * @see AWS.DynamoDB.batchWriteItem\n * @example Write to and delete from a table\n * var params = {\n * RequestItems: {\n * 'Table-1': [\n * {\n * DeleteRequest: {\n * Key: { HashKey: 'someKey' }\n * }\n * },\n * {\n * PutRequest: {\n * Item: {\n * HashKey: 'anotherKey',\n * NumAttribute: 1,\n * BoolAttribute: true,\n * ListAttribute: [1, 'two', false],\n * MapAttribute: { foo: 'bar' }\n * }\n * }\n * }\n * ]\n * }\n * };\n *\n * var documentClient = new AWS.DynamoDB.DocumentClient();\n *\n * documentClient.batchWrite(params, function(err, data) {\n * if (err) console.log(err);\n * else console.log(data);\n * });\n *\n */\n batchWrite: function(params, callback) {\n var operation = this.serviceClientOperationsMap['batchWrite'];\n return this.makeServiceRequest(operation, params, callback);\n },\n\n /**\n * Deletes a single item in a table by primary key by delegating to\n * `AWS.DynamoDB.deleteItem()`\n *\n * Supply the same parameters as {AWS.DynamoDB.deleteItem} with\n * `AttributeValue`s substituted by native JavaScript types.\n *\n * @see AWS.DynamoDB.deleteItem\n * @example Delete an item from a table\n * var params = {\n * TableName : 'Table',\n * Key: {\n * HashKey: 'hashkey',\n * NumberRangeKey: 1\n * }\n * };\n *\n * var documentClient = new AWS.DynamoDB.DocumentClient();\n *\n * documentClient.delete(params, function(err, data) {\n * if (err) console.log(err);\n * else console.log(data);\n * });\n *\n */\n delete: function(params, callback) {\n var operation = this.serviceClientOperationsMap['delete'];\n return this.makeServiceRequest(operation, params, callback);\n },\n\n /**\n * Returns a set of attributes for the item with the given primary key\n * by delegating to `AWS.DynamoDB.getItem()`.\n *\n * Supply the same parameters as {AWS.DynamoDB.getItem} with\n * `AttributeValue`s substituted by native JavaScript types.\n *\n * @see AWS.DynamoDB.getItem\n * @example Get an item from a table\n * var params = {\n * TableName : 'Table',\n * Key: {\n * HashKey: 'hashkey'\n * }\n * };\n *\n * var documentClient = new AWS.DynamoDB.DocumentClient();\n *\n * documentClient.get(params, function(err, data) {\n * if (err) console.log(err);\n * else console.log(data);\n * });\n *\n */\n get: function(params, callback) {\n var operation = this.serviceClientOperationsMap['get'];\n return this.makeServiceRequest(operation, params, callback);\n },\n\n /**\n * Creates a new item, or replaces an old item with a new item by\n * delegating to `AWS.DynamoDB.putItem()`.\n *\n * Supply the same parameters as {AWS.DynamoDB.putItem} with\n * `AttributeValue`s substituted by native JavaScript types.\n *\n * @see AWS.DynamoDB.putItem\n * @example Create a new item in a table\n * var params = {\n * TableName : 'Table',\n * Item: {\n * HashKey: 'haskey',\n * NumAttribute: 1,\n * BoolAttribute: true,\n * ListAttribute: [1, 'two', false],\n * MapAttribute: { foo: 'bar'},\n * NullAttribute: null\n * }\n * };\n *\n * var documentClient = new AWS.DynamoDB.DocumentClient();\n *\n * documentClient.put(params, function(err, data) {\n * if (err) console.log(err);\n * else console.log(data);\n * });\n *\n */\n put: function(params, callback) {\n var operation = this.serviceClientOperationsMap['put'];\n return this.makeServiceRequest(operation, params, callback);\n },\n\n /**\n * Edits an existing item's attributes, or adds a new item to the table if\n * it does not already exist by delegating to `AWS.DynamoDB.updateItem()`.\n *\n * Supply the same parameters as {AWS.DynamoDB.updateItem} with\n * `AttributeValue`s substituted by native JavaScript types.\n *\n * @see AWS.DynamoDB.updateItem\n * @example Update an item with expressions\n * var params = {\n * TableName: 'Table',\n * Key: { HashKey : 'hashkey' },\n * UpdateExpression: 'set #a = :x + :y',\n * ConditionExpression: '#a < :MAX',\n * ExpressionAttributeNames: {'#a' : 'Sum'},\n * ExpressionAttributeValues: {\n * ':x' : 20,\n * ':y' : 45,\n * ':MAX' : 100,\n * }\n * };\n *\n * var documentClient = new AWS.DynamoDB.DocumentClient();\n *\n * documentClient.update(params, function(err, data) {\n * if (err) console.log(err);\n * else console.log(data);\n * });\n *\n */\n update: function(params, callback) {\n var operation = this.serviceClientOperationsMap['update'];\n return this.makeServiceRequest(operation, params, callback);\n },\n\n /**\n * Returns one or more items and item attributes by accessing every item\n * in a table or a secondary index.\n *\n * Supply the same parameters as {AWS.DynamoDB.scan} with\n * `AttributeValue`s substituted by native JavaScript types.\n *\n * @see AWS.DynamoDB.scan\n * @example Scan the table with a filter expression\n * var params = {\n * TableName : 'Table',\n * FilterExpression : 'Year = :this_year',\n * ExpressionAttributeValues : {':this_year' : 2015}\n * };\n *\n * var documentClient = new AWS.DynamoDB.DocumentClient();\n *\n * documentClient.scan(params, function(err, data) {\n * if (err) console.log(err);\n * else console.log(data);\n * });\n *\n */\n scan: function(params, callback) {\n var operation = this.serviceClientOperationsMap['scan'];\n return this.makeServiceRequest(operation, params, callback);\n },\n\n /**\n * Directly access items from a table by primary key or a secondary index.\n *\n * Supply the same parameters as {AWS.DynamoDB.query} with\n * `AttributeValue`s substituted by native JavaScript types.\n *\n * @see AWS.DynamoDB.query\n * @example Query an index\n * var params = {\n * TableName: 'Table',\n * IndexName: 'Index',\n * KeyConditionExpression: 'HashKey = :hkey and RangeKey > :rkey',\n * ExpressionAttributeValues: {\n * ':hkey': 'key',\n * ':rkey': 2015\n * }\n * };\n *\n * var documentClient = new AWS.DynamoDB.DocumentClient();\n *\n * documentClient.query(params, function(err, data) {\n * if (err) console.log(err);\n * else console.log(data);\n * });\n *\n */\n query: function(params, callback) {\n var operation = this.serviceClientOperationsMap['query'];\n return this.makeServiceRequest(operation, params, callback);\n },\n\n /**\n * Synchronous write operation that groups up to 10 action requests\n *\n * Supply the same parameters as {AWS.DynamoDB.transactWriteItems} with\n * `AttributeValue`s substituted by native JavaScript types.\n *\n * @see AWS.DynamoDB.transactWriteItems\n * @example Get items from multiple tables\n * var params = {\n * TransactItems: [{\n * Put: {\n * TableName : 'Table0',\n * Item: {\n * HashKey: 'haskey',\n * NumAttribute: 1,\n * BoolAttribute: true,\n * ListAttribute: [1, 'two', false],\n * MapAttribute: { foo: 'bar'},\n * NullAttribute: null\n * }\n * }\n * }, {\n * Update: {\n * TableName: 'Table1',\n * Key: { HashKey : 'hashkey' },\n * UpdateExpression: 'set #a = :x + :y',\n * ConditionExpression: '#a < :MAX',\n * ExpressionAttributeNames: {'#a' : 'Sum'},\n * ExpressionAttributeValues: {\n * ':x' : 20,\n * ':y' : 45,\n * ':MAX' : 100,\n * }\n * }\n * }]\n * };\n *\n * documentClient.transactWrite(params, function(err, data) {\n * if (err) console.log(err);\n * else console.log(data);\n * });\n */\n transactWrite: function(params, callback) {\n var operation = this.serviceClientOperationsMap['transactWrite'];\n return this.makeServiceRequest(operation, params, callback);\n },\n\n /**\n * Atomically retrieves multiple items from one or more tables (but not from indexes)\n * in a single account and region.\n *\n * Supply the same parameters as {AWS.DynamoDB.transactGetItems} with\n * `AttributeValue`s substituted by native JavaScript types.\n *\n * @see AWS.DynamoDB.transactGetItems\n * @example Get items from multiple tables\n * var params = {\n * TransactItems: [{\n * Get: {\n * TableName : 'Table0',\n * Key: {\n * HashKey: 'hashkey0'\n * }\n * }\n * }, {\n * Get: {\n * TableName : 'Table1',\n * Key: {\n * HashKey: 'hashkey1'\n * }\n * }\n * }]\n * };\n *\n * documentClient.transactGet(params, function(err, data) {\n * if (err) console.log(err);\n * else console.log(data);\n * });\n */\n transactGet: function(params, callback) {\n var operation = this.serviceClientOperationsMap['transactGet'];\n return this.makeServiceRequest(operation, params, callback);\n },\n\n /**\n * Creates a set of elements inferring the type of set from\n * the type of the first element. Amazon DynamoDB currently supports\n * the number sets, string sets, and binary sets. For more information\n * about DynamoDB data types see the documentation on the\n * [Amazon DynamoDB Data Model](http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/DataModel.html#DataModel.DataTypes).\n *\n * @param list [Array] Collection to represent your DynamoDB Set\n * @param options [map]\n * * **validate** [Boolean] set to true if you want to validate the type\n * of each element in the set. Defaults to `false`.\n * @example Creating a number set\n * var documentClient = new AWS.DynamoDB.DocumentClient();\n *\n * var params = {\n * Item: {\n * hashkey: 'hashkey'\n * numbers: documentClient.createSet([1, 2, 3]);\n * }\n * };\n *\n * documentClient.put(params, function(err, data) {\n * if (err) console.log(err);\n * else console.log(data);\n * });\n *\n */\n createSet: function(list, options) {\n options = options || {};\n return new DynamoDBSet(list, options);\n },\n\n /**\n * @api private\n */\n getTranslator: function() {\n return new Translator(this.options);\n },\n\n /**\n * @api private\n */\n setupRequest: function setupRequest(request) {\n var self = this;\n var translator = self.getTranslator();\n var operation = request.operation;\n var inputShape = request.service.api.operations[operation].input;\n request._events.validate.unshift(function(req) {\n req.rawParams = AWS.util.copy(req.params);\n req.params = translator.translateInput(req.rawParams, inputShape);\n });\n },\n\n /**\n * @api private\n */\n setupResponse: function setupResponse(request) {\n var self = this;\n var translator = self.getTranslator();\n var outputShape = self.service.api.operations[request.operation].output;\n request.on('extractData', function(response) {\n response.data = translator.translateOutput(response.data, outputShape);\n });\n\n var response = request.response;\n response.nextPage = function(cb) {\n var resp = this;\n var req = resp.request;\n var config;\n var service = req.service;\n var operation = req.operation;\n try {\n config = service.paginationConfig(operation, true);\n } catch (e) { resp.error = e; }\n\n if (!resp.hasNextPage()) {\n if (cb) cb(resp.error, null);\n else if (resp.error) throw resp.error;\n return null;\n }\n\n var params = AWS.util.copy(req.rawParams);\n if (!resp.nextPageTokens) {\n return cb ? cb(null, null) : null;\n } else {\n var inputTokens = config.inputToken;\n if (typeof inputTokens === 'string') inputTokens = [inputTokens];\n for (var i = 0; i < inputTokens.length; i++) {\n params[inputTokens[i]] = resp.nextPageTokens[i];\n }\n return self[operation](params, cb);\n }\n };\n }\n\n});\n\n/**\n * @api private\n */\nmodule.exports = AWS.DynamoDB.DocumentClient;\n","var util = require('../core').util;\n\n/**\n * An object recognizable as a numeric value that stores the underlying number\n * as a string.\n *\n * Intended to be a deserialization target for the DynamoDB Document Client when\n * the `wrapNumbers` flag is set. This allows for numeric values that lose\n * precision when converted to JavaScript's `number` type.\n */\nvar DynamoDBNumberValue = util.inherit({\n constructor: function NumberValue(value) {\n this.wrapperName = 'NumberValue';\n this.value = value.toString();\n },\n\n /**\n * Render the underlying value as a number when converting to JSON.\n */\n toJSON: function () {\n return this.toNumber();\n },\n\n /**\n * Convert the underlying value to a JavaScript number.\n */\n toNumber: function () {\n return Number(this.value);\n },\n\n /**\n * Return a string representing the unaltered value provided to the\n * constructor.\n */\n toString: function () {\n return this.value;\n }\n});\n\n/**\n * @api private\n */\nmodule.exports = DynamoDBNumberValue;\n","var util = require('../core').util;\nvar typeOf = require('./types').typeOf;\n\n/**\n * @api private\n */\nvar memberTypeToSetType = {\n 'String': 'String',\n 'Number': 'Number',\n 'NumberValue': 'Number',\n 'Binary': 'Binary'\n};\n\n/**\n * @api private\n */\nvar DynamoDBSet = util.inherit({\n\n constructor: function Set(list, options) {\n options = options || {};\n this.wrapperName = 'Set';\n this.initialize(list, options.validate);\n },\n\n initialize: function(list, validate) {\n var self = this;\n self.values = [].concat(list);\n self.detectType();\n if (validate) {\n self.validate();\n }\n },\n\n detectType: function() {\n this.type = memberTypeToSetType[typeOf(this.values[0])];\n if (!this.type) {\n throw util.error(new Error(), {\n code: 'InvalidSetType',\n message: 'Sets can contain string, number, or binary values'\n });\n }\n },\n\n validate: function() {\n var self = this;\n var length = self.values.length;\n var values = self.values;\n for (var i = 0; i < length; i++) {\n if (memberTypeToSetType[typeOf(values[i])] !== self.type) {\n throw util.error(new Error(), {\n code: 'InvalidType',\n message: self.type + ' Set contains ' + typeOf(values[i]) + ' value'\n });\n }\n }\n },\n\n /**\n * Render the underlying values only when converting to JSON.\n */\n toJSON: function() {\n var self = this;\n return self.values;\n }\n\n});\n\n/**\n * @api private\n */\nmodule.exports = DynamoDBSet;\n","var util = require('../core').util;\nvar convert = require('./converter');\n\nvar Translator = function(options) {\n options = options || {};\n this.attrValue = options.attrValue;\n this.convertEmptyValues = Boolean(options.convertEmptyValues);\n this.wrapNumbers = Boolean(options.wrapNumbers);\n};\n\nTranslator.prototype.translateInput = function(value, shape) {\n this.mode = 'input';\n return this.translate(value, shape);\n};\n\nTranslator.prototype.translateOutput = function(value, shape) {\n this.mode = 'output';\n return this.translate(value, shape);\n};\n\nTranslator.prototype.translate = function(value, shape) {\n var self = this;\n if (!shape || value === undefined) return undefined;\n\n if (shape.shape === self.attrValue) {\n return convert[self.mode](value, {\n convertEmptyValues: self.convertEmptyValues,\n wrapNumbers: self.wrapNumbers,\n });\n }\n switch (shape.type) {\n case 'structure': return self.translateStructure(value, shape);\n case 'map': return self.translateMap(value, shape);\n case 'list': return self.translateList(value, shape);\n default: return self.translateScalar(value, shape);\n }\n};\n\nTranslator.prototype.translateStructure = function(structure, shape) {\n var self = this;\n if (structure == null) return undefined;\n\n var struct = {};\n util.each(structure, function(name, value) {\n var memberShape = shape.members[name];\n if (memberShape) {\n var result = self.translate(value, memberShape);\n if (result !== undefined) struct[name] = result;\n }\n });\n return struct;\n};\n\nTranslator.prototype.translateList = function(list, shape) {\n var self = this;\n if (list == null) return undefined;\n\n var out = [];\n util.arrayEach(list, function(value) {\n var result = self.translate(value, shape.member);\n if (result === undefined) out.push(null);\n else out.push(result);\n });\n return out;\n};\n\nTranslator.prototype.translateMap = function(map, shape) {\n var self = this;\n if (map == null) return undefined;\n\n var out = {};\n util.each(map, function(key, value) {\n var result = self.translate(value, shape.value);\n if (result === undefined) out[key] = null;\n else out[key] = result;\n });\n return out;\n};\n\nTranslator.prototype.translateScalar = function(value, shape) {\n return shape.toType(value);\n};\n\n/**\n * @api private\n */\nmodule.exports = Translator;\n","var util = require('../core').util;\n\nfunction typeOf(data) {\n if (data === null && typeof data === 'object') {\n return 'null';\n } else if (data !== undefined && isBinary(data)) {\n return 'Binary';\n } else if (data !== undefined && data.constructor) {\n return data.wrapperName || util.typeName(data.constructor);\n } else if (data !== undefined && typeof data === 'object') {\n // this object is the result of Object.create(null), hence the absence of a\n // defined constructor\n return 'Object';\n } else {\n return 'undefined';\n }\n}\n\nfunction isBinary(data) {\n var types = [\n 'Buffer', 'File', 'Blob', 'ArrayBuffer', 'DataView',\n 'Int8Array', 'Uint8Array', 'Uint8ClampedArray',\n 'Int16Array', 'Uint16Array', 'Int32Array', 'Uint32Array',\n 'Float32Array', 'Float64Array'\n ];\n if (util.isNode()) {\n var Stream = util.stream.Stream;\n if (util.Buffer.isBuffer(data) || data instanceof Stream) {\n return true;\n }\n }\n\n for (var i = 0; i < types.length; i++) {\n if (data !== undefined && data.constructor) {\n if (util.isType(data, types[i])) return true;\n if (util.typeName(data.constructor) === types[i]) return true;\n }\n }\n\n return false;\n}\n\n/**\n * @api private\n */\nmodule.exports = {\n typeOf: typeOf,\n isBinary: isBinary\n};\n","var eventMessageChunker = require('../event-stream/event-message-chunker').eventMessageChunker;\nvar parseEvent = require('./parse-event').parseEvent;\n\nfunction createEventStream(body, parser, model) {\n var eventMessages = eventMessageChunker(body);\n\n var events = [];\n\n for (var i = 0; i < eventMessages.length; i++) {\n events.push(parseEvent(parser, eventMessages[i], model));\n }\n\n return events;\n}\n\n/**\n * @api private\n */\nmodule.exports = {\n createEventStream: createEventStream\n};\n","var util = require('../core').util;\nvar Transform = require('stream').Transform;\nvar allocBuffer = util.buffer.alloc;\n\n/** @type {Transform} */\nfunction EventMessageChunkerStream(options) {\n Transform.call(this, options);\n\n this.currentMessageTotalLength = 0;\n this.currentMessagePendingLength = 0;\n /** @type {Buffer} */\n this.currentMessage = null;\n\n /** @type {Buffer} */\n this.messageLengthBuffer = null;\n}\n\nEventMessageChunkerStream.prototype = Object.create(Transform.prototype);\n\n/**\n *\n * @param {Buffer} chunk\n * @param {string} encoding\n * @param {*} callback\n */\nEventMessageChunkerStream.prototype._transform = function(chunk, encoding, callback) {\n var chunkLength = chunk.length;\n var currentOffset = 0;\n\n while (currentOffset < chunkLength) {\n // create new message if necessary\n if (!this.currentMessage) {\n // working on a new message, determine total length\n var bytesRemaining = chunkLength - currentOffset;\n // prevent edge case where total length spans 2 chunks\n if (!this.messageLengthBuffer) {\n this.messageLengthBuffer = allocBuffer(4);\n }\n var numBytesForTotal = Math.min(\n 4 - this.currentMessagePendingLength, // remaining bytes to fill the messageLengthBuffer\n bytesRemaining // bytes left in chunk\n );\n\n chunk.copy(\n this.messageLengthBuffer,\n this.currentMessagePendingLength,\n currentOffset,\n currentOffset + numBytesForTotal\n );\n\n this.currentMessagePendingLength += numBytesForTotal;\n currentOffset += numBytesForTotal;\n\n if (this.currentMessagePendingLength < 4) {\n // not enough information to create the current message\n break;\n }\n this.allocateMessage(this.messageLengthBuffer.readUInt32BE(0));\n this.messageLengthBuffer = null;\n }\n\n // write data into current message\n var numBytesToWrite = Math.min(\n this.currentMessageTotalLength - this.currentMessagePendingLength, // number of bytes left to complete message\n chunkLength - currentOffset // number of bytes left in the original chunk\n );\n chunk.copy(\n this.currentMessage, // target buffer\n this.currentMessagePendingLength, // target offset\n currentOffset, // chunk offset\n currentOffset + numBytesToWrite // chunk end to write\n );\n this.currentMessagePendingLength += numBytesToWrite;\n currentOffset += numBytesToWrite;\n\n // check if a message is ready to be pushed\n if (this.currentMessageTotalLength && this.currentMessageTotalLength === this.currentMessagePendingLength) {\n // push out the message\n this.push(this.currentMessage);\n // cleanup\n this.currentMessage = null;\n this.currentMessageTotalLength = 0;\n this.currentMessagePendingLength = 0;\n }\n }\n\n callback();\n};\n\nEventMessageChunkerStream.prototype._flush = function(callback) {\n if (this.currentMessageTotalLength) {\n if (this.currentMessageTotalLength === this.currentMessagePendingLength) {\n callback(null, this.currentMessage);\n } else {\n callback(new Error('Truncated event message received.'));\n }\n } else {\n callback();\n }\n};\n\n/**\n * @param {number} size Size of the message to be allocated.\n * @api private\n */\nEventMessageChunkerStream.prototype.allocateMessage = function(size) {\n if (typeof size !== 'number') {\n throw new Error('Attempted to allocate an event message where size was not a number: ' + size);\n }\n this.currentMessageTotalLength = size;\n this.currentMessagePendingLength = 4;\n this.currentMessage = allocBuffer(size);\n this.currentMessage.writeUInt32BE(size, 0);\n};\n\n/**\n * @api private\n */\nmodule.exports = {\n EventMessageChunkerStream: EventMessageChunkerStream\n};\n","/**\n * Takes in a buffer of event messages and splits them into individual messages.\n * @param {Buffer} buffer\n * @api private\n */\nfunction eventMessageChunker(buffer) {\n /** @type Buffer[] */\n var messages = [];\n var offset = 0;\n\n while (offset < buffer.length) {\n var totalLength = buffer.readInt32BE(offset);\n\n // create new buffer for individual message (shares memory with original)\n var message = buffer.slice(offset, totalLength + offset);\n // increment offset to it starts at the next message\n offset += totalLength;\n\n messages.push(message);\n }\n\n return messages;\n}\n\n/**\n * @api private\n */\nmodule.exports = {\n eventMessageChunker: eventMessageChunker\n};\n","var Transform = require('stream').Transform;\nvar parseEvent = require('./parse-event').parseEvent;\n\n/** @type {Transform} */\nfunction EventUnmarshallerStream(options) {\n options = options || {};\n // set output to object mode\n options.readableObjectMode = true;\n Transform.call(this, options);\n this._readableState.objectMode = true;\n\n this.parser = options.parser;\n this.eventStreamModel = options.eventStreamModel;\n}\n\nEventUnmarshallerStream.prototype = Object.create(Transform.prototype);\n\n/**\n *\n * @param {Buffer} chunk\n * @param {string} encoding\n * @param {*} callback\n */\nEventUnmarshallerStream.prototype._transform = function(chunk, encoding, callback) {\n try {\n var event = parseEvent(this.parser, chunk, this.eventStreamModel);\n this.push(event);\n return callback();\n } catch (err) {\n callback(err);\n }\n};\n\n/**\n * @api private\n */\nmodule.exports = {\n EventUnmarshallerStream: EventUnmarshallerStream\n};\n","var util = require('../core').util;\nvar toBuffer = util.buffer.toBuffer;\n\n/**\n * A lossless representation of a signed, 64-bit integer. Instances of this\n * class may be used in arithmetic expressions as if they were numeric\n * primitives, but the binary representation will be preserved unchanged as the\n * `bytes` property of the object. The bytes should be encoded as big-endian,\n * two's complement integers.\n * @param {Buffer} bytes\n *\n * @api private\n */\nfunction Int64(bytes) {\n if (bytes.length !== 8) {\n throw new Error('Int64 buffers must be exactly 8 bytes');\n }\n if (!util.Buffer.isBuffer(bytes)) bytes = toBuffer(bytes);\n\n this.bytes = bytes;\n}\n\n/**\n * @param {number} number\n * @returns {Int64}\n *\n * @api private\n */\nInt64.fromNumber = function(number) {\n if (number > 9223372036854775807 || number < -9223372036854775808) {\n throw new Error(\n number + ' is too large (or, if negative, too small) to represent as an Int64'\n );\n }\n\n var bytes = new Uint8Array(8);\n for (\n var i = 7, remaining = Math.abs(Math.round(number));\n i > -1 && remaining > 0;\n i--, remaining /= 256\n ) {\n bytes[i] = remaining;\n }\n\n if (number < 0) {\n negate(bytes);\n }\n\n return new Int64(bytes);\n};\n\n/**\n * @returns {number}\n *\n * @api private\n */\nInt64.prototype.valueOf = function() {\n var bytes = this.bytes.slice(0);\n var negative = bytes[0] & 128;\n if (negative) {\n negate(bytes);\n }\n\n return parseInt(bytes.toString('hex'), 16) * (negative ? -1 : 1);\n};\n\nInt64.prototype.toString = function() {\n return String(this.valueOf());\n};\n\n/**\n * @param {Buffer} bytes\n *\n * @api private\n */\nfunction negate(bytes) {\n for (var i = 0; i < 8; i++) {\n bytes[i] ^= 0xFF;\n }\n for (var i = 7; i > -1; i--) {\n bytes[i]++;\n if (bytes[i] !== 0) {\n break;\n }\n }\n}\n\n/**\n * @api private\n */\nmodule.exports = {\n Int64: Int64\n};\n","var parseMessage = require('./parse-message').parseMessage;\n\n/**\n *\n * @param {*} parser\n * @param {Buffer} message\n * @param {*} shape\n * @api private\n */\nfunction parseEvent(parser, message, shape) {\n var parsedMessage = parseMessage(message);\n\n // check if message is an event or error\n var messageType = parsedMessage.headers[':message-type'];\n if (messageType) {\n if (messageType.value === 'error') {\n throw parseError(parsedMessage);\n } else if (messageType.value !== 'event') {\n // not sure how to parse non-events/non-errors, ignore for now\n return;\n }\n }\n\n // determine event type\n var eventType = parsedMessage.headers[':event-type'];\n // check that the event type is modeled\n var eventModel = shape.members[eventType.value];\n if (!eventModel) {\n return;\n }\n\n var result = {};\n // check if an event payload exists\n var eventPayloadMemberName = eventModel.eventPayloadMemberName;\n if (eventPayloadMemberName) {\n var payloadShape = eventModel.members[eventPayloadMemberName];\n // if the shape is binary, return the byte array\n if (payloadShape.type === 'binary') {\n result[eventPayloadMemberName] = parsedMessage.body;\n } else {\n result[eventPayloadMemberName] = parser.parse(parsedMessage.body.toString(), payloadShape);\n }\n }\n\n // read event headers\n var eventHeaderNames = eventModel.eventHeaderMemberNames;\n for (var i = 0; i < eventHeaderNames.length; i++) {\n var name = eventHeaderNames[i];\n if (parsedMessage.headers[name]) {\n // parse the header!\n result[name] = eventModel.members[name].toType(parsedMessage.headers[name].value);\n }\n }\n\n var output = {};\n output[eventType.value] = result;\n return output;\n}\n\nfunction parseError(message) {\n var errorCode = message.headers[':error-code'];\n var errorMessage = message.headers[':error-message'];\n var error = new Error(errorMessage.value || errorMessage);\n error.code = error.name = errorCode.value || errorCode;\n return error;\n}\n\n/**\n * @api private\n */\nmodule.exports = {\n parseEvent: parseEvent\n};\n","var Int64 = require('./int64').Int64;\n\nvar splitMessage = require('./split-message').splitMessage;\n\nvar BOOLEAN_TAG = 'boolean';\nvar BYTE_TAG = 'byte';\nvar SHORT_TAG = 'short';\nvar INT_TAG = 'integer';\nvar LONG_TAG = 'long';\nvar BINARY_TAG = 'binary';\nvar STRING_TAG = 'string';\nvar TIMESTAMP_TAG = 'timestamp';\nvar UUID_TAG = 'uuid';\n\n/**\n * @api private\n *\n * @param {Buffer} headers\n */\nfunction parseHeaders(headers) {\n var out = {};\n var position = 0;\n while (position < headers.length) {\n var nameLength = headers.readUInt8(position++);\n var name = headers.slice(position, position + nameLength).toString();\n position += nameLength;\n switch (headers.readUInt8(position++)) {\n case 0 /* boolTrue */:\n out[name] = {\n type: BOOLEAN_TAG,\n value: true\n };\n break;\n case 1 /* boolFalse */:\n out[name] = {\n type: BOOLEAN_TAG,\n value: false\n };\n break;\n case 2 /* byte */:\n out[name] = {\n type: BYTE_TAG,\n value: headers.readInt8(position++)\n };\n break;\n case 3 /* short */:\n out[name] = {\n type: SHORT_TAG,\n value: headers.readInt16BE(position)\n };\n position += 2;\n break;\n case 4 /* integer */:\n out[name] = {\n type: INT_TAG,\n value: headers.readInt32BE(position)\n };\n position += 4;\n break;\n case 5 /* long */:\n out[name] = {\n type: LONG_TAG,\n value: new Int64(headers.slice(position, position + 8))\n };\n position += 8;\n break;\n case 6 /* byteArray */:\n var binaryLength = headers.readUInt16BE(position);\n position += 2;\n out[name] = {\n type: BINARY_TAG,\n value: headers.slice(position, position + binaryLength)\n };\n position += binaryLength;\n break;\n case 7 /* string */:\n var stringLength = headers.readUInt16BE(position);\n position += 2;\n out[name] = {\n type: STRING_TAG,\n value: headers.slice(\n position,\n position + stringLength\n ).toString()\n };\n position += stringLength;\n break;\n case 8 /* timestamp */:\n out[name] = {\n type: TIMESTAMP_TAG,\n value: new Date(\n new Int64(headers.slice(position, position + 8))\n .valueOf()\n )\n };\n position += 8;\n break;\n case 9 /* uuid */:\n var uuidChars = headers.slice(position, position + 16)\n .toString('hex');\n position += 16;\n out[name] = {\n type: UUID_TAG,\n value: uuidChars.substr(0, 8) + '-' +\n uuidChars.substr(8, 4) + '-' +\n uuidChars.substr(12, 4) + '-' +\n uuidChars.substr(16, 4) + '-' +\n uuidChars.substr(20)\n };\n break;\n default:\n throw new Error('Unrecognized header type tag');\n }\n }\n return out;\n}\n\nfunction parseMessage(message) {\n var parsed = splitMessage(message);\n return { headers: parseHeaders(parsed.headers), body: parsed.body };\n}\n\n/**\n * @api private\n */\nmodule.exports = {\n parseMessage: parseMessage\n};\n","var util = require('../core').util;\nvar toBuffer = util.buffer.toBuffer;\n\n// All prelude components are unsigned, 32-bit integers\nvar PRELUDE_MEMBER_LENGTH = 4;\n// The prelude consists of two components\nvar PRELUDE_LENGTH = PRELUDE_MEMBER_LENGTH * 2;\n// Checksums are always CRC32 hashes.\nvar CHECKSUM_LENGTH = 4;\n// Messages must include a full prelude, a prelude checksum, and a message checksum\nvar MINIMUM_MESSAGE_LENGTH = PRELUDE_LENGTH + CHECKSUM_LENGTH * 2;\n\n/**\n * @api private\n *\n * @param {Buffer} message\n */\nfunction splitMessage(message) {\n if (!util.Buffer.isBuffer(message)) message = toBuffer(message);\n\n if (message.length < MINIMUM_MESSAGE_LENGTH) {\n throw new Error('Provided message too short to accommodate event stream message overhead');\n }\n\n if (message.length !== message.readUInt32BE(0)) {\n throw new Error('Reported message length does not match received message length');\n }\n\n var expectedPreludeChecksum = message.readUInt32BE(PRELUDE_LENGTH);\n\n if (\n expectedPreludeChecksum !== util.crypto.crc32(\n message.slice(0, PRELUDE_LENGTH)\n )\n ) {\n throw new Error(\n 'The prelude checksum specified in the message (' +\n expectedPreludeChecksum +\n ') does not match the calculated CRC32 checksum.'\n );\n }\n\n var expectedMessageChecksum = message.readUInt32BE(message.length - CHECKSUM_LENGTH);\n\n if (\n expectedMessageChecksum !== util.crypto.crc32(\n message.slice(0, message.length - CHECKSUM_LENGTH)\n )\n ) {\n throw new Error(\n 'The message checksum did not match the expected value of ' +\n expectedMessageChecksum\n );\n }\n\n var headersStart = PRELUDE_LENGTH + CHECKSUM_LENGTH;\n var headersEnd = headersStart + message.readUInt32BE(PRELUDE_MEMBER_LENGTH);\n\n return {\n headers: message.slice(headersStart, headersEnd),\n body: message.slice(headersEnd, message.length - CHECKSUM_LENGTH),\n };\n}\n\n/**\n * @api private\n */\nmodule.exports = {\n splitMessage: splitMessage\n};\n","/**\n * What is necessary to create an event stream in node?\n * - http response stream\n * - parser\n * - event stream model\n */\n\nvar EventMessageChunkerStream = require('../event-stream/event-message-chunker-stream').EventMessageChunkerStream;\nvar EventUnmarshallerStream = require('../event-stream/event-message-unmarshaller-stream').EventUnmarshallerStream;\n\nfunction createEventStream(stream, parser, model) {\n var eventStream = new EventUnmarshallerStream({\n parser: parser,\n eventStreamModel: model\n });\n\n var eventMessageChunker = new EventMessageChunkerStream();\n\n stream.pipe(\n eventMessageChunker\n ).pipe(eventStream);\n\n stream.on('error', function(err) {\n eventMessageChunker.emit('error', err);\n });\n\n eventMessageChunker.on('error', function(err) {\n eventStream.emit('error', err);\n });\n\n return eventStream;\n}\n\n/**\n * @api private\n */\nmodule.exports = {\n createEventStream: createEventStream\n};\n","var AWS = require('./core');\nvar SequentialExecutor = require('./sequential_executor');\nvar DISCOVER_ENDPOINT = require('./discover_endpoint').discoverEndpoint;\n/**\n * The namespace used to register global event listeners for request building\n * and sending.\n */\nAWS.EventListeners = {\n /**\n * @!attribute VALIDATE_CREDENTIALS\n * A request listener that validates whether the request is being\n * sent with credentials.\n * Handles the {AWS.Request~validate 'validate' Request event}\n * @example Sending a request without validating credentials\n * var listener = AWS.EventListeners.Core.VALIDATE_CREDENTIALS;\n * request.removeListener('validate', listener);\n * @readonly\n * @return [Function]\n * @!attribute VALIDATE_REGION\n * A request listener that validates whether the region is set\n * for a request.\n * Handles the {AWS.Request~validate 'validate' Request event}\n * @example Sending a request without validating region configuration\n * var listener = AWS.EventListeners.Core.VALIDATE_REGION;\n * request.removeListener('validate', listener);\n * @readonly\n * @return [Function]\n * @!attribute VALIDATE_PARAMETERS\n * A request listener that validates input parameters in a request.\n * Handles the {AWS.Request~validate 'validate' Request event}\n * @example Sending a request without validating parameters\n * var listener = AWS.EventListeners.Core.VALIDATE_PARAMETERS;\n * request.removeListener('validate', listener);\n * @example Disable parameter validation globally\n * AWS.EventListeners.Core.removeListener('validate',\n * AWS.EventListeners.Core.VALIDATE_REGION);\n * @readonly\n * @return [Function]\n * @!attribute SEND\n * A request listener that initiates the HTTP connection for a\n * request being sent. Handles the {AWS.Request~send 'send' Request event}\n * @example Replacing the HTTP handler\n * var listener = AWS.EventListeners.Core.SEND;\n * request.removeListener('send', listener);\n * request.on('send', function(response) {\n * customHandler.send(response);\n * });\n * @return [Function]\n * @readonly\n * @!attribute HTTP_DATA\n * A request listener that reads data from the HTTP connection in order\n * to build the response data.\n * Handles the {AWS.Request~httpData 'httpData' Request event}.\n * Remove this handler if you are overriding the 'httpData' event and\n * do not want extra data processing and buffering overhead.\n * @example Disabling default data processing\n * var listener = AWS.EventListeners.Core.HTTP_DATA;\n * request.removeListener('httpData', listener);\n * @return [Function]\n * @readonly\n */\n Core: {} /* doc hack */\n};\n\n/**\n * @api private\n */\nfunction getOperationAuthtype(req) {\n if (!req.service.api.operations) {\n return '';\n }\n var operation = req.service.api.operations[req.operation];\n return operation ? operation.authtype : '';\n}\n\nAWS.EventListeners = {\n Core: new SequentialExecutor().addNamedListeners(function(add, addAsync) {\n addAsync('VALIDATE_CREDENTIALS', 'validate',\n function VALIDATE_CREDENTIALS(req, done) {\n if (!req.service.api.signatureVersion && !req.service.config.signatureVersion) return done(); // none\n req.service.config.getCredentials(function(err) {\n if (err) {\n req.response.error = AWS.util.error(err,\n {code: 'CredentialsError', message: 'Missing credentials in config, if using AWS_CONFIG_FILE, set AWS_SDK_LOAD_CONFIG=1'});\n }\n done();\n });\n });\n\n add('VALIDATE_REGION', 'validate', function VALIDATE_REGION(req) {\n if (!req.service.isGlobalEndpoint) {\n var dnsHostRegex = new RegExp(/^([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9-]{0,61}[a-zA-Z0-9])$/);\n if (!req.service.config.region) {\n req.response.error = AWS.util.error(new Error(),\n {code: 'ConfigError', message: 'Missing region in config'});\n } else if (!dnsHostRegex.test(req.service.config.region)) {\n req.response.error = AWS.util.error(new Error(),\n {code: 'ConfigError', message: 'Invalid region in config'});\n }\n }\n });\n\n add('BUILD_IDEMPOTENCY_TOKENS', 'validate', function BUILD_IDEMPOTENCY_TOKENS(req) {\n if (!req.service.api.operations) {\n return;\n }\n var operation = req.service.api.operations[req.operation];\n if (!operation) {\n return;\n }\n var idempotentMembers = operation.idempotentMembers;\n if (!idempotentMembers.length) {\n return;\n }\n // creates a copy of params so user's param object isn't mutated\n var params = AWS.util.copy(req.params);\n for (var i = 0, iLen = idempotentMembers.length; i < iLen; i++) {\n if (!params[idempotentMembers[i]]) {\n // add the member\n params[idempotentMembers[i]] = AWS.util.uuid.v4();\n }\n }\n req.params = params;\n });\n\n add('VALIDATE_PARAMETERS', 'validate', function VALIDATE_PARAMETERS(req) {\n if (!req.service.api.operations) {\n return;\n }\n var rules = req.service.api.operations[req.operation].input;\n var validation = req.service.config.paramValidation;\n new AWS.ParamValidator(validation).validate(rules, req.params);\n });\n\n addAsync('COMPUTE_SHA256', 'afterBuild', function COMPUTE_SHA256(req, done) {\n req.haltHandlersOnError();\n if (!req.service.api.operations) {\n return;\n }\n var operation = req.service.api.operations[req.operation];\n var authtype = operation ? operation.authtype : '';\n if (!req.service.api.signatureVersion && !authtype && !req.service.config.signatureVersion) return done(); // none\n if (req.service.getSignerClass(req) === AWS.Signers.V4) {\n var body = req.httpRequest.body || '';\n if (authtype.indexOf('unsigned-body') >= 0) {\n req.httpRequest.headers['X-Amz-Content-Sha256'] = 'UNSIGNED-PAYLOAD';\n return done();\n }\n AWS.util.computeSha256(body, function(err, sha) {\n if (err) {\n done(err);\n }\n else {\n req.httpRequest.headers['X-Amz-Content-Sha256'] = sha;\n done();\n }\n });\n } else {\n done();\n }\n });\n\n add('SET_CONTENT_LENGTH', 'afterBuild', function SET_CONTENT_LENGTH(req) {\n var authtype = getOperationAuthtype(req);\n var payloadMember = AWS.util.getRequestPayloadShape(req);\n if (req.httpRequest.headers['Content-Length'] === undefined) {\n try {\n var length = AWS.util.string.byteLength(req.httpRequest.body);\n req.httpRequest.headers['Content-Length'] = length;\n } catch (err) {\n if (payloadMember && payloadMember.isStreaming) {\n if (payloadMember.requiresLength) {\n //streaming payload requires length(s3, glacier)\n throw err;\n } else if (authtype.indexOf('unsigned-body') >= 0) {\n //unbounded streaming payload(lex, mediastore)\n req.httpRequest.headers['Transfer-Encoding'] = 'chunked';\n return;\n } else {\n throw err;\n }\n }\n throw err;\n }\n }\n });\n\n add('SET_HTTP_HOST', 'afterBuild', function SET_HTTP_HOST(req) {\n req.httpRequest.headers['Host'] = req.httpRequest.endpoint.host;\n });\n\n add('RESTART', 'restart', function RESTART() {\n var err = this.response.error;\n if (!err || !err.retryable) return;\n\n this.httpRequest = new AWS.HttpRequest(\n this.service.endpoint,\n this.service.region\n );\n\n if (this.response.retryCount < this.service.config.maxRetries) {\n this.response.retryCount++;\n } else {\n this.response.error = null;\n }\n });\n\n var addToHead = true;\n addAsync('DISCOVER_ENDPOINT', 'sign', DISCOVER_ENDPOINT, addToHead);\n\n addAsync('SIGN', 'sign', function SIGN(req, done) {\n var service = req.service;\n var operations = req.service.api.operations || {};\n var operation = operations[req.operation];\n var authtype = operation ? operation.authtype : '';\n if (!service.api.signatureVersion && !authtype && !service.config.signatureVersion) return done(); // none\n\n service.config.getCredentials(function (err, credentials) {\n if (err) {\n req.response.error = err;\n return done();\n }\n\n try {\n var date = service.getSkewCorrectedDate();\n var SignerClass = service.getSignerClass(req);\n var signer = new SignerClass(req.httpRequest,\n service.getSigningName(req),\n {\n signatureCache: service.config.signatureCache,\n operation: operation,\n signatureVersion: service.api.signatureVersion\n });\n signer.setServiceClientId(service._clientId);\n\n // clear old authorization headers\n delete req.httpRequest.headers['Authorization'];\n delete req.httpRequest.headers['Date'];\n delete req.httpRequest.headers['X-Amz-Date'];\n\n // add new authorization\n signer.addAuthorization(credentials, date);\n req.signedAt = date;\n } catch (e) {\n req.response.error = e;\n }\n done();\n });\n });\n\n add('VALIDATE_RESPONSE', 'validateResponse', function VALIDATE_RESPONSE(resp) {\n if (this.service.successfulResponse(resp, this)) {\n resp.data = {};\n resp.error = null;\n } else {\n resp.data = null;\n resp.error = AWS.util.error(new Error(),\n {code: 'UnknownError', message: 'An unknown error occurred.'});\n }\n });\n\n addAsync('SEND', 'send', function SEND(resp, done) {\n resp.httpResponse._abortCallback = done;\n resp.error = null;\n resp.data = null;\n\n function callback(httpResp) {\n resp.httpResponse.stream = httpResp;\n var stream = resp.request.httpRequest.stream;\n var service = resp.request.service;\n var api = service.api;\n var operationName = resp.request.operation;\n var operation = api.operations[operationName] || {};\n\n httpResp.on('headers', function onHeaders(statusCode, headers, statusMessage) {\n resp.request.emit(\n 'httpHeaders',\n [statusCode, headers, resp, statusMessage]\n );\n\n if (!resp.httpResponse.streaming) {\n if (AWS.HttpClient.streamsApiVersion === 2) { // streams2 API check\n // if we detect event streams, we're going to have to\n // return the stream immediately\n if (operation.hasEventOutput && service.successfulResponse(resp)) {\n // skip reading the IncomingStream\n resp.request.emit('httpDone');\n done();\n return;\n }\n\n httpResp.on('readable', function onReadable() {\n var data = httpResp.read();\n if (data !== null) {\n resp.request.emit('httpData', [data, resp]);\n }\n });\n } else { // legacy streams API\n httpResp.on('data', function onData(data) {\n resp.request.emit('httpData', [data, resp]);\n });\n }\n }\n });\n\n httpResp.on('end', function onEnd() {\n if (!stream || !stream.didCallback) {\n if (AWS.HttpClient.streamsApiVersion === 2 && (operation.hasEventOutput && service.successfulResponse(resp))) {\n // don't concatenate response chunks when streaming event stream data when response is successful\n return;\n }\n resp.request.emit('httpDone');\n done();\n }\n });\n }\n\n function progress(httpResp) {\n httpResp.on('sendProgress', function onSendProgress(value) {\n resp.request.emit('httpUploadProgress', [value, resp]);\n });\n\n httpResp.on('receiveProgress', function onReceiveProgress(value) {\n resp.request.emit('httpDownloadProgress', [value, resp]);\n });\n }\n\n function error(err) {\n if (err.code !== 'RequestAbortedError') {\n var errCode = err.code === 'TimeoutError' ? err.code : 'NetworkingError';\n err = AWS.util.error(err, {\n code: errCode,\n region: resp.request.httpRequest.region,\n hostname: resp.request.httpRequest.endpoint.hostname,\n retryable: true\n });\n }\n resp.error = err;\n resp.request.emit('httpError', [resp.error, resp], function() {\n done();\n });\n }\n\n function executeSend() {\n var http = AWS.HttpClient.getInstance();\n var httpOptions = resp.request.service.config.httpOptions || {};\n try {\n var stream = http.handleRequest(resp.request.httpRequest, httpOptions,\n callback, error);\n progress(stream);\n } catch (err) {\n error(err);\n }\n }\n var timeDiff = (resp.request.service.getSkewCorrectedDate() - this.signedAt) / 1000;\n if (timeDiff >= 60 * 10) { // if we signed 10min ago, re-sign\n this.emit('sign', [this], function(err) {\n if (err) done(err);\n else executeSend();\n });\n } else {\n executeSend();\n }\n });\n\n add('HTTP_HEADERS', 'httpHeaders',\n function HTTP_HEADERS(statusCode, headers, resp, statusMessage) {\n resp.httpResponse.statusCode = statusCode;\n resp.httpResponse.statusMessage = statusMessage;\n resp.httpResponse.headers = headers;\n resp.httpResponse.body = AWS.util.buffer.toBuffer('');\n resp.httpResponse.buffers = [];\n resp.httpResponse.numBytes = 0;\n var dateHeader = headers.date || headers.Date;\n var service = resp.request.service;\n if (dateHeader) {\n var serverTime = Date.parse(dateHeader);\n if (service.config.correctClockSkew\n && service.isClockSkewed(serverTime)) {\n service.applyClockOffset(serverTime);\n }\n }\n });\n\n add('HTTP_DATA', 'httpData', function HTTP_DATA(chunk, resp) {\n if (chunk) {\n if (AWS.util.isNode()) {\n resp.httpResponse.numBytes += chunk.length;\n\n var total = resp.httpResponse.headers['content-length'];\n var progress = { loaded: resp.httpResponse.numBytes, total: total };\n resp.request.emit('httpDownloadProgress', [progress, resp]);\n }\n\n resp.httpResponse.buffers.push(AWS.util.buffer.toBuffer(chunk));\n }\n });\n\n add('HTTP_DONE', 'httpDone', function HTTP_DONE(resp) {\n // convert buffers array into single buffer\n if (resp.httpResponse.buffers && resp.httpResponse.buffers.length > 0) {\n var body = AWS.util.buffer.concat(resp.httpResponse.buffers);\n resp.httpResponse.body = body;\n }\n delete resp.httpResponse.numBytes;\n delete resp.httpResponse.buffers;\n });\n\n add('FINALIZE_ERROR', 'retry', function FINALIZE_ERROR(resp) {\n if (resp.httpResponse.statusCode) {\n resp.error.statusCode = resp.httpResponse.statusCode;\n if (resp.error.retryable === undefined) {\n resp.error.retryable = this.service.retryableError(resp.error, this);\n }\n }\n });\n\n add('INVALIDATE_CREDENTIALS', 'retry', function INVALIDATE_CREDENTIALS(resp) {\n if (!resp.error) return;\n switch (resp.error.code) {\n case 'RequestExpired': // EC2 only\n case 'ExpiredTokenException':\n case 'ExpiredToken':\n resp.error.retryable = true;\n resp.request.service.config.credentials.expired = true;\n }\n });\n\n add('EXPIRED_SIGNATURE', 'retry', function EXPIRED_SIGNATURE(resp) {\n var err = resp.error;\n if (!err) return;\n if (typeof err.code === 'string' && typeof err.message === 'string') {\n if (err.code.match(/Signature/) && err.message.match(/expired/)) {\n resp.error.retryable = true;\n }\n }\n });\n\n add('CLOCK_SKEWED', 'retry', function CLOCK_SKEWED(resp) {\n if (!resp.error) return;\n if (this.service.clockSkewError(resp.error)\n && this.service.config.correctClockSkew) {\n resp.error.retryable = true;\n }\n });\n\n add('REDIRECT', 'retry', function REDIRECT(resp) {\n if (resp.error && resp.error.statusCode >= 300 &&\n resp.error.statusCode < 400 && resp.httpResponse.headers['location']) {\n this.httpRequest.endpoint =\n new AWS.Endpoint(resp.httpResponse.headers['location']);\n this.httpRequest.headers['Host'] = this.httpRequest.endpoint.host;\n resp.error.redirect = true;\n resp.error.retryable = true;\n }\n });\n\n add('RETRY_CHECK', 'retry', function RETRY_CHECK(resp) {\n if (resp.error) {\n if (resp.error.redirect && resp.redirectCount < resp.maxRedirects) {\n resp.error.retryDelay = 0;\n } else if (resp.retryCount < resp.maxRetries) {\n resp.error.retryDelay = this.service.retryDelays(resp.retryCount, resp.error) || 0;\n }\n }\n });\n\n addAsync('RESET_RETRY_STATE', 'afterRetry', function RESET_RETRY_STATE(resp, done) {\n var delay, willRetry = false;\n\n if (resp.error) {\n delay = resp.error.retryDelay || 0;\n if (resp.error.retryable && resp.retryCount < resp.maxRetries) {\n resp.retryCount++;\n willRetry = true;\n } else if (resp.error.redirect && resp.redirectCount < resp.maxRedirects) {\n resp.redirectCount++;\n willRetry = true;\n }\n }\n\n // delay < 0 is a signal from customBackoff to skip retries\n if (willRetry && delay >= 0) {\n resp.error = null;\n setTimeout(done, delay);\n } else {\n done();\n }\n });\n }),\n\n CorePost: new SequentialExecutor().addNamedListeners(function(add) {\n add('EXTRACT_REQUEST_ID', 'extractData', AWS.util.extractRequestId);\n add('EXTRACT_REQUEST_ID', 'extractError', AWS.util.extractRequestId);\n\n add('ENOTFOUND_ERROR', 'httpError', function ENOTFOUND_ERROR(err) {\n function isDNSError(err) {\n return err.errno === 'ENOTFOUND' ||\n typeof err.errno === 'number' &&\n typeof AWS.util.getSystemErrorName === 'function' &&\n ['EAI_NONAME', 'EAI_NODATA'].indexOf(AWS.util.getSystemErrorName(err.errno) >= 0);\n }\n if (err.code === 'NetworkingError' && isDNSError(err)) {\n var message = 'Inaccessible host: `' + err.hostname +\n '\\'. This service may not be available in the `' + err.region +\n '\\' region.';\n this.response.error = AWS.util.error(new Error(message), {\n code: 'UnknownEndpoint',\n region: err.region,\n hostname: err.hostname,\n retryable: true,\n originalError: err\n });\n }\n });\n }),\n\n Logger: new SequentialExecutor().addNamedListeners(function(add) {\n add('LOG_REQUEST', 'complete', function LOG_REQUEST(resp) {\n var req = resp.request;\n var logger = req.service.config.logger;\n if (!logger) return;\n function filterSensitiveLog(inputShape, shape) {\n if (!shape) {\n return shape;\n }\n if (inputShape.isSensitive) {\n return '***SensitiveInformation***';\n }\n switch (inputShape.type) {\n case 'structure':\n var struct = {};\n AWS.util.each(shape, function(subShapeName, subShape) {\n if (Object.prototype.hasOwnProperty.call(inputShape.members, subShapeName)) {\n struct[subShapeName] = filterSensitiveLog(inputShape.members[subShapeName], subShape);\n } else {\n struct[subShapeName] = subShape;\n }\n });\n return struct;\n case 'list':\n var list = [];\n AWS.util.arrayEach(shape, function(subShape, index) {\n list.push(filterSensitiveLog(inputShape.member, subShape));\n });\n return list;\n case 'map':\n var map = {};\n AWS.util.each(shape, function(key, value) {\n map[key] = filterSensitiveLog(inputShape.value, value);\n });\n return map;\n default:\n return shape;\n }\n }\n\n function buildMessage() {\n var time = resp.request.service.getSkewCorrectedDate().getTime();\n var delta = (time - req.startTime.getTime()) / 1000;\n var ansi = logger.isTTY ? true : false;\n var status = resp.httpResponse.statusCode;\n var censoredParams = req.params;\n if (\n req.service.api.operations &&\n req.service.api.operations[req.operation] &&\n req.service.api.operations[req.operation].input\n ) {\n var inputShape = req.service.api.operations[req.operation].input;\n censoredParams = filterSensitiveLog(inputShape, req.params);\n }\n var params = require('util').inspect(censoredParams, true, null);\n var message = '';\n if (ansi) message += '\\x1B[33m';\n message += '[AWS ' + req.service.serviceIdentifier + ' ' + status;\n message += ' ' + delta.toString() + 's ' + resp.retryCount + ' retries]';\n if (ansi) message += '\\x1B[0;1m';\n message += ' ' + AWS.util.string.lowerFirst(req.operation);\n message += '(' + params + ')';\n if (ansi) message += '\\x1B[0m';\n return message;\n }\n\n var line = buildMessage();\n if (typeof logger.log === 'function') {\n logger.log(line);\n } else if (typeof logger.write === 'function') {\n logger.write(line + '\\n');\n }\n });\n }),\n\n Json: new SequentialExecutor().addNamedListeners(function(add) {\n var svc = require('./protocol/json');\n add('BUILD', 'build', svc.buildRequest);\n add('EXTRACT_DATA', 'extractData', svc.extractData);\n add('EXTRACT_ERROR', 'extractError', svc.extractError);\n }),\n\n Rest: new SequentialExecutor().addNamedListeners(function(add) {\n var svc = require('./protocol/rest');\n add('BUILD', 'build', svc.buildRequest);\n add('EXTRACT_DATA', 'extractData', svc.extractData);\n add('EXTRACT_ERROR', 'extractError', svc.extractError);\n }),\n\n RestJson: new SequentialExecutor().addNamedListeners(function(add) {\n var svc = require('./protocol/rest_json');\n add('BUILD', 'build', svc.buildRequest);\n add('EXTRACT_DATA', 'extractData', svc.extractData);\n add('EXTRACT_ERROR', 'extractError', svc.extractError);\n }),\n\n RestXml: new SequentialExecutor().addNamedListeners(function(add) {\n var svc = require('./protocol/rest_xml');\n add('BUILD', 'build', svc.buildRequest);\n add('EXTRACT_DATA', 'extractData', svc.extractData);\n add('EXTRACT_ERROR', 'extractError', svc.extractError);\n }),\n\n Query: new SequentialExecutor().addNamedListeners(function(add) {\n var svc = require('./protocol/query');\n add('BUILD', 'build', svc.buildRequest);\n add('EXTRACT_DATA', 'extractData', svc.extractData);\n add('EXTRACT_ERROR', 'extractError', svc.extractError);\n })\n};\n","var AWS = require('./core');\nvar inherit = AWS.util.inherit;\n\n/**\n * The endpoint that a service will talk to, for example,\n * `'https://ec2.ap-southeast-1.amazonaws.com'`. If\n * you need to override an endpoint for a service, you can\n * set the endpoint on a service by passing the endpoint\n * object with the `endpoint` option key:\n *\n * ```javascript\n * var ep = new AWS.Endpoint('awsproxy.example.com');\n * var s3 = new AWS.S3({endpoint: ep});\n * s3.service.endpoint.hostname == 'awsproxy.example.com'\n * ```\n *\n * Note that if you do not specify a protocol, the protocol will\n * be selected based on your current {AWS.config} configuration.\n *\n * @!attribute protocol\n * @return [String] the protocol (http or https) of the endpoint\n * URL\n * @!attribute hostname\n * @return [String] the host portion of the endpoint, e.g.,\n * example.com\n * @!attribute host\n * @return [String] the host portion of the endpoint including\n * the port, e.g., example.com:80\n * @!attribute port\n * @return [Integer] the port of the endpoint\n * @!attribute href\n * @return [String] the full URL of the endpoint\n */\nAWS.Endpoint = inherit({\n\n /**\n * @overload Endpoint(endpoint)\n * Constructs a new endpoint given an endpoint URL. If the\n * URL omits a protocol (http or https), the default protocol\n * set in the global {AWS.config} will be used.\n * @param endpoint [String] the URL to construct an endpoint from\n */\n constructor: function Endpoint(endpoint, config) {\n AWS.util.hideProperties(this, ['slashes', 'auth', 'hash', 'search', 'query']);\n\n if (typeof endpoint === 'undefined' || endpoint === null) {\n throw new Error('Invalid endpoint: ' + endpoint);\n } else if (typeof endpoint !== 'string') {\n return AWS.util.copy(endpoint);\n }\n\n if (!endpoint.match(/^http/)) {\n var useSSL = config && config.sslEnabled !== undefined ?\n config.sslEnabled : AWS.config.sslEnabled;\n endpoint = (useSSL ? 'https' : 'http') + '://' + endpoint;\n }\n\n AWS.util.update(this, AWS.util.urlParse(endpoint));\n\n // Ensure the port property is set as an integer\n if (this.port) {\n this.port = parseInt(this.port, 10);\n } else {\n this.port = this.protocol === 'https:' ? 443 : 80;\n }\n }\n\n});\n\n/**\n * The low level HTTP request object, encapsulating all HTTP header\n * and body data sent by a service request.\n *\n * @!attribute method\n * @return [String] the HTTP method of the request\n * @!attribute path\n * @return [String] the path portion of the URI, e.g.,\n * \"/list/?start=5&num=10\"\n * @!attribute headers\n * @return [map]\n * a map of header keys and their respective values\n * @!attribute body\n * @return [String] the request body payload\n * @!attribute endpoint\n * @return [AWS.Endpoint] the endpoint for the request\n * @!attribute region\n * @api private\n * @return [String] the region, for signing purposes only.\n */\nAWS.HttpRequest = inherit({\n\n /**\n * @api private\n */\n constructor: function HttpRequest(endpoint, region) {\n endpoint = new AWS.Endpoint(endpoint);\n this.method = 'POST';\n this.path = endpoint.path || '/';\n this.headers = {};\n this.body = '';\n this.endpoint = endpoint;\n this.region = region;\n this._userAgent = '';\n this.setUserAgent();\n },\n\n /**\n * @api private\n */\n setUserAgent: function setUserAgent() {\n this._userAgent = this.headers[this.getUserAgentHeaderName()] = AWS.util.userAgent();\n },\n\n getUserAgentHeaderName: function getUserAgentHeaderName() {\n var prefix = AWS.util.isBrowser() ? 'X-Amz-' : '';\n return prefix + 'User-Agent';\n },\n\n /**\n * @api private\n */\n appendToUserAgent: function appendToUserAgent(agentPartial) {\n if (typeof agentPartial === 'string' && agentPartial) {\n this._userAgent += ' ' + agentPartial;\n }\n this.headers[this.getUserAgentHeaderName()] = this._userAgent;\n },\n\n /**\n * @api private\n */\n getUserAgent: function getUserAgent() {\n return this._userAgent;\n },\n\n /**\n * @return [String] the part of the {path} excluding the\n * query string\n */\n pathname: function pathname() {\n return this.path.split('?', 1)[0];\n },\n\n /**\n * @return [String] the query string portion of the {path}\n */\n search: function search() {\n var query = this.path.split('?', 2)[1];\n if (query) {\n query = AWS.util.queryStringParse(query);\n return AWS.util.queryParamsToString(query);\n }\n return '';\n },\n\n /**\n * @api private\n * update httpRequest endpoint with endpoint string\n */\n updateEndpoint: function updateEndpoint(endpointStr) {\n var newEndpoint = new AWS.Endpoint(endpointStr);\n this.endpoint = newEndpoint;\n this.path = newEndpoint.path || '/';\n if (this.headers['Host']) {\n this.headers['Host'] = newEndpoint.host;\n }\n }\n});\n\n/**\n * The low level HTTP response object, encapsulating all HTTP header\n * and body data returned from the request.\n *\n * @!attribute statusCode\n * @return [Integer] the HTTP status code of the response (e.g., 200, 404)\n * @!attribute headers\n * @return [map]\n * a map of response header keys and their respective values\n * @!attribute body\n * @return [String] the response body payload\n * @!attribute [r] streaming\n * @return [Boolean] whether this response is being streamed at a low-level.\n * Defaults to `false` (buffered reads). Do not modify this manually, use\n * {createUnbufferedStream} to convert the stream to unbuffered mode\n * instead.\n */\nAWS.HttpResponse = inherit({\n\n /**\n * @api private\n */\n constructor: function HttpResponse() {\n this.statusCode = undefined;\n this.headers = {};\n this.body = undefined;\n this.streaming = false;\n this.stream = null;\n },\n\n /**\n * Disables buffering on the HTTP response and returns the stream for reading.\n * @return [Stream, XMLHttpRequest, null] the underlying stream object.\n * Use this object to directly read data off of the stream.\n * @note This object is only available after the {AWS.Request~httpHeaders}\n * event has fired. This method must be called prior to\n * {AWS.Request~httpData}.\n * @example Taking control of a stream\n * request.on('httpHeaders', function(statusCode, headers) {\n * if (statusCode < 300) {\n * if (headers.etag === 'xyz') {\n * // pipe the stream, disabling buffering\n * var stream = this.response.httpResponse.createUnbufferedStream();\n * stream.pipe(process.stdout);\n * } else { // abort this request and set a better error message\n * this.abort();\n * this.response.error = new Error('Invalid ETag');\n * }\n * }\n * }).send(console.log);\n */\n createUnbufferedStream: function createUnbufferedStream() {\n this.streaming = true;\n return this.stream;\n }\n});\n\n\nAWS.HttpClient = inherit({});\n\n/**\n * @api private\n */\nAWS.HttpClient.getInstance = function getInstance() {\n if (this.singleton === undefined) {\n this.singleton = new this();\n }\n return this.singleton;\n};\n","var AWS = require('../core');\nvar Stream = AWS.util.stream.Stream;\nvar TransformStream = AWS.util.stream.Transform;\nvar ReadableStream = AWS.util.stream.Readable;\nrequire('../http');\nvar CONNECTION_REUSE_ENV_NAME = 'AWS_NODEJS_CONNECTION_REUSE_ENABLED';\n\n/**\n * @api private\n */\nAWS.NodeHttpClient = AWS.util.inherit({\n handleRequest: function handleRequest(httpRequest, httpOptions, callback, errCallback) {\n var self = this;\n var endpoint = httpRequest.endpoint;\n var pathPrefix = '';\n if (!httpOptions) httpOptions = {};\n if (httpOptions.proxy) {\n pathPrefix = endpoint.protocol + '//' + endpoint.hostname;\n if (endpoint.port !== 80 && endpoint.port !== 443) {\n pathPrefix += ':' + endpoint.port;\n }\n endpoint = new AWS.Endpoint(httpOptions.proxy);\n }\n\n var useSSL = endpoint.protocol === 'https:';\n var http = useSSL ? require('https') : require('http');\n var options = {\n host: endpoint.hostname,\n port: endpoint.port,\n method: httpRequest.method,\n headers: httpRequest.headers,\n path: pathPrefix + httpRequest.path\n };\n\n if (!httpOptions.agent) {\n options.agent = this.getAgent(useSSL, {\n keepAlive: process.env[CONNECTION_REUSE_ENV_NAME] === '1' ? true : false\n });\n }\n\n AWS.util.update(options, httpOptions);\n delete options.proxy; // proxy isn't an HTTP option\n delete options.timeout; // timeout isn't an HTTP option\n\n var stream = http.request(options, function (httpResp) {\n if (stream.didCallback) return;\n\n callback(httpResp);\n httpResp.emit(\n 'headers',\n httpResp.statusCode,\n httpResp.headers,\n httpResp.statusMessage\n );\n });\n httpRequest.stream = stream; // attach stream to httpRequest\n stream.didCallback = false;\n\n // connection timeout support\n if (httpOptions.connectTimeout) {\n var connectTimeoutId;\n stream.on('socket', function(socket) {\n if (socket.connecting) {\n connectTimeoutId = setTimeout(function connectTimeout() {\n if (stream.didCallback) return; stream.didCallback = true;\n\n stream.abort();\n errCallback(AWS.util.error(\n new Error('Socket timed out without establishing a connection'),\n {code: 'TimeoutError'}\n ));\n }, httpOptions.connectTimeout);\n socket.on('connect', function() {\n clearTimeout(connectTimeoutId);\n connectTimeoutId = null;\n });\n }\n });\n }\n\n // timeout support\n stream.setTimeout(httpOptions.timeout || 0, function() {\n if (stream.didCallback) return; stream.didCallback = true;\n\n var msg = 'Connection timed out after ' + httpOptions.timeout + 'ms';\n errCallback(AWS.util.error(new Error(msg), {code: 'TimeoutError'}));\n stream.abort();\n });\n\n stream.on('error', function() {\n if (connectTimeoutId) {\n clearTimeout(connectTimeoutId);\n connectTimeoutId = null;\n }\n if (stream.didCallback) return; stream.didCallback = true;\n errCallback.apply(stream, arguments);\n });\n\n var expect = httpRequest.headers.Expect || httpRequest.headers.expect;\n if (expect === '100-continue') {\n stream.once('continue', function() {\n self.writeBody(stream, httpRequest);\n });\n } else {\n this.writeBody(stream, httpRequest);\n }\n\n return stream;\n },\n\n writeBody: function writeBody(stream, httpRequest) {\n var body = httpRequest.body;\n var totalBytes = parseInt(httpRequest.headers['Content-Length'], 10);\n\n if (body instanceof Stream) {\n // For progress support of streaming content -\n // pipe the data through a transform stream to emit 'sendProgress' events\n var progressStream = this.progressStream(stream, totalBytes);\n if (progressStream) {\n body.pipe(progressStream).pipe(stream);\n } else {\n body.pipe(stream);\n }\n } else if (body) {\n // The provided body is a buffer/string and is already fully available in memory -\n // For performance it's best to send it as a whole by calling stream.end(body),\n // Callers expect a 'sendProgress' event which is best emitted once\n // the http request stream has been fully written and all data flushed.\n // The use of totalBytes is important over body.length for strings where\n // length is char length and not byte length.\n stream.once('finish', function() {\n stream.emit('sendProgress', {\n loaded: totalBytes,\n total: totalBytes\n });\n });\n stream.end(body);\n } else {\n // no request body\n stream.end();\n }\n },\n\n /**\n * Create the https.Agent or http.Agent according to the request schema.\n */\n getAgent: function getAgent(useSSL, agentOptions) {\n var http = useSSL ? require('https') : require('http');\n if (useSSL) {\n if (!AWS.NodeHttpClient.sslAgent) {\n AWS.NodeHttpClient.sslAgent = new http.Agent(AWS.util.merge({\n rejectUnauthorized: process.env.NODE_TLS_REJECT_UNAUTHORIZED === '0' ? false : true\n }, agentOptions || {}));\n AWS.NodeHttpClient.sslAgent.setMaxListeners(0);\n\n // delegate maxSockets to globalAgent, set a default limit of 50 if current value is Infinity.\n // Users can bypass this default by supplying their own Agent as part of SDK configuration.\n Object.defineProperty(AWS.NodeHttpClient.sslAgent, 'maxSockets', {\n enumerable: true,\n get: function() {\n var defaultMaxSockets = 50;\n var globalAgent = http.globalAgent;\n if (globalAgent && globalAgent.maxSockets !== Infinity && typeof globalAgent.maxSockets === 'number') {\n return globalAgent.maxSockets;\n }\n return defaultMaxSockets;\n }\n });\n }\n return AWS.NodeHttpClient.sslAgent;\n } else {\n if (!AWS.NodeHttpClient.agent) {\n AWS.NodeHttpClient.agent = new http.Agent(agentOptions);\n }\n return AWS.NodeHttpClient.agent;\n }\n },\n\n progressStream: function progressStream(stream, totalBytes) {\n if (typeof TransformStream === 'undefined') {\n // for node 0.8 there is no streaming progress\n return;\n }\n var loadedBytes = 0;\n var reporter = new TransformStream();\n reporter._transform = function(chunk, encoding, callback) {\n if (chunk) {\n loadedBytes += chunk.length;\n stream.emit('sendProgress', {\n loaded: loadedBytes,\n total: totalBytes\n });\n }\n callback(null, chunk);\n };\n return reporter;\n },\n\n emitter: null\n});\n\n/**\n * @!ignore\n */\n\n/**\n * @api private\n */\nAWS.HttpClient.prototype = AWS.NodeHttpClient.prototype;\n\n/**\n * @api private\n */\nAWS.HttpClient.streamsApiVersion = ReadableStream ? 2 : 1;\n","var util = require('../util');\n\nfunction JsonBuilder() { }\n\nJsonBuilder.prototype.build = function(value, shape) {\n return JSON.stringify(translate(value, shape));\n};\n\nfunction translate(value, shape) {\n if (!shape || value === undefined || value === null) return undefined;\n\n switch (shape.type) {\n case 'structure': return translateStructure(value, shape);\n case 'map': return translateMap(value, shape);\n case 'list': return translateList(value, shape);\n default: return translateScalar(value, shape);\n }\n}\n\nfunction translateStructure(structure, shape) {\n var struct = {};\n util.each(structure, function(name, value) {\n var memberShape = shape.members[name];\n if (memberShape) {\n if (memberShape.location !== 'body') return;\n var locationName = memberShape.isLocationName ? memberShape.name : name;\n var result = translate(value, memberShape);\n if (result !== undefined) struct[locationName] = result;\n }\n });\n return struct;\n}\n\nfunction translateList(list, shape) {\n var out = [];\n util.arrayEach(list, function(value) {\n var result = translate(value, shape.member);\n if (result !== undefined) out.push(result);\n });\n return out;\n}\n\nfunction translateMap(map, shape) {\n var out = {};\n util.each(map, function(key, value) {\n var result = translate(value, shape.value);\n if (result !== undefined) out[key] = result;\n });\n return out;\n}\n\nfunction translateScalar(value, shape) {\n return shape.toWireFormat(value);\n}\n\n/**\n * @api private\n */\nmodule.exports = JsonBuilder;\n","var util = require('../util');\n\nfunction JsonParser() { }\n\nJsonParser.prototype.parse = function(value, shape) {\n return translate(JSON.parse(value), shape);\n};\n\nfunction translate(value, shape) {\n if (!shape || value === undefined) return undefined;\n\n switch (shape.type) {\n case 'structure': return translateStructure(value, shape);\n case 'map': return translateMap(value, shape);\n case 'list': return translateList(value, shape);\n default: return translateScalar(value, shape);\n }\n}\n\nfunction translateStructure(structure, shape) {\n if (structure == null) return undefined;\n\n var struct = {};\n var shapeMembers = shape.members;\n util.each(shapeMembers, function(name, memberShape) {\n var locationName = memberShape.isLocationName ? memberShape.name : name;\n if (Object.prototype.hasOwnProperty.call(structure, locationName)) {\n var value = structure[locationName];\n var result = translate(value, memberShape);\n if (result !== undefined) struct[name] = result;\n }\n });\n return struct;\n}\n\nfunction translateList(list, shape) {\n if (list == null) return undefined;\n\n var out = [];\n util.arrayEach(list, function(value) {\n var result = translate(value, shape.member);\n if (result === undefined) out.push(null);\n else out.push(result);\n });\n return out;\n}\n\nfunction translateMap(map, shape) {\n if (map == null) return undefined;\n\n var out = {};\n util.each(map, function(key, value) {\n var result = translate(value, shape.value);\n if (result === undefined) out[key] = null;\n else out[key] = result;\n });\n return out;\n}\n\nfunction translateScalar(value, shape) {\n return shape.toType(value);\n}\n\n/**\n * @api private\n */\nmodule.exports = JsonParser;\n","var AWS = require('./core');\nrequire('./http');\nvar inherit = AWS.util.inherit;\n\n/**\n * Represents a metadata service available on EC2 instances. Using the\n * {request} method, you can receieve metadata about any available resource\n * on the metadata service.\n *\n * You can disable the use of the IMDS by setting the AWS_EC2_METADATA_DISABLED\n * environment variable to a truthy value.\n *\n * @!attribute [r] httpOptions\n * @return [map] a map of options to pass to the underlying HTTP request:\n *\n * * **timeout** (Number) — a timeout value in milliseconds to wait\n * before aborting the connection. Set to 0 for no timeout.\n *\n * @!macro nobrowser\n */\nAWS.MetadataService = inherit({\n /**\n * @return [String] the hostname of the instance metadata service\n */\n host: '169.254.169.254',\n\n /**\n * @!ignore\n */\n\n /**\n * Default HTTP options. By default, the metadata service is set to not\n * timeout on long requests. This means that on non-EC2 machines, this\n * request will never return. If you are calling this operation from an\n * environment that may not always run on EC2, set a `timeout` value so\n * the SDK will abort the request after a given number of milliseconds.\n */\n httpOptions: { timeout: 0 },\n\n /**\n * when enabled, metadata service will not fetch token\n */\n disableFetchToken: false,\n\n /**\n * Creates a new MetadataService object with a given set of options.\n *\n * @option options host [String] the hostname of the instance metadata\n * service\n * @option options httpOptions [map] a map of options to pass to the\n * underlying HTTP request:\n *\n * * **timeout** (Number) — a timeout value in milliseconds to wait\n * before aborting the connection. Set to 0 for no timeout.\n * @option options maxRetries [Integer] the maximum number of retries to\n * perform for timeout errors\n * @option options retryDelayOptions [map] A set of options to configure the\n * retry delay on retryable errors. See AWS.Config for details.\n */\n constructor: function MetadataService(options) {\n AWS.util.update(this, options);\n },\n\n /**\n * Sends a request to the instance metadata service for a given resource.\n *\n * @param path [String] the path of the resource to get\n *\n * @param options [map] an optional map used to make request\n *\n * * **method** (String) — HTTP request method\n *\n * * **headers** (map) — a map of response header keys and their respective values\n *\n * @callback callback function(err, data)\n * Called when a response is available from the service.\n * @param err [Error, null] if an error occurred, this value will be set\n * @param data [String, null] if the request was successful, the body of\n * the response\n */\n request: function request(path, options, callback) {\n if (arguments.length === 2) {\n callback = options;\n options = {};\n }\n\n if (process.env[AWS.util.imdsDisabledEnv]) {\n callback(new Error('EC2 Instance Metadata Service access disabled'));\n return;\n }\n\n path = path || '/';\n var httpRequest = new AWS.HttpRequest('http://' + this.host + path);\n httpRequest.method = options.method || 'GET';\n if (options.headers) {\n httpRequest.headers = options.headers;\n }\n AWS.util.handleRequestWithRetries(httpRequest, this, callback);\n },\n\n /**\n * @api private\n */\n loadCredentialsCallbacks: [],\n\n /**\n * Fetches metadata token used for getting credentials\n *\n * @api private\n * @callback callback function(err, token)\n * Called when token is loaded from the resource\n */\n fetchMetadataToken: function fetchMetadataToken(callback) {\n var self = this;\n var tokenFetchPath = '/latest/api/token';\n self.request(\n tokenFetchPath,\n {\n 'method': 'PUT',\n 'headers': {\n 'x-aws-ec2-metadata-token-ttl-seconds': '21600'\n }\n },\n callback\n );\n },\n\n /**\n * Fetches credentials\n *\n * @api private\n * @callback cb function(err, creds)\n * Called when credentials are loaded from the resource\n */\n fetchCredentials: function fetchCredentials(options, cb) {\n var self = this;\n var basePath = '/latest/meta-data/iam/security-credentials/';\n\n self.request(basePath, options, function (err, roleName) {\n if (err) {\n self.disableFetchToken = !(err.statusCode === 401);\n cb(AWS.util.error(\n err,\n {\n message: 'EC2 Metadata roleName request returned error'\n }\n ));\n return;\n }\n roleName = roleName.split('\\n')[0]; // grab first (and only) role\n self.request(basePath + roleName, options, function (credErr, credData) {\n if (credErr) {\n self.disableFetchToken = !(credErr.statusCode === 401);\n cb(AWS.util.error(\n credErr,\n {\n message: 'EC2 Metadata creds request returned error'\n }\n ));\n return;\n }\n try {\n var credentials = JSON.parse(credData);\n cb(null, credentials);\n } catch (parseError) {\n cb(parseError);\n }\n });\n });\n },\n\n /**\n * Loads a set of credentials stored in the instance metadata service\n *\n * @api private\n * @callback callback function(err, credentials)\n * Called when credentials are loaded from the resource\n * @param err [Error] if an error occurred, this value will be set\n * @param credentials [Object] the raw JSON object containing all\n * metadata from the credentials resource\n */\n loadCredentials: function loadCredentials(callback) {\n var self = this;\n self.loadCredentialsCallbacks.push(callback);\n if (self.loadCredentialsCallbacks.length > 1) { return; }\n\n function callbacks(err, creds) {\n var cb;\n while ((cb = self.loadCredentialsCallbacks.shift()) !== undefined) {\n cb(err, creds);\n }\n }\n\n if (self.disableFetchToken) {\n self.fetchCredentials({}, callbacks);\n } else {\n self.fetchMetadataToken(function(tokenError, token) {\n if (tokenError) {\n if (tokenError.code === 'TimeoutError') {\n self.disableFetchToken = true;\n } else if (tokenError.retryable === true) {\n callbacks(AWS.util.error(\n tokenError,\n {\n message: 'EC2 Metadata token request returned error'\n }\n ));\n return;\n } else if (tokenError.statusCode === 400) {\n callbacks(AWS.util.error(\n tokenError,\n {\n message: 'EC2 Metadata token request returned 400'\n }\n ));\n return;\n }\n }\n var options = {};\n if (token) {\n options.headers = {\n 'x-aws-ec2-metadata-token': token\n };\n }\n self.fetchCredentials(options, callbacks);\n });\n\n }\n }\n});\n\n/**\n * @api private\n */\nmodule.exports = AWS.MetadataService;\n","var Collection = require('./collection');\nvar Operation = require('./operation');\nvar Shape = require('./shape');\nvar Paginator = require('./paginator');\nvar ResourceWaiter = require('./resource_waiter');\nvar metadata = require('../../apis/metadata.json');\n\nvar util = require('../util');\nvar property = util.property;\nvar memoizedProperty = util.memoizedProperty;\n\nfunction Api(api, options) {\n var self = this;\n api = api || {};\n options = options || {};\n options.api = this;\n\n api.metadata = api.metadata || {};\n\n var serviceIdentifier = options.serviceIdentifier;\n delete options.serviceIdentifier;\n\n property(this, 'isApi', true, false);\n property(this, 'apiVersion', api.metadata.apiVersion);\n property(this, 'endpointPrefix', api.metadata.endpointPrefix);\n property(this, 'signingName', api.metadata.signingName);\n property(this, 'globalEndpoint', api.metadata.globalEndpoint);\n property(this, 'signatureVersion', api.metadata.signatureVersion);\n property(this, 'jsonVersion', api.metadata.jsonVersion);\n property(this, 'targetPrefix', api.metadata.targetPrefix);\n property(this, 'protocol', api.metadata.protocol);\n property(this, 'timestampFormat', api.metadata.timestampFormat);\n property(this, 'xmlNamespaceUri', api.metadata.xmlNamespace);\n property(this, 'abbreviation', api.metadata.serviceAbbreviation);\n property(this, 'fullName', api.metadata.serviceFullName);\n property(this, 'serviceId', api.metadata.serviceId);\n if (serviceIdentifier && metadata[serviceIdentifier]) {\n property(this, 'xmlNoDefaultLists', metadata[serviceIdentifier].xmlNoDefaultLists, false);\n }\n\n memoizedProperty(this, 'className', function() {\n var name = api.metadata.serviceAbbreviation || api.metadata.serviceFullName;\n if (!name) return null;\n\n name = name.replace(/^Amazon|AWS\\s*|\\(.*|\\s+|\\W+/g, '');\n if (name === 'ElasticLoadBalancing') name = 'ELB';\n return name;\n });\n\n function addEndpointOperation(name, operation) {\n if (operation.endpointoperation === true) {\n property(self, 'endpointOperation', util.string.lowerFirst(name));\n }\n if (operation.endpointdiscovery && !self.hasRequiredEndpointDiscovery) {\n property(\n self,\n 'hasRequiredEndpointDiscovery',\n operation.endpointdiscovery.required === true\n );\n }\n }\n\n property(this, 'operations', new Collection(api.operations, options, function(name, operation) {\n return new Operation(name, operation, options);\n }, util.string.lowerFirst, addEndpointOperation));\n\n property(this, 'shapes', new Collection(api.shapes, options, function(name, shape) {\n return Shape.create(shape, options);\n }));\n\n property(this, 'paginators', new Collection(api.paginators, options, function(name, paginator) {\n return new Paginator(name, paginator, options);\n }));\n\n property(this, 'waiters', new Collection(api.waiters, options, function(name, waiter) {\n return new ResourceWaiter(name, waiter, options);\n }, util.string.lowerFirst));\n\n if (options.documentation) {\n property(this, 'documentation', api.documentation);\n property(this, 'documentationUrl', api.documentationUrl);\n }\n}\n\n/**\n * @api private\n */\nmodule.exports = Api;\n","var memoizedProperty = require('../util').memoizedProperty;\n\nfunction memoize(name, value, factory, nameTr) {\n memoizedProperty(this, nameTr(name), function() {\n return factory(name, value);\n });\n}\n\nfunction Collection(iterable, options, factory, nameTr, callback) {\n nameTr = nameTr || String;\n var self = this;\n\n for (var id in iterable) {\n if (Object.prototype.hasOwnProperty.call(iterable, id)) {\n memoize.call(self, id, iterable[id], factory, nameTr);\n if (callback) callback(id, iterable[id]);\n }\n }\n}\n\n/**\n * @api private\n */\nmodule.exports = Collection;\n","var Shape = require('./shape');\n\nvar util = require('../util');\nvar property = util.property;\nvar memoizedProperty = util.memoizedProperty;\n\nfunction Operation(name, operation, options) {\n var self = this;\n options = options || {};\n\n property(this, 'name', operation.name || name);\n property(this, 'api', options.api, false);\n\n operation.http = operation.http || {};\n property(this, 'endpoint', operation.endpoint);\n property(this, 'httpMethod', operation.http.method || 'POST');\n property(this, 'httpPath', operation.http.requestUri || '/');\n property(this, 'authtype', operation.authtype || '');\n property(\n this,\n 'endpointDiscoveryRequired',\n operation.endpointdiscovery ?\n (operation.endpointdiscovery.required ? 'REQUIRED' : 'OPTIONAL') :\n 'NULL'\n );\n\n memoizedProperty(this, 'input', function() {\n if (!operation.input) {\n return new Shape.create({type: 'structure'}, options);\n }\n return Shape.create(operation.input, options);\n });\n\n memoizedProperty(this, 'output', function() {\n if (!operation.output) {\n return new Shape.create({type: 'structure'}, options);\n }\n return Shape.create(operation.output, options);\n });\n\n memoizedProperty(this, 'errors', function() {\n var list = [];\n if (!operation.errors) return null;\n\n for (var i = 0; i < operation.errors.length; i++) {\n list.push(Shape.create(operation.errors[i], options));\n }\n\n return list;\n });\n\n memoizedProperty(this, 'paginator', function() {\n return options.api.paginators[name];\n });\n\n if (options.documentation) {\n property(this, 'documentation', operation.documentation);\n property(this, 'documentationUrl', operation.documentationUrl);\n }\n\n // idempotentMembers only tracks top-level input shapes\n memoizedProperty(this, 'idempotentMembers', function() {\n var idempotentMembers = [];\n var input = self.input;\n var members = input.members;\n if (!input.members) {\n return idempotentMembers;\n }\n for (var name in members) {\n if (!members.hasOwnProperty(name)) {\n continue;\n }\n if (members[name].isIdempotent === true) {\n idempotentMembers.push(name);\n }\n }\n return idempotentMembers;\n });\n\n memoizedProperty(this, 'hasEventOutput', function() {\n var output = self.output;\n return hasEventStream(output);\n });\n}\n\nfunction hasEventStream(topLevelShape) {\n var members = topLevelShape.members;\n var payload = topLevelShape.payload;\n\n if (!topLevelShape.members) {\n return false;\n }\n\n if (payload) {\n var payloadMember = members[payload];\n return payloadMember.isEventStream;\n }\n\n // check if any member is an event stream\n for (var name in members) {\n if (!members.hasOwnProperty(name)) {\n if (members[name].isEventStream === true) {\n return true;\n }\n }\n }\n return false;\n}\n\n/**\n * @api private\n */\nmodule.exports = Operation;\n","var property = require('../util').property;\n\nfunction Paginator(name, paginator) {\n property(this, 'inputToken', paginator.input_token);\n property(this, 'limitKey', paginator.limit_key);\n property(this, 'moreResults', paginator.more_results);\n property(this, 'outputToken', paginator.output_token);\n property(this, 'resultKey', paginator.result_key);\n}\n\n/**\n * @api private\n */\nmodule.exports = Paginator;\n","var util = require('../util');\nvar property = util.property;\n\nfunction ResourceWaiter(name, waiter, options) {\n options = options || {};\n property(this, 'name', name);\n property(this, 'api', options.api, false);\n\n if (waiter.operation) {\n property(this, 'operation', util.string.lowerFirst(waiter.operation));\n }\n\n var self = this;\n var keys = [\n 'type',\n 'description',\n 'delay',\n 'maxAttempts',\n 'acceptors'\n ];\n\n keys.forEach(function(key) {\n var value = waiter[key];\n if (value) {\n property(self, key, value);\n }\n });\n}\n\n/**\n * @api private\n */\nmodule.exports = ResourceWaiter;\n","var Collection = require('./collection');\n\nvar util = require('../util');\n\nfunction property(obj, name, value) {\n if (value !== null && value !== undefined) {\n util.property.apply(this, arguments);\n }\n}\n\nfunction memoizedProperty(obj, name) {\n if (!obj.constructor.prototype[name]) {\n util.memoizedProperty.apply(this, arguments);\n }\n}\n\nfunction Shape(shape, options, memberName) {\n options = options || {};\n\n property(this, 'shape', shape.shape);\n property(this, 'api', options.api, false);\n property(this, 'type', shape.type);\n property(this, 'enum', shape.enum);\n property(this, 'min', shape.min);\n property(this, 'max', shape.max);\n property(this, 'pattern', shape.pattern);\n property(this, 'location', shape.location || this.location || 'body');\n property(this, 'name', this.name || shape.xmlName || shape.queryName ||\n shape.locationName || memberName);\n property(this, 'isStreaming', shape.streaming || this.isStreaming || false);\n property(this, 'requiresLength', shape.requiresLength, false);\n property(this, 'isComposite', shape.isComposite || false);\n property(this, 'isShape', true, false);\n property(this, 'isQueryName', Boolean(shape.queryName), false);\n property(this, 'isLocationName', Boolean(shape.locationName), false);\n property(this, 'isIdempotent', shape.idempotencyToken === true);\n property(this, 'isJsonValue', shape.jsonvalue === true);\n property(this, 'isSensitive', shape.sensitive === true || shape.prototype && shape.prototype.sensitive === true);\n property(this, 'isEventStream', Boolean(shape.eventstream), false);\n property(this, 'isEvent', Boolean(shape.event), false);\n property(this, 'isEventPayload', Boolean(shape.eventpayload), false);\n property(this, 'isEventHeader', Boolean(shape.eventheader), false);\n property(this, 'isTimestampFormatSet', Boolean(shape.timestampFormat) || shape.prototype && shape.prototype.isTimestampFormatSet === true, false);\n property(this, 'endpointDiscoveryId', Boolean(shape.endpointdiscoveryid), false);\n property(this, 'hostLabel', Boolean(shape.hostLabel), false);\n\n if (options.documentation) {\n property(this, 'documentation', shape.documentation);\n property(this, 'documentationUrl', shape.documentationUrl);\n }\n\n if (shape.xmlAttribute) {\n property(this, 'isXmlAttribute', shape.xmlAttribute || false);\n }\n\n // type conversion and parsing\n property(this, 'defaultValue', null);\n this.toWireFormat = function(value) {\n if (value === null || value === undefined) return '';\n return value;\n };\n this.toType = function(value) { return value; };\n}\n\n/**\n * @api private\n */\nShape.normalizedTypes = {\n character: 'string',\n double: 'float',\n long: 'integer',\n short: 'integer',\n biginteger: 'integer',\n bigdecimal: 'float',\n blob: 'binary'\n};\n\n/**\n * @api private\n */\nShape.types = {\n 'structure': StructureShape,\n 'list': ListShape,\n 'map': MapShape,\n 'boolean': BooleanShape,\n 'timestamp': TimestampShape,\n 'float': FloatShape,\n 'integer': IntegerShape,\n 'string': StringShape,\n 'base64': Base64Shape,\n 'binary': BinaryShape\n};\n\nShape.resolve = function resolve(shape, options) {\n if (shape.shape) {\n var refShape = options.api.shapes[shape.shape];\n if (!refShape) {\n throw new Error('Cannot find shape reference: ' + shape.shape);\n }\n\n return refShape;\n } else {\n return null;\n }\n};\n\nShape.create = function create(shape, options, memberName) {\n if (shape.isShape) return shape;\n\n var refShape = Shape.resolve(shape, options);\n if (refShape) {\n var filteredKeys = Object.keys(shape);\n if (!options.documentation) {\n filteredKeys = filteredKeys.filter(function(name) {\n return !name.match(/documentation/);\n });\n }\n\n // create an inline shape with extra members\n var InlineShape = function() {\n refShape.constructor.call(this, shape, options, memberName);\n };\n InlineShape.prototype = refShape;\n return new InlineShape();\n } else {\n // set type if not set\n if (!shape.type) {\n if (shape.members) shape.type = 'structure';\n else if (shape.member) shape.type = 'list';\n else if (shape.key) shape.type = 'map';\n else shape.type = 'string';\n }\n\n // normalize types\n var origType = shape.type;\n if (Shape.normalizedTypes[shape.type]) {\n shape.type = Shape.normalizedTypes[shape.type];\n }\n\n if (Shape.types[shape.type]) {\n return new Shape.types[shape.type](shape, options, memberName);\n } else {\n throw new Error('Unrecognized shape type: ' + origType);\n }\n }\n};\n\nfunction CompositeShape(shape) {\n Shape.apply(this, arguments);\n property(this, 'isComposite', true);\n\n if (shape.flattened) {\n property(this, 'flattened', shape.flattened || false);\n }\n}\n\nfunction StructureShape(shape, options) {\n var self = this;\n var requiredMap = null, firstInit = !this.isShape;\n\n CompositeShape.apply(this, arguments);\n\n if (firstInit) {\n property(this, 'defaultValue', function() { return {}; });\n property(this, 'members', {});\n property(this, 'memberNames', []);\n property(this, 'required', []);\n property(this, 'isRequired', function() { return false; });\n }\n\n if (shape.members) {\n property(this, 'members', new Collection(shape.members, options, function(name, member) {\n return Shape.create(member, options, name);\n }));\n memoizedProperty(this, 'memberNames', function() {\n return shape.xmlOrder || Object.keys(shape.members);\n });\n\n if (shape.event) {\n memoizedProperty(this, 'eventPayloadMemberName', function() {\n var members = self.members;\n var memberNames = self.memberNames;\n // iterate over members to find ones that are event payloads\n for (var i = 0, iLen = memberNames.length; i < iLen; i++) {\n if (members[memberNames[i]].isEventPayload) {\n return memberNames[i];\n }\n }\n });\n\n memoizedProperty(this, 'eventHeaderMemberNames', function() {\n var members = self.members;\n var memberNames = self.memberNames;\n var eventHeaderMemberNames = [];\n // iterate over members to find ones that are event headers\n for (var i = 0, iLen = memberNames.length; i < iLen; i++) {\n if (members[memberNames[i]].isEventHeader) {\n eventHeaderMemberNames.push(memberNames[i]);\n }\n }\n return eventHeaderMemberNames;\n });\n }\n }\n\n if (shape.required) {\n property(this, 'required', shape.required);\n property(this, 'isRequired', function(name) {\n if (!requiredMap) {\n requiredMap = {};\n for (var i = 0; i < shape.required.length; i++) {\n requiredMap[shape.required[i]] = true;\n }\n }\n\n return requiredMap[name];\n }, false, true);\n }\n\n property(this, 'resultWrapper', shape.resultWrapper || null);\n\n if (shape.payload) {\n property(this, 'payload', shape.payload);\n }\n\n if (typeof shape.xmlNamespace === 'string') {\n property(this, 'xmlNamespaceUri', shape.xmlNamespace);\n } else if (typeof shape.xmlNamespace === 'object') {\n property(this, 'xmlNamespacePrefix', shape.xmlNamespace.prefix);\n property(this, 'xmlNamespaceUri', shape.xmlNamespace.uri);\n }\n}\n\nfunction ListShape(shape, options) {\n var self = this, firstInit = !this.isShape;\n CompositeShape.apply(this, arguments);\n\n if (firstInit) {\n property(this, 'defaultValue', function() { return []; });\n }\n\n if (shape.member) {\n memoizedProperty(this, 'member', function() {\n return Shape.create(shape.member, options);\n });\n }\n\n if (this.flattened) {\n var oldName = this.name;\n memoizedProperty(this, 'name', function() {\n return self.member.name || oldName;\n });\n }\n}\n\nfunction MapShape(shape, options) {\n var firstInit = !this.isShape;\n CompositeShape.apply(this, arguments);\n\n if (firstInit) {\n property(this, 'defaultValue', function() { return {}; });\n property(this, 'key', Shape.create({type: 'string'}, options));\n property(this, 'value', Shape.create({type: 'string'}, options));\n }\n\n if (shape.key) {\n memoizedProperty(this, 'key', function() {\n return Shape.create(shape.key, options);\n });\n }\n if (shape.value) {\n memoizedProperty(this, 'value', function() {\n return Shape.create(shape.value, options);\n });\n }\n}\n\nfunction TimestampShape(shape) {\n var self = this;\n Shape.apply(this, arguments);\n\n if (shape.timestampFormat) {\n property(this, 'timestampFormat', shape.timestampFormat);\n } else if (self.isTimestampFormatSet && this.timestampFormat) {\n property(this, 'timestampFormat', this.timestampFormat);\n } else if (this.location === 'header') {\n property(this, 'timestampFormat', 'rfc822');\n } else if (this.location === 'querystring') {\n property(this, 'timestampFormat', 'iso8601');\n } else if (this.api) {\n switch (this.api.protocol) {\n case 'json':\n case 'rest-json':\n property(this, 'timestampFormat', 'unixTimestamp');\n break;\n case 'rest-xml':\n case 'query':\n case 'ec2':\n property(this, 'timestampFormat', 'iso8601');\n break;\n }\n }\n\n this.toType = function(value) {\n if (value === null || value === undefined) return null;\n if (typeof value.toUTCString === 'function') return value;\n return typeof value === 'string' || typeof value === 'number' ?\n util.date.parseTimestamp(value) : null;\n };\n\n this.toWireFormat = function(value) {\n return util.date.format(value, self.timestampFormat);\n };\n}\n\nfunction StringShape() {\n Shape.apply(this, arguments);\n\n var nullLessProtocols = ['rest-xml', 'query', 'ec2'];\n this.toType = function(value) {\n value = this.api && nullLessProtocols.indexOf(this.api.protocol) > -1 ?\n value || '' : value;\n if (this.isJsonValue) {\n return JSON.parse(value);\n }\n\n return value && typeof value.toString === 'function' ?\n value.toString() : value;\n };\n\n this.toWireFormat = function(value) {\n return this.isJsonValue ? JSON.stringify(value) : value;\n };\n}\n\nfunction FloatShape() {\n Shape.apply(this, arguments);\n\n this.toType = function(value) {\n if (value === null || value === undefined) return null;\n return parseFloat(value);\n };\n this.toWireFormat = this.toType;\n}\n\nfunction IntegerShape() {\n Shape.apply(this, arguments);\n\n this.toType = function(value) {\n if (value === null || value === undefined) return null;\n return parseInt(value, 10);\n };\n this.toWireFormat = this.toType;\n}\n\nfunction BinaryShape() {\n Shape.apply(this, arguments);\n this.toType = function(value) {\n var buf = util.base64.decode(value);\n if (this.isSensitive && util.isNode() && typeof util.Buffer.alloc === 'function') {\n /* Node.js can create a Buffer that is not isolated.\n * i.e. buf.byteLength !== buf.buffer.byteLength\n * This means that the sensitive data is accessible to anyone with access to buf.buffer.\n * If this is the node shared Buffer, then other code within this process _could_ find this secret.\n * Copy sensitive data to an isolated Buffer and zero the sensitive data.\n * While this is safe to do here, copying this code somewhere else may produce unexpected results.\n */\n var secureBuf = util.Buffer.alloc(buf.length, buf);\n buf.fill(0);\n buf = secureBuf;\n }\n return buf;\n };\n this.toWireFormat = util.base64.encode;\n}\n\nfunction Base64Shape() {\n BinaryShape.apply(this, arguments);\n}\n\nfunction BooleanShape() {\n Shape.apply(this, arguments);\n\n this.toType = function(value) {\n if (typeof value === 'boolean') return value;\n if (value === null || value === undefined) return null;\n return value === 'true';\n };\n}\n\n/**\n * @api private\n */\nShape.shapes = {\n StructureShape: StructureShape,\n ListShape: ListShape,\n MapShape: MapShape,\n StringShape: StringShape,\n BooleanShape: BooleanShape,\n Base64Shape: Base64Shape\n};\n\n/**\n * @api private\n */\nmodule.exports = Shape;\n","var util = require('./util');\n\nutil.isBrowser = function() { return false; };\nutil.isNode = function() { return true; };\n\n// node.js specific modules\nutil.crypto.lib = require('crypto');\nutil.Buffer = require('buffer').Buffer;\nutil.domain = require('domain');\nutil.stream = require('stream');\nutil.url = require('url');\nutil.querystring = require('querystring');\nutil.environment = 'nodejs';\nutil.createEventStream = util.stream.Readable ?\n require('./event-stream/streaming-create-event-stream').createEventStream : require('./event-stream/buffered-create-event-stream').createEventStream;\nutil.realClock = require('./realclock/nodeClock');\nutil.clientSideMonitoring = {\n Publisher: require('./publisher').Publisher,\n configProvider: require('./publisher/configuration'),\n};\nutil.iniLoader = require('./shared-ini').iniLoader;\nutil.getSystemErrorName = require('util').getSystemErrorName;\n\nvar AWS;\n\n/**\n * @api private\n */\nmodule.exports = AWS = require('./core');\n\nrequire('./credentials');\nrequire('./credentials/credential_provider_chain');\nrequire('./credentials/temporary_credentials');\nrequire('./credentials/chainable_temporary_credentials');\nrequire('./credentials/web_identity_credentials');\nrequire('./credentials/cognito_identity_credentials');\nrequire('./credentials/saml_credentials');\nrequire('./credentials/process_credentials');\n\n// Load the xml2js XML parser\nAWS.XML.Parser = require('./xml/node_parser');\n\n// Load Node HTTP client\nrequire('./http/node');\n\nrequire('./shared-ini/ini-loader');\n\n// Load custom credential providers\nrequire('./credentials/token_file_web_identity_credentials');\nrequire('./credentials/ec2_metadata_credentials');\nrequire('./credentials/remote_credentials');\nrequire('./credentials/ecs_credentials');\nrequire('./credentials/environment_credentials');\nrequire('./credentials/file_system_credentials');\nrequire('./credentials/shared_ini_file_credentials');\nrequire('./credentials/process_credentials');\n\n// Setup default chain providers\n// If this changes, please update documentation for\n// AWS.CredentialProviderChain.defaultProviders in\n// credentials/credential_provider_chain.js\nAWS.CredentialProviderChain.defaultProviders = [\n function () { return new AWS.EnvironmentCredentials('AWS'); },\n function () { return new AWS.EnvironmentCredentials('AMAZON'); },\n function () { return new AWS.SharedIniFileCredentials(); },\n function () { return new AWS.ECSCredentials(); },\n function () { return new AWS.ProcessCredentials(); },\n function () { return new AWS.TokenFileWebIdentityCredentials(); },\n function () { return new AWS.EC2MetadataCredentials(); }\n];\n\n// Update configuration keys\nAWS.util.update(AWS.Config.prototype.keys, {\n credentials: function () {\n var credentials = null;\n new AWS.CredentialProviderChain([\n function () { return new AWS.EnvironmentCredentials('AWS'); },\n function () { return new AWS.EnvironmentCredentials('AMAZON'); },\n function () { return new AWS.SharedIniFileCredentials({ disableAssumeRole: true }); }\n ]).resolve(function(err, creds) {\n if (!err) credentials = creds;\n });\n return credentials;\n },\n credentialProvider: function() {\n return new AWS.CredentialProviderChain();\n },\n logger: function () {\n return process.env.AWSJS_DEBUG ? console : null;\n },\n region: function() {\n var env = process.env;\n var region = env.AWS_REGION || env.AMAZON_REGION;\n if (env[AWS.util.configOptInEnv]) {\n var toCheck = [\n {filename: env[AWS.util.sharedCredentialsFileEnv]},\n {isConfig: true, filename: env[AWS.util.sharedConfigFileEnv]}\n ];\n var iniLoader = AWS.util.iniLoader;\n while (!region && toCheck.length) {\n var configFile = {};\n var fileInfo = toCheck.shift();\n try {\n configFile = iniLoader.loadFrom(fileInfo);\n } catch (err) {\n if (fileInfo.isConfig) throw err;\n }\n var profile = configFile[env.AWS_PROFILE || AWS.util.defaultProfile];\n region = profile && profile.region;\n }\n }\n return region;\n }\n});\n\n// Reset configuration\nAWS.config = new AWS.Config();\n","var AWS = require('./core');\n\n/**\n * @api private\n */\nAWS.ParamValidator = AWS.util.inherit({\n /**\n * Create a new validator object.\n *\n * @param validation [Boolean|map] whether input parameters should be\n * validated against the operation description before sending the\n * request. Pass a map to enable any of the following specific\n * validation features:\n *\n * * **min** [Boolean] — Validates that a value meets the min\n * constraint. This is enabled by default when paramValidation is set\n * to `true`.\n * * **max** [Boolean] — Validates that a value meets the max\n * constraint.\n * * **pattern** [Boolean] — Validates that a string value matches a\n * regular expression.\n * * **enum** [Boolean] — Validates that a string value matches one\n * of the allowable enum values.\n */\n constructor: function ParamValidator(validation) {\n if (validation === true || validation === undefined) {\n validation = {'min': true};\n }\n this.validation = validation;\n },\n\n validate: function validate(shape, params, context) {\n this.errors = [];\n this.validateMember(shape, params || {}, context || 'params');\n\n if (this.errors.length > 1) {\n var msg = this.errors.join('\\n* ');\n msg = 'There were ' + this.errors.length +\n ' validation errors:\\n* ' + msg;\n throw AWS.util.error(new Error(msg),\n {code: 'MultipleValidationErrors', errors: this.errors});\n } else if (this.errors.length === 1) {\n throw this.errors[0];\n } else {\n return true;\n }\n },\n\n fail: function fail(code, message) {\n this.errors.push(AWS.util.error(new Error(message), {code: code}));\n },\n\n validateStructure: function validateStructure(shape, params, context) {\n this.validateType(params, context, ['object'], 'structure');\n\n var paramName;\n for (var i = 0; shape.required && i < shape.required.length; i++) {\n paramName = shape.required[i];\n var value = params[paramName];\n if (value === undefined || value === null) {\n this.fail('MissingRequiredParameter',\n 'Missing required key \\'' + paramName + '\\' in ' + context);\n }\n }\n\n // validate hash members\n for (paramName in params) {\n if (!Object.prototype.hasOwnProperty.call(params, paramName)) continue;\n\n var paramValue = params[paramName],\n memberShape = shape.members[paramName];\n\n if (memberShape !== undefined) {\n var memberContext = [context, paramName].join('.');\n this.validateMember(memberShape, paramValue, memberContext);\n } else if (paramValue !== undefined && paramValue !== null) {\n this.fail('UnexpectedParameter',\n 'Unexpected key \\'' + paramName + '\\' found in ' + context);\n }\n }\n\n return true;\n },\n\n validateMember: function validateMember(shape, param, context) {\n switch (shape.type) {\n case 'structure':\n return this.validateStructure(shape, param, context);\n case 'list':\n return this.validateList(shape, param, context);\n case 'map':\n return this.validateMap(shape, param, context);\n default:\n return this.validateScalar(shape, param, context);\n }\n },\n\n validateList: function validateList(shape, params, context) {\n if (this.validateType(params, context, [Array])) {\n this.validateRange(shape, params.length, context, 'list member count');\n // validate array members\n for (var i = 0; i < params.length; i++) {\n this.validateMember(shape.member, params[i], context + '[' + i + ']');\n }\n }\n },\n\n validateMap: function validateMap(shape, params, context) {\n if (this.validateType(params, context, ['object'], 'map')) {\n // Build up a count of map members to validate range traits.\n var mapCount = 0;\n for (var param in params) {\n if (!Object.prototype.hasOwnProperty.call(params, param)) continue;\n // Validate any map key trait constraints\n this.validateMember(shape.key, param,\n context + '[key=\\'' + param + '\\']');\n this.validateMember(shape.value, params[param],\n context + '[\\'' + param + '\\']');\n mapCount++;\n }\n this.validateRange(shape, mapCount, context, 'map member count');\n }\n },\n\n validateScalar: function validateScalar(shape, value, context) {\n switch (shape.type) {\n case null:\n case undefined:\n case 'string':\n return this.validateString(shape, value, context);\n case 'base64':\n case 'binary':\n return this.validatePayload(value, context);\n case 'integer':\n case 'float':\n return this.validateNumber(shape, value, context);\n case 'boolean':\n return this.validateType(value, context, ['boolean']);\n case 'timestamp':\n return this.validateType(value, context, [Date,\n /^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?Z$/, 'number'],\n 'Date object, ISO-8601 string, or a UNIX timestamp');\n default:\n return this.fail('UnkownType', 'Unhandled type ' +\n shape.type + ' for ' + context);\n }\n },\n\n validateString: function validateString(shape, value, context) {\n var validTypes = ['string'];\n if (shape.isJsonValue) {\n validTypes = validTypes.concat(['number', 'object', 'boolean']);\n }\n if (value !== null && this.validateType(value, context, validTypes)) {\n this.validateEnum(shape, value, context);\n this.validateRange(shape, value.length, context, 'string length');\n this.validatePattern(shape, value, context);\n this.validateUri(shape, value, context);\n }\n },\n\n validateUri: function validateUri(shape, value, context) {\n if (shape['location'] === 'uri') {\n if (value.length === 0) {\n this.fail('UriParameterError', 'Expected uri parameter to have length >= 1,'\n + ' but found \"' + value +'\" for ' + context);\n }\n }\n },\n\n validatePattern: function validatePattern(shape, value, context) {\n if (this.validation['pattern'] && shape['pattern'] !== undefined) {\n if (!(new RegExp(shape['pattern'])).test(value)) {\n this.fail('PatternMatchError', 'Provided value \"' + value + '\" '\n + 'does not match regex pattern /' + shape['pattern'] + '/ for '\n + context);\n }\n }\n },\n\n validateRange: function validateRange(shape, value, context, descriptor) {\n if (this.validation['min']) {\n if (shape['min'] !== undefined && value < shape['min']) {\n this.fail('MinRangeError', 'Expected ' + descriptor + ' >= '\n + shape['min'] + ', but found ' + value + ' for ' + context);\n }\n }\n if (this.validation['max']) {\n if (shape['max'] !== undefined && value > shape['max']) {\n this.fail('MaxRangeError', 'Expected ' + descriptor + ' <= '\n + shape['max'] + ', but found ' + value + ' for ' + context);\n }\n }\n },\n\n validateEnum: function validateRange(shape, value, context) {\n if (this.validation['enum'] && shape['enum'] !== undefined) {\n // Fail if the string value is not present in the enum list\n if (shape['enum'].indexOf(value) === -1) {\n this.fail('EnumError', 'Found string value of ' + value + ', but '\n + 'expected ' + shape['enum'].join('|') + ' for ' + context);\n }\n }\n },\n\n validateType: function validateType(value, context, acceptedTypes, type) {\n // We will not log an error for null or undefined, but we will return\n // false so that callers know that the expected type was not strictly met.\n if (value === null || value === undefined) return false;\n\n var foundInvalidType = false;\n for (var i = 0; i < acceptedTypes.length; i++) {\n if (typeof acceptedTypes[i] === 'string') {\n if (typeof value === acceptedTypes[i]) return true;\n } else if (acceptedTypes[i] instanceof RegExp) {\n if ((value || '').toString().match(acceptedTypes[i])) return true;\n } else {\n if (value instanceof acceptedTypes[i]) return true;\n if (AWS.util.isType(value, acceptedTypes[i])) return true;\n if (!type && !foundInvalidType) acceptedTypes = acceptedTypes.slice();\n acceptedTypes[i] = AWS.util.typeName(acceptedTypes[i]);\n }\n foundInvalidType = true;\n }\n\n var acceptedType = type;\n if (!acceptedType) {\n acceptedType = acceptedTypes.join(', ').replace(/,([^,]+)$/, ', or$1');\n }\n\n var vowel = acceptedType.match(/^[aeiou]/i) ? 'n' : '';\n this.fail('InvalidParameterType', 'Expected ' + context + ' to be a' +\n vowel + ' ' + acceptedType);\n return false;\n },\n\n validateNumber: function validateNumber(shape, value, context) {\n if (value === null || value === undefined) return;\n if (typeof value === 'string') {\n var castedValue = parseFloat(value);\n if (castedValue.toString() === value) value = castedValue;\n }\n if (this.validateType(value, context, ['number'])) {\n this.validateRange(shape, value, context, 'numeric value');\n }\n },\n\n validatePayload: function validatePayload(value, context) {\n if (value === null || value === undefined) return;\n if (typeof value === 'string') return;\n if (value && typeof value.byteLength === 'number') return; // typed arrays\n if (AWS.util.isNode()) { // special check for buffer/stream in Node.js\n var Stream = AWS.util.stream.Stream;\n if (AWS.util.Buffer.isBuffer(value) || value instanceof Stream) return;\n } else {\n if (typeof Blob !== void 0 && value instanceof Blob) return;\n }\n\n var types = ['Buffer', 'Stream', 'File', 'Blob', 'ArrayBuffer', 'DataView'];\n if (value) {\n for (var i = 0; i < types.length; i++) {\n if (AWS.util.isType(value, types[i])) return;\n if (AWS.util.typeName(value.constructor) === types[i]) return;\n }\n }\n\n this.fail('InvalidParameterType', 'Expected ' + context + ' to be a ' +\n 'string, Buffer, Stream, Blob, or typed array object');\n }\n});\n","var AWS = require('../core');\nvar rest = AWS.Protocol.Rest;\n\n/**\n * A presigner object can be used to generate presigned urls for the Polly service.\n */\nAWS.Polly.Presigner = AWS.util.inherit({\n /**\n * Creates a presigner object with a set of configuration options.\n *\n * @option options params [map] An optional map of parameters to bind to every\n * request sent by this service object.\n * @option options service [AWS.Polly] An optional pre-configured instance\n * of the AWS.Polly service object to use for requests. The object may\n * bound parameters used by the presigner.\n * @see AWS.Polly.constructor\n */\n constructor: function Signer(options) {\n options = options || {};\n this.options = options;\n this.service = options.service;\n this.bindServiceObject(options);\n this._operations = {};\n },\n\n /**\n * @api private\n */\n bindServiceObject: function bindServiceObject(options) {\n options = options || {};\n if (!this.service) {\n this.service = new AWS.Polly(options);\n } else {\n var config = AWS.util.copy(this.service.config);\n this.service = new this.service.constructor.__super__(config);\n this.service.config.params = AWS.util.merge(this.service.config.params || {}, options.params);\n }\n },\n\n /**\n * @api private\n */\n modifyInputMembers: function modifyInputMembers(input) {\n // make copies of the input so we don't overwrite the api\n // need to be careful to copy anything we access/modify\n var modifiedInput = AWS.util.copy(input);\n modifiedInput.members = AWS.util.copy(input.members);\n AWS.util.each(input.members, function(name, member) {\n modifiedInput.members[name] = AWS.util.copy(member);\n // update location and locationName\n if (!member.location || member.location === 'body') {\n modifiedInput.members[name].location = 'querystring';\n modifiedInput.members[name].locationName = name;\n }\n });\n return modifiedInput;\n },\n\n /**\n * @api private\n */\n convertPostToGet: function convertPostToGet(req) {\n // convert method\n req.httpRequest.method = 'GET';\n\n var operation = req.service.api.operations[req.operation];\n // get cached operation input first\n var input = this._operations[req.operation];\n if (!input) {\n // modify the original input\n this._operations[req.operation] = input = this.modifyInputMembers(operation.input);\n }\n\n var uri = rest.generateURI(req.httpRequest.endpoint.path, operation.httpPath, input, req.params);\n\n req.httpRequest.path = uri;\n req.httpRequest.body = '';\n\n // don't need these headers on a GET request\n delete req.httpRequest.headers['Content-Length'];\n delete req.httpRequest.headers['Content-Type'];\n },\n\n /**\n * @overload getSynthesizeSpeechUrl(params = {}, [expires = 3600], [callback])\n * Generate a presigned url for {AWS.Polly.synthesizeSpeech}.\n * @note You must ensure that you have static or previously resolved\n * credentials if you call this method synchronously (with no callback),\n * otherwise it may not properly sign the request. If you cannot guarantee\n * this (you are using an asynchronous credential provider, i.e., EC2\n * IAM roles), you should always call this method with an asynchronous\n * callback.\n * @param params [map] parameters to pass to the operation. See the {AWS.Polly.synthesizeSpeech}\n * operation for the expected operation parameters.\n * @param expires [Integer] (3600) the number of seconds to expire the pre-signed URL operation in.\n * Defaults to 1 hour.\n * @return [string] if called synchronously (with no callback), returns the signed URL.\n * @return [null] nothing is returned if a callback is provided.\n * @callback callback function (err, url)\n * If a callback is supplied, it is called when a signed URL has been generated.\n * @param err [Error] the error object returned from the presigner.\n * @param url [String] the signed URL.\n * @see AWS.Polly.synthesizeSpeech\n */\n getSynthesizeSpeechUrl: function getSynthesizeSpeechUrl(params, expires, callback) {\n var self = this;\n var request = this.service.makeRequest('synthesizeSpeech', params);\n // remove existing build listeners\n request.removeAllListeners('build');\n request.on('build', function(req) {\n self.convertPostToGet(req);\n });\n return request.presign(expires, callback);\n }\n});\n","var util = require('../util');\nvar AWS = require('../core');\n\n/**\n * Prepend prefix defined by API model to endpoint that's already\n * constructed. This feature does not apply to operations using\n * endpoint discovery and can be disabled.\n * @api private\n */\nfunction populateHostPrefix(request) {\n var enabled = request.service.config.hostPrefixEnabled;\n if (!enabled) return request;\n var operationModel = request.service.api.operations[request.operation];\n //don't marshal host prefix when operation has endpoint discovery traits\n if (hasEndpointDiscover(request)) return request;\n if (operationModel.endpoint && operationModel.endpoint.hostPrefix) {\n var hostPrefixNotation = operationModel.endpoint.hostPrefix;\n var hostPrefix = expandHostPrefix(hostPrefixNotation, request.params, operationModel.input);\n prependEndpointPrefix(request.httpRequest.endpoint, hostPrefix);\n validateHostname(request.httpRequest.endpoint.hostname);\n }\n return request;\n}\n\n/**\n * @api private\n */\nfunction hasEndpointDiscover(request) {\n var api = request.service.api;\n var operationModel = api.operations[request.operation];\n var isEndpointOperation = api.endpointOperation && (api.endpointOperation === util.string.lowerFirst(operationModel.name));\n return (operationModel.endpointDiscoveryRequired !== 'NULL' || isEndpointOperation === true);\n}\n\n/**\n * @api private\n */\nfunction expandHostPrefix(hostPrefixNotation, params, shape) {\n util.each(shape.members, function(name, member) {\n if (member.hostLabel === true) {\n if (typeof params[name] !== 'string' || params[name] === '') {\n throw util.error(new Error(), {\n message: 'Parameter ' + name + ' should be a non-empty string.',\n code: 'InvalidParameter'\n });\n }\n var regex = new RegExp('\\\\{' + name + '\\\\}', 'g');\n hostPrefixNotation = hostPrefixNotation.replace(regex, params[name]);\n }\n });\n return hostPrefixNotation;\n}\n\n/**\n * @api private\n */\nfunction prependEndpointPrefix(endpoint, prefix) {\n if (endpoint.host) {\n endpoint.host = prefix + endpoint.host;\n }\n if (endpoint.hostname) {\n endpoint.hostname = prefix + endpoint.hostname;\n }\n}\n\n/**\n * @api private\n */\nfunction validateHostname(hostname) {\n var labels = hostname.split('.');\n //Reference: https://tools.ietf.org/html/rfc1123#section-2\n var hostPattern = /^[a-zA-Z0-9]{1}$|^[a-zA-Z0-9][a-zA-Z0-9\\-]*[a-zA-Z0-9]$/;\n util.arrayEach(labels, function(label) {\n if (!label.length || label.length < 1 || label.length > 63) {\n throw util.error(new Error(), {\n code: 'ValidationError',\n message: 'Hostname label length should be between 1 to 63 characters, inclusive.'\n });\n }\n if (!hostPattern.test(label)) {\n throw AWS.util.error(new Error(),\n {code: 'ValidationError', message: label + ' is not hostname compatible.'});\n }\n });\n}\n\nmodule.exports = {\n populateHostPrefix: populateHostPrefix\n};\n","var util = require('../util');\nvar JsonBuilder = require('../json/builder');\nvar JsonParser = require('../json/parser');\nvar populateHostPrefix = require('./helpers').populateHostPrefix;\n\nfunction buildRequest(req) {\n var httpRequest = req.httpRequest;\n var api = req.service.api;\n var target = api.targetPrefix + '.' + api.operations[req.operation].name;\n var version = api.jsonVersion || '1.0';\n var input = api.operations[req.operation].input;\n var builder = new JsonBuilder();\n\n if (version === 1) version = '1.0';\n httpRequest.body = builder.build(req.params || {}, input);\n httpRequest.headers['Content-Type'] = 'application/x-amz-json-' + version;\n httpRequest.headers['X-Amz-Target'] = target;\n\n populateHostPrefix(req);\n}\n\nfunction extractError(resp) {\n var error = {};\n var httpResponse = resp.httpResponse;\n\n error.code = httpResponse.headers['x-amzn-errortype'] || 'UnknownError';\n if (typeof error.code === 'string') {\n error.code = error.code.split(':')[0];\n }\n\n if (httpResponse.body.length > 0) {\n try {\n var e = JSON.parse(httpResponse.body.toString());\n var code = e.__type || e.code || e.Code;\n if (code) {\n error.code = code.split('#').pop();\n }\n if (error.code === 'RequestEntityTooLarge') {\n error.message = 'Request body must be less than 1 MB';\n } else {\n error.message = (e.message || e.Message || null);\n }\n } catch (e) {\n error.statusCode = httpResponse.statusCode;\n error.message = httpResponse.statusMessage;\n }\n } else {\n error.statusCode = httpResponse.statusCode;\n error.message = httpResponse.statusCode.toString();\n }\n\n resp.error = util.error(new Error(), error);\n}\n\nfunction extractData(resp) {\n var body = resp.httpResponse.body.toString() || '{}';\n if (resp.request.service.config.convertResponseTypes === false) {\n resp.data = JSON.parse(body);\n } else {\n var operation = resp.request.service.api.operations[resp.request.operation];\n var shape = operation.output || {};\n var parser = new JsonParser();\n resp.data = parser.parse(body, shape);\n }\n}\n\n/**\n * @api private\n */\nmodule.exports = {\n buildRequest: buildRequest,\n extractError: extractError,\n extractData: extractData\n};\n","var AWS = require('../core');\nvar util = require('../util');\nvar QueryParamSerializer = require('../query/query_param_serializer');\nvar Shape = require('../model/shape');\nvar populateHostPrefix = require('./helpers').populateHostPrefix;\n\nfunction buildRequest(req) {\n var operation = req.service.api.operations[req.operation];\n var httpRequest = req.httpRequest;\n httpRequest.headers['Content-Type'] =\n 'application/x-www-form-urlencoded; charset=utf-8';\n httpRequest.params = {\n Version: req.service.api.apiVersion,\n Action: operation.name\n };\n\n // convert the request parameters into a list of query params,\n // e.g. Deeply.NestedParam.0.Name=value\n var builder = new QueryParamSerializer();\n builder.serialize(req.params, operation.input, function(name, value) {\n httpRequest.params[name] = value;\n });\n httpRequest.body = util.queryParamsToString(httpRequest.params);\n\n populateHostPrefix(req);\n}\n\nfunction extractError(resp) {\n var data, body = resp.httpResponse.body.toString();\n if (body.match('= 0 ? '&' : '?');\n var parts = [];\n util.arrayEach(Object.keys(queryString).sort(), function(key) {\n if (!Array.isArray(queryString[key])) {\n queryString[key] = [queryString[key]];\n }\n for (var i = 0; i < queryString[key].length; i++) {\n parts.push(util.uriEscape(String(key)) + '=' + queryString[key][i]);\n }\n });\n uri += parts.join('&');\n }\n\n return uri;\n}\n\nfunction populateURI(req) {\n var operation = req.service.api.operations[req.operation];\n var input = operation.input;\n\n var uri = generateURI(req.httpRequest.endpoint.path, operation.httpPath, input, req.params);\n req.httpRequest.path = uri;\n}\n\nfunction populateHeaders(req) {\n var operation = req.service.api.operations[req.operation];\n util.each(operation.input.members, function (name, member) {\n var value = req.params[name];\n if (value === null || value === undefined) return;\n\n if (member.location === 'headers' && member.type === 'map') {\n util.each(value, function(key, memberValue) {\n req.httpRequest.headers[member.name + key] = memberValue;\n });\n } else if (member.location === 'header') {\n value = member.toWireFormat(value).toString();\n if (member.isJsonValue) {\n value = util.base64.encode(value);\n }\n req.httpRequest.headers[member.name] = value;\n }\n });\n}\n\nfunction buildRequest(req) {\n populateMethod(req);\n populateURI(req);\n populateHeaders(req);\n populateHostPrefix(req);\n}\n\nfunction extractError() {\n}\n\nfunction extractData(resp) {\n var req = resp.request;\n var data = {};\n var r = resp.httpResponse;\n var operation = req.service.api.operations[req.operation];\n var output = operation.output;\n\n // normalize headers names to lower-cased keys for matching\n var headers = {};\n util.each(r.headers, function (k, v) {\n headers[k.toLowerCase()] = v;\n });\n\n util.each(output.members, function(name, member) {\n var header = (member.name || name).toLowerCase();\n if (member.location === 'headers' && member.type === 'map') {\n data[name] = {};\n var location = member.isLocationName ? member.name : '';\n var pattern = new RegExp('^' + location + '(.+)', 'i');\n util.each(r.headers, function (k, v) {\n var result = k.match(pattern);\n if (result !== null) {\n data[name][result[1]] = v;\n }\n });\n } else if (member.location === 'header') {\n if (headers[header] !== undefined) {\n var value = member.isJsonValue ?\n util.base64.decode(headers[header]) :\n headers[header];\n data[name] = member.toType(value);\n }\n } else if (member.location === 'statusCode') {\n data[name] = parseInt(r.statusCode, 10);\n }\n });\n\n resp.data = data;\n}\n\n/**\n * @api private\n */\nmodule.exports = {\n buildRequest: buildRequest,\n extractError: extractError,\n extractData: extractData,\n generateURI: generateURI\n};\n","var util = require('../util');\nvar Rest = require('./rest');\nvar Json = require('./json');\nvar JsonBuilder = require('../json/builder');\nvar JsonParser = require('../json/parser');\n\nfunction populateBody(req) {\n var builder = new JsonBuilder();\n var input = req.service.api.operations[req.operation].input;\n\n if (input.payload) {\n var params = {};\n var payloadShape = input.members[input.payload];\n params = req.params[input.payload];\n if (params === undefined) return;\n\n if (payloadShape.type === 'structure') {\n req.httpRequest.body = builder.build(params, payloadShape);\n applyContentTypeHeader(req);\n } else { // non-JSON payload\n req.httpRequest.body = params;\n if (payloadShape.type === 'binary' || payloadShape.isStreaming) {\n applyContentTypeHeader(req, true);\n }\n }\n } else {\n var body = builder.build(req.params, input);\n if (body !== '{}' || req.httpRequest.method !== 'GET') { //don't send empty body for GET method\n req.httpRequest.body = body;\n }\n applyContentTypeHeader(req);\n }\n}\n\nfunction applyContentTypeHeader(req, isBinary) {\n var operation = req.service.api.operations[req.operation];\n var input = operation.input;\n\n if (!req.httpRequest.headers['Content-Type']) {\n var type = isBinary ? 'binary/octet-stream' : 'application/json';\n req.httpRequest.headers['Content-Type'] = type;\n }\n}\n\nfunction buildRequest(req) {\n Rest.buildRequest(req);\n\n // never send body payload on HEAD/DELETE\n if (['HEAD', 'DELETE'].indexOf(req.httpRequest.method) < 0) {\n populateBody(req);\n }\n}\n\nfunction extractError(resp) {\n Json.extractError(resp);\n}\n\nfunction extractData(resp) {\n Rest.extractData(resp);\n\n var req = resp.request;\n var operation = req.service.api.operations[req.operation];\n var rules = req.service.api.operations[req.operation].output || {};\n var parser;\n var hasEventOutput = operation.hasEventOutput;\n\n if (rules.payload) {\n var payloadMember = rules.members[rules.payload];\n var body = resp.httpResponse.body;\n if (payloadMember.isEventStream) {\n parser = new JsonParser();\n resp.data[payload] = util.createEventStream(\n AWS.HttpClient.streamsApiVersion === 2 ? resp.httpResponse.stream : body,\n parser,\n payloadMember\n );\n } else if (payloadMember.type === 'structure' || payloadMember.type === 'list') {\n var parser = new JsonParser();\n resp.data[rules.payload] = parser.parse(body, payloadMember);\n } else if (payloadMember.type === 'binary' || payloadMember.isStreaming) {\n resp.data[rules.payload] = body;\n } else {\n resp.data[rules.payload] = payloadMember.toType(body);\n }\n } else {\n var data = resp.data;\n Json.extractData(resp);\n resp.data = util.merge(data, resp.data);\n }\n}\n\n/**\n * @api private\n */\nmodule.exports = {\n buildRequest: buildRequest,\n extractError: extractError,\n extractData: extractData\n};\n","var AWS = require('../core');\nvar util = require('../util');\nvar Rest = require('./rest');\n\nfunction populateBody(req) {\n var input = req.service.api.operations[req.operation].input;\n var builder = new AWS.XML.Builder();\n var params = req.params;\n\n var payload = input.payload;\n if (payload) {\n var payloadMember = input.members[payload];\n params = params[payload];\n if (params === undefined) return;\n\n if (payloadMember.type === 'structure') {\n var rootElement = payloadMember.name;\n req.httpRequest.body = builder.toXML(params, payloadMember, rootElement, true);\n } else { // non-xml payload\n req.httpRequest.body = params;\n }\n } else {\n req.httpRequest.body = builder.toXML(params, input, input.name ||\n input.shape || util.string.upperFirst(req.operation) + 'Request');\n }\n}\n\nfunction buildRequest(req) {\n Rest.buildRequest(req);\n\n // never send body payload on GET/HEAD\n if (['GET', 'HEAD'].indexOf(req.httpRequest.method) < 0) {\n populateBody(req);\n }\n}\n\nfunction extractError(resp) {\n Rest.extractError(resp);\n\n var data;\n try {\n data = new AWS.XML.Parser().parse(resp.httpResponse.body.toString());\n } catch (e) {\n data = {\n Code: resp.httpResponse.statusCode,\n Message: resp.httpResponse.statusMessage\n };\n }\n\n if (data.Errors) data = data.Errors;\n if (data.Error) data = data.Error;\n if (data.Code) {\n resp.error = util.error(new Error(), {\n code: data.Code,\n message: data.Message\n });\n } else {\n resp.error = util.error(new Error(), {\n code: resp.httpResponse.statusCode,\n message: null\n });\n }\n}\n\nfunction extractData(resp) {\n Rest.extractData(resp);\n\n var parser;\n var req = resp.request;\n var body = resp.httpResponse.body;\n var operation = req.service.api.operations[req.operation];\n var output = operation.output;\n\n var hasEventOutput = operation.hasEventOutput;\n\n var payload = output.payload;\n if (payload) {\n var payloadMember = output.members[payload];\n if (payloadMember.isEventStream) {\n parser = new AWS.XML.Parser();\n resp.data[payload] = util.createEventStream(\n AWS.HttpClient.streamsApiVersion === 2 ? resp.httpResponse.stream : resp.httpResponse.body,\n parser,\n payloadMember\n );\n } else if (payloadMember.type === 'structure') {\n parser = new AWS.XML.Parser();\n resp.data[payload] = parser.parse(body.toString(), payloadMember);\n } else if (payloadMember.type === 'binary' || payloadMember.isStreaming) {\n resp.data[payload] = body;\n } else {\n resp.data[payload] = payloadMember.toType(body);\n }\n } else if (body.length > 0) {\n parser = new AWS.XML.Parser();\n var data = parser.parse(body.toString(), output);\n util.update(resp.data, data);\n }\n}\n\n/**\n * @api private\n */\nmodule.exports = {\n buildRequest: buildRequest,\n extractError: extractError,\n extractData: extractData\n};\n","var AWS = require('../core');\n\n/**\n * Resolve client-side monitoring configuration from either environmental variables\n * or shared config file. Configurations from environmental variables have higher priority\n * than those from shared config file. The resolver will try to read the shared config file\n * no matter whether the AWS_SDK_LOAD_CONFIG variable is set.\n * @api private\n */\nfunction resolveMonitoringConfig() {\n var config = {\n port: undefined,\n clientId: undefined,\n enabled: undefined,\n host: undefined\n };\n if (fromEnvironment(config) || fromConfigFile(config)) return toJSType(config);\n return toJSType(config);\n}\n\n/**\n * Resolve configurations from environmental variables.\n * @param {object} client side monitoring config object needs to be resolved\n * @returns {boolean} whether resolving configurations is done\n * @api private\n */\nfunction fromEnvironment(config) {\n config.port = config.port || process.env.AWS_CSM_PORT;\n config.enabled = config.enabled || process.env.AWS_CSM_ENABLED;\n config.clientId = config.clientId || process.env.AWS_CSM_CLIENT_ID;\n config.host = config.host || process.env.AWS_CSM_HOST;\n return config.port && config.enabled && config.clientId && config.host ||\n ['false', '0'].indexOf(config.enabled) >= 0; //no need to read shared config file if explicitely disabled\n}\n\n/**\n * Resolve cofigurations from shared config file with specified role name\n * @param {object} client side monitoring config object needs to be resolved\n * @returns {boolean} whether resolving configurations is done\n * @api private\n */\nfunction fromConfigFile(config) {\n var sharedFileConfig;\n try {\n var configFile = AWS.util.iniLoader.loadFrom({\n isConfig: true,\n filename: process.env[AWS.util.sharedConfigFileEnv]\n });\n var sharedFileConfig = configFile[\n process.env.AWS_PROFILE || AWS.util.defaultProfile\n ];\n } catch (err) {\n return false;\n }\n if (!sharedFileConfig) return config;\n config.port = config.port || sharedFileConfig.csm_port;\n config.enabled = config.enabled || sharedFileConfig.csm_enabled;\n config.clientId = config.clientId || sharedFileConfig.csm_client_id;\n config.host = config.host || sharedFileConfig.csm_host;\n return config.port && config.enabled && config.clientId && config.host;\n}\n\n/**\n * Transfer the resolved configuration value to proper types: port as number, enabled\n * as boolean and clientId as string. The 'enabled' flag is valued to false when set\n * to 'false' or '0'.\n * @param {object} resolved client side monitoring config\n * @api private\n */\nfunction toJSType(config) {\n //config.XXX is either undefined or string\n var falsyNotations = ['false', '0', undefined];\n if (!config.enabled || falsyNotations.indexOf(config.enabled.toLowerCase()) >= 0) {\n config.enabled = false;\n } else {\n config.enabled = true;\n }\n config.port = config.port ? parseInt(config.port, 10) : undefined;\n return config;\n}\n\nmodule.exports = resolveMonitoringConfig;\n","var util = require('../core').util;\nvar dgram = require('dgram');\nvar stringToBuffer = util.buffer.toBuffer;\n\nvar MAX_MESSAGE_SIZE = 1024 * 8; // 8 KB\n\n/**\n * Publishes metrics via udp.\n * @param {object} options Paramters for Publisher constructor\n * @param {number} [options.port = 31000] Port number\n * @param {string} [options.clientId = ''] Client Identifier\n * @param {boolean} [options.enabled = false] enable sending metrics datagram\n * @api private\n */\nfunction Publisher(options) {\n // handle configuration\n options = options || {};\n this.enabled = options.enabled || false;\n this.port = options.port || 31000;\n this.clientId = options.clientId || '';\n this.address = options.host || '127.0.0.1';\n if (this.clientId.length > 255) {\n // ClientId has a max length of 255\n this.clientId = this.clientId.substr(0, 255);\n }\n this.messagesInFlight = 0;\n}\n\nPublisher.prototype.fieldsToTrim = {\n UserAgent: 256,\n SdkException: 128,\n SdkExceptionMessage: 512,\n AwsException: 128,\n AwsExceptionMessage: 512,\n FinalSdkException: 128,\n FinalSdkExceptionMessage: 512,\n FinalAwsException: 128,\n FinalAwsExceptionMessage: 512\n\n};\n\n/**\n * Trims fields that have a specified max length.\n * @param {object} event ApiCall or ApiCallAttempt event.\n * @returns {object}\n * @api private\n */\nPublisher.prototype.trimFields = function(event) {\n var trimmableFields = Object.keys(this.fieldsToTrim);\n for (var i = 0, iLen = trimmableFields.length; i < iLen; i++) {\n var field = trimmableFields[i];\n if (event.hasOwnProperty(field)) {\n var maxLength = this.fieldsToTrim[field];\n var value = event[field];\n if (value && value.length > maxLength) {\n event[field] = value.substr(0, maxLength);\n }\n }\n }\n return event;\n};\n\n/**\n * Handles ApiCall and ApiCallAttempt events.\n * @param {Object} event apiCall or apiCallAttempt event.\n * @api private\n */\nPublisher.prototype.eventHandler = function(event) {\n // set the clientId\n event.ClientId = this.clientId;\n\n this.trimFields(event);\n\n var message = stringToBuffer(JSON.stringify(event));\n if (!this.enabled || message.length > MAX_MESSAGE_SIZE) {\n // drop the message if publisher not enabled or it is too large\n return;\n }\n\n this.publishDatagram(message);\n};\n\n/**\n * Publishes message to an agent.\n * @param {Buffer} message JSON message to send to agent.\n * @api private\n */\nPublisher.prototype.publishDatagram = function(message) {\n var self = this;\n var client = this.getClient();\n\n this.messagesInFlight++;\n this.client.send(message, 0, message.length, this.port, this.address, function(err, bytes) {\n if (--self.messagesInFlight <= 0) {\n // destroy existing client so the event loop isn't kept open\n self.destroyClient();\n }\n });\n};\n\n/**\n * Returns an existing udp socket, or creates one if it doesn't already exist.\n * @api private\n */\nPublisher.prototype.getClient = function() {\n if (!this.client) {\n this.client = dgram.createSocket('udp4');\n }\n return this.client;\n};\n\n/**\n * Destroys the udp socket.\n * @api private\n */\nPublisher.prototype.destroyClient = function() {\n if (this.client) {\n this.client.close();\n this.client = void 0;\n }\n};\n\nmodule.exports = {\n Publisher: Publisher\n};\n","var util = require('../util');\n\nfunction QueryParamSerializer() {\n}\n\nQueryParamSerializer.prototype.serialize = function(params, shape, fn) {\n serializeStructure('', params, shape, fn);\n};\n\nfunction ucfirst(shape) {\n if (shape.isQueryName || shape.api.protocol !== 'ec2') {\n return shape.name;\n } else {\n return shape.name[0].toUpperCase() + shape.name.substr(1);\n }\n}\n\nfunction serializeStructure(prefix, struct, rules, fn) {\n util.each(rules.members, function(name, member) {\n var value = struct[name];\n if (value === null || value === undefined) return;\n\n var memberName = ucfirst(member);\n memberName = prefix ? prefix + '.' + memberName : memberName;\n serializeMember(memberName, value, member, fn);\n });\n}\n\nfunction serializeMap(name, map, rules, fn) {\n var i = 1;\n util.each(map, function (key, value) {\n var prefix = rules.flattened ? '.' : '.entry.';\n var position = prefix + (i++) + '.';\n var keyName = position + (rules.key.name || 'key');\n var valueName = position + (rules.value.name || 'value');\n serializeMember(name + keyName, key, rules.key, fn);\n serializeMember(name + valueName, value, rules.value, fn);\n });\n}\n\nfunction serializeList(name, list, rules, fn) {\n var memberRules = rules.member || {};\n\n if (list.length === 0) {\n fn.call(this, name, null);\n return;\n }\n\n util.arrayEach(list, function (v, n) {\n var suffix = '.' + (n + 1);\n if (rules.api.protocol === 'ec2') {\n // Do nothing for EC2\n suffix = suffix + ''; // make linter happy\n } else if (rules.flattened) {\n if (memberRules.name) {\n var parts = name.split('.');\n parts.pop();\n parts.push(ucfirst(memberRules));\n name = parts.join('.');\n }\n } else {\n suffix = '.' + (memberRules.name ? memberRules.name : 'member') + suffix;\n }\n serializeMember(name + suffix, v, memberRules, fn);\n });\n}\n\nfunction serializeMember(name, value, rules, fn) {\n if (value === null || value === undefined) return;\n if (rules.type === 'structure') {\n serializeStructure(name, value, rules, fn);\n } else if (rules.type === 'list') {\n serializeList(name, value, rules, fn);\n } else if (rules.type === 'map') {\n serializeMap(name, value, rules, fn);\n } else {\n fn(name, rules.toWireFormat(value).toString());\n }\n}\n\n/**\n * @api private\n */\nmodule.exports = QueryParamSerializer;\n","var AWS = require('../core');\n\n/**\n * @api private\n */\nvar service = null;\n\n/**\n * @api private\n */\nvar api = {\n signatureVersion: 'v4',\n signingName: 'rds-db',\n operations: {}\n};\n\n/**\n * @api private\n */\nvar requiredAuthTokenOptions = {\n region: 'string',\n hostname: 'string',\n port: 'number',\n username: 'string'\n};\n\n/**\n * A signer object can be used to generate an auth token to a database.\n */\nAWS.RDS.Signer = AWS.util.inherit({\n /**\n * Creates a signer object can be used to generate an auth token.\n *\n * @option options credentials [AWS.Credentials] the AWS credentials\n * to sign requests with. Uses the default credential provider chain\n * if not specified.\n * @option options hostname [String] the hostname of the database to connect to.\n * @option options port [Number] the port number the database is listening on.\n * @option options region [String] the region the database is located in.\n * @option options username [String] the username to login as.\n * @example Passing in options to constructor\n * var signer = new AWS.RDS.Signer({\n * credentials: new AWS.SharedIniFileCredentials({profile: 'default'}),\n * region: 'us-east-1',\n * hostname: 'db.us-east-1.rds.amazonaws.com',\n * port: 8000,\n * username: 'name'\n * });\n */\n constructor: function Signer(options) {\n this.options = options || {};\n },\n\n /**\n * @api private\n * Strips the protocol from a url.\n */\n convertUrlToAuthToken: function convertUrlToAuthToken(url) {\n // we are always using https as the protocol\n var protocol = 'https://';\n if (url.indexOf(protocol) === 0) {\n return url.substring(protocol.length);\n }\n },\n\n /**\n * @overload getAuthToken(options = {}, [callback])\n * Generate an auth token to a database.\n * @note You must ensure that you have static or previously resolved\n * credentials if you call this method synchronously (with no callback),\n * otherwise it may not properly sign the request. If you cannot guarantee\n * this (you are using an asynchronous credential provider, i.e., EC2\n * IAM roles), you should always call this method with an asynchronous\n * callback.\n *\n * @param options [map] The fields to use when generating an auth token.\n * Any options specified here will be merged on top of any options passed\n * to AWS.RDS.Signer:\n *\n * * **credentials** (AWS.Credentials) — the AWS credentials\n * to sign requests with. Uses the default credential provider chain\n * if not specified.\n * * **hostname** (String) — the hostname of the database to connect to.\n * * **port** (Number) — the port number the database is listening on.\n * * **region** (String) — the region the database is located in.\n * * **username** (String) — the username to login as.\n * @return [String] if called synchronously (with no callback), returns the\n * auth token.\n * @return [null] nothing is returned if a callback is provided.\n * @callback callback function (err, token)\n * If a callback is supplied, it is called when an auth token has been generated.\n * @param err [Error] the error object returned from the signer.\n * @param token [String] the auth token.\n *\n * @example Generating an auth token synchronously\n * var signer = new AWS.RDS.Signer({\n * // configure options\n * region: 'us-east-1',\n * username: 'default',\n * hostname: 'db.us-east-1.amazonaws.com',\n * port: 8000\n * });\n * var token = signer.getAuthToken({\n * // these options are merged with those defined when creating the signer, overriding in the case of a duplicate option\n * // credentials are not specified here or when creating the signer, so default credential provider will be used\n * username: 'test' // overriding username\n * });\n * @example Generating an auth token asynchronously\n * var signer = new AWS.RDS.Signer({\n * // configure options\n * region: 'us-east-1',\n * username: 'default',\n * hostname: 'db.us-east-1.amazonaws.com',\n * port: 8000\n * });\n * signer.getAuthToken({\n * // these options are merged with those defined when creating the signer, overriding in the case of a duplicate option\n * // credentials are not specified here or when creating the signer, so default credential provider will be used\n * username: 'test' // overriding username\n * }, function(err, token) {\n * if (err) {\n * // handle error\n * } else {\n * // use token\n * }\n * });\n *\n */\n getAuthToken: function getAuthToken(options, callback) {\n if (typeof options === 'function' && callback === undefined) {\n callback = options;\n options = {};\n }\n var self = this;\n var hasCallback = typeof callback === 'function';\n // merge options with existing options\n options = AWS.util.merge(this.options, options);\n // validate options\n var optionsValidation = this.validateAuthTokenOptions(options);\n if (optionsValidation !== true) {\n if (hasCallback) {\n return callback(optionsValidation, null);\n }\n throw optionsValidation;\n }\n\n // 15 minutes\n var expires = 900;\n // create service to generate a request from\n var serviceOptions = {\n region: options.region,\n endpoint: new AWS.Endpoint(options.hostname + ':' + options.port),\n paramValidation: false,\n signatureVersion: 'v4'\n };\n if (options.credentials) {\n serviceOptions.credentials = options.credentials;\n }\n service = new AWS.Service(serviceOptions);\n // ensure the SDK is using sigv4 signing (config is not enough)\n service.api = api;\n\n var request = service.makeRequest();\n // add listeners to request to properly build auth token\n this.modifyRequestForAuthToken(request, options);\n\n if (hasCallback) {\n request.presign(expires, function(err, url) {\n if (url) {\n url = self.convertUrlToAuthToken(url);\n }\n callback(err, url);\n });\n } else {\n var url = request.presign(expires);\n return this.convertUrlToAuthToken(url);\n }\n },\n\n /**\n * @api private\n * Modifies a request to allow the presigner to generate an auth token.\n */\n modifyRequestForAuthToken: function modifyRequestForAuthToken(request, options) {\n request.on('build', request.buildAsGet);\n var httpRequest = request.httpRequest;\n httpRequest.body = AWS.util.queryParamsToString({\n Action: 'connect',\n DBUser: options.username\n });\n },\n\n /**\n * @api private\n * Validates that the options passed in contain all the keys with values of the correct type that\n * are needed to generate an auth token.\n */\n validateAuthTokenOptions: function validateAuthTokenOptions(options) {\n // iterate over all keys in options\n var message = '';\n options = options || {};\n for (var key in requiredAuthTokenOptions) {\n if (!Object.prototype.hasOwnProperty.call(requiredAuthTokenOptions, key)) {\n continue;\n }\n if (typeof options[key] !== requiredAuthTokenOptions[key]) {\n message += 'option \\'' + key + '\\' should have been type \\'' + requiredAuthTokenOptions[key] + '\\', was \\'' + typeof options[key] + '\\'.\\n';\n }\n }\n if (message.length) {\n return AWS.util.error(new Error(), {\n code: 'InvalidParameter',\n message: message\n });\n }\n return true;\n }\n});\n","module.exports = {\n //provide realtime clock for performance measurement\n now: function now() {\n var second = process.hrtime();\n return second[0] * 1000 + (second[1] / 1000000);\n }\n};\n","var util = require('./util');\nvar regionConfig = require('./region_config_data.json');\n\nfunction generateRegionPrefix(region) {\n if (!region) return null;\n\n var parts = region.split('-');\n if (parts.length < 3) return null;\n return parts.slice(0, parts.length - 2).join('-') + '-*';\n}\n\nfunction derivedKeys(service) {\n var region = service.config.region;\n var regionPrefix = generateRegionPrefix(region);\n var endpointPrefix = service.api.endpointPrefix;\n\n return [\n [region, endpointPrefix],\n [regionPrefix, endpointPrefix],\n [region, '*'],\n [regionPrefix, '*'],\n ['*', endpointPrefix],\n ['*', '*']\n ].map(function(item) {\n return item[0] && item[1] ? item.join('/') : null;\n });\n}\n\nfunction applyConfig(service, config) {\n util.each(config, function(key, value) {\n if (key === 'globalEndpoint') return;\n if (service.config[key] === undefined || service.config[key] === null) {\n service.config[key] = value;\n }\n });\n}\n\nfunction configureEndpoint(service) {\n var keys = derivedKeys(service);\n for (var i = 0; i < keys.length; i++) {\n var key = keys[i];\n if (!key) continue;\n\n if (Object.prototype.hasOwnProperty.call(regionConfig.rules, key)) {\n var config = regionConfig.rules[key];\n if (typeof config === 'string') {\n config = regionConfig.patterns[config];\n }\n\n // set dualstack endpoint\n if (service.config.useDualstack && util.isDualstackAvailable(service)) {\n config = util.copy(config);\n config.endpoint = config.endpoint.replace(\n /{service}\\.({region}\\.)?/,\n '{service}.dualstack.{region}.'\n );\n }\n\n // set global endpoint\n service.isGlobalEndpoint = !!config.globalEndpoint;\n if (config.signingRegion) {\n service.signingRegion = config.signingRegion;\n }\n\n // signature version\n if (!config.signatureVersion) config.signatureVersion = 'v4';\n\n // merge config\n applyConfig(service, config);\n return;\n }\n }\n}\n\nfunction getEndpointSuffix(region) {\n var regionRegexes = {\n '^(us|eu|ap|sa|ca|me)\\\\-\\\\w+\\\\-\\\\d+$': 'amazonaws.com',\n '^cn\\\\-\\\\w+\\\\-\\\\d+$': 'amazonaws.com.cn',\n '^us\\\\-gov\\\\-\\\\w+\\\\-\\\\d+$': 'amazonaws.com',\n '^us\\\\-iso\\\\-\\\\w+\\\\-\\\\d+$': 'c2s.ic.gov',\n '^us\\\\-isob\\\\-\\\\w+\\\\-\\\\d+$': 'sc2s.sgov.gov'\n };\n var defaultSuffix = 'amazonaws.com';\n var regexes = Object.keys(regionRegexes);\n for (var i = 0; i < regexes.length; i++) {\n var regionPattern = RegExp(regexes[i]);\n var dnsSuffix = regionRegexes[regexes[i]];\n if (regionPattern.test(region)) return dnsSuffix;\n }\n return defaultSuffix;\n}\n\n/**\n * @api private\n */\nmodule.exports = {\n configureEndpoint: configureEndpoint,\n getEndpointSuffix: getEndpointSuffix\n};\n","var AWS = require('./core');\nvar AcceptorStateMachine = require('./state_machine');\nvar inherit = AWS.util.inherit;\nvar domain = AWS.util.domain;\nvar jmespath = require('jmespath');\n\n/**\n * @api private\n */\nvar hardErrorStates = {success: 1, error: 1, complete: 1};\n\nfunction isTerminalState(machine) {\n return Object.prototype.hasOwnProperty.call(hardErrorStates, machine._asm.currentState);\n}\n\nvar fsm = new AcceptorStateMachine();\nfsm.setupStates = function() {\n var transition = function(_, done) {\n var self = this;\n self._haltHandlersOnError = false;\n\n self.emit(self._asm.currentState, function(err) {\n if (err) {\n if (isTerminalState(self)) {\n if (domain && self.domain instanceof domain.Domain) {\n err.domainEmitter = self;\n err.domain = self.domain;\n err.domainThrown = false;\n self.domain.emit('error', err);\n } else {\n throw err;\n }\n } else {\n self.response.error = err;\n done(err);\n }\n } else {\n done(self.response.error);\n }\n });\n\n };\n\n this.addState('validate', 'build', 'error', transition);\n this.addState('build', 'afterBuild', 'restart', transition);\n this.addState('afterBuild', 'sign', 'restart', transition);\n this.addState('sign', 'send', 'retry', transition);\n this.addState('retry', 'afterRetry', 'afterRetry', transition);\n this.addState('afterRetry', 'sign', 'error', transition);\n this.addState('send', 'validateResponse', 'retry', transition);\n this.addState('validateResponse', 'extractData', 'extractError', transition);\n this.addState('extractError', 'extractData', 'retry', transition);\n this.addState('extractData', 'success', 'retry', transition);\n this.addState('restart', 'build', 'error', transition);\n this.addState('success', 'complete', 'complete', transition);\n this.addState('error', 'complete', 'complete', transition);\n this.addState('complete', null, null, transition);\n};\nfsm.setupStates();\n\n/**\n * ## Asynchronous Requests\n *\n * All requests made through the SDK are asynchronous and use a\n * callback interface. Each service method that kicks off a request\n * returns an `AWS.Request` object that you can use to register\n * callbacks.\n *\n * For example, the following service method returns the request\n * object as \"request\", which can be used to register callbacks:\n *\n * ```javascript\n * // request is an AWS.Request object\n * var request = ec2.describeInstances();\n *\n * // register callbacks on request to retrieve response data\n * request.on('success', function(response) {\n * console.log(response.data);\n * });\n * ```\n *\n * When a request is ready to be sent, the {send} method should\n * be called:\n *\n * ```javascript\n * request.send();\n * ```\n *\n * Since registered callbacks may or may not be idempotent, requests should only\n * be sent once. To perform the same operation multiple times, you will need to\n * create multiple request objects, each with its own registered callbacks.\n *\n * ## Removing Default Listeners for Events\n *\n * Request objects are built with default listeners for the various events,\n * depending on the service type. In some cases, you may want to remove\n * some built-in listeners to customize behaviour. Doing this requires\n * access to the built-in listener functions, which are exposed through\n * the {AWS.EventListeners.Core} namespace. For instance, you may\n * want to customize the HTTP handler used when sending a request. In this\n * case, you can remove the built-in listener associated with the 'send'\n * event, the {AWS.EventListeners.Core.SEND} listener and add your own.\n *\n * ## Multiple Callbacks and Chaining\n *\n * You can register multiple callbacks on any request object. The\n * callbacks can be registered for different events, or all for the\n * same event. In addition, you can chain callback registration, for\n * example:\n *\n * ```javascript\n * request.\n * on('success', function(response) {\n * console.log(\"Success!\");\n * }).\n * on('error', function(error, response) {\n * console.log(\"Error!\");\n * }).\n * on('complete', function(response) {\n * console.log(\"Always!\");\n * }).\n * send();\n * ```\n *\n * The above example will print either \"Success! Always!\", or \"Error! Always!\",\n * depending on whether the request succeeded or not.\n *\n * @!attribute httpRequest\n * @readonly\n * @!group HTTP Properties\n * @return [AWS.HttpRequest] the raw HTTP request object\n * containing request headers and body information\n * sent by the service.\n *\n * @!attribute startTime\n * @readonly\n * @!group Operation Properties\n * @return [Date] the time that the request started\n *\n * @!group Request Building Events\n *\n * @!event validate(request)\n * Triggered when a request is being validated. Listeners\n * should throw an error if the request should not be sent.\n * @param request [Request] the request object being sent\n * @see AWS.EventListeners.Core.VALIDATE_CREDENTIALS\n * @see AWS.EventListeners.Core.VALIDATE_REGION\n * @example Ensuring that a certain parameter is set before sending a request\n * var req = s3.putObject(params);\n * req.on('validate', function() {\n * if (!req.params.Body.match(/^Hello\\s/)) {\n * throw new Error('Body must start with \"Hello \"');\n * }\n * });\n * req.send(function(err, data) { ... });\n *\n * @!event build(request)\n * Triggered when the request payload is being built. Listeners\n * should fill the necessary information to send the request\n * over HTTP.\n * @param (see AWS.Request~validate)\n * @example Add a custom HTTP header to a request\n * var req = s3.putObject(params);\n * req.on('build', function() {\n * req.httpRequest.headers['Custom-Header'] = 'value';\n * });\n * req.send(function(err, data) { ... });\n *\n * @!event sign(request)\n * Triggered when the request is being signed. Listeners should\n * add the correct authentication headers and/or adjust the body,\n * depending on the authentication mechanism being used.\n * @param (see AWS.Request~validate)\n *\n * @!group Request Sending Events\n *\n * @!event send(response)\n * Triggered when the request is ready to be sent. Listeners\n * should call the underlying transport layer to initiate\n * the sending of the request.\n * @param response [Response] the response object\n * @context [Request] the request object that was sent\n * @see AWS.EventListeners.Core.SEND\n *\n * @!event retry(response)\n * Triggered when a request failed and might need to be retried or redirected.\n * If the response is retryable, the listener should set the\n * `response.error.retryable` property to `true`, and optionally set\n * `response.error.retryDelay` to the millisecond delay for the next attempt.\n * In the case of a redirect, `response.error.redirect` should be set to\n * `true` with `retryDelay` set to an optional delay on the next request.\n *\n * If a listener decides that a request should not be retried,\n * it should set both `retryable` and `redirect` to false.\n *\n * Note that a retryable error will be retried at most\n * {AWS.Config.maxRetries} times (based on the service object's config).\n * Similarly, a request that is redirected will only redirect at most\n * {AWS.Config.maxRedirects} times.\n *\n * @param (see AWS.Request~send)\n * @context (see AWS.Request~send)\n * @example Adding a custom retry for a 404 response\n * request.on('retry', function(response) {\n * // this resource is not yet available, wait 10 seconds to get it again\n * if (response.httpResponse.statusCode === 404 && response.error) {\n * response.error.retryable = true; // retry this error\n * response.error.retryDelay = 10000; // wait 10 seconds\n * }\n * });\n *\n * @!group Data Parsing Events\n *\n * @!event extractError(response)\n * Triggered on all non-2xx requests so that listeners can extract\n * error details from the response body. Listeners to this event\n * should set the `response.error` property.\n * @param (see AWS.Request~send)\n * @context (see AWS.Request~send)\n *\n * @!event extractData(response)\n * Triggered in successful requests to allow listeners to\n * de-serialize the response body into `response.data`.\n * @param (see AWS.Request~send)\n * @context (see AWS.Request~send)\n *\n * @!group Completion Events\n *\n * @!event success(response)\n * Triggered when the request completed successfully.\n * `response.data` will contain the response data and\n * `response.error` will be null.\n * @param (see AWS.Request~send)\n * @context (see AWS.Request~send)\n *\n * @!event error(error, response)\n * Triggered when an error occurs at any point during the\n * request. `response.error` will contain details about the error\n * that occurred. `response.data` will be null.\n * @param error [Error] the error object containing details about\n * the error that occurred.\n * @param (see AWS.Request~send)\n * @context (see AWS.Request~send)\n *\n * @!event complete(response)\n * Triggered whenever a request cycle completes. `response.error`\n * should be checked, since the request may have failed.\n * @param (see AWS.Request~send)\n * @context (see AWS.Request~send)\n *\n * @!group HTTP Events\n *\n * @!event httpHeaders(statusCode, headers, response, statusMessage)\n * Triggered when headers are sent by the remote server\n * @param statusCode [Integer] the HTTP response code\n * @param headers [map] the response headers\n * @param (see AWS.Request~send)\n * @param statusMessage [String] A status message corresponding to the HTTP\n * response code\n * @context (see AWS.Request~send)\n *\n * @!event httpData(chunk, response)\n * Triggered when data is sent by the remote server\n * @param chunk [Buffer] the buffer data containing the next data chunk\n * from the server\n * @param (see AWS.Request~send)\n * @context (see AWS.Request~send)\n * @see AWS.EventListeners.Core.HTTP_DATA\n *\n * @!event httpUploadProgress(progress, response)\n * Triggered when the HTTP request has uploaded more data\n * @param progress [map] An object containing the `loaded` and `total` bytes\n * of the request.\n * @param (see AWS.Request~send)\n * @context (see AWS.Request~send)\n * @note This event will not be emitted in Node.js 0.8.x.\n *\n * @!event httpDownloadProgress(progress, response)\n * Triggered when the HTTP request has downloaded more data\n * @param progress [map] An object containing the `loaded` and `total` bytes\n * of the request.\n * @param (see AWS.Request~send)\n * @context (see AWS.Request~send)\n * @note This event will not be emitted in Node.js 0.8.x.\n *\n * @!event httpError(error, response)\n * Triggered when the HTTP request failed\n * @param error [Error] the error object that was thrown\n * @param (see AWS.Request~send)\n * @context (see AWS.Request~send)\n *\n * @!event httpDone(response)\n * Triggered when the server is finished sending data\n * @param (see AWS.Request~send)\n * @context (see AWS.Request~send)\n *\n * @see AWS.Response\n */\nAWS.Request = inherit({\n\n /**\n * Creates a request for an operation on a given service with\n * a set of input parameters.\n *\n * @param service [AWS.Service] the service to perform the operation on\n * @param operation [String] the operation to perform on the service\n * @param params [Object] parameters to send to the operation.\n * See the operation's documentation for the format of the\n * parameters.\n */\n constructor: function Request(service, operation, params) {\n var endpoint = service.endpoint;\n var region = service.config.region;\n var customUserAgent = service.config.customUserAgent;\n\n if (service.isGlobalEndpoint) {\n if (service.signingRegion) {\n region = service.signingRegion;\n } else {\n region = 'us-east-1';\n }\n }\n\n this.domain = domain && domain.active;\n this.service = service;\n this.operation = operation;\n this.params = params || {};\n this.httpRequest = new AWS.HttpRequest(endpoint, region);\n this.httpRequest.appendToUserAgent(customUserAgent);\n this.startTime = service.getSkewCorrectedDate();\n\n this.response = new AWS.Response(this);\n this._asm = new AcceptorStateMachine(fsm.states, 'validate');\n this._haltHandlersOnError = false;\n\n AWS.SequentialExecutor.call(this);\n this.emit = this.emitEvent;\n },\n\n /**\n * @!group Sending a Request\n */\n\n /**\n * @overload send(callback = null)\n * Sends the request object.\n *\n * @callback callback function(err, data)\n * If a callback is supplied, it is called when a response is returned\n * from the service.\n * @context [AWS.Request] the request object being sent.\n * @param err [Error] the error object returned from the request.\n * Set to `null` if the request is successful.\n * @param data [Object] the de-serialized data returned from\n * the request. Set to `null` if a request error occurs.\n * @example Sending a request with a callback\n * request = s3.putObject({Bucket: 'bucket', Key: 'key'});\n * request.send(function(err, data) { console.log(err, data); });\n * @example Sending a request with no callback (using event handlers)\n * request = s3.putObject({Bucket: 'bucket', Key: 'key'});\n * request.on('complete', function(response) { ... }); // register a callback\n * request.send();\n */\n send: function send(callback) {\n if (callback) {\n // append to user agent\n this.httpRequest.appendToUserAgent('callback');\n this.on('complete', function (resp) {\n callback.call(resp, resp.error, resp.data);\n });\n }\n this.runTo();\n\n return this.response;\n },\n\n /**\n * @!method promise()\n * Sends the request and returns a 'thenable' promise.\n *\n * Two callbacks can be provided to the `then` method on the returned promise.\n * The first callback will be called if the promise is fulfilled, and the second\n * callback will be called if the promise is rejected.\n * @callback fulfilledCallback function(data)\n * Called if the promise is fulfilled.\n * @param data [Object] the de-serialized data returned from the request.\n * @callback rejectedCallback function(error)\n * Called if the promise is rejected.\n * @param error [Error] the error object returned from the request.\n * @return [Promise] A promise that represents the state of the request.\n * @example Sending a request using promises.\n * var request = s3.putObject({Bucket: 'bucket', Key: 'key'});\n * var result = request.promise();\n * result.then(function(data) { ... }, function(error) { ... });\n */\n\n /**\n * @api private\n */\n build: function build(callback) {\n return this.runTo('send', callback);\n },\n\n /**\n * @api private\n */\n runTo: function runTo(state, done) {\n this._asm.runTo(state, done, this);\n return this;\n },\n\n /**\n * Aborts a request, emitting the error and complete events.\n *\n * @!macro nobrowser\n * @example Aborting a request after sending\n * var params = {\n * Bucket: 'bucket', Key: 'key',\n * Body: Buffer.alloc(1024 * 1024 * 5) // 5MB payload\n * };\n * var request = s3.putObject(params);\n * request.send(function (err, data) {\n * if (err) console.log(\"Error:\", err.code, err.message);\n * else console.log(data);\n * });\n *\n * // abort request in 1 second\n * setTimeout(request.abort.bind(request), 1000);\n *\n * // prints \"Error: RequestAbortedError Request aborted by user\"\n * @return [AWS.Request] the same request object, for chaining.\n * @since v1.4.0\n */\n abort: function abort() {\n this.removeAllListeners('validateResponse');\n this.removeAllListeners('extractError');\n this.on('validateResponse', function addAbortedError(resp) {\n resp.error = AWS.util.error(new Error('Request aborted by user'), {\n code: 'RequestAbortedError', retryable: false\n });\n });\n\n if (this.httpRequest.stream && !this.httpRequest.stream.didCallback) { // abort HTTP stream\n this.httpRequest.stream.abort();\n if (this.httpRequest._abortCallback) {\n this.httpRequest._abortCallback();\n } else {\n this.removeAllListeners('send'); // haven't sent yet, so let's not\n }\n }\n\n return this;\n },\n\n /**\n * Iterates over each page of results given a pageable request, calling\n * the provided callback with each page of data. After all pages have been\n * retrieved, the callback is called with `null` data.\n *\n * @note This operation can generate multiple requests to a service.\n * @example Iterating over multiple pages of objects in an S3 bucket\n * var pages = 1;\n * s3.listObjects().eachPage(function(err, data) {\n * if (err) return;\n * console.log(\"Page\", pages++);\n * console.log(data);\n * });\n * @example Iterating over multiple pages with an asynchronous callback\n * s3.listObjects(params).eachPage(function(err, data, done) {\n * doSomethingAsyncAndOrExpensive(function() {\n * // The next page of results isn't fetched until done is called\n * done();\n * });\n * });\n * @callback callback function(err, data, [doneCallback])\n * Called with each page of resulting data from the request. If the\n * optional `doneCallback` is provided in the function, it must be called\n * when the callback is complete.\n *\n * @param err [Error] an error object, if an error occurred.\n * @param data [Object] a single page of response data. If there is no\n * more data, this object will be `null`.\n * @param doneCallback [Function] an optional done callback. If this\n * argument is defined in the function declaration, it should be called\n * when the next page is ready to be retrieved. This is useful for\n * controlling serial pagination across asynchronous operations.\n * @return [Boolean] if the callback returns `false`, pagination will\n * stop.\n *\n * @see AWS.Request.eachItem\n * @see AWS.Response.nextPage\n * @since v1.4.0\n */\n eachPage: function eachPage(callback) {\n // Make all callbacks async-ish\n callback = AWS.util.fn.makeAsync(callback, 3);\n\n function wrappedCallback(response) {\n callback.call(response, response.error, response.data, function (result) {\n if (result === false) return;\n\n if (response.hasNextPage()) {\n response.nextPage().on('complete', wrappedCallback).send();\n } else {\n callback.call(response, null, null, AWS.util.fn.noop);\n }\n });\n }\n\n this.on('complete', wrappedCallback).send();\n },\n\n /**\n * Enumerates over individual items of a request, paging the responses if\n * necessary.\n *\n * @api experimental\n * @since v1.4.0\n */\n eachItem: function eachItem(callback) {\n var self = this;\n function wrappedCallback(err, data) {\n if (err) return callback(err, null);\n if (data === null) return callback(null, null);\n\n var config = self.service.paginationConfig(self.operation);\n var resultKey = config.resultKey;\n if (Array.isArray(resultKey)) resultKey = resultKey[0];\n var items = jmespath.search(data, resultKey);\n var continueIteration = true;\n AWS.util.arrayEach(items, function(item) {\n continueIteration = callback(null, item);\n if (continueIteration === false) {\n return AWS.util.abort;\n }\n });\n return continueIteration;\n }\n\n this.eachPage(wrappedCallback);\n },\n\n /**\n * @return [Boolean] whether the operation can return multiple pages of\n * response data.\n * @see AWS.Response.eachPage\n * @since v1.4.0\n */\n isPageable: function isPageable() {\n return this.service.paginationConfig(this.operation) ? true : false;\n },\n\n /**\n * Sends the request and converts the request object into a readable stream\n * that can be read from or piped into a writable stream.\n *\n * @note The data read from a readable stream contains only\n * the raw HTTP body contents.\n * @example Manually reading from a stream\n * request.createReadStream().on('data', function(data) {\n * console.log(\"Got data:\", data.toString());\n * });\n * @example Piping a request body into a file\n * var out = fs.createWriteStream('/path/to/outfile.jpg');\n * s3.service.getObject(params).createReadStream().pipe(out);\n * @return [Stream] the readable stream object that can be piped\n * or read from (by registering 'data' event listeners).\n * @!macro nobrowser\n */\n createReadStream: function createReadStream() {\n var streams = AWS.util.stream;\n var req = this;\n var stream = null;\n\n if (AWS.HttpClient.streamsApiVersion === 2) {\n stream = new streams.PassThrough();\n process.nextTick(function() { req.send(); });\n } else {\n stream = new streams.Stream();\n stream.readable = true;\n\n stream.sent = false;\n stream.on('newListener', function(event) {\n if (!stream.sent && event === 'data') {\n stream.sent = true;\n process.nextTick(function() { req.send(); });\n }\n });\n }\n\n this.on('error', function(err) {\n stream.emit('error', err);\n });\n\n this.on('httpHeaders', function streamHeaders(statusCode, headers, resp) {\n if (statusCode < 300) {\n req.removeListener('httpData', AWS.EventListeners.Core.HTTP_DATA);\n req.removeListener('httpError', AWS.EventListeners.Core.HTTP_ERROR);\n req.on('httpError', function streamHttpError(error) {\n resp.error = error;\n resp.error.retryable = false;\n });\n\n var shouldCheckContentLength = false;\n var expectedLen;\n if (req.httpRequest.method !== 'HEAD') {\n expectedLen = parseInt(headers['content-length'], 10);\n }\n if (expectedLen !== undefined && !isNaN(expectedLen) && expectedLen >= 0) {\n shouldCheckContentLength = true;\n var receivedLen = 0;\n }\n\n var checkContentLengthAndEmit = function checkContentLengthAndEmit() {\n if (shouldCheckContentLength && receivedLen !== expectedLen) {\n stream.emit('error', AWS.util.error(\n new Error('Stream content length mismatch. Received ' +\n receivedLen + ' of ' + expectedLen + ' bytes.'),\n { code: 'StreamContentLengthMismatch' }\n ));\n } else if (AWS.HttpClient.streamsApiVersion === 2) {\n stream.end();\n } else {\n stream.emit('end');\n }\n };\n\n var httpStream = resp.httpResponse.createUnbufferedStream();\n\n if (AWS.HttpClient.streamsApiVersion === 2) {\n if (shouldCheckContentLength) {\n var lengthAccumulator = new streams.PassThrough();\n lengthAccumulator._write = function(chunk) {\n if (chunk && chunk.length) {\n receivedLen += chunk.length;\n }\n return streams.PassThrough.prototype._write.apply(this, arguments);\n };\n\n lengthAccumulator.on('end', checkContentLengthAndEmit);\n stream.on('error', function(err) {\n shouldCheckContentLength = false;\n httpStream.unpipe(lengthAccumulator);\n lengthAccumulator.emit('end');\n lengthAccumulator.end();\n });\n httpStream.pipe(lengthAccumulator).pipe(stream, { end: false });\n } else {\n httpStream.pipe(stream);\n }\n } else {\n\n if (shouldCheckContentLength) {\n httpStream.on('data', function(arg) {\n if (arg && arg.length) {\n receivedLen += arg.length;\n }\n });\n }\n\n httpStream.on('data', function(arg) {\n stream.emit('data', arg);\n });\n httpStream.on('end', checkContentLengthAndEmit);\n }\n\n httpStream.on('error', function(err) {\n shouldCheckContentLength = false;\n stream.emit('error', err);\n });\n }\n });\n\n return stream;\n },\n\n /**\n * @param [Array,Response] args This should be the response object,\n * or an array of args to send to the event.\n * @api private\n */\n emitEvent: function emit(eventName, args, done) {\n if (typeof args === 'function') { done = args; args = null; }\n if (!done) done = function() { };\n if (!args) args = this.eventParameters(eventName, this.response);\n\n var origEmit = AWS.SequentialExecutor.prototype.emit;\n origEmit.call(this, eventName, args, function (err) {\n if (err) this.response.error = err;\n done.call(this, err);\n });\n },\n\n /**\n * @api private\n */\n eventParameters: function eventParameters(eventName) {\n switch (eventName) {\n case 'restart':\n case 'validate':\n case 'sign':\n case 'build':\n case 'afterValidate':\n case 'afterBuild':\n return [this];\n case 'error':\n return [this.response.error, this.response];\n default:\n return [this.response];\n }\n },\n\n /**\n * @api private\n */\n presign: function presign(expires, callback) {\n if (!callback && typeof expires === 'function') {\n callback = expires;\n expires = null;\n }\n return new AWS.Signers.Presign().sign(this.toGet(), expires, callback);\n },\n\n /**\n * @api private\n */\n isPresigned: function isPresigned() {\n return Object.prototype.hasOwnProperty.call(this.httpRequest.headers, 'presigned-expires');\n },\n\n /**\n * @api private\n */\n toUnauthenticated: function toUnauthenticated() {\n this._unAuthenticated = true;\n this.removeListener('validate', AWS.EventListeners.Core.VALIDATE_CREDENTIALS);\n this.removeListener('sign', AWS.EventListeners.Core.SIGN);\n return this;\n },\n\n /**\n * @api private\n */\n toGet: function toGet() {\n if (this.service.api.protocol === 'query' ||\n this.service.api.protocol === 'ec2') {\n this.removeListener('build', this.buildAsGet);\n this.addListener('build', this.buildAsGet);\n }\n return this;\n },\n\n /**\n * @api private\n */\n buildAsGet: function buildAsGet(request) {\n request.httpRequest.method = 'GET';\n request.httpRequest.path = request.service.endpoint.path +\n '?' + request.httpRequest.body;\n request.httpRequest.body = '';\n\n // don't need these headers on a GET request\n delete request.httpRequest.headers['Content-Length'];\n delete request.httpRequest.headers['Content-Type'];\n },\n\n /**\n * @api private\n */\n haltHandlersOnError: function haltHandlersOnError() {\n this._haltHandlersOnError = true;\n }\n});\n\n/**\n * @api private\n */\nAWS.Request.addPromisesToClass = function addPromisesToClass(PromiseDependency) {\n this.prototype.promise = function promise() {\n var self = this;\n // append to user agent\n this.httpRequest.appendToUserAgent('promise');\n return new PromiseDependency(function(resolve, reject) {\n self.on('complete', function(resp) {\n if (resp.error) {\n reject(resp.error);\n } else {\n // define $response property so that it is not enumerable\n // this prevents circular reference errors when stringifying the JSON object\n resolve(Object.defineProperty(\n resp.data || {},\n '$response',\n {value: resp}\n ));\n }\n });\n self.runTo();\n });\n };\n};\n\n/**\n * @api private\n */\nAWS.Request.deletePromisesFromClass = function deletePromisesFromClass() {\n delete this.prototype.promise;\n};\n\nAWS.util.addPromises(AWS.Request);\n\nAWS.util.mixin(AWS.Request, AWS.SequentialExecutor);\n","/**\n * Copyright 2012-2013 Amazon.com, Inc. or its affiliates. All Rights Reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\"). You\n * may not use this file except in compliance with the License. A copy of\n * the License is located at\n *\n * http://aws.amazon.com/apache2.0/\n *\n * or in the \"license\" file accompanying this file. This file is\n * distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF\n * ANY KIND, either express or implied. See the License for the specific\n * language governing permissions and limitations under the License.\n */\n\nvar AWS = require('./core');\nvar inherit = AWS.util.inherit;\nvar jmespath = require('jmespath');\n\n/**\n * @api private\n */\nfunction CHECK_ACCEPTORS(resp) {\n var waiter = resp.request._waiter;\n var acceptors = waiter.config.acceptors;\n var acceptorMatched = false;\n var state = 'retry';\n\n acceptors.forEach(function(acceptor) {\n if (!acceptorMatched) {\n var matcher = waiter.matchers[acceptor.matcher];\n if (matcher && matcher(resp, acceptor.expected, acceptor.argument)) {\n acceptorMatched = true;\n state = acceptor.state;\n }\n }\n });\n\n if (!acceptorMatched && resp.error) state = 'failure';\n\n if (state === 'success') {\n waiter.setSuccess(resp);\n } else {\n waiter.setError(resp, state === 'retry');\n }\n}\n\n/**\n * @api private\n */\nAWS.ResourceWaiter = inherit({\n /**\n * Waits for a given state on a service object\n * @param service [Service] the service object to wait on\n * @param state [String] the state (defined in waiter configuration) to wait\n * for.\n * @example Create a waiter for running EC2 instances\n * var ec2 = new AWS.EC2;\n * var waiter = new AWS.ResourceWaiter(ec2, 'instanceRunning');\n */\n constructor: function constructor(service, state) {\n this.service = service;\n this.state = state;\n this.loadWaiterConfig(this.state);\n },\n\n service: null,\n\n state: null,\n\n config: null,\n\n matchers: {\n path: function(resp, expected, argument) {\n try {\n var result = jmespath.search(resp.data, argument);\n } catch (err) {\n return false;\n }\n\n return jmespath.strictDeepEqual(result,expected);\n },\n\n pathAll: function(resp, expected, argument) {\n try {\n var results = jmespath.search(resp.data, argument);\n } catch (err) {\n return false;\n }\n\n if (!Array.isArray(results)) results = [results];\n var numResults = results.length;\n if (!numResults) return false;\n for (var ind = 0 ; ind < numResults; ind++) {\n if (!jmespath.strictDeepEqual(results[ind], expected)) {\n return false;\n }\n }\n return true;\n },\n\n pathAny: function(resp, expected, argument) {\n try {\n var results = jmespath.search(resp.data, argument);\n } catch (err) {\n return false;\n }\n\n if (!Array.isArray(results)) results = [results];\n var numResults = results.length;\n for (var ind = 0 ; ind < numResults; ind++) {\n if (jmespath.strictDeepEqual(results[ind], expected)) {\n return true;\n }\n }\n return false;\n },\n\n status: function(resp, expected) {\n var statusCode = resp.httpResponse.statusCode;\n return (typeof statusCode === 'number') && (statusCode === expected);\n },\n\n error: function(resp, expected) {\n if (typeof expected === 'string' && resp.error) {\n return expected === resp.error.code;\n }\n // if expected is not string, can be boolean indicating presence of error\n return expected === !!resp.error;\n }\n },\n\n listeners: new AWS.SequentialExecutor().addNamedListeners(function(add) {\n add('RETRY_CHECK', 'retry', function(resp) {\n var waiter = resp.request._waiter;\n if (resp.error && resp.error.code === 'ResourceNotReady') {\n resp.error.retryDelay = (waiter.config.delay || 0) * 1000;\n }\n });\n\n add('CHECK_OUTPUT', 'extractData', CHECK_ACCEPTORS);\n\n add('CHECK_ERROR', 'extractError', CHECK_ACCEPTORS);\n }),\n\n /**\n * @return [AWS.Request]\n */\n wait: function wait(params, callback) {\n if (typeof params === 'function') {\n callback = params; params = undefined;\n }\n\n if (params && params.$waiter) {\n params = AWS.util.copy(params);\n if (typeof params.$waiter.delay === 'number') {\n this.config.delay = params.$waiter.delay;\n }\n if (typeof params.$waiter.maxAttempts === 'number') {\n this.config.maxAttempts = params.$waiter.maxAttempts;\n }\n delete params.$waiter;\n }\n\n var request = this.service.makeRequest(this.config.operation, params);\n request._waiter = this;\n request.response.maxRetries = this.config.maxAttempts;\n request.addListeners(this.listeners);\n\n if (callback) request.send(callback);\n return request;\n },\n\n setSuccess: function setSuccess(resp) {\n resp.error = null;\n resp.data = resp.data || {};\n resp.request.removeAllListeners('extractData');\n },\n\n setError: function setError(resp, retryable) {\n resp.data = null;\n resp.error = AWS.util.error(resp.error || new Error(), {\n code: 'ResourceNotReady',\n message: 'Resource is not in the state ' + this.state,\n retryable: retryable\n });\n },\n\n /**\n * Loads waiter configuration from API configuration\n *\n * @api private\n */\n loadWaiterConfig: function loadWaiterConfig(state) {\n if (!this.service.api.waiters[state]) {\n throw new AWS.util.error(new Error(), {\n code: 'StateNotFoundError',\n message: 'State ' + state + ' not found.'\n });\n }\n\n this.config = AWS.util.copy(this.service.api.waiters[state]);\n }\n});\n","var AWS = require('./core');\nvar inherit = AWS.util.inherit;\nvar jmespath = require('jmespath');\n\n/**\n * This class encapsulates the response information\n * from a service request operation sent through {AWS.Request}.\n * The response object has two main properties for getting information\n * back from a request:\n *\n * ## The `data` property\n *\n * The `response.data` property contains the serialized object data\n * retrieved from the service request. For instance, for an\n * Amazon DynamoDB `listTables` method call, the response data might\n * look like:\n *\n * ```\n * > resp.data\n * { TableNames:\n * [ 'table1', 'table2', ... ] }\n * ```\n *\n * The `data` property can be null if an error occurs (see below).\n *\n * ## The `error` property\n *\n * In the event of a service error (or transfer error), the\n * `response.error` property will be filled with the given\n * error data in the form:\n *\n * ```\n * { code: 'SHORT_UNIQUE_ERROR_CODE',\n * message: 'Some human readable error message' }\n * ```\n *\n * In the case of an error, the `data` property will be `null`.\n * Note that if you handle events that can be in a failure state,\n * you should always check whether `response.error` is set\n * before attempting to access the `response.data` property.\n *\n * @!attribute data\n * @readonly\n * @!group Data Properties\n * @note Inside of a {AWS.Request~httpData} event, this\n * property contains a single raw packet instead of the\n * full de-serialized service response.\n * @return [Object] the de-serialized response data\n * from the service.\n *\n * @!attribute error\n * An structure containing information about a service\n * or networking error.\n * @readonly\n * @!group Data Properties\n * @note This attribute is only filled if a service or\n * networking error occurs.\n * @return [Error]\n * * code [String] a unique short code representing the\n * error that was emitted.\n * * message [String] a longer human readable error message\n * * retryable [Boolean] whether the error message is\n * retryable.\n * * statusCode [Numeric] in the case of a request that reached the service,\n * this value contains the response status code.\n * * time [Date] the date time object when the error occurred.\n * * hostname [String] set when a networking error occurs to easily\n * identify the endpoint of the request.\n * * region [String] set when a networking error occurs to easily\n * identify the region of the request.\n *\n * @!attribute requestId\n * @readonly\n * @!group Data Properties\n * @return [String] the unique request ID associated with the response.\n * Log this value when debugging requests for AWS support.\n *\n * @!attribute retryCount\n * @readonly\n * @!group Operation Properties\n * @return [Integer] the number of retries that were\n * attempted before the request was completed.\n *\n * @!attribute redirectCount\n * @readonly\n * @!group Operation Properties\n * @return [Integer] the number of redirects that were\n * followed before the request was completed.\n *\n * @!attribute httpResponse\n * @readonly\n * @!group HTTP Properties\n * @return [AWS.HttpResponse] the raw HTTP response object\n * containing the response headers and body information\n * from the server.\n *\n * @see AWS.Request\n */\nAWS.Response = inherit({\n\n /**\n * @api private\n */\n constructor: function Response(request) {\n this.request = request;\n this.data = null;\n this.error = null;\n this.retryCount = 0;\n this.redirectCount = 0;\n this.httpResponse = new AWS.HttpResponse();\n if (request) {\n this.maxRetries = request.service.numRetries();\n this.maxRedirects = request.service.config.maxRedirects;\n }\n },\n\n /**\n * Creates a new request for the next page of response data, calling the\n * callback with the page data if a callback is provided.\n *\n * @callback callback function(err, data)\n * Called when a page of data is returned from the next request.\n *\n * @param err [Error] an error object, if an error occurred in the request\n * @param data [Object] the next page of data, or null, if there are no\n * more pages left.\n * @return [AWS.Request] the request object for the next page of data\n * @return [null] if no callback is provided and there are no pages left\n * to retrieve.\n * @since v1.4.0\n */\n nextPage: function nextPage(callback) {\n var config;\n var service = this.request.service;\n var operation = this.request.operation;\n try {\n config = service.paginationConfig(operation, true);\n } catch (e) { this.error = e; }\n\n if (!this.hasNextPage()) {\n if (callback) callback(this.error, null);\n else if (this.error) throw this.error;\n return null;\n }\n\n var params = AWS.util.copy(this.request.params);\n if (!this.nextPageTokens) {\n return callback ? callback(null, null) : null;\n } else {\n var inputTokens = config.inputToken;\n if (typeof inputTokens === 'string') inputTokens = [inputTokens];\n for (var i = 0; i < inputTokens.length; i++) {\n params[inputTokens[i]] = this.nextPageTokens[i];\n }\n return service.makeRequest(this.request.operation, params, callback);\n }\n },\n\n /**\n * @return [Boolean] whether more pages of data can be returned by further\n * requests\n * @since v1.4.0\n */\n hasNextPage: function hasNextPage() {\n this.cacheNextPageTokens();\n if (this.nextPageTokens) return true;\n if (this.nextPageTokens === undefined) return undefined;\n else return false;\n },\n\n /**\n * @api private\n */\n cacheNextPageTokens: function cacheNextPageTokens() {\n if (Object.prototype.hasOwnProperty.call(this, 'nextPageTokens')) return this.nextPageTokens;\n this.nextPageTokens = undefined;\n\n var config = this.request.service.paginationConfig(this.request.operation);\n if (!config) return this.nextPageTokens;\n\n this.nextPageTokens = null;\n if (config.moreResults) {\n if (!jmespath.search(this.data, config.moreResults)) {\n return this.nextPageTokens;\n }\n }\n\n var exprs = config.outputToken;\n if (typeof exprs === 'string') exprs = [exprs];\n AWS.util.arrayEach.call(this, exprs, function (expr) {\n var output = jmespath.search(this.data, expr);\n if (output) {\n this.nextPageTokens = this.nextPageTokens || [];\n this.nextPageTokens.push(output);\n }\n });\n\n return this.nextPageTokens;\n }\n\n});\n","var AWS = require('../core');\nvar byteLength = AWS.util.string.byteLength;\nvar Buffer = AWS.util.Buffer;\n\n/**\n * The managed uploader allows for easy and efficient uploading of buffers,\n * blobs, or streams, using a configurable amount of concurrency to perform\n * multipart uploads where possible. This abstraction also enables uploading\n * streams of unknown size due to the use of multipart uploads.\n *\n * To construct a managed upload object, see the {constructor} function.\n *\n * ## Tracking upload progress\n *\n * The managed upload object can also track progress by attaching an\n * 'httpUploadProgress' listener to the upload manager. This event is similar\n * to {AWS.Request~httpUploadProgress} but groups all concurrent upload progress\n * into a single event. See {AWS.S3.ManagedUpload~httpUploadProgress} for more\n * information.\n *\n * ## Handling Multipart Cleanup\n *\n * By default, this class will automatically clean up any multipart uploads\n * when an individual part upload fails. This behavior can be disabled in order\n * to manually handle failures by setting the `leavePartsOnError` configuration\n * option to `true` when initializing the upload object.\n *\n * @!event httpUploadProgress(progress)\n * Triggered when the uploader has uploaded more data.\n * @note The `total` property may not be set if the stream being uploaded has\n * not yet finished chunking. In this case the `total` will be undefined\n * until the total stream size is known.\n * @note This event will not be emitted in Node.js 0.8.x.\n * @param progress [map] An object containing the `loaded` and `total` bytes\n * of the request and the `key` of the S3 object. Note that `total` may be undefined until the payload\n * size is known.\n * @context (see AWS.Request~send)\n */\nAWS.S3.ManagedUpload = AWS.util.inherit({\n /**\n * Creates a managed upload object with a set of configuration options.\n *\n * @note A \"Body\" parameter is required to be set prior to calling {send}.\n * @note In Node.js, sending \"Body\" as {https://nodejs.org/dist/latest/docs/api/stream.html#stream_object_mode object-mode stream}\n * may result in upload hangs. Using buffer stream is preferable.\n * @option options params [map] a map of parameters to pass to the upload\n * requests. The \"Body\" parameter is required to be specified either on\n * the service or in the params option.\n * @note ContentMD5 should not be provided when using the managed upload object.\n * Instead, setting \"computeChecksums\" to true will enable automatic ContentMD5 generation\n * by the managed upload object.\n * @option options queueSize [Number] (4) the size of the concurrent queue\n * manager to upload parts in parallel. Set to 1 for synchronous uploading\n * of parts. Note that the uploader will buffer at most queueSize * partSize\n * bytes into memory at any given time.\n * @option options partSize [Number] (5mb) the size in bytes for each\n * individual part to be uploaded. Adjust the part size to ensure the number\n * of parts does not exceed {maxTotalParts}. See {minPartSize} for the\n * minimum allowed part size.\n * @option options leavePartsOnError [Boolean] (false) whether to abort the\n * multipart upload if an error occurs. Set to true if you want to handle\n * failures manually.\n * @option options service [AWS.S3] an optional S3 service object to use for\n * requests. This object might have bound parameters used by the uploader.\n * @option options tags [Array] The tags to apply to the uploaded object.\n * Each tag should have a `Key` and `Value` keys.\n * @example Creating a default uploader for a stream object\n * var upload = new AWS.S3.ManagedUpload({\n * params: {Bucket: 'bucket', Key: 'key', Body: stream}\n * });\n * @example Creating an uploader with concurrency of 1 and partSize of 10mb\n * var upload = new AWS.S3.ManagedUpload({\n * partSize: 10 * 1024 * 1024, queueSize: 1,\n * params: {Bucket: 'bucket', Key: 'key', Body: stream}\n * });\n * @example Creating an uploader with tags\n * var upload = new AWS.S3.ManagedUpload({\n * params: {Bucket: 'bucket', Key: 'key', Body: stream},\n * tags: [{Key: 'tag1', Value: 'value1'}, {Key: 'tag2', Value: 'value2'}]\n * });\n * @see send\n */\n constructor: function ManagedUpload(options) {\n var self = this;\n AWS.SequentialExecutor.call(self);\n self.body = null;\n self.sliceFn = null;\n self.callback = null;\n self.parts = {};\n self.completeInfo = [];\n self.fillQueue = function() {\n self.callback(new Error('Unsupported body payload ' + typeof self.body));\n };\n\n self.configure(options);\n },\n\n /**\n * @api private\n */\n configure: function configure(options) {\n options = options || {};\n this.partSize = this.minPartSize;\n\n if (options.queueSize) this.queueSize = options.queueSize;\n if (options.partSize) this.partSize = options.partSize;\n if (options.leavePartsOnError) this.leavePartsOnError = true;\n if (options.tags) {\n if (!Array.isArray(options.tags)) {\n throw new Error('Tags must be specified as an array; ' +\n typeof options.tags + ' provided.');\n }\n this.tags = options.tags;\n }\n\n if (this.partSize < this.minPartSize) {\n throw new Error('partSize must be greater than ' +\n this.minPartSize);\n }\n\n this.service = options.service;\n this.bindServiceObject(options.params);\n this.validateBody();\n this.adjustTotalBytes();\n },\n\n /**\n * @api private\n */\n leavePartsOnError: false,\n\n /**\n * @api private\n */\n queueSize: 4,\n\n /**\n * @api private\n */\n partSize: null,\n\n /**\n * @readonly\n * @return [Number] the minimum number of bytes for an individual part\n * upload.\n */\n minPartSize: 1024 * 1024 * 5,\n\n /**\n * @readonly\n * @return [Number] the maximum allowed number of parts in a multipart upload.\n */\n maxTotalParts: 10000,\n\n /**\n * Initiates the managed upload for the payload.\n *\n * @callback callback function(err, data)\n * @param err [Error] an error or null if no error occurred.\n * @param data [map] The response data from the successful upload:\n * * `Location` (String) the URL of the uploaded object\n * * `ETag` (String) the ETag of the uploaded object\n * * `Bucket` (String) the bucket to which the object was uploaded\n * * `Key` (String) the key to which the object was uploaded\n * @example Sending a managed upload object\n * var params = {Bucket: 'bucket', Key: 'key', Body: stream};\n * var upload = new AWS.S3.ManagedUpload({params: params});\n * upload.send(function(err, data) {\n * console.log(err, data);\n * });\n */\n send: function(callback) {\n var self = this;\n self.failed = false;\n self.callback = callback || function(err) { if (err) throw err; };\n\n var runFill = true;\n if (self.sliceFn) {\n self.fillQueue = self.fillBuffer;\n } else if (AWS.util.isNode()) {\n var Stream = AWS.util.stream.Stream;\n if (self.body instanceof Stream) {\n runFill = false;\n self.fillQueue = self.fillStream;\n self.partBuffers = [];\n self.body.\n on('error', function(err) { self.cleanup(err); }).\n on('readable', function() { self.fillQueue(); }).\n on('end', function() {\n self.isDoneChunking = true;\n self.numParts = self.totalPartNumbers;\n self.fillQueue.call(self);\n\n if (self.isDoneChunking && self.totalPartNumbers >= 1 && self.doneParts === self.numParts) {\n self.finishMultiPart();\n }\n });\n }\n }\n\n if (runFill) self.fillQueue.call(self);\n },\n\n /**\n * @!method promise()\n * Returns a 'thenable' promise.\n *\n * Two callbacks can be provided to the `then` method on the returned promise.\n * The first callback will be called if the promise is fulfilled, and the second\n * callback will be called if the promise is rejected.\n * @callback fulfilledCallback function(data)\n * Called if the promise is fulfilled.\n * @param data [map] The response data from the successful upload:\n * `Location` (String) the URL of the uploaded object\n * `ETag` (String) the ETag of the uploaded object\n * `Bucket` (String) the bucket to which the object was uploaded\n * `Key` (String) the key to which the object was uploaded\n * @callback rejectedCallback function(err)\n * Called if the promise is rejected.\n * @param err [Error] an error or null if no error occurred.\n * @return [Promise] A promise that represents the state of the upload request.\n * @example Sending an upload request using promises.\n * var upload = s3.upload({Bucket: 'bucket', Key: 'key', Body: stream});\n * var promise = upload.promise();\n * promise.then(function(data) { ... }, function(err) { ... });\n */\n\n /**\n * Aborts a managed upload, including all concurrent upload requests.\n * @note By default, calling this function will cleanup a multipart upload\n * if one was created. To leave the multipart upload around after aborting\n * a request, configure `leavePartsOnError` to `true` in the {constructor}.\n * @note Calling {abort} in the browser environment will not abort any requests\n * that are already in flight. If a multipart upload was created, any parts\n * not yet uploaded will not be sent, and the multipart upload will be cleaned up.\n * @example Aborting an upload\n * var params = {\n * Bucket: 'bucket', Key: 'key',\n * Body: Buffer.alloc(1024 * 1024 * 25) // 25MB payload\n * };\n * var upload = s3.upload(params);\n * upload.send(function (err, data) {\n * if (err) console.log(\"Error:\", err.code, err.message);\n * else console.log(data);\n * });\n *\n * // abort request in 1 second\n * setTimeout(upload.abort.bind(upload), 1000);\n */\n abort: function() {\n var self = this;\n //abort putObject request\n if (self.isDoneChunking === true && self.totalPartNumbers === 1 && self.singlePart) {\n self.singlePart.abort();\n } else {\n self.cleanup(AWS.util.error(new Error('Request aborted by user'), {\n code: 'RequestAbortedError', retryable: false\n }));\n }\n },\n\n /**\n * @api private\n */\n validateBody: function validateBody() {\n var self = this;\n self.body = self.service.config.params.Body;\n if (typeof self.body === 'string') {\n self.body = AWS.util.buffer.toBuffer(self.body);\n } else if (!self.body) {\n throw new Error('params.Body is required');\n }\n self.sliceFn = AWS.util.arraySliceFn(self.body);\n },\n\n /**\n * @api private\n */\n bindServiceObject: function bindServiceObject(params) {\n params = params || {};\n var self = this;\n // bind parameters to new service object\n if (!self.service) {\n self.service = new AWS.S3({params: params});\n } else {\n // Create a new S3 client from the supplied client's constructor.\n var service = self.service;\n var config = AWS.util.copy(service.config);\n config.signatureVersion = service.getSignatureVersion();\n self.service = new service.constructor.__super__(config);\n self.service.config.params =\n AWS.util.merge(self.service.config.params || {}, params);\n Object.defineProperty(self.service, '_originalConfig', {\n get: function() { return service._originalConfig; },\n enumerable: false,\n configurable: true\n });\n }\n },\n\n /**\n * @api private\n */\n adjustTotalBytes: function adjustTotalBytes() {\n var self = this;\n try { // try to get totalBytes\n self.totalBytes = byteLength(self.body);\n } catch (e) { }\n\n // try to adjust partSize if we know payload length\n if (self.totalBytes) {\n var newPartSize = Math.ceil(self.totalBytes / self.maxTotalParts);\n if (newPartSize > self.partSize) self.partSize = newPartSize;\n } else {\n self.totalBytes = undefined;\n }\n },\n\n /**\n * @api private\n */\n isDoneChunking: false,\n\n /**\n * @api private\n */\n partPos: 0,\n\n /**\n * @api private\n */\n totalChunkedBytes: 0,\n\n /**\n * @api private\n */\n totalUploadedBytes: 0,\n\n /**\n * @api private\n */\n totalBytes: undefined,\n\n /**\n * @api private\n */\n numParts: 0,\n\n /**\n * @api private\n */\n totalPartNumbers: 0,\n\n /**\n * @api private\n */\n activeParts: 0,\n\n /**\n * @api private\n */\n doneParts: 0,\n\n /**\n * @api private\n */\n parts: null,\n\n /**\n * @api private\n */\n completeInfo: null,\n\n /**\n * @api private\n */\n failed: false,\n\n /**\n * @api private\n */\n multipartReq: null,\n\n /**\n * @api private\n */\n partBuffers: null,\n\n /**\n * @api private\n */\n partBufferLength: 0,\n\n /**\n * @api private\n */\n fillBuffer: function fillBuffer() {\n var self = this;\n var bodyLen = byteLength(self.body);\n\n if (bodyLen === 0) {\n self.isDoneChunking = true;\n self.numParts = 1;\n self.nextChunk(self.body);\n return;\n }\n\n while (self.activeParts < self.queueSize && self.partPos < bodyLen) {\n var endPos = Math.min(self.partPos + self.partSize, bodyLen);\n var buf = self.sliceFn.call(self.body, self.partPos, endPos);\n self.partPos += self.partSize;\n\n if (byteLength(buf) < self.partSize || self.partPos === bodyLen) {\n self.isDoneChunking = true;\n self.numParts = self.totalPartNumbers + 1;\n }\n self.nextChunk(buf);\n }\n },\n\n /**\n * @api private\n */\n fillStream: function fillStream() {\n var self = this;\n if (self.activeParts >= self.queueSize) return;\n\n var buf = self.body.read(self.partSize - self.partBufferLength) ||\n self.body.read();\n if (buf) {\n self.partBuffers.push(buf);\n self.partBufferLength += buf.length;\n self.totalChunkedBytes += buf.length;\n }\n\n if (self.partBufferLength >= self.partSize) {\n // if we have single buffer we avoid copyfull concat\n var pbuf = self.partBuffers.length === 1 ?\n self.partBuffers[0] : Buffer.concat(self.partBuffers);\n self.partBuffers = [];\n self.partBufferLength = 0;\n\n // if we have more than partSize, push the rest back on the queue\n if (pbuf.length > self.partSize) {\n var rest = pbuf.slice(self.partSize);\n self.partBuffers.push(rest);\n self.partBufferLength += rest.length;\n pbuf = pbuf.slice(0, self.partSize);\n }\n\n self.nextChunk(pbuf);\n }\n\n if (self.isDoneChunking && !self.isDoneSending) {\n // if we have single buffer we avoid copyfull concat\n pbuf = self.partBuffers.length === 1 ?\n self.partBuffers[0] : Buffer.concat(self.partBuffers);\n self.partBuffers = [];\n self.partBufferLength = 0;\n self.totalBytes = self.totalChunkedBytes;\n self.isDoneSending = true;\n\n if (self.numParts === 0 || pbuf.length > 0) {\n self.numParts++;\n self.nextChunk(pbuf);\n }\n }\n\n self.body.read(0);\n },\n\n /**\n * @api private\n */\n nextChunk: function nextChunk(chunk) {\n var self = this;\n if (self.failed) return null;\n\n var partNumber = ++self.totalPartNumbers;\n if (self.isDoneChunking && partNumber === 1) {\n var params = {Body: chunk};\n if (this.tags) {\n params.Tagging = this.getTaggingHeader();\n }\n var req = self.service.putObject(params);\n req._managedUpload = self;\n req.on('httpUploadProgress', self.progress).send(self.finishSinglePart);\n self.singlePart = req; //save the single part request\n return null;\n } else if (self.service.config.params.ContentMD5) {\n var err = AWS.util.error(new Error('The Content-MD5 you specified is invalid for multi-part uploads.'), {\n code: 'InvalidDigest', retryable: false\n });\n\n self.cleanup(err);\n return null;\n }\n\n if (self.completeInfo[partNumber] && self.completeInfo[partNumber].ETag !== null) {\n return null; // Already uploaded this part.\n }\n\n self.activeParts++;\n if (!self.service.config.params.UploadId) {\n\n if (!self.multipartReq) { // create multipart\n self.multipartReq = self.service.createMultipartUpload();\n self.multipartReq.on('success', function(resp) {\n self.service.config.params.UploadId = resp.data.UploadId;\n self.multipartReq = null;\n });\n self.queueChunks(chunk, partNumber);\n self.multipartReq.on('error', function(err) {\n self.cleanup(err);\n });\n self.multipartReq.send();\n } else {\n self.queueChunks(chunk, partNumber);\n }\n } else { // multipart is created, just send\n self.uploadPart(chunk, partNumber);\n }\n },\n\n /**\n * @api private\n */\n getTaggingHeader: function getTaggingHeader() {\n var kvPairStrings = [];\n for (var i = 0; i < this.tags.length; i++) {\n kvPairStrings.push(AWS.util.uriEscape(this.tags[i].Key) + '=' +\n AWS.util.uriEscape(this.tags[i].Value));\n }\n\n return kvPairStrings.join('&');\n },\n\n /**\n * @api private\n */\n uploadPart: function uploadPart(chunk, partNumber) {\n var self = this;\n\n var partParams = {\n Body: chunk,\n ContentLength: AWS.util.string.byteLength(chunk),\n PartNumber: partNumber\n };\n\n var partInfo = {ETag: null, PartNumber: partNumber};\n self.completeInfo[partNumber] = partInfo;\n\n var req = self.service.uploadPart(partParams);\n self.parts[partNumber] = req;\n req._lastUploadedBytes = 0;\n req._managedUpload = self;\n req.on('httpUploadProgress', self.progress);\n req.send(function(err, data) {\n delete self.parts[partParams.PartNumber];\n self.activeParts--;\n\n if (!err && (!data || !data.ETag)) {\n var message = 'No access to ETag property on response.';\n if (AWS.util.isBrowser()) {\n message += ' Check CORS configuration to expose ETag header.';\n }\n\n err = AWS.util.error(new Error(message), {\n code: 'ETagMissing', retryable: false\n });\n }\n if (err) return self.cleanup(err);\n //prevent sending part being returned twice (https://github.com/aws/aws-sdk-js/issues/2304)\n if (self.completeInfo[partNumber] && self.completeInfo[partNumber].ETag !== null) return null;\n partInfo.ETag = data.ETag;\n self.doneParts++;\n if (self.isDoneChunking && self.doneParts === self.numParts) {\n self.finishMultiPart();\n } else {\n self.fillQueue.call(self);\n }\n });\n },\n\n /**\n * @api private\n */\n queueChunks: function queueChunks(chunk, partNumber) {\n var self = this;\n self.multipartReq.on('success', function() {\n self.uploadPart(chunk, partNumber);\n });\n },\n\n /**\n * @api private\n */\n cleanup: function cleanup(err) {\n var self = this;\n if (self.failed) return;\n\n // clean up stream\n if (typeof self.body.removeAllListeners === 'function' &&\n typeof self.body.resume === 'function') {\n self.body.removeAllListeners('readable');\n self.body.removeAllListeners('end');\n self.body.resume();\n }\n\n // cleanup multipartReq listeners\n if (self.multipartReq) {\n self.multipartReq.removeAllListeners('success');\n self.multipartReq.removeAllListeners('error');\n self.multipartReq.removeAllListeners('complete');\n delete self.multipartReq;\n }\n\n if (self.service.config.params.UploadId && !self.leavePartsOnError) {\n self.service.abortMultipartUpload().send();\n } else if (self.leavePartsOnError) {\n self.isDoneChunking = false;\n }\n\n AWS.util.each(self.parts, function(partNumber, part) {\n part.removeAllListeners('complete');\n part.abort();\n });\n\n self.activeParts = 0;\n self.partPos = 0;\n self.numParts = 0;\n self.totalPartNumbers = 0;\n self.parts = {};\n self.failed = true;\n self.callback(err);\n },\n\n /**\n * @api private\n */\n finishMultiPart: function finishMultiPart() {\n var self = this;\n var completeParams = { MultipartUpload: { Parts: self.completeInfo.slice(1) } };\n self.service.completeMultipartUpload(completeParams, function(err, data) {\n if (err) {\n return self.cleanup(err);\n }\n\n if (data && typeof data.Location === 'string') {\n data.Location = data.Location.replace(/%2F/g, '/');\n }\n\n if (Array.isArray(self.tags)) {\n for (var i = 0; i < self.tags.length; i++) {\n self.tags[i].Value = String(self.tags[i].Value);\n }\n self.service.putObjectTagging(\n {Tagging: {TagSet: self.tags}},\n function(e, d) {\n if (e) {\n self.callback(e);\n } else {\n self.callback(e, data);\n }\n }\n );\n } else {\n self.callback(err, data);\n }\n });\n },\n\n /**\n * @api private\n */\n finishSinglePart: function finishSinglePart(err, data) {\n var upload = this.request._managedUpload;\n var httpReq = this.request.httpRequest;\n var endpoint = httpReq.endpoint;\n if (err) return upload.callback(err);\n data.Location =\n [endpoint.protocol, '//', endpoint.host, httpReq.path].join('');\n data.key = this.request.params.Key; // will stay undocumented\n data.Key = this.request.params.Key;\n data.Bucket = this.request.params.Bucket;\n upload.callback(err, data);\n },\n\n /**\n * @api private\n */\n progress: function progress(info) {\n var upload = this._managedUpload;\n if (this.operation === 'putObject') {\n info.part = 1;\n info.key = this.params.Key;\n } else {\n upload.totalUploadedBytes += info.loaded - this._lastUploadedBytes;\n this._lastUploadedBytes = info.loaded;\n info = {\n loaded: upload.totalUploadedBytes,\n total: upload.totalBytes,\n part: this.params.PartNumber,\n key: this.params.Key\n };\n }\n upload.emit('httpUploadProgress', [info]);\n }\n});\n\nAWS.util.mixin(AWS.S3.ManagedUpload, AWS.SequentialExecutor);\n\n/**\n * @api private\n */\nAWS.S3.ManagedUpload.addPromisesToClass = function addPromisesToClass(PromiseDependency) {\n this.prototype.promise = AWS.util.promisifyMethod('send', PromiseDependency);\n};\n\n/**\n * @api private\n */\nAWS.S3.ManagedUpload.deletePromisesFromClass = function deletePromisesFromClass() {\n delete this.prototype.promise;\n};\n\nAWS.util.addPromises(AWS.S3.ManagedUpload);\n\n/**\n * @api private\n */\nmodule.exports = AWS.S3.ManagedUpload;\n","var AWS = require('./core');\n\n/**\n * @api private\n * @!method on(eventName, callback)\n * Registers an event listener callback for the event given by `eventName`.\n * Parameters passed to the callback function depend on the individual event\n * being triggered. See the event documentation for those parameters.\n *\n * @param eventName [String] the event name to register the listener for\n * @param callback [Function] the listener callback function\n * @param toHead [Boolean] attach the listener callback to the head of callback array if set to true.\n * Default to be false.\n * @return [AWS.SequentialExecutor] the same object for chaining\n */\nAWS.SequentialExecutor = AWS.util.inherit({\n\n constructor: function SequentialExecutor() {\n this._events = {};\n },\n\n /**\n * @api private\n */\n listeners: function listeners(eventName) {\n return this._events[eventName] ? this._events[eventName].slice(0) : [];\n },\n\n on: function on(eventName, listener, toHead) {\n if (this._events[eventName]) {\n toHead ?\n this._events[eventName].unshift(listener) :\n this._events[eventName].push(listener);\n } else {\n this._events[eventName] = [listener];\n }\n return this;\n },\n\n onAsync: function onAsync(eventName, listener, toHead) {\n listener._isAsync = true;\n return this.on(eventName, listener, toHead);\n },\n\n removeListener: function removeListener(eventName, listener) {\n var listeners = this._events[eventName];\n if (listeners) {\n var length = listeners.length;\n var position = -1;\n for (var i = 0; i < length; ++i) {\n if (listeners[i] === listener) {\n position = i;\n }\n }\n if (position > -1) {\n listeners.splice(position, 1);\n }\n }\n return this;\n },\n\n removeAllListeners: function removeAllListeners(eventName) {\n if (eventName) {\n delete this._events[eventName];\n } else {\n this._events = {};\n }\n return this;\n },\n\n /**\n * @api private\n */\n emit: function emit(eventName, eventArgs, doneCallback) {\n if (!doneCallback) doneCallback = function() { };\n var listeners = this.listeners(eventName);\n var count = listeners.length;\n this.callListeners(listeners, eventArgs, doneCallback);\n return count > 0;\n },\n\n /**\n * @api private\n */\n callListeners: function callListeners(listeners, args, doneCallback, prevError) {\n var self = this;\n var error = prevError || null;\n\n function callNextListener(err) {\n if (err) {\n error = AWS.util.error(error || new Error(), err);\n if (self._haltHandlersOnError) {\n return doneCallback.call(self, error);\n }\n }\n self.callListeners(listeners, args, doneCallback, error);\n }\n\n while (listeners.length > 0) {\n var listener = listeners.shift();\n if (listener._isAsync) { // asynchronous listener\n listener.apply(self, args.concat([callNextListener]));\n return; // stop here, callNextListener will continue\n } else { // synchronous listener\n try {\n listener.apply(self, args);\n } catch (err) {\n error = AWS.util.error(error || new Error(), err);\n }\n if (error && self._haltHandlersOnError) {\n doneCallback.call(self, error);\n return;\n }\n }\n }\n doneCallback.call(self, error);\n },\n\n /**\n * Adds or copies a set of listeners from another list of\n * listeners or SequentialExecutor object.\n *\n * @param listeners [map>, AWS.SequentialExecutor]\n * a list of events and callbacks, or an event emitter object\n * containing listeners to add to this emitter object.\n * @return [AWS.SequentialExecutor] the emitter object, for chaining.\n * @example Adding listeners from a map of listeners\n * emitter.addListeners({\n * event1: [function() { ... }, function() { ... }],\n * event2: [function() { ... }]\n * });\n * emitter.emit('event1'); // emitter has event1\n * emitter.emit('event2'); // emitter has event2\n * @example Adding listeners from another emitter object\n * var emitter1 = new AWS.SequentialExecutor();\n * emitter1.on('event1', function() { ... });\n * emitter1.on('event2', function() { ... });\n * var emitter2 = new AWS.SequentialExecutor();\n * emitter2.addListeners(emitter1);\n * emitter2.emit('event1'); // emitter2 has event1\n * emitter2.emit('event2'); // emitter2 has event2\n */\n addListeners: function addListeners(listeners) {\n var self = this;\n\n // extract listeners if parameter is an SequentialExecutor object\n if (listeners._events) listeners = listeners._events;\n\n AWS.util.each(listeners, function(event, callbacks) {\n if (typeof callbacks === 'function') callbacks = [callbacks];\n AWS.util.arrayEach(callbacks, function(callback) {\n self.on(event, callback);\n });\n });\n\n return self;\n },\n\n /**\n * Registers an event with {on} and saves the callback handle function\n * as a property on the emitter object using a given `name`.\n *\n * @param name [String] the property name to set on this object containing\n * the callback function handle so that the listener can be removed in\n * the future.\n * @param (see on)\n * @return (see on)\n * @example Adding a named listener DATA_CALLBACK\n * var listener = function() { doSomething(); };\n * emitter.addNamedListener('DATA_CALLBACK', 'data', listener);\n *\n * // the following prints: true\n * console.log(emitter.DATA_CALLBACK == listener);\n */\n addNamedListener: function addNamedListener(name, eventName, callback, toHead) {\n this[name] = callback;\n this.addListener(eventName, callback, toHead);\n return this;\n },\n\n /**\n * @api private\n */\n addNamedAsyncListener: function addNamedAsyncListener(name, eventName, callback, toHead) {\n callback._isAsync = true;\n return this.addNamedListener(name, eventName, callback, toHead);\n },\n\n /**\n * Helper method to add a set of named listeners using\n * {addNamedListener}. The callback contains a parameter\n * with a handle to the `addNamedListener` method.\n *\n * @callback callback function(add)\n * The callback function is called immediately in order to provide\n * the `add` function to the block. This simplifies the addition of\n * a large group of named listeners.\n * @param add [Function] the {addNamedListener} function to call\n * when registering listeners.\n * @example Adding a set of named listeners\n * emitter.addNamedListeners(function(add) {\n * add('DATA_CALLBACK', 'data', function() { ... });\n * add('OTHER', 'otherEvent', function() { ... });\n * add('LAST', 'lastEvent', function() { ... });\n * });\n *\n * // these properties are now set:\n * emitter.DATA_CALLBACK;\n * emitter.OTHER;\n * emitter.LAST;\n */\n addNamedListeners: function addNamedListeners(callback) {\n var self = this;\n callback(\n function() {\n self.addNamedListener.apply(self, arguments);\n },\n function() {\n self.addNamedAsyncListener.apply(self, arguments);\n }\n );\n return this;\n }\n});\n\n/**\n * {on} is the prefered method.\n * @api private\n */\nAWS.SequentialExecutor.prototype.addListener = AWS.SequentialExecutor.prototype.on;\n\n/**\n * @api private\n */\nmodule.exports = AWS.SequentialExecutor;\n","var AWS = require('./core');\nvar Api = require('./model/api');\nvar regionConfig = require('./region_config');\n\nvar inherit = AWS.util.inherit;\nvar clientCount = 0;\n\n/**\n * The service class representing an AWS service.\n *\n * @class_abstract This class is an abstract class.\n *\n * @!attribute apiVersions\n * @return [Array] the list of API versions supported by this service.\n * @readonly\n */\nAWS.Service = inherit({\n /**\n * Create a new service object with a configuration object\n *\n * @param config [map] a map of configuration options\n */\n constructor: function Service(config) {\n if (!this.loadServiceClass) {\n throw AWS.util.error(new Error(),\n 'Service must be constructed with `new\\' operator');\n }\n var ServiceClass = this.loadServiceClass(config || {});\n if (ServiceClass) {\n var originalConfig = AWS.util.copy(config);\n var svc = new ServiceClass(config);\n Object.defineProperty(svc, '_originalConfig', {\n get: function() { return originalConfig; },\n enumerable: false,\n configurable: true\n });\n svc._clientId = ++clientCount;\n return svc;\n }\n this.initialize(config);\n },\n\n /**\n * @api private\n */\n initialize: function initialize(config) {\n var svcConfig = AWS.config[this.serviceIdentifier];\n this.config = new AWS.Config(AWS.config);\n if (svcConfig) this.config.update(svcConfig, true);\n if (config) this.config.update(config, true);\n\n this.validateService();\n if (!this.config.endpoint) regionConfig.configureEndpoint(this);\n\n this.config.endpoint = this.endpointFromTemplate(this.config.endpoint);\n this.setEndpoint(this.config.endpoint);\n //enable attaching listeners to service client\n AWS.SequentialExecutor.call(this);\n AWS.Service.addDefaultMonitoringListeners(this);\n if ((this.config.clientSideMonitoring || AWS.Service._clientSideMonitoring) && this.publisher) {\n var publisher = this.publisher;\n this.addNamedListener('PUBLISH_API_CALL', 'apiCall', function PUBLISH_API_CALL(event) {\n process.nextTick(function() {publisher.eventHandler(event);});\n });\n this.addNamedListener('PUBLISH_API_ATTEMPT', 'apiCallAttempt', function PUBLISH_API_ATTEMPT(event) {\n process.nextTick(function() {publisher.eventHandler(event);});\n });\n }\n },\n\n /**\n * @api private\n */\n validateService: function validateService() {\n },\n\n /**\n * @api private\n */\n loadServiceClass: function loadServiceClass(serviceConfig) {\n var config = serviceConfig;\n if (!AWS.util.isEmpty(this.api)) {\n return null;\n } else if (config.apiConfig) {\n return AWS.Service.defineServiceApi(this.constructor, config.apiConfig);\n } else if (!this.constructor.services) {\n return null;\n } else {\n config = new AWS.Config(AWS.config);\n config.update(serviceConfig, true);\n var version = config.apiVersions[this.constructor.serviceIdentifier];\n version = version || config.apiVersion;\n return this.getLatestServiceClass(version);\n }\n },\n\n /**\n * @api private\n */\n getLatestServiceClass: function getLatestServiceClass(version) {\n version = this.getLatestServiceVersion(version);\n if (this.constructor.services[version] === null) {\n AWS.Service.defineServiceApi(this.constructor, version);\n }\n\n return this.constructor.services[version];\n },\n\n /**\n * @api private\n */\n getLatestServiceVersion: function getLatestServiceVersion(version) {\n if (!this.constructor.services || this.constructor.services.length === 0) {\n throw new Error('No services defined on ' +\n this.constructor.serviceIdentifier);\n }\n\n if (!version) {\n version = 'latest';\n } else if (AWS.util.isType(version, Date)) {\n version = AWS.util.date.iso8601(version).split('T')[0];\n }\n\n if (Object.hasOwnProperty(this.constructor.services, version)) {\n return version;\n }\n\n var keys = Object.keys(this.constructor.services).sort();\n var selectedVersion = null;\n for (var i = keys.length - 1; i >= 0; i--) {\n // versions that end in \"*\" are not available on disk and can be\n // skipped, so do not choose these as selectedVersions\n if (keys[i][keys[i].length - 1] !== '*') {\n selectedVersion = keys[i];\n }\n if (keys[i].substr(0, 10) <= version) {\n return selectedVersion;\n }\n }\n\n throw new Error('Could not find ' + this.constructor.serviceIdentifier +\n ' API to satisfy version constraint `' + version + '\\'');\n },\n\n /**\n * @api private\n */\n api: {},\n\n /**\n * @api private\n */\n defaultRetryCount: 3,\n\n /**\n * @api private\n */\n customizeRequests: function customizeRequests(callback) {\n if (!callback) {\n this.customRequestHandler = null;\n } else if (typeof callback === 'function') {\n this.customRequestHandler = callback;\n } else {\n throw new Error('Invalid callback type \\'' + typeof callback + '\\' provided in customizeRequests');\n }\n },\n\n /**\n * Calls an operation on a service with the given input parameters.\n *\n * @param operation [String] the name of the operation to call on the service.\n * @param params [map] a map of input options for the operation\n * @callback callback function(err, data)\n * If a callback is supplied, it is called when a response is returned\n * from the service.\n * @param err [Error] the error object returned from the request.\n * Set to `null` if the request is successful.\n * @param data [Object] the de-serialized data returned from\n * the request. Set to `null` if a request error occurs.\n */\n makeRequest: function makeRequest(operation, params, callback) {\n if (typeof params === 'function') {\n callback = params;\n params = null;\n }\n\n params = params || {};\n if (this.config.params) { // copy only toplevel bound params\n var rules = this.api.operations[operation];\n if (rules) {\n params = AWS.util.copy(params);\n AWS.util.each(this.config.params, function(key, value) {\n if (rules.input.members[key]) {\n if (params[key] === undefined || params[key] === null) {\n params[key] = value;\n }\n }\n });\n }\n }\n\n var request = new AWS.Request(this, operation, params);\n this.addAllRequestListeners(request);\n this.attachMonitoringEmitter(request);\n if (callback) request.send(callback);\n return request;\n },\n\n /**\n * Calls an operation on a service with the given input parameters, without\n * any authentication data. This method is useful for \"public\" API operations.\n *\n * @param operation [String] the name of the operation to call on the service.\n * @param params [map] a map of input options for the operation\n * @callback callback function(err, data)\n * If a callback is supplied, it is called when a response is returned\n * from the service.\n * @param err [Error] the error object returned from the request.\n * Set to `null` if the request is successful.\n * @param data [Object] the de-serialized data returned from\n * the request. Set to `null` if a request error occurs.\n */\n makeUnauthenticatedRequest: function makeUnauthenticatedRequest(operation, params, callback) {\n if (typeof params === 'function') {\n callback = params;\n params = {};\n }\n\n var request = this.makeRequest(operation, params).toUnauthenticated();\n return callback ? request.send(callback) : request;\n },\n\n /**\n * Waits for a given state\n *\n * @param state [String] the state on the service to wait for\n * @param params [map] a map of parameters to pass with each request\n * @option params $waiter [map] a map of configuration options for the waiter\n * @option params $waiter.delay [Number] The number of seconds to wait between\n * requests\n * @option params $waiter.maxAttempts [Number] The maximum number of requests\n * to send while waiting\n * @callback callback function(err, data)\n * If a callback is supplied, it is called when a response is returned\n * from the service.\n * @param err [Error] the error object returned from the request.\n * Set to `null` if the request is successful.\n * @param data [Object] the de-serialized data returned from\n * the request. Set to `null` if a request error occurs.\n */\n waitFor: function waitFor(state, params, callback) {\n var waiter = new AWS.ResourceWaiter(this, state);\n return waiter.wait(params, callback);\n },\n\n /**\n * @api private\n */\n addAllRequestListeners: function addAllRequestListeners(request) {\n var list = [AWS.events, AWS.EventListeners.Core, this.serviceInterface(),\n AWS.EventListeners.CorePost];\n for (var i = 0; i < list.length; i++) {\n if (list[i]) request.addListeners(list[i]);\n }\n\n // disable parameter validation\n if (!this.config.paramValidation) {\n request.removeListener('validate',\n AWS.EventListeners.Core.VALIDATE_PARAMETERS);\n }\n\n if (this.config.logger) { // add logging events\n request.addListeners(AWS.EventListeners.Logger);\n }\n\n this.setupRequestListeners(request);\n // call prototype's customRequestHandler\n if (typeof this.constructor.prototype.customRequestHandler === 'function') {\n this.constructor.prototype.customRequestHandler(request);\n }\n // call instance's customRequestHandler\n if (Object.prototype.hasOwnProperty.call(this, 'customRequestHandler') && typeof this.customRequestHandler === 'function') {\n this.customRequestHandler(request);\n }\n },\n\n /**\n * Event recording metrics for a whole API call.\n * @returns {object} a subset of api call metrics\n * @api private\n */\n apiCallEvent: function apiCallEvent(request) {\n var api = request.service.api.operations[request.operation];\n var monitoringEvent = {\n Type: 'ApiCall',\n Api: api ? api.name : request.operation,\n Version: 1,\n Service: request.service.api.serviceId || request.service.api.endpointPrefix,\n Region: request.httpRequest.region,\n MaxRetriesExceeded: 0,\n UserAgent: request.httpRequest.getUserAgent(),\n };\n var response = request.response;\n if (response.httpResponse.statusCode) {\n monitoringEvent.FinalHttpStatusCode = response.httpResponse.statusCode;\n }\n if (response.error) {\n var error = response.error;\n var statusCode = response.httpResponse.statusCode;\n if (statusCode > 299) {\n if (error.code) monitoringEvent.FinalAwsException = error.code;\n if (error.message) monitoringEvent.FinalAwsExceptionMessage = error.message;\n } else {\n if (error.code || error.name) monitoringEvent.FinalSdkException = error.code || error.name;\n if (error.message) monitoringEvent.FinalSdkExceptionMessage = error.message;\n }\n }\n return monitoringEvent;\n },\n\n /**\n * Event recording metrics for an API call attempt.\n * @returns {object} a subset of api call attempt metrics\n * @api private\n */\n apiAttemptEvent: function apiAttemptEvent(request) {\n var api = request.service.api.operations[request.operation];\n var monitoringEvent = {\n Type: 'ApiCallAttempt',\n Api: api ? api.name : request.operation,\n Version: 1,\n Service: request.service.api.serviceId || request.service.api.endpointPrefix,\n Fqdn: request.httpRequest.endpoint.hostname,\n UserAgent: request.httpRequest.getUserAgent(),\n };\n var response = request.response;\n if (response.httpResponse.statusCode) {\n monitoringEvent.HttpStatusCode = response.httpResponse.statusCode;\n }\n if (\n !request._unAuthenticated &&\n request.service.config.credentials &&\n request.service.config.credentials.accessKeyId\n ) {\n monitoringEvent.AccessKey = request.service.config.credentials.accessKeyId;\n }\n if (!response.httpResponse.headers) return monitoringEvent;\n if (request.httpRequest.headers['x-amz-security-token']) {\n monitoringEvent.SessionToken = request.httpRequest.headers['x-amz-security-token'];\n }\n if (response.httpResponse.headers['x-amzn-requestid']) {\n monitoringEvent.XAmznRequestId = response.httpResponse.headers['x-amzn-requestid'];\n }\n if (response.httpResponse.headers['x-amz-request-id']) {\n monitoringEvent.XAmzRequestId = response.httpResponse.headers['x-amz-request-id'];\n }\n if (response.httpResponse.headers['x-amz-id-2']) {\n monitoringEvent.XAmzId2 = response.httpResponse.headers['x-amz-id-2'];\n }\n return monitoringEvent;\n },\n\n /**\n * Add metrics of failed request.\n * @api private\n */\n attemptFailEvent: function attemptFailEvent(request) {\n var monitoringEvent = this.apiAttemptEvent(request);\n var response = request.response;\n var error = response.error;\n if (response.httpResponse.statusCode > 299 ) {\n if (error.code) monitoringEvent.AwsException = error.code;\n if (error.message) monitoringEvent.AwsExceptionMessage = error.message;\n } else {\n if (error.code || error.name) monitoringEvent.SdkException = error.code || error.name;\n if (error.message) monitoringEvent.SdkExceptionMessage = error.message;\n }\n return monitoringEvent;\n },\n\n /**\n * Attach listeners to request object to fetch metrics of each request\n * and emit data object through \\'ApiCall\\' and \\'ApiCallAttempt\\' events.\n * @api private\n */\n attachMonitoringEmitter: function attachMonitoringEmitter(request) {\n var attemptTimestamp; //timestamp marking the beginning of a request attempt\n var attemptStartRealTime; //Start time of request attempt. Used to calculating attemptLatency\n var attemptLatency; //latency from request sent out to http response reaching SDK\n var callStartRealTime; //Start time of API call. Used to calculating API call latency\n var attemptCount = 0; //request.retryCount is not reliable here\n var region; //region cache region for each attempt since it can be updated in plase (e.g. s3)\n var callTimestamp; //timestamp when the request is created\n var self = this;\n var addToHead = true;\n\n request.on('validate', function () {\n callStartRealTime = AWS.util.realClock.now();\n callTimestamp = Date.now();\n }, addToHead);\n request.on('sign', function () {\n attemptStartRealTime = AWS.util.realClock.now();\n attemptTimestamp = Date.now();\n region = request.httpRequest.region;\n attemptCount++;\n }, addToHead);\n request.on('validateResponse', function() {\n attemptLatency = Math.round(AWS.util.realClock.now() - attemptStartRealTime);\n });\n request.addNamedListener('API_CALL_ATTEMPT', 'success', function API_CALL_ATTEMPT() {\n var apiAttemptEvent = self.apiAttemptEvent(request);\n apiAttemptEvent.Timestamp = attemptTimestamp;\n apiAttemptEvent.AttemptLatency = attemptLatency >= 0 ? attemptLatency : 0;\n apiAttemptEvent.Region = region;\n self.emit('apiCallAttempt', [apiAttemptEvent]);\n });\n request.addNamedListener('API_CALL_ATTEMPT_RETRY', 'retry', function API_CALL_ATTEMPT_RETRY() {\n var apiAttemptEvent = self.attemptFailEvent(request);\n apiAttemptEvent.Timestamp = attemptTimestamp;\n //attemptLatency may not be available if fail before response\n attemptLatency = attemptLatency ||\n Math.round(AWS.util.realClock.now() - attemptStartRealTime);\n apiAttemptEvent.AttemptLatency = attemptLatency >= 0 ? attemptLatency : 0;\n apiAttemptEvent.Region = region;\n self.emit('apiCallAttempt', [apiAttemptEvent]);\n });\n request.addNamedListener('API_CALL', 'complete', function API_CALL() {\n var apiCallEvent = self.apiCallEvent(request);\n apiCallEvent.AttemptCount = attemptCount;\n if (apiCallEvent.AttemptCount <= 0) return;\n apiCallEvent.Timestamp = callTimestamp;\n var latency = Math.round(AWS.util.realClock.now() - callStartRealTime);\n apiCallEvent.Latency = latency >= 0 ? latency : 0;\n var response = request.response;\n if (\n response.error &&\n response.error.retryable &&\n typeof response.retryCount === 'number' &&\n typeof response.maxRetries === 'number' &&\n (response.retryCount >= response.maxRetries)\n ) {\n apiCallEvent.MaxRetriesExceeded = 1;\n }\n self.emit('apiCall', [apiCallEvent]);\n });\n },\n\n /**\n * Override this method to setup any custom request listeners for each\n * new request to the service.\n *\n * @method_abstract This is an abstract method.\n */\n setupRequestListeners: function setupRequestListeners(request) {\n },\n\n /**\n * Gets the signing name for a given request\n * @api private\n */\n getSigningName: function getSigningName() {\n return this.api.signingName || this.api.endpointPrefix;\n },\n\n /**\n * Gets the signer class for a given request\n * @api private\n */\n getSignerClass: function getSignerClass(request) {\n var version;\n // get operation authtype if present\n var operation = null;\n var authtype = '';\n if (request) {\n var operations = request.service.api.operations || {};\n operation = operations[request.operation] || null;\n authtype = operation ? operation.authtype : '';\n }\n if (this.config.signatureVersion) {\n version = this.config.signatureVersion;\n } else if (authtype === 'v4' || authtype === 'v4-unsigned-body') {\n version = 'v4';\n } else {\n version = this.api.signatureVersion;\n }\n return AWS.Signers.RequestSigner.getVersion(version);\n },\n\n /**\n * @api private\n */\n serviceInterface: function serviceInterface() {\n switch (this.api.protocol) {\n case 'ec2': return AWS.EventListeners.Query;\n case 'query': return AWS.EventListeners.Query;\n case 'json': return AWS.EventListeners.Json;\n case 'rest-json': return AWS.EventListeners.RestJson;\n case 'rest-xml': return AWS.EventListeners.RestXml;\n }\n if (this.api.protocol) {\n throw new Error('Invalid service `protocol\\' ' +\n this.api.protocol + ' in API config');\n }\n },\n\n /**\n * @api private\n */\n successfulResponse: function successfulResponse(resp) {\n return resp.httpResponse.statusCode < 300;\n },\n\n /**\n * How many times a failed request should be retried before giving up.\n * the defaultRetryCount can be overriden by service classes.\n *\n * @api private\n */\n numRetries: function numRetries() {\n if (this.config.maxRetries !== undefined) {\n return this.config.maxRetries;\n } else {\n return this.defaultRetryCount;\n }\n },\n\n /**\n * @api private\n */\n retryDelays: function retryDelays(retryCount, err) {\n return AWS.util.calculateRetryDelay(retryCount, this.config.retryDelayOptions, err);\n },\n\n /**\n * @api private\n */\n retryableError: function retryableError(error) {\n if (this.timeoutError(error)) return true;\n if (this.networkingError(error)) return true;\n if (this.expiredCredentialsError(error)) return true;\n if (this.throttledError(error)) return true;\n if (error.statusCode >= 500) return true;\n return false;\n },\n\n /**\n * @api private\n */\n networkingError: function networkingError(error) {\n return error.code === 'NetworkingError';\n },\n\n /**\n * @api private\n */\n timeoutError: function timeoutError(error) {\n return error.code === 'TimeoutError';\n },\n\n /**\n * @api private\n */\n expiredCredentialsError: function expiredCredentialsError(error) {\n // TODO : this only handles *one* of the expired credential codes\n return (error.code === 'ExpiredTokenException');\n },\n\n /**\n * @api private\n */\n clockSkewError: function clockSkewError(error) {\n switch (error.code) {\n case 'RequestTimeTooSkewed':\n case 'RequestExpired':\n case 'InvalidSignatureException':\n case 'SignatureDoesNotMatch':\n case 'AuthFailure':\n case 'RequestInTheFuture':\n return true;\n default: return false;\n }\n },\n\n /**\n * @api private\n */\n getSkewCorrectedDate: function getSkewCorrectedDate() {\n return new Date(Date.now() + this.config.systemClockOffset);\n },\n\n /**\n * @api private\n */\n applyClockOffset: function applyClockOffset(newServerTime) {\n if (newServerTime) {\n this.config.systemClockOffset = newServerTime - Date.now();\n }\n },\n\n /**\n * @api private\n */\n isClockSkewed: function isClockSkewed(newServerTime) {\n if (newServerTime) {\n return Math.abs(this.getSkewCorrectedDate().getTime() - newServerTime) >= 300000;\n }\n },\n\n /**\n * @api private\n */\n throttledError: function throttledError(error) {\n // this logic varies between services\n if (error.statusCode === 429) return true;\n switch (error.code) {\n case 'ProvisionedThroughputExceededException':\n case 'Throttling':\n case 'ThrottlingException':\n case 'RequestLimitExceeded':\n case 'RequestThrottled':\n case 'RequestThrottledException':\n case 'TooManyRequestsException':\n case 'TransactionInProgressException': //dynamodb\n case 'EC2ThrottledException':\n return true;\n default:\n return false;\n }\n },\n\n /**\n * @api private\n */\n endpointFromTemplate: function endpointFromTemplate(endpoint) {\n if (typeof endpoint !== 'string') return endpoint;\n\n var e = endpoint;\n e = e.replace(/\\{service\\}/g, this.api.endpointPrefix);\n e = e.replace(/\\{region\\}/g, this.config.region);\n e = e.replace(/\\{scheme\\}/g, this.config.sslEnabled ? 'https' : 'http');\n return e;\n },\n\n /**\n * @api private\n */\n setEndpoint: function setEndpoint(endpoint) {\n this.endpoint = new AWS.Endpoint(endpoint, this.config);\n },\n\n /**\n * @api private\n */\n paginationConfig: function paginationConfig(operation, throwException) {\n var paginator = this.api.operations[operation].paginator;\n if (!paginator) {\n if (throwException) {\n var e = new Error();\n throw AWS.util.error(e, 'No pagination configuration for ' + operation);\n }\n return null;\n }\n\n return paginator;\n }\n});\n\nAWS.util.update(AWS.Service, {\n\n /**\n * Adds one method for each operation described in the api configuration\n *\n * @api private\n */\n defineMethods: function defineMethods(svc) {\n AWS.util.each(svc.prototype.api.operations, function iterator(method) {\n if (svc.prototype[method]) return;\n var operation = svc.prototype.api.operations[method];\n if (operation.authtype === 'none') {\n svc.prototype[method] = function (params, callback) {\n return this.makeUnauthenticatedRequest(method, params, callback);\n };\n } else {\n svc.prototype[method] = function (params, callback) {\n return this.makeRequest(method, params, callback);\n };\n }\n });\n },\n\n /**\n * Defines a new Service class using a service identifier and list of versions\n * including an optional set of features (functions) to apply to the class\n * prototype.\n *\n * @param serviceIdentifier [String] the identifier for the service\n * @param versions [Array] a list of versions that work with this\n * service\n * @param features [Object] an object to attach to the prototype\n * @return [Class] the service class defined by this function.\n */\n defineService: function defineService(serviceIdentifier, versions, features) {\n AWS.Service._serviceMap[serviceIdentifier] = true;\n if (!Array.isArray(versions)) {\n features = versions;\n versions = [];\n }\n\n var svc = inherit(AWS.Service, features || {});\n\n if (typeof serviceIdentifier === 'string') {\n AWS.Service.addVersions(svc, versions);\n\n var identifier = svc.serviceIdentifier || serviceIdentifier;\n svc.serviceIdentifier = identifier;\n } else { // defineService called with an API\n svc.prototype.api = serviceIdentifier;\n AWS.Service.defineMethods(svc);\n }\n AWS.SequentialExecutor.call(this.prototype);\n //util.clientSideMonitoring is only available in node\n if (!this.prototype.publisher && AWS.util.clientSideMonitoring) {\n var Publisher = AWS.util.clientSideMonitoring.Publisher;\n var configProvider = AWS.util.clientSideMonitoring.configProvider;\n var publisherConfig = configProvider();\n this.prototype.publisher = new Publisher(publisherConfig);\n if (publisherConfig.enabled) {\n //if csm is enabled in environment, SDK should send all metrics\n AWS.Service._clientSideMonitoring = true;\n }\n }\n AWS.SequentialExecutor.call(svc.prototype);\n AWS.Service.addDefaultMonitoringListeners(svc.prototype);\n return svc;\n },\n\n /**\n * @api private\n */\n addVersions: function addVersions(svc, versions) {\n if (!Array.isArray(versions)) versions = [versions];\n\n svc.services = svc.services || {};\n for (var i = 0; i < versions.length; i++) {\n if (svc.services[versions[i]] === undefined) {\n svc.services[versions[i]] = null;\n }\n }\n\n svc.apiVersions = Object.keys(svc.services).sort();\n },\n\n /**\n * @api private\n */\n defineServiceApi: function defineServiceApi(superclass, version, apiConfig) {\n var svc = inherit(superclass, {\n serviceIdentifier: superclass.serviceIdentifier\n });\n\n function setApi(api) {\n if (api.isApi) {\n svc.prototype.api = api;\n } else {\n svc.prototype.api = new Api(api, {\n serviceIdentifier: superclass.serviceIdentifier\n });\n }\n }\n\n if (typeof version === 'string') {\n if (apiConfig) {\n setApi(apiConfig);\n } else {\n try {\n setApi(AWS.apiLoader(superclass.serviceIdentifier, version));\n } catch (err) {\n throw AWS.util.error(err, {\n message: 'Could not find API configuration ' +\n superclass.serviceIdentifier + '-' + version\n });\n }\n }\n if (!Object.prototype.hasOwnProperty.call(superclass.services, version)) {\n superclass.apiVersions = superclass.apiVersions.concat(version).sort();\n }\n superclass.services[version] = svc;\n } else {\n setApi(version);\n }\n\n AWS.Service.defineMethods(svc);\n return svc;\n },\n\n /**\n * @api private\n */\n hasService: function(identifier) {\n return Object.prototype.hasOwnProperty.call(AWS.Service._serviceMap, identifier);\n },\n\n /**\n * @param attachOn attach default monitoring listeners to object\n *\n * Each monitoring event should be emitted from service client to service constructor prototype and then\n * to global service prototype like bubbling up. These default monitoring events listener will transfer\n * the monitoring events to the upper layer.\n * @api private\n */\n addDefaultMonitoringListeners: function addDefaultMonitoringListeners(attachOn) {\n attachOn.addNamedListener('MONITOR_EVENTS_BUBBLE', 'apiCallAttempt', function EVENTS_BUBBLE(event) {\n var baseClass = Object.getPrototypeOf(attachOn);\n if (baseClass._events) baseClass.emit('apiCallAttempt', [event]);\n });\n attachOn.addNamedListener('CALL_EVENTS_BUBBLE', 'apiCall', function CALL_EVENTS_BUBBLE(event) {\n var baseClass = Object.getPrototypeOf(attachOn);\n if (baseClass._events) baseClass.emit('apiCall', [event]);\n });\n },\n\n /**\n * @api private\n */\n _serviceMap: {}\n});\n\nAWS.util.mixin(AWS.Service, AWS.SequentialExecutor);\n\n/**\n * @api private\n */\nmodule.exports = AWS.Service;\n","var AWS = require('../core');\n\nAWS.util.update(AWS.APIGateway.prototype, {\n/**\n * Sets the Accept header to application/json.\n *\n * @api private\n */\n setAcceptHeader: function setAcceptHeader(req) {\n var httpRequest = req.httpRequest;\n if (!httpRequest.headers.Accept) {\n httpRequest.headers['Accept'] = 'application/json';\n }\n },\n\n /**\n * @api private\n */\n setupRequestListeners: function setupRequestListeners(request) {\n request.addListener('build', this.setAcceptHeader);\n if (request.operation === 'getExport') {\n var params = request.params || {};\n if (params.exportType === 'swagger') {\n request.addListener('extractData', AWS.util.convertPayloadToString);\n }\n }\n }\n});\n\n","var AWS = require('../core');\n\n// pull in CloudFront signer\nrequire('../cloudfront/signer');\n\nAWS.util.update(AWS.CloudFront.prototype, {\n\n setupRequestListeners: function setupRequestListeners(request) {\n request.addListener('extractData', AWS.util.hoistPayloadMember);\n }\n\n});\n","var AWS = require('../core');\n\n/**\n * Constructs a service interface object. Each API operation is exposed as a\n * function on service.\n *\n * ### Sending a Request Using CloudSearchDomain\n *\n * ```javascript\n * var csd = new AWS.CloudSearchDomain({endpoint: 'my.host.tld'});\n * csd.search(params, function (err, data) {\n * if (err) console.log(err, err.stack); // an error occurred\n * else console.log(data); // successful response\n * });\n * ```\n *\n * ### Locking the API Version\n *\n * In order to ensure that the CloudSearchDomain object uses this specific API,\n * you can construct the object by passing the `apiVersion` option to the\n * constructor:\n *\n * ```javascript\n * var csd = new AWS.CloudSearchDomain({\n * endpoint: 'my.host.tld',\n * apiVersion: '2013-01-01'\n * });\n * ```\n *\n * You can also set the API version globally in `AWS.config.apiVersions` using\n * the **cloudsearchdomain** service identifier:\n *\n * ```javascript\n * AWS.config.apiVersions = {\n * cloudsearchdomain: '2013-01-01',\n * // other service API versions\n * };\n *\n * var csd = new AWS.CloudSearchDomain({endpoint: 'my.host.tld'});\n * ```\n *\n * @note You *must* provide an `endpoint` configuration parameter when\n * constructing this service. See {constructor} for more information.\n *\n * @!method constructor(options = {})\n * Constructs a service object. This object has one method for each\n * API operation.\n *\n * @example Constructing a CloudSearchDomain object\n * var csd = new AWS.CloudSearchDomain({endpoint: 'my.host.tld'});\n * @note You *must* provide an `endpoint` when constructing this service.\n * @option (see AWS.Config.constructor)\n *\n * @service cloudsearchdomain\n * @version 2013-01-01\n */\nAWS.util.update(AWS.CloudSearchDomain.prototype, {\n /**\n * @api private\n */\n validateService: function validateService() {\n if (!this.config.endpoint || this.config.endpoint.indexOf('{') >= 0) {\n var msg = 'AWS.CloudSearchDomain requires an explicit ' +\n '`endpoint\\' configuration option.';\n throw AWS.util.error(new Error(),\n {name: 'InvalidEndpoint', message: msg});\n }\n },\n\n /**\n * @api private\n */\n setupRequestListeners: function setupRequestListeners(request) {\n request.removeListener('validate',\n AWS.EventListeners.Core.VALIDATE_CREDENTIALS\n );\n request.onAsync('validate', this.validateCredentials);\n request.addListener('validate', this.updateRegion);\n if (request.operation === 'search') {\n request.addListener('build', this.convertGetToPost);\n }\n },\n\n /**\n * @api private\n */\n validateCredentials: function(req, done) {\n if (!req.service.api.signatureVersion) return done(); // none\n req.service.config.getCredentials(function(err) {\n if (err) {\n req.removeListener('sign', AWS.EventListeners.Core.SIGN);\n }\n done();\n });\n },\n\n /**\n * @api private\n */\n convertGetToPost: function(request) {\n var httpRequest = request.httpRequest;\n // convert queries to POST to avoid length restrictions\n var path = httpRequest.path.split('?');\n httpRequest.method = 'POST';\n httpRequest.path = path[0];\n httpRequest.body = path[1];\n httpRequest.headers['Content-Length'] = httpRequest.body.length;\n httpRequest.headers['Content-Type'] = 'application/x-www-form-urlencoded';\n },\n\n /**\n * @api private\n */\n updateRegion: function updateRegion(request) {\n var endpoint = request.httpRequest.endpoint.hostname;\n var zones = endpoint.split('.');\n request.httpRequest.region = zones[1] || request.httpRequest.region;\n }\n\n});\n","var AWS = require('../core');\nvar rdsutil = require('./rdsutil');\n\n/**\n* @api private\n*/\nvar crossRegionOperations = ['createDBCluster', 'copyDBClusterSnapshot'];\n\nAWS.util.update(AWS.DocDB.prototype, {\n /**\n * @api private\n */\n setupRequestListeners: function setupRequestListeners(request) {\n if (\n crossRegionOperations.indexOf(request.operation) !== -1 &&\n this.config.params &&\n this.config.params.SourceRegion &&\n request.params &&\n !request.params.SourceRegion\n ) {\n request.params.SourceRegion = this.config.params.SourceRegion;\n }\n rdsutil.setupRequestListeners(this, request, crossRegionOperations);\n },\n});\n","var AWS = require('../core');\nrequire('../dynamodb/document_client');\n\nAWS.util.update(AWS.DynamoDB.prototype, {\n /**\n * @api private\n */\n setupRequestListeners: function setupRequestListeners(request) {\n if (request.service.config.dynamoDbCrc32) {\n request.removeListener('extractData', AWS.EventListeners.Json.EXTRACT_DATA);\n request.addListener('extractData', this.checkCrc32);\n request.addListener('extractData', AWS.EventListeners.Json.EXTRACT_DATA);\n }\n },\n\n /**\n * @api private\n */\n checkCrc32: function checkCrc32(resp) {\n if (!resp.httpResponse.streaming && !resp.request.service.crc32IsValid(resp)) {\n resp.data = null;\n resp.error = AWS.util.error(new Error(), {\n code: 'CRC32CheckFailed',\n message: 'CRC32 integrity check failed',\n retryable: true\n });\n resp.request.haltHandlersOnError();\n throw (resp.error);\n }\n },\n\n /**\n * @api private\n */\n crc32IsValid: function crc32IsValid(resp) {\n var crc = resp.httpResponse.headers['x-amz-crc32'];\n if (!crc) return true; // no (valid) CRC32 header\n return parseInt(crc, 10) === AWS.util.crypto.crc32(resp.httpResponse.body);\n },\n\n /**\n * @api private\n */\n defaultRetryCount: 10,\n\n /**\n * @api private\n */\n retryDelays: function retryDelays(retryCount, err) {\n var retryDelayOptions = AWS.util.copy(this.config.retryDelayOptions);\n\n if (typeof retryDelayOptions.base !== 'number') {\n retryDelayOptions.base = 50; // default for dynamodb\n }\n var delay = AWS.util.calculateRetryDelay(retryCount, retryDelayOptions, err);\n return delay;\n }\n});\n","var AWS = require('../core');\n\nAWS.util.update(AWS.EC2.prototype, {\n /**\n * @api private\n */\n setupRequestListeners: function setupRequestListeners(request) {\n request.removeListener('extractError', AWS.EventListeners.Query.EXTRACT_ERROR);\n request.addListener('extractError', this.extractError);\n\n if (request.operation === 'copySnapshot') {\n request.onAsync('validate', this.buildCopySnapshotPresignedUrl);\n }\n },\n\n /**\n * @api private\n */\n buildCopySnapshotPresignedUrl: function buildCopySnapshotPresignedUrl(req, done) {\n if (req.params.PresignedUrl || req._subRequest) {\n return done();\n }\n\n req.params = AWS.util.copy(req.params);\n req.params.DestinationRegion = req.service.config.region;\n\n var config = AWS.util.copy(req.service.config);\n delete config.endpoint;\n config.region = req.params.SourceRegion;\n var svc = new req.service.constructor(config);\n var newReq = svc[req.operation](req.params);\n newReq._subRequest = true;\n newReq.presign(function(err, url) {\n if (err) done(err);\n else {\n req.params.PresignedUrl = url;\n done();\n }\n });\n },\n\n /**\n * @api private\n */\n extractError: function extractError(resp) {\n // EC2 nests the error code and message deeper than other AWS Query services.\n var httpResponse = resp.httpResponse;\n var data = new AWS.XML.Parser().parse(httpResponse.body.toString() || '');\n if (data.Errors) {\n resp.error = AWS.util.error(new Error(), {\n code: data.Errors.Error.Code,\n message: data.Errors.Error.Message\n });\n } else {\n resp.error = AWS.util.error(new Error(), {\n code: httpResponse.statusCode,\n message: null\n });\n }\n resp.error.requestId = data.RequestID || null;\n }\n});\n","var AWS = require('../core');\n\nAWS.util.update(AWS.Glacier.prototype, {\n /**\n * @api private\n */\n setupRequestListeners: function setupRequestListeners(request) {\n if (Array.isArray(request._events.validate)) {\n request._events.validate.unshift(this.validateAccountId);\n } else {\n request.on('validate', this.validateAccountId);\n }\n request.removeListener('afterBuild',\n AWS.EventListeners.Core.COMPUTE_SHA256);\n request.on('build', this.addGlacierApiVersion);\n request.on('build', this.addTreeHashHeaders);\n },\n\n /**\n * @api private\n */\n validateAccountId: function validateAccountId(request) {\n if (request.params.accountId !== undefined) return;\n request.params = AWS.util.copy(request.params);\n request.params.accountId = '-';\n },\n\n /**\n * @api private\n */\n addGlacierApiVersion: function addGlacierApiVersion(request) {\n var version = request.service.api.apiVersion;\n request.httpRequest.headers['x-amz-glacier-version'] = version;\n },\n\n /**\n * @api private\n */\n addTreeHashHeaders: function addTreeHashHeaders(request) {\n if (request.params.body === undefined) return;\n\n var hashes = request.service.computeChecksums(request.params.body);\n request.httpRequest.headers['X-Amz-Content-Sha256'] = hashes.linearHash;\n\n if (!request.httpRequest.headers['x-amz-sha256-tree-hash']) {\n request.httpRequest.headers['x-amz-sha256-tree-hash'] = hashes.treeHash;\n }\n },\n\n /**\n * @!group Computing Checksums\n */\n\n /**\n * Computes the SHA-256 linear and tree hash checksums for a given\n * block of Buffer data. Pass the tree hash of the computed checksums\n * as the checksum input to the {completeMultipartUpload} when performing\n * a multi-part upload.\n *\n * @example Calculate checksum of 5.5MB data chunk\n * var glacier = new AWS.Glacier();\n * var data = Buffer.alloc(5.5 * 1024 * 1024);\n * data.fill('0'); // fill with zeros\n * var results = glacier.computeChecksums(data);\n * // Result: { linearHash: '68aff0c5a9...', treeHash: '154e26c78f...' }\n * @param data [Buffer, String] data to calculate the checksum for\n * @return [map] a map containing\n * the linearHash and treeHash properties representing hex based digests\n * of the respective checksums.\n * @see completeMultipartUpload\n */\n computeChecksums: function computeChecksums(data) {\n if (!AWS.util.Buffer.isBuffer(data)) data = AWS.util.buffer.toBuffer(data);\n\n var mb = 1024 * 1024;\n var hashes = [];\n var hash = AWS.util.crypto.createHash('sha256');\n\n // build leaf nodes in 1mb chunks\n for (var i = 0; i < data.length; i += mb) {\n var chunk = data.slice(i, Math.min(i + mb, data.length));\n hash.update(chunk);\n hashes.push(AWS.util.crypto.sha256(chunk));\n }\n\n return {\n linearHash: hash.digest('hex'),\n treeHash: this.buildHashTree(hashes)\n };\n },\n\n /**\n * @api private\n */\n buildHashTree: function buildHashTree(hashes) {\n // merge leaf nodes\n while (hashes.length > 1) {\n var tmpHashes = [];\n for (var i = 0; i < hashes.length; i += 2) {\n if (hashes[i + 1]) {\n var tmpHash = AWS.util.buffer.alloc(64);\n tmpHash.write(hashes[i], 0, 32, 'binary');\n tmpHash.write(hashes[i + 1], 32, 32, 'binary');\n tmpHashes.push(AWS.util.crypto.sha256(tmpHash));\n } else {\n tmpHashes.push(hashes[i]);\n }\n }\n hashes = tmpHashes;\n }\n\n return AWS.util.crypto.toHex(hashes[0]);\n }\n});\n","var AWS = require('../core');\n\n/**\n * @api private\n */\nvar blobPayloadOutputOps = [\n 'deleteThingShadow',\n 'getThingShadow',\n 'updateThingShadow'\n];\n\n/**\n * Constructs a service interface object. Each API operation is exposed as a\n * function on service.\n *\n * ### Sending a Request Using IotData\n *\n * ```javascript\n * var iotdata = new AWS.IotData({endpoint: 'my.host.tld'});\n * iotdata.getThingShadow(params, function (err, data) {\n * if (err) console.log(err, err.stack); // an error occurred\n * else console.log(data); // successful response\n * });\n * ```\n *\n * ### Locking the API Version\n *\n * In order to ensure that the IotData object uses this specific API,\n * you can construct the object by passing the `apiVersion` option to the\n * constructor:\n *\n * ```javascript\n * var iotdata = new AWS.IotData({\n * endpoint: 'my.host.tld',\n * apiVersion: '2015-05-28'\n * });\n * ```\n *\n * You can also set the API version globally in `AWS.config.apiVersions` using\n * the **iotdata** service identifier:\n *\n * ```javascript\n * AWS.config.apiVersions = {\n * iotdata: '2015-05-28',\n * // other service API versions\n * };\n *\n * var iotdata = new AWS.IotData({endpoint: 'my.host.tld'});\n * ```\n *\n * @note You *must* provide an `endpoint` configuration parameter when\n * constructing this service. See {constructor} for more information.\n *\n * @!method constructor(options = {})\n * Constructs a service object. This object has one method for each\n * API operation.\n *\n * @example Constructing a IotData object\n * var iotdata = new AWS.IotData({endpoint: 'my.host.tld'});\n * @note You *must* provide an `endpoint` when constructing this service.\n * @option (see AWS.Config.constructor)\n *\n * @service iotdata\n * @version 2015-05-28\n */\nAWS.util.update(AWS.IotData.prototype, {\n /**\n * @api private\n */\n validateService: function validateService() {\n if (!this.config.endpoint || this.config.endpoint.indexOf('{') >= 0) {\n var msg = 'AWS.IotData requires an explicit ' +\n '`endpoint\\' configuration option.';\n throw AWS.util.error(new Error(),\n {name: 'InvalidEndpoint', message: msg});\n }\n },\n\n /**\n * @api private\n */\n setupRequestListeners: function setupRequestListeners(request) {\n request.addListener('validateResponse', this.validateResponseBody);\n if (blobPayloadOutputOps.indexOf(request.operation) > -1) {\n request.addListener('extractData', AWS.util.convertPayloadToString);\n }\n },\n\n /**\n * @api private\n */\n validateResponseBody: function validateResponseBody(resp) {\n var body = resp.httpResponse.body.toString() || '{}';\n var bodyCheck = body.trim();\n if (!bodyCheck || bodyCheck.charAt(0) !== '{') {\n resp.httpResponse.body = '';\n }\n }\n\n});\n","var AWS = require('../core');\n\nAWS.util.update(AWS.Lambda.prototype, {\n /**\n * @api private\n */\n setupRequestListeners: function setupRequestListeners(request) {\n if (request.operation === 'invoke') {\n request.addListener('extractData', AWS.util.convertPayloadToString);\n }\n }\n});\n\n","var AWS = require('../core');\n\nAWS.util.update(AWS.LexModelsV2.prototype, {\n /**\n * @api private\n */\n setupRequestListeners: function setupRequestListeners(request) {\n request.addListener('build', this.modifyContentType);\n },\n\n /**\n * Normally rest-json services require `Content-Type` header to be 'application/json',\n * However Lex Model V2 services requires the header to be 'application/x-amz-json-1.1'.\n *\n * @api private\n */\n modifyContentType: function modifyContentType(request) {\n if (request.httpRequest.headers['Content-Type'] === 'application/json') {\n request.httpRequest.headers['Content-Type'] = 'application/x-amz-json-1.1';\n }\n }\n});\n\n","var AWS = require('../core');\n\nAWS.util.update(AWS.LookoutMetrics.prototype, {\n /**\n * @api private\n */\n setupRequestListeners: function setupRequestListeners(request) {\n request.addListener('build', this.modifyContentType);\n },\n\n /**\n * Normally rest-json services require `Content-Type` header to be 'application/json',\n * However lookout metrics services requires the header to be 'application/x-amz-json-1.1'.\n *\n * @api private\n */\n modifyContentType: function modifyContentType(request) {\n if (request.httpRequest.headers['Content-Type'] === 'application/json') {\n request.httpRequest.headers['Content-Type'] = 'application/x-amz-json-1.1';\n }\n }\n});\n","var AWS = require('../core');\n\nAWS.util.update(AWS.MachineLearning.prototype, {\n /**\n * @api private\n */\n setupRequestListeners: function setupRequestListeners(request) {\n if (request.operation === 'predict') {\n request.addListener('build', this.buildEndpoint);\n }\n },\n\n /**\n * Updates request endpoint from PredictEndpoint\n * @api private\n */\n buildEndpoint: function buildEndpoint(request) {\n var url = request.params.PredictEndpoint;\n if (url) {\n request.httpRequest.endpoint = new AWS.Endpoint(url);\n }\n }\n\n});\n","var AWS = require('../core');\nvar rdsutil = require('./rdsutil');\n\n/**\n* @api private\n*/\nvar crossRegionOperations = ['createDBCluster', 'copyDBClusterSnapshot'];\n\nAWS.util.update(AWS.Neptune.prototype, {\n /**\n * @api private\n */\n setupRequestListeners: function setupRequestListeners(request) {\n if (\n crossRegionOperations.indexOf(request.operation) !== -1 &&\n this.config.params &&\n this.config.params.SourceRegion &&\n request.params &&\n !request.params.SourceRegion\n ) {\n request.params.SourceRegion = this.config.params.SourceRegion;\n }\n rdsutil.setupRequestListeners(this, request, crossRegionOperations);\n },\n});\n","require('../polly/presigner');\n","var AWS = require('../core');\nvar rdsutil = require('./rdsutil');\nrequire('../rds/signer');\n /**\n * @api private\n */\n var crossRegionOperations = ['copyDBSnapshot', 'createDBInstanceReadReplica', 'createDBCluster', 'copyDBClusterSnapshot', 'startDBInstanceAutomatedBackupsReplication'];\n\n AWS.util.update(AWS.RDS.prototype, {\n /**\n * @api private\n */\n setupRequestListeners: function setupRequestListeners(request) {\n rdsutil.setupRequestListeners(this, request, crossRegionOperations);\n },\n });\n","var AWS = require('../core');\n\nAWS.util.update(AWS.RDSDataService.prototype, {\n /**\n * @return [Boolean] whether the error can be retried\n * @api private\n */\n retryableError: function retryableError(error) {\n if (error.code === 'BadRequestException' &&\n error.message &&\n error.message.match(/^Communications link failure/) &&\n error.statusCode === 400) {\n return true;\n } else {\n var _super = AWS.Service.prototype.retryableError;\n return _super.call(this, error);\n }\n }\n});\n","var AWS = require('../core');\n\nvar rdsutil = {\n /**\n * @api private\n */\n setupRequestListeners: function setupRequestListeners(service, request, crossRegionOperations) {\n if (crossRegionOperations.indexOf(request.operation) !== -1 &&\n request.params.SourceRegion) {\n request.params = AWS.util.copy(request.params);\n if (request.params.PreSignedUrl ||\n request.params.SourceRegion === service.config.region) {\n delete request.params.SourceRegion;\n } else {\n var doesParamValidation = !!service.config.paramValidation;\n // remove the validate parameters listener so we can re-add it after we build the URL\n if (doesParamValidation) {\n request.removeListener('validate', AWS.EventListeners.Core.VALIDATE_PARAMETERS);\n }\n request.onAsync('validate', rdsutil.buildCrossRegionPresignedUrl);\n if (doesParamValidation) {\n request.addListener('validate', AWS.EventListeners.Core.VALIDATE_PARAMETERS);\n }\n }\n }\n },\n\n /**\n * @api private\n */\n buildCrossRegionPresignedUrl: function buildCrossRegionPresignedUrl(req, done) {\n var config = AWS.util.copy(req.service.config);\n config.region = req.params.SourceRegion;\n delete req.params.SourceRegion;\n delete config.endpoint;\n // relevant params for the operation will already be in req.params\n delete config.params;\n config.signatureVersion = 'v4';\n var destinationRegion = req.service.config.region;\n\n var svc = new req.service.constructor(config);\n var newReq = svc[req.operation](AWS.util.copy(req.params));\n newReq.on('build', function addDestinationRegionParam(request) {\n var httpRequest = request.httpRequest;\n httpRequest.params.DestinationRegion = destinationRegion;\n httpRequest.body = AWS.util.queryParamsToString(httpRequest.params);\n });\n newReq.presign(function(err, url) {\n if (err) done(err);\n else {\n req.params.PreSignedUrl = url;\n done();\n }\n });\n }\n};\n\n/**\n * @api private\n */\nmodule.exports = rdsutil;\n","var AWS = require('../core');\n\nAWS.util.update(AWS.Route53.prototype, {\n /**\n * @api private\n */\n setupRequestListeners: function setupRequestListeners(request) {\n request.on('build', this.sanitizeUrl);\n },\n\n /**\n * @api private\n */\n sanitizeUrl: function sanitizeUrl(request) {\n var path = request.httpRequest.path;\n request.httpRequest.path = path.replace(/\\/%2F\\w+%2F/, '/');\n },\n\n /**\n * @return [Boolean] whether the error can be retried\n * @api private\n */\n retryableError: function retryableError(error) {\n if (error.code === 'PriorRequestNotComplete' &&\n error.statusCode === 400) {\n return true;\n } else {\n var _super = AWS.Service.prototype.retryableError;\n return _super.call(this, error);\n }\n }\n});\n","var AWS = require('../core');\nvar v4Credentials = require('../signers/v4_credentials');\nvar resolveRegionalEndpointsFlag = require('../config_regional_endpoint');\nvar s3util = require('./s3util');\nvar regionUtil = require('../region_config');\n\n// Pull in managed upload extension\nrequire('../s3/managed_upload');\n\n/**\n * @api private\n */\nvar operationsWith200StatusCodeError = {\n 'completeMultipartUpload': true,\n 'copyObject': true,\n 'uploadPartCopy': true\n};\n\n/**\n * @api private\n */\n var regionRedirectErrorCodes = [\n 'AuthorizationHeaderMalformed', // non-head operations on virtual-hosted global bucket endpoints\n 'BadRequest', // head operations on virtual-hosted global bucket endpoints\n 'PermanentRedirect', // non-head operations on path-style or regional endpoints\n 301 // head operations on path-style or regional endpoints\n ];\n\nvar OBJECT_LAMBDA_SERVICE = 's3-object-lambda';\n\nAWS.util.update(AWS.S3.prototype, {\n /**\n * @api private\n */\n getSignatureVersion: function getSignatureVersion(request) {\n var defaultApiVersion = this.api.signatureVersion;\n var userDefinedVersion = this._originalConfig ? this._originalConfig.signatureVersion : null;\n var regionDefinedVersion = this.config.signatureVersion;\n var isPresigned = request ? request.isPresigned() : false;\n /*\n 1) User defined version specified:\n a) always return user defined version\n 2) No user defined version specified:\n a) If not using presigned urls, default to V4\n b) If using presigned urls, default to lowest version the region supports\n */\n if (userDefinedVersion) {\n userDefinedVersion = userDefinedVersion === 'v2' ? 's3' : userDefinedVersion;\n return userDefinedVersion;\n }\n if (isPresigned !== true) {\n defaultApiVersion = 'v4';\n } else if (regionDefinedVersion) {\n defaultApiVersion = regionDefinedVersion;\n }\n return defaultApiVersion;\n },\n\n /**\n * @api private\n */\n getSigningName: function getSigningName(req) {\n if (req && req.operation === 'writeGetObjectResponse') {\n return OBJECT_LAMBDA_SERVICE;\n }\n\n var _super = AWS.Service.prototype.getSigningName;\n return (req && req._parsedArn && req._parsedArn.service)\n ? req._parsedArn.service\n : _super.call(this);\n },\n\n /**\n * @api private\n */\n getSignerClass: function getSignerClass(request) {\n var signatureVersion = this.getSignatureVersion(request);\n return AWS.Signers.RequestSigner.getVersion(signatureVersion);\n },\n\n /**\n * @api private\n */\n validateService: function validateService() {\n var msg;\n var messages = [];\n\n // default to us-east-1 when no region is provided\n if (!this.config.region) this.config.region = 'us-east-1';\n\n if (!this.config.endpoint && this.config.s3BucketEndpoint) {\n messages.push('An endpoint must be provided when configuring ' +\n '`s3BucketEndpoint` to true.');\n }\n if (messages.length === 1) {\n msg = messages[0];\n } else if (messages.length > 1) {\n msg = 'Multiple configuration errors:\\n' + messages.join('\\n');\n }\n if (msg) {\n throw AWS.util.error(new Error(),\n {name: 'InvalidEndpoint', message: msg});\n }\n },\n\n /**\n * @api private\n */\n shouldDisableBodySigning: function shouldDisableBodySigning(request) {\n var signerClass = this.getSignerClass();\n if (this.config.s3DisableBodySigning === true && signerClass === AWS.Signers.V4\n && request.httpRequest.endpoint.protocol === 'https:') {\n return true;\n }\n return false;\n },\n\n /**\n * @api private\n */\n setupRequestListeners: function setupRequestListeners(request) {\n var prependListener = true;\n request.addListener('validate', this.validateScheme);\n request.addListener('validate', this.validateBucketName, prependListener);\n request.addListener('validate', this.optInUsEast1RegionalEndpoint, prependListener);\n\n request.removeListener('validate',\n AWS.EventListeners.Core.VALIDATE_REGION);\n request.addListener('build', this.addContentType);\n request.addListener('build', this.computeContentMd5);\n request.addListener('build', this.computeSseCustomerKeyMd5);\n request.addListener('build', this.populateURI);\n request.addListener('afterBuild', this.addExpect100Continue);\n request.addListener('extractError', this.extractError);\n request.addListener('extractData', AWS.util.hoistPayloadMember);\n request.addListener('extractData', this.extractData);\n request.addListener('extractData', this.extractErrorFrom200Response);\n request.addListener('beforePresign', this.prepareSignedUrl);\n if (this.shouldDisableBodySigning(request)) {\n request.removeListener('afterBuild', AWS.EventListeners.Core.COMPUTE_SHA256);\n request.addListener('afterBuild', this.disableBodySigning);\n }\n //deal with ARNs supplied to Bucket\n if (request.operation !== 'createBucket' && s3util.isArnInParam(request, 'Bucket')) {\n // avoid duplicate parsing in the future\n request._parsedArn = AWS.util.ARN.parse(request.params.Bucket);\n\n request.removeListener('validate', this.validateBucketName);\n request.removeListener('build', this.populateURI);\n if (request._parsedArn.service === 's3') {\n request.addListener('validate', s3util.validateS3AccessPointArn);\n request.addListener('validate', this.validateArnResourceType);\n } else if (request._parsedArn.service === 's3-outposts') {\n request.addListener('validate', s3util.validateOutpostsAccessPointArn);\n request.addListener('validate', s3util.validateOutpostsArn);\n }\n request.addListener('validate', s3util.validateArnRegion);\n request.addListener('validate', s3util.validateArnAccount);\n request.addListener('validate', s3util.validateArnService);\n request.addListener('build', this.populateUriFromAccessPointArn);\n request.addListener('build', s3util.validatePopulateUriFromArn);\n return;\n }\n //listeners regarding region inference\n request.addListener('validate', this.validateBucketEndpoint);\n request.addListener('validate', this.correctBucketRegionFromCache);\n request.onAsync('extractError', this.requestBucketRegion);\n if (AWS.util.isBrowser()) {\n request.onAsync('retry', this.reqRegionForNetworkingError);\n }\n },\n\n /**\n * @api private\n */\n validateScheme: function(req) {\n var params = req.params,\n scheme = req.httpRequest.endpoint.protocol,\n sensitive = params.SSECustomerKey || params.CopySourceSSECustomerKey;\n if (sensitive && scheme !== 'https:') {\n var msg = 'Cannot send SSE keys over HTTP. Set \\'sslEnabled\\'' +\n 'to \\'true\\' in your configuration';\n throw AWS.util.error(new Error(),\n { code: 'ConfigError', message: msg });\n }\n },\n\n /**\n * @api private\n */\n validateBucketEndpoint: function(req) {\n if (!req.params.Bucket && req.service.config.s3BucketEndpoint) {\n var msg = 'Cannot send requests to root API with `s3BucketEndpoint` set.';\n throw AWS.util.error(new Error(),\n { code: 'ConfigError', message: msg });\n }\n },\n\n /**\n * Validate resource-type supplied in S3 ARN\n */\n validateArnResourceType: function validateArnResourceType(req) {\n var resource = req._parsedArn.resource;\n\n if (\n resource.indexOf('accesspoint:') !== 0 &&\n resource.indexOf('accesspoint/') !== 0\n ) {\n throw AWS.util.error(new Error(), {\n code: 'InvalidARN',\n message: 'ARN resource should begin with \\'accesspoint/\\''\n });\n }\n },\n\n /**\n * @api private\n */\n validateBucketName: function validateBucketName(req) {\n var service = req.service;\n var signatureVersion = service.getSignatureVersion(req);\n var bucket = req.params && req.params.Bucket;\n var key = req.params && req.params.Key;\n var slashIndex = bucket && bucket.indexOf('/');\n if (bucket && slashIndex >= 0) {\n if (typeof key === 'string' && slashIndex > 0) {\n req.params = AWS.util.copy(req.params);\n // Need to include trailing slash to match sigv2 behavior\n var prefix = bucket.substr(slashIndex + 1) || '';\n req.params.Key = prefix + '/' + key;\n req.params.Bucket = bucket.substr(0, slashIndex);\n } else if (signatureVersion === 'v4') {\n var msg = 'Bucket names cannot contain forward slashes. Bucket: ' + bucket;\n throw AWS.util.error(new Error(),\n { code: 'InvalidBucket', message: msg });\n }\n }\n },\n\n /**\n * @api private\n */\n isValidAccelerateOperation: function isValidAccelerateOperation(operation) {\n var invalidOperations = [\n 'createBucket',\n 'deleteBucket',\n 'listBuckets'\n ];\n return invalidOperations.indexOf(operation) === -1;\n },\n\n /**\n * When us-east-1 region endpoint configuration is set, in stead of sending request to\n * global endpoint(e.g. 's3.amazonaws.com'), we will send request to\n * 's3.us-east-1.amazonaws.com'.\n * @api private\n */\n optInUsEast1RegionalEndpoint: function optInUsEast1RegionalEndpoint(req) {\n var service = req.service;\n var config = service.config;\n config.s3UsEast1RegionalEndpoint = resolveRegionalEndpointsFlag(service._originalConfig, {\n env: 'AWS_S3_US_EAST_1_REGIONAL_ENDPOINT',\n sharedConfig: 's3_us_east_1_regional_endpoint',\n clientConfig: 's3UsEast1RegionalEndpoint'\n });\n if (\n !(service._originalConfig || {}).endpoint &&\n req.httpRequest.region === 'us-east-1' &&\n config.s3UsEast1RegionalEndpoint === 'regional' &&\n req.httpRequest.endpoint.hostname.indexOf('s3.amazonaws.com') >= 0\n ) {\n var insertPoint = config.endpoint.indexOf('.amazonaws.com');\n regionalEndpoint = config.endpoint.substring(0, insertPoint) +\n '.us-east-1' + config.endpoint.substring(insertPoint);\n req.httpRequest.updateEndpoint(regionalEndpoint);\n }\n },\n\n /**\n * S3 prefers dns-compatible bucket names to be moved from the uri path\n * to the hostname as a sub-domain. This is not possible, even for dns-compat\n * buckets when using SSL and the bucket name contains a dot ('.'). The\n * ssl wildcard certificate is only 1-level deep.\n *\n * @api private\n */\n populateURI: function populateURI(req) {\n var httpRequest = req.httpRequest;\n var b = req.params.Bucket;\n var service = req.service;\n var endpoint = httpRequest.endpoint;\n if (b) {\n if (!service.pathStyleBucketName(b)) {\n if (service.config.useAccelerateEndpoint && service.isValidAccelerateOperation(req.operation)) {\n if (service.config.useDualstack) {\n endpoint.hostname = b + '.s3-accelerate.dualstack.amazonaws.com';\n } else {\n endpoint.hostname = b + '.s3-accelerate.amazonaws.com';\n }\n } else if (!service.config.s3BucketEndpoint) {\n endpoint.hostname =\n b + '.' + endpoint.hostname;\n }\n\n var port = endpoint.port;\n if (port !== 80 && port !== 443) {\n endpoint.host = endpoint.hostname + ':' +\n endpoint.port;\n } else {\n endpoint.host = endpoint.hostname;\n }\n\n httpRequest.virtualHostedBucket = b; // needed for signing the request\n service.removeVirtualHostedBucketFromPath(req);\n }\n }\n },\n\n /**\n * Takes the bucket name out of the path if bucket is virtual-hosted\n *\n * @api private\n */\n removeVirtualHostedBucketFromPath: function removeVirtualHostedBucketFromPath(req) {\n var httpRequest = req.httpRequest;\n var bucket = httpRequest.virtualHostedBucket;\n if (bucket && httpRequest.path) {\n if (req.params && req.params.Key) {\n var encodedS3Key = '/' + AWS.util.uriEscapePath(req.params.Key);\n if (httpRequest.path.indexOf(encodedS3Key) === 0 && (httpRequest.path.length === encodedS3Key.length || httpRequest.path[encodedS3Key.length] === '?')) {\n //path only contains key or path contains only key and querystring\n return;\n }\n }\n httpRequest.path = httpRequest.path.replace(new RegExp('/' + bucket), '');\n if (httpRequest.path[0] !== '/') {\n httpRequest.path = '/' + httpRequest.path;\n }\n }\n },\n\n /**\n * When user supply an access point ARN in the Bucket parameter, we need to\n * populate the URI according to the ARN.\n */\n populateUriFromAccessPointArn: function populateUriFromAccessPointArn(req) {\n var accessPointArn = req._parsedArn;\n\n var isOutpostArn = accessPointArn.service === 's3-outposts';\n var isObjectLambdaArn = accessPointArn.service === 's3-object-lambda';\n\n var outpostsSuffix = isOutpostArn ? '.' + accessPointArn.outpostId: '';\n var serviceName = isOutpostArn ? 's3-outposts': 's3-accesspoint';\n var dualStackSuffix = !isOutpostArn && req.service.config.useDualstack ? '.dualstack' : '';\n\n var endpoint = req.httpRequest.endpoint;\n var dnsSuffix = regionUtil.getEndpointSuffix(accessPointArn.region);\n var useArnRegion = req.service.config.s3UseArnRegion;\n\n endpoint.hostname = [\n accessPointArn.accessPoint + '-' + accessPointArn.accountId + outpostsSuffix,\n serviceName + dualStackSuffix,\n useArnRegion ? accessPointArn.region : req.service.config.region,\n dnsSuffix\n ].join('.');\n\n if (isObjectLambdaArn) {\n // should be in the format: \"accesspoint/${accesspointName}\"\n var serviceName = 's3-object-lambda';\n var accesspointName = accessPointArn.resource.split('/')[1];\n endpoint.hostname = [\n accesspointName + '-' + accessPointArn.accountId,\n serviceName,\n useArnRegion ? accessPointArn.region : req.service.config.region,\n dnsSuffix\n ].join('.');\n }\n endpoint.host = endpoint.hostname;\n var encodedArn = AWS.util.uriEscape(req.params.Bucket);\n var path = req.httpRequest.path;\n //remove the Bucket value from path\n req.httpRequest.path = path.replace(new RegExp('/' + encodedArn), '');\n if (req.httpRequest.path[0] !== '/') {\n req.httpRequest.path = '/' + req.httpRequest.path;\n }\n req.httpRequest.region = accessPointArn.region; //region used to sign\n },\n\n /**\n * Adds Expect: 100-continue header if payload is greater-or-equal 1MB\n * @api private\n */\n addExpect100Continue: function addExpect100Continue(req) {\n var len = req.httpRequest.headers['Content-Length'];\n if (AWS.util.isNode() && (len >= 1024 * 1024 || req.params.Body instanceof AWS.util.stream.Stream)) {\n req.httpRequest.headers['Expect'] = '100-continue';\n }\n },\n\n /**\n * Adds a default content type if none is supplied.\n *\n * @api private\n */\n addContentType: function addContentType(req) {\n var httpRequest = req.httpRequest;\n if (httpRequest.method === 'GET' || httpRequest.method === 'HEAD') {\n // Content-Type is not set in GET/HEAD requests\n delete httpRequest.headers['Content-Type'];\n return;\n }\n\n if (!httpRequest.headers['Content-Type']) { // always have a Content-Type\n httpRequest.headers['Content-Type'] = 'application/octet-stream';\n }\n\n var contentType = httpRequest.headers['Content-Type'];\n if (AWS.util.isBrowser()) {\n if (typeof httpRequest.body === 'string' && !contentType.match(/;\\s*charset=/)) {\n var charset = '; charset=UTF-8';\n httpRequest.headers['Content-Type'] += charset;\n } else {\n var replaceFn = function(_, prefix, charsetName) {\n return prefix + charsetName.toUpperCase();\n };\n\n httpRequest.headers['Content-Type'] =\n contentType.replace(/(;\\s*charset=)(.+)$/, replaceFn);\n }\n }\n },\n\n /**\n * @api private\n */\n computableChecksumOperations: {\n putBucketCors: true,\n putBucketLifecycle: true,\n putBucketLifecycleConfiguration: true,\n putBucketTagging: true,\n deleteObjects: true,\n putBucketReplication: true,\n putObjectLegalHold: true,\n putObjectRetention: true,\n putObjectLockConfiguration: true\n },\n\n /**\n * Checks whether checksums should be computed for the request.\n * If the request requires checksums to be computed, this will always\n * return true, otherwise it depends on whether {AWS.Config.computeChecksums}\n * is set.\n *\n * @param req [AWS.Request] the request to check against\n * @return [Boolean] whether to compute checksums for a request.\n * @api private\n */\n willComputeChecksums: function willComputeChecksums(req) {\n if (this.computableChecksumOperations[req.operation]) return true;\n if (!this.config.computeChecksums) return false;\n\n // TODO: compute checksums for Stream objects\n if (!AWS.util.Buffer.isBuffer(req.httpRequest.body) &&\n typeof req.httpRequest.body !== 'string') {\n return false;\n }\n\n var rules = req.service.api.operations[req.operation].input.members;\n\n // Sha256 signing disabled, and not a presigned url\n if (req.service.shouldDisableBodySigning(req) && !Object.prototype.hasOwnProperty.call(req.httpRequest.headers, 'presigned-expires')) {\n if (rules.ContentMD5 && !req.params.ContentMD5) {\n return true;\n }\n }\n\n // V4 signer uses SHA256 signatures so only compute MD5 if it is required\n if (req.service.getSignerClass(req) === AWS.Signers.V4) {\n if (rules.ContentMD5 && !rules.ContentMD5.required) return false;\n }\n\n if (rules.ContentMD5 && !req.params.ContentMD5) return true;\n },\n\n /**\n * A listener that computes the Content-MD5 and sets it in the header.\n * @see AWS.S3.willComputeChecksums\n * @api private\n */\n computeContentMd5: function computeContentMd5(req) {\n if (req.service.willComputeChecksums(req)) {\n var md5 = AWS.util.crypto.md5(req.httpRequest.body, 'base64');\n req.httpRequest.headers['Content-MD5'] = md5;\n }\n },\n\n /**\n * @api private\n */\n computeSseCustomerKeyMd5: function computeSseCustomerKeyMd5(req) {\n var keys = {\n SSECustomerKey: 'x-amz-server-side-encryption-customer-key-MD5',\n CopySourceSSECustomerKey: 'x-amz-copy-source-server-side-encryption-customer-key-MD5'\n };\n AWS.util.each(keys, function(key, header) {\n if (req.params[key]) {\n var value = AWS.util.crypto.md5(req.params[key], 'base64');\n req.httpRequest.headers[header] = value;\n }\n });\n },\n\n /**\n * Returns true if the bucket name should be left in the URI path for\n * a request to S3. This function takes into account the current\n * endpoint protocol (e.g. http or https).\n *\n * @api private\n */\n pathStyleBucketName: function pathStyleBucketName(bucketName) {\n // user can force path style requests via the configuration\n if (this.config.s3ForcePathStyle) return true;\n if (this.config.s3BucketEndpoint) return false;\n\n if (s3util.dnsCompatibleBucketName(bucketName)) {\n return (this.config.sslEnabled && bucketName.match(/\\./)) ? true : false;\n } else {\n return true; // not dns compatible names must always use path style\n }\n },\n\n /**\n * For COPY operations, some can be error even with status code 200.\n * SDK treats the response as exception when response body indicates\n * an exception or body is empty.\n *\n * @api private\n */\n extractErrorFrom200Response: function extractErrorFrom200Response(resp) {\n if (!operationsWith200StatusCodeError[resp.request.operation]) return;\n var httpResponse = resp.httpResponse;\n if (httpResponse.body && httpResponse.body.toString().match('')) {\n // Response body with '...' indicates an exception.\n // Get S3 client object. In ManagedUpload, this.service refers to\n // S3 client object.\n resp.data = null;\n var service = this.service ? this.service : this;\n service.extractError(resp);\n throw resp.error;\n } else if (!httpResponse.body || !httpResponse.body.toString().match(/<[\\w_]/)) {\n // When body is empty or incomplete, S3 might stop the request on detecting client\n // side aborting the request.\n resp.data = null;\n throw AWS.util.error(new Error(), {\n code: 'InternalError',\n message: 'S3 aborted request'\n });\n }\n },\n\n /**\n * @return [Boolean] whether the error can be retried\n * @api private\n */\n retryableError: function retryableError(error, request) {\n if (operationsWith200StatusCodeError[request.operation] &&\n error.statusCode === 200) {\n return true;\n } else if (request._requestRegionForBucket &&\n request.service.bucketRegionCache[request._requestRegionForBucket]) {\n return false;\n } else if (error && error.code === 'RequestTimeout') {\n return true;\n } else if (error &&\n regionRedirectErrorCodes.indexOf(error.code) != -1 &&\n error.region && error.region != request.httpRequest.region) {\n request.httpRequest.region = error.region;\n if (error.statusCode === 301) {\n request.service.updateReqBucketRegion(request);\n }\n return true;\n } else {\n var _super = AWS.Service.prototype.retryableError;\n return _super.call(this, error, request);\n }\n },\n\n /**\n * Updates httpRequest with region. If region is not provided, then\n * the httpRequest will be updated based on httpRequest.region\n *\n * @api private\n */\n updateReqBucketRegion: function updateReqBucketRegion(request, region) {\n var httpRequest = request.httpRequest;\n if (typeof region === 'string' && region.length) {\n httpRequest.region = region;\n }\n if (!httpRequest.endpoint.host.match(/s3(?!-accelerate).*\\.amazonaws\\.com$/)) {\n return;\n }\n var service = request.service;\n var s3Config = service.config;\n var s3BucketEndpoint = s3Config.s3BucketEndpoint;\n if (s3BucketEndpoint) {\n delete s3Config.s3BucketEndpoint;\n }\n var newConfig = AWS.util.copy(s3Config);\n delete newConfig.endpoint;\n newConfig.region = httpRequest.region;\n\n httpRequest.endpoint = (new AWS.S3(newConfig)).endpoint;\n service.populateURI(request);\n s3Config.s3BucketEndpoint = s3BucketEndpoint;\n httpRequest.headers.Host = httpRequest.endpoint.host;\n\n if (request._asm.currentState === 'validate') {\n request.removeListener('build', service.populateURI);\n request.addListener('build', service.removeVirtualHostedBucketFromPath);\n }\n },\n\n /**\n * Provides a specialized parser for getBucketLocation -- all other\n * operations are parsed by the super class.\n *\n * @api private\n */\n extractData: function extractData(resp) {\n var req = resp.request;\n if (req.operation === 'getBucketLocation') {\n var match = resp.httpResponse.body.toString().match(/>(.+)<\\/Location/);\n delete resp.data['_'];\n if (match) {\n resp.data.LocationConstraint = match[1];\n } else {\n resp.data.LocationConstraint = '';\n }\n }\n var bucket = req.params.Bucket || null;\n if (req.operation === 'deleteBucket' && typeof bucket === 'string' && !resp.error) {\n req.service.clearBucketRegionCache(bucket);\n } else {\n var headers = resp.httpResponse.headers || {};\n var region = headers['x-amz-bucket-region'] || null;\n if (!region && req.operation === 'createBucket' && !resp.error) {\n var createBucketConfiguration = req.params.CreateBucketConfiguration;\n if (!createBucketConfiguration) {\n region = 'us-east-1';\n } else if (createBucketConfiguration.LocationConstraint === 'EU') {\n region = 'eu-west-1';\n } else {\n region = createBucketConfiguration.LocationConstraint;\n }\n }\n if (region) {\n if (bucket && region !== req.service.bucketRegionCache[bucket]) {\n req.service.bucketRegionCache[bucket] = region;\n }\n }\n }\n req.service.extractRequestIds(resp);\n },\n\n /**\n * Extracts an error object from the http response.\n *\n * @api private\n */\n extractError: function extractError(resp) {\n var codes = {\n 304: 'NotModified',\n 403: 'Forbidden',\n 400: 'BadRequest',\n 404: 'NotFound'\n };\n\n var req = resp.request;\n var code = resp.httpResponse.statusCode;\n var body = resp.httpResponse.body || '';\n\n var headers = resp.httpResponse.headers || {};\n var region = headers['x-amz-bucket-region'] || null;\n var bucket = req.params.Bucket || null;\n var bucketRegionCache = req.service.bucketRegionCache;\n if (region && bucket && region !== bucketRegionCache[bucket]) {\n bucketRegionCache[bucket] = region;\n }\n\n var cachedRegion;\n if (codes[code] && body.length === 0) {\n if (bucket && !region) {\n cachedRegion = bucketRegionCache[bucket] || null;\n if (cachedRegion !== req.httpRequest.region) {\n region = cachedRegion;\n }\n }\n resp.error = AWS.util.error(new Error(), {\n code: codes[code],\n message: null,\n region: region\n });\n } else {\n var data = new AWS.XML.Parser().parse(body.toString());\n\n if (data.Region && !region) {\n region = data.Region;\n if (bucket && region !== bucketRegionCache[bucket]) {\n bucketRegionCache[bucket] = region;\n }\n } else if (bucket && !region && !data.Region) {\n cachedRegion = bucketRegionCache[bucket] || null;\n if (cachedRegion !== req.httpRequest.region) {\n region = cachedRegion;\n }\n }\n\n resp.error = AWS.util.error(new Error(), {\n code: data.Code || code,\n message: data.Message || null,\n region: region\n });\n }\n req.service.extractRequestIds(resp);\n },\n\n /**\n * If region was not obtained synchronously, then send async request\n * to get bucket region for errors resulting from wrong region.\n *\n * @api private\n */\n requestBucketRegion: function requestBucketRegion(resp, done) {\n var error = resp.error;\n var req = resp.request;\n var bucket = req.params.Bucket || null;\n\n if (!error || !bucket || error.region || req.operation === 'listObjects' ||\n (AWS.util.isNode() && req.operation === 'headBucket') ||\n (error.statusCode === 400 && req.operation !== 'headObject') ||\n regionRedirectErrorCodes.indexOf(error.code) === -1) {\n return done();\n }\n var reqOperation = AWS.util.isNode() ? 'headBucket' : 'listObjects';\n var reqParams = {Bucket: bucket};\n if (reqOperation === 'listObjects') reqParams.MaxKeys = 0;\n var regionReq = req.service[reqOperation](reqParams);\n regionReq._requestRegionForBucket = bucket;\n regionReq.send(function() {\n var region = req.service.bucketRegionCache[bucket] || null;\n error.region = region;\n done();\n });\n },\n\n /**\n * For browser only. If NetworkingError received, will attempt to obtain\n * the bucket region.\n *\n * @api private\n */\n reqRegionForNetworkingError: function reqRegionForNetworkingError(resp, done) {\n if (!AWS.util.isBrowser()) {\n return done();\n }\n var error = resp.error;\n var request = resp.request;\n var bucket = request.params.Bucket;\n if (!error || error.code !== 'NetworkingError' || !bucket ||\n request.httpRequest.region === 'us-east-1') {\n return done();\n }\n var service = request.service;\n var bucketRegionCache = service.bucketRegionCache;\n var cachedRegion = bucketRegionCache[bucket] || null;\n\n if (cachedRegion && cachedRegion !== request.httpRequest.region) {\n service.updateReqBucketRegion(request, cachedRegion);\n done();\n } else if (!s3util.dnsCompatibleBucketName(bucket)) {\n service.updateReqBucketRegion(request, 'us-east-1');\n if (bucketRegionCache[bucket] !== 'us-east-1') {\n bucketRegionCache[bucket] = 'us-east-1';\n }\n done();\n } else if (request.httpRequest.virtualHostedBucket) {\n var getRegionReq = service.listObjects({Bucket: bucket, MaxKeys: 0});\n service.updateReqBucketRegion(getRegionReq, 'us-east-1');\n getRegionReq._requestRegionForBucket = bucket;\n\n getRegionReq.send(function() {\n var region = service.bucketRegionCache[bucket] || null;\n if (region && region !== request.httpRequest.region) {\n service.updateReqBucketRegion(request, region);\n }\n done();\n });\n } else {\n // DNS-compatible path-style\n // (s3ForcePathStyle or bucket name with dot over https)\n // Cannot obtain region information for this case\n done();\n }\n },\n\n /**\n * Cache for bucket region.\n *\n * @api private\n */\n bucketRegionCache: {},\n\n /**\n * Clears bucket region cache.\n *\n * @api private\n */\n clearBucketRegionCache: function(buckets) {\n var bucketRegionCache = this.bucketRegionCache;\n if (!buckets) {\n buckets = Object.keys(bucketRegionCache);\n } else if (typeof buckets === 'string') {\n buckets = [buckets];\n }\n for (var i = 0; i < buckets.length; i++) {\n delete bucketRegionCache[buckets[i]];\n }\n return bucketRegionCache;\n },\n\n /**\n * Corrects request region if bucket's cached region is different\n *\n * @api private\n */\n correctBucketRegionFromCache: function correctBucketRegionFromCache(req) {\n var bucket = req.params.Bucket || null;\n if (bucket) {\n var service = req.service;\n var requestRegion = req.httpRequest.region;\n var cachedRegion = service.bucketRegionCache[bucket];\n if (cachedRegion && cachedRegion !== requestRegion) {\n service.updateReqBucketRegion(req, cachedRegion);\n }\n }\n },\n\n /**\n * Extracts S3 specific request ids from the http response.\n *\n * @api private\n */\n extractRequestIds: function extractRequestIds(resp) {\n var extendedRequestId = resp.httpResponse.headers ? resp.httpResponse.headers['x-amz-id-2'] : null;\n var cfId = resp.httpResponse.headers ? resp.httpResponse.headers['x-amz-cf-id'] : null;\n resp.extendedRequestId = extendedRequestId;\n resp.cfId = cfId;\n\n if (resp.error) {\n resp.error.requestId = resp.requestId || null;\n resp.error.extendedRequestId = extendedRequestId;\n resp.error.cfId = cfId;\n }\n },\n\n /**\n * Get a pre-signed URL for a given operation name.\n *\n * @note You must ensure that you have static or previously resolved\n * credentials if you call this method synchronously (with no callback),\n * otherwise it may not properly sign the request. If you cannot guarantee\n * this (you are using an asynchronous credential provider, i.e., EC2\n * IAM roles), you should always call this method with an asynchronous\n * callback.\n * @note Not all operation parameters are supported when using pre-signed\n * URLs. Certain parameters, such as `SSECustomerKey`, `ACL`, `Expires`,\n * `ContentLength`, or `Tagging` must be provided as headers when sending a\n * request. If you are using pre-signed URLs to upload from a browser and\n * need to use these fields, see {createPresignedPost}.\n * @note The default signer allows altering the request by adding corresponding\n * headers to set some parameters (e.g. Range) and these added parameters\n * won't be signed. You must use signatureVersion v4 to to include these\n * parameters in the signed portion of the URL and enforce exact matching\n * between headers and signed params in the URL.\n * @note This operation cannot be used with a promise. See note above regarding\n * asynchronous credentials and use with a callback.\n * @param operation [String] the name of the operation to call\n * @param params [map] parameters to pass to the operation. See the given\n * operation for the expected operation parameters. In addition, you can\n * also pass the \"Expires\" parameter to inform S3 how long the URL should\n * work for.\n * @option params Expires [Integer] (900) the number of seconds to expire\n * the pre-signed URL operation in. Defaults to 15 minutes.\n * @param callback [Function] if a callback is provided, this function will\n * pass the URL as the second parameter (after the error parameter) to\n * the callback function.\n * @return [String] if called synchronously (with no callback), returns the\n * signed URL.\n * @return [null] nothing is returned if a callback is provided.\n * @example Pre-signing a getObject operation (synchronously)\n * var params = {Bucket: 'bucket', Key: 'key'};\n * var url = s3.getSignedUrl('getObject', params);\n * console.log('The URL is', url);\n * @example Pre-signing a putObject (asynchronously)\n * var params = {Bucket: 'bucket', Key: 'key'};\n * s3.getSignedUrl('putObject', params, function (err, url) {\n * console.log('The URL is', url);\n * });\n * @example Pre-signing a putObject operation with a specific payload\n * var params = {Bucket: 'bucket', Key: 'key', Body: 'body'};\n * var url = s3.getSignedUrl('putObject', params);\n * console.log('The URL is', url);\n * @example Passing in a 1-minute expiry time for a pre-signed URL\n * var params = {Bucket: 'bucket', Key: 'key', Expires: 60};\n * var url = s3.getSignedUrl('getObject', params);\n * console.log('The URL is', url); // expires in 60 seconds\n */\n getSignedUrl: function getSignedUrl(operation, params, callback) {\n params = AWS.util.copy(params || {});\n var expires = params.Expires || 900;\n\n if (typeof expires !== 'number') {\n throw AWS.util.error(new Error(),\n { code: 'InvalidParameterException', message: 'The expiration must be a number, received ' + typeof expires });\n }\n\n delete params.Expires; // we can't validate this\n var request = this.makeRequest(operation, params);\n\n if (callback) {\n AWS.util.defer(function() {\n request.presign(expires, callback);\n });\n } else {\n return request.presign(expires, callback);\n }\n },\n\n /**\n * @!method getSignedUrlPromise()\n * Returns a 'thenable' promise that will be resolved with a pre-signed URL\n * for a given operation name.\n *\n * Two callbacks can be provided to the `then` method on the returned promise.\n * The first callback will be called if the promise is fulfilled, and the second\n * callback will be called if the promise is rejected.\n * @note Not all operation parameters are supported when using pre-signed\n * URLs. Certain parameters, such as `SSECustomerKey`, `ACL`, `Expires`,\n * `ContentLength`, or `Tagging` must be provided as headers when sending a\n * request. If you are using pre-signed URLs to upload from a browser and\n * need to use these fields, see {createPresignedPost}.\n * @param operation [String] the name of the operation to call\n * @param params [map] parameters to pass to the operation. See the given\n * operation for the expected operation parameters. In addition, you can\n * also pass the \"Expires\" parameter to inform S3 how long the URL should\n * work for.\n * @option params Expires [Integer] (900) the number of seconds to expire\n * the pre-signed URL operation in. Defaults to 15 minutes.\n * @callback fulfilledCallback function(url)\n * Called if the promise is fulfilled.\n * @param url [String] the signed url\n * @callback rejectedCallback function(err)\n * Called if the promise is rejected.\n * @param err [Error] if an error occurred, this value will be filled\n * @return [Promise] A promise that represents the state of the `refresh` call.\n * @example Pre-signing a getObject operation\n * var params = {Bucket: 'bucket', Key: 'key'};\n * var promise = s3.getSignedUrlPromise('getObject', params);\n * promise.then(function(url) {\n * console.log('The URL is', url);\n * }, function(err) { ... });\n * @example Pre-signing a putObject operation with a specific payload\n * var params = {Bucket: 'bucket', Key: 'key', Body: 'body'};\n * var promise = s3.getSignedUrlPromise('putObject', params);\n * promise.then(function(url) {\n * console.log('The URL is', url);\n * }, function(err) { ... });\n * @example Passing in a 1-minute expiry time for a pre-signed URL\n * var params = {Bucket: 'bucket', Key: 'key', Expires: 60};\n * var promise = s3.getSignedUrlPromise('getObject', params);\n * promise.then(function(url) {\n * console.log('The URL is', url);\n * }, function(err) { ... });\n */\n\n /**\n * Get a pre-signed POST policy to support uploading to S3 directly from an\n * HTML form.\n *\n * @param params [map]\n * @option params Bucket [String] The bucket to which the post should be\n * uploaded\n * @option params Expires [Integer] (3600) The number of seconds for which\n * the presigned policy should be valid.\n * @option params Conditions [Array] An array of conditions that must be met\n * for the presigned policy to allow the\n * upload. This can include required tags,\n * the accepted range for content lengths,\n * etc.\n * @see http://docs.aws.amazon.com/AmazonS3/latest/API/sigv4-HTTPPOSTConstructPolicy.html\n * @option params Fields [map] Fields to include in the form. All\n * values passed in as fields will be\n * signed as exact match conditions.\n * @param callback [Function]\n *\n * @note All fields passed in when creating presigned post data will be signed\n * as exact match conditions. Any fields that will be interpolated by S3\n * must be added to the fields hash after signing, and an appropriate\n * condition for such fields must be explicitly added to the Conditions\n * array passed to this function before signing.\n *\n * @example Presiging post data with a known key\n * var params = {\n * Bucket: 'bucket',\n * Fields: {\n * key: 'key'\n * }\n * };\n * s3.createPresignedPost(params, function(err, data) {\n * if (err) {\n * console.error('Presigning post data encountered an error', err);\n * } else {\n * console.log('The post data is', data);\n * }\n * });\n *\n * @example Presigning post data with an interpolated key\n * var params = {\n * Bucket: 'bucket',\n * Conditions: [\n * ['starts-with', '$key', 'path/to/uploads/']\n * ]\n * };\n * s3.createPresignedPost(params, function(err, data) {\n * if (err) {\n * console.error('Presigning post data encountered an error', err);\n * } else {\n * data.Fields.key = 'path/to/uploads/${filename}';\n * console.log('The post data is', data);\n * }\n * });\n *\n * @note You must ensure that you have static or previously resolved\n * credentials if you call this method synchronously (with no callback),\n * otherwise it may not properly sign the request. If you cannot guarantee\n * this (you are using an asynchronous credential provider, i.e., EC2\n * IAM roles), you should always call this method with an asynchronous\n * callback.\n *\n * @return [map] If called synchronously (with no callback), returns a hash\n * with the url to set as the form action and a hash of fields\n * to include in the form.\n * @return [null] Nothing is returned if a callback is provided.\n *\n * @callback callback function (err, data)\n * @param err [Error] the error object returned from the policy signer\n * @param data [map] The data necessary to construct an HTML form\n * @param data.url [String] The URL to use as the action of the form\n * @param data.fields [map] A hash of fields that must be included in the\n * form for the upload to succeed. This hash will\n * include the signed POST policy, your access key\n * ID and security token (if present), etc. These\n * may be safely included as input elements of type\n * 'hidden.'\n */\n createPresignedPost: function createPresignedPost(params, callback) {\n if (typeof params === 'function' && callback === undefined) {\n callback = params;\n params = null;\n }\n\n params = AWS.util.copy(params || {});\n var boundParams = this.config.params || {};\n var bucket = params.Bucket || boundParams.Bucket,\n self = this,\n config = this.config,\n endpoint = AWS.util.copy(this.endpoint);\n if (!config.s3BucketEndpoint) {\n endpoint.pathname = '/' + bucket;\n }\n\n function finalizePost() {\n return {\n url: AWS.util.urlFormat(endpoint),\n fields: self.preparePostFields(\n config.credentials,\n config.region,\n bucket,\n params.Fields,\n params.Conditions,\n params.Expires\n )\n };\n }\n\n if (callback) {\n config.getCredentials(function (err) {\n if (err) {\n callback(err);\n } else {\n try {\n callback(null, finalizePost());\n } catch (err) {\n callback(err);\n }\n }\n });\n } else {\n return finalizePost();\n }\n },\n\n /**\n * @api private\n */\n preparePostFields: function preparePostFields(\n credentials,\n region,\n bucket,\n fields,\n conditions,\n expiresInSeconds\n ) {\n var now = this.getSkewCorrectedDate();\n if (!credentials || !region || !bucket) {\n throw new Error('Unable to create a POST object policy without a bucket,'\n + ' region, and credentials');\n }\n fields = AWS.util.copy(fields || {});\n conditions = (conditions || []).slice(0);\n expiresInSeconds = expiresInSeconds || 3600;\n\n var signingDate = AWS.util.date.iso8601(now).replace(/[:\\-]|\\.\\d{3}/g, '');\n var shortDate = signingDate.substr(0, 8);\n var scope = v4Credentials.createScope(shortDate, region, 's3');\n var credential = credentials.accessKeyId + '/' + scope;\n\n fields['bucket'] = bucket;\n fields['X-Amz-Algorithm'] = 'AWS4-HMAC-SHA256';\n fields['X-Amz-Credential'] = credential;\n fields['X-Amz-Date'] = signingDate;\n if (credentials.sessionToken) {\n fields['X-Amz-Security-Token'] = credentials.sessionToken;\n }\n for (var field in fields) {\n if (fields.hasOwnProperty(field)) {\n var condition = {};\n condition[field] = fields[field];\n conditions.push(condition);\n }\n }\n\n fields.Policy = this.preparePostPolicy(\n new Date(now.valueOf() + expiresInSeconds * 1000),\n conditions\n );\n fields['X-Amz-Signature'] = AWS.util.crypto.hmac(\n v4Credentials.getSigningKey(credentials, shortDate, region, 's3', true),\n fields.Policy,\n 'hex'\n );\n\n return fields;\n },\n\n /**\n * @api private\n */\n preparePostPolicy: function preparePostPolicy(expiration, conditions) {\n return AWS.util.base64.encode(JSON.stringify({\n expiration: AWS.util.date.iso8601(expiration),\n conditions: conditions\n }));\n },\n\n /**\n * @api private\n */\n prepareSignedUrl: function prepareSignedUrl(request) {\n request.addListener('validate', request.service.noPresignedContentLength);\n request.removeListener('build', request.service.addContentType);\n if (!request.params.Body) {\n // no Content-MD5/SHA-256 if body is not provided\n request.removeListener('build', request.service.computeContentMd5);\n } else {\n request.addListener('afterBuild', AWS.EventListeners.Core.COMPUTE_SHA256);\n }\n },\n\n /**\n * @api private\n * @param request\n */\n disableBodySigning: function disableBodySigning(request) {\n var headers = request.httpRequest.headers;\n // Add the header to anything that isn't a presigned url, unless that presigned url had a body defined\n if (!Object.prototype.hasOwnProperty.call(headers, 'presigned-expires')) {\n headers['X-Amz-Content-Sha256'] = 'UNSIGNED-PAYLOAD';\n }\n },\n\n /**\n * @api private\n */\n noPresignedContentLength: function noPresignedContentLength(request) {\n if (request.params.ContentLength !== undefined) {\n throw AWS.util.error(new Error(), {code: 'UnexpectedParameter',\n message: 'ContentLength is not supported in pre-signed URLs.'});\n }\n },\n\n createBucket: function createBucket(params, callback) {\n // When creating a bucket *outside* the classic region, the location\n // constraint must be set for the bucket and it must match the endpoint.\n // This chunk of code will set the location constraint param based\n // on the region (when possible), but it will not override a passed-in\n // location constraint.\n if (typeof params === 'function' || !params) {\n callback = callback || params;\n params = {};\n }\n var hostname = this.endpoint.hostname;\n // copy params so that appending keys does not unintentioinallly\n // mutate params object argument passed in by user\n var copiedParams = AWS.util.copy(params);\n\n if (hostname !== this.api.globalEndpoint && !params.CreateBucketConfiguration) {\n copiedParams.CreateBucketConfiguration = { LocationConstraint: this.config.region };\n }\n return this.makeRequest('createBucket', copiedParams, callback);\n },\n\n writeGetObjectResponse: function writeGetObjectResponse(params, callback) {\n\n var request = this.makeRequest('writeGetObjectResponse', AWS.util.copy(params), callback);\n var hostname = this.endpoint.hostname;\n if (hostname.indexOf(this.config.region) !== -1) {\n // hostname specifies a region already\n hostname = hostname.replace('s3.', OBJECT_LAMBDA_SERVICE + '.');\n } else {\n // Hostname doesn't have a region.\n // Object Lambda requires an explicit region.\n hostname = hostname.replace('s3.', OBJECT_LAMBDA_SERVICE + '.' + this.config.region + '.');\n }\n\n request.httpRequest.endpoint = new AWS.Endpoint(hostname, this.config);\n return request;\n },\n\n /**\n * @see AWS.S3.ManagedUpload\n * @overload upload(params = {}, [options], [callback])\n * Uploads an arbitrarily sized buffer, blob, or stream, using intelligent\n * concurrent handling of parts if the payload is large enough. You can\n * configure the concurrent queue size by setting `options`. Note that this\n * is the only operation for which the SDK can retry requests with stream\n * bodies.\n *\n * @param (see AWS.S3.putObject)\n * @option (see AWS.S3.ManagedUpload.constructor)\n * @return [AWS.S3.ManagedUpload] the managed upload object that can call\n * `send()` or track progress.\n * @example Uploading a stream object\n * var params = {Bucket: 'bucket', Key: 'key', Body: stream};\n * s3.upload(params, function(err, data) {\n * console.log(err, data);\n * });\n * @example Uploading a stream with concurrency of 1 and partSize of 10mb\n * var params = {Bucket: 'bucket', Key: 'key', Body: stream};\n * var options = {partSize: 10 * 1024 * 1024, queueSize: 1};\n * s3.upload(params, options, function(err, data) {\n * console.log(err, data);\n * });\n * @callback callback function(err, data)\n * @param err [Error] an error or null if no error occurred.\n * @param data [map] The response data from the successful upload:\n * @param data.Location [String] the URL of the uploaded object\n * @param data.ETag [String] the ETag of the uploaded object\n * @param data.Bucket [String] the bucket to which the object was uploaded\n * @param data.Key [String] the key to which the object was uploaded\n */\n upload: function upload(params, options, callback) {\n if (typeof options === 'function' && callback === undefined) {\n callback = options;\n options = null;\n }\n\n options = options || {};\n options = AWS.util.merge(options || {}, {service: this, params: params});\n\n var uploader = new AWS.S3.ManagedUpload(options);\n if (typeof callback === 'function') uploader.send(callback);\n return uploader;\n }\n});\n\n/**\n * @api private\n */\nAWS.S3.addPromisesToClass = function addPromisesToClass(PromiseDependency) {\n this.prototype.getSignedUrlPromise = AWS.util.promisifyMethod('getSignedUrl', PromiseDependency);\n};\n\n/**\n * @api private\n */\nAWS.S3.deletePromisesFromClass = function deletePromisesFromClass() {\n delete this.prototype.getSignedUrlPromise;\n};\n\nAWS.util.addPromises(AWS.S3);\n","var AWS = require('../core');\nvar s3util = require('./s3util');\nvar regionUtil = require('../region_config');\n\nAWS.util.update(AWS.S3Control.prototype, {\n /**\n * @api private\n */\n setupRequestListeners: function setupRequestListeners(request) {\n request.addListener('extractError', this.extractHostId);\n request.addListener('extractData', this.extractHostId);\n request.addListener('validate', this.validateAccountId);\n\n var isArnInBucket = s3util.isArnInParam(request, 'Bucket');\n var isArnInName = s3util.isArnInParam(request, 'Name');\n\n if (isArnInBucket) {\n request._parsedArn = AWS.util.ARN.parse(request.params['Bucket']);\n request.addListener('validate', this.validateOutpostsBucketArn);\n request.addListener('validate', s3util.validateOutpostsArn);\n request.addListener('afterBuild', this.addOutpostIdHeader);\n } else if (isArnInName) {\n request._parsedArn = AWS.util.ARN.parse(request.params['Name']);\n request.addListener('validate', s3util.validateOutpostsAccessPointArn);\n request.addListener('validate', s3util.validateOutpostsArn);\n request.addListener('afterBuild', this.addOutpostIdHeader);\n }\n\n if (isArnInBucket || isArnInName) {\n request.addListener('validate', s3util.validateArnRegion);\n request.addListener('validate', this.validateArnAccountWithParams, true);\n request.addListener('validate', s3util.validateArnAccount);\n request.addListener('validate', s3util.validateArnService);\n request.addListener('build', this.populateParamFromArn, true);\n request.addListener('build', this.populateUriFromArn);\n request.addListener('build', s3util.validatePopulateUriFromArn);\n }\n\n if (request.params.OutpostId &&\n (request.operation === 'createBucket' ||\n request.operation === 'listRegionalBuckets')) {\n request.addListener('build', this.populateEndpointForOutpostId);\n }\n },\n\n /**\n * Adds outpostId header\n */\n addOutpostIdHeader: function addOutpostIdHeader(req) {\n req.httpRequest.headers['x-amz-outpost-id'] = req._parsedArn.outpostId;\n },\n\n /**\n * Validate Outposts ARN supplied in Bucket parameter is a valid bucket name\n */\n validateOutpostsBucketArn: function validateOutpostsBucketArn(req) {\n var parsedArn = req._parsedArn;\n\n //can be ':' or '/'\n var delimiter = parsedArn.resource['outpost'.length];\n\n if (parsedArn.resource.split(delimiter).length !== 4) {\n throw AWS.util.error(new Error(), {\n code: 'InvalidARN',\n message: 'Bucket ARN should have two resources outpost/{outpostId}/bucket/{accesspointName}'\n });\n }\n\n var bucket = parsedArn.resource.split(delimiter)[3];\n if (!s3util.dnsCompatibleBucketName(bucket) || bucket.match(/\\./)) {\n throw AWS.util.error(new Error(), {\n code: 'InvalidARN',\n message: 'Bucket ARN is not DNS compatible. Got ' + bucket\n });\n }\n\n //set parsed valid bucket\n req._parsedArn.bucket = bucket;\n },\n\n /**\n * @api private\n */\n populateParamFromArn: function populateParamFromArn(req) {\n var parsedArn = req._parsedArn;\n if (s3util.isArnInParam(req, 'Bucket')) {\n req.params.Bucket = parsedArn.bucket;\n } else if (s3util.isArnInParam(req, 'Name')) {\n req.params.Name = parsedArn.accessPoint;\n }\n },\n\n /**\n * Populate URI according to the ARN\n */\n populateUriFromArn: function populateUriFromArn(req) {\n var parsedArn = req._parsedArn;\n\n var endpoint = req.httpRequest.endpoint;\n var useArnRegion = req.service.config.s3UseArnRegion;\n\n endpoint.hostname = [\n 's3-outposts',\n useArnRegion ? parsedArn.region : req.service.config.region,\n 'amazonaws.com'\n ].join('.');\n endpoint.host = endpoint.hostname;\n },\n\n /**\n * @api private\n */\n populateEndpointForOutpostId: function populateEndpointForOutpostId(req) {\n var endpoint = req.httpRequest.endpoint;\n endpoint.hostname = [\n 's3-outposts',\n req.service.config.region,\n 'amazonaws.com'\n ].join('.');\n endpoint.host = endpoint.hostname;\n },\n\n /**\n * @api private\n */\n extractHostId: function(response) {\n var hostId = response.httpResponse.headers ? response.httpResponse.headers['x-amz-id-2'] : null;\n response.extendedRequestId = hostId;\n if (response.error) {\n response.error.extendedRequestId = hostId;\n }\n },\n\n /**\n * @api private\n */\n validateArnAccountWithParams: function validateArnAccountWithParams(req) {\n var params = req.params;\n var inputModel = req.service.api.operations[req.operation].input;\n if (inputModel.members.AccountId) {\n var parsedArn = req._parsedArn;\n if (parsedArn.accountId) {\n if (params.AccountId) {\n if (params.AccountId !== parsedArn.accountId) {\n throw AWS.util.error(\n new Error(),\n {code: 'ValidationError', message: 'AccountId in ARN and request params should be same.'}\n );\n }\n } else {\n // Store accountId from ARN in params\n params.AccountId = parsedArn.accountId;\n }\n }\n }\n },\n\n /**\n * @api private\n */\n validateAccountId: function(request) {\n var params = request.params;\n if (!Object.prototype.hasOwnProperty.call(params, 'AccountId')) return;\n var accountId = params.AccountId;\n //validate type\n if (typeof accountId !== 'string') {\n throw AWS.util.error(\n new Error(),\n {code: 'ValidationError', message: 'AccountId must be a string.'}\n );\n }\n //validate length\n if (accountId.length < 1 || accountId.length > 63) {\n throw AWS.util.error(\n new Error(),\n {code: 'ValidationError', message: 'AccountId length should be between 1 to 63 characters, inclusive.'}\n );\n }\n //validate pattern\n var hostPattern = /^[a-zA-Z0-9]{1}$|^[a-zA-Z0-9][a-zA-Z0-9\\-]*[a-zA-Z0-9]$/;\n if (!hostPattern.test(accountId)) {\n throw AWS.util.error(new Error(),\n {code: 'ValidationError', message: 'AccountId should be hostname compatible. AccountId: ' + accountId});\n }\n },\n\n /**\n * @api private\n */\n getSigningName: function getSigningName(req) {\n var _super = AWS.Service.prototype.getSigningName;\n if (req && req._parsedArn && req._parsedArn.service) {\n return req._parsedArn.service;\n } else if (req.params.OutpostId &&\n (req.operation === 'createBucket' ||\n req.operation === 'listRegionalBuckets')) {\n return 's3-outposts';\n } else {\n return _super.call(this, req);\n }\n },\n});\n","var AWS = require('../core');\nvar regionUtil = require('../region_config');\n\nvar s3util = {\n /**\n * @api private\n */\n isArnInParam: function isArnInParam(req, paramName) {\n var inputShape = (req.service.api.operations[req.operation] || {}).input || {};\n var inputMembers = inputShape.members || {};\n if (!req.params[paramName] || !inputMembers[paramName]) return false;\n return AWS.util.ARN.validate(req.params[paramName]);\n },\n\n /**\n * Validate service component from ARN supplied in Bucket parameter\n */\n validateArnService: function validateArnService(req) {\n var parsedArn = req._parsedArn;\n\n if (parsedArn.service !== 's3'\n && parsedArn.service !== 's3-outposts'\n && parsedArn.service !== 's3-object-lambda') {\n throw AWS.util.error(new Error(), {\n code: 'InvalidARN',\n message: 'expect \\'s3\\' or \\'s3-outposts\\' or \\'s3-object-lambda\\' in ARN service component'\n });\n }\n },\n\n /**\n * Validate account ID from ARN supplied in Bucket parameter is a valid account\n */\n validateArnAccount: function validateArnAccount(req) {\n var parsedArn = req._parsedArn;\n\n if (!/[0-9]{12}/.exec(parsedArn.accountId)) {\n throw AWS.util.error(new Error(), {\n code: 'InvalidARN',\n message: 'ARN accountID does not match regex \"[0-9]{12}\"'\n });\n }\n },\n\n /**\n * Validate ARN supplied in Bucket parameter is a valid access point ARN\n */\n validateS3AccessPointArn: function validateS3AccessPointArn(req) {\n var parsedArn = req._parsedArn;\n\n //can be ':' or '/'\n var delimiter = parsedArn.resource['accesspoint'.length];\n\n if (parsedArn.resource.split(delimiter).length !== 2) {\n throw AWS.util.error(new Error(), {\n code: 'InvalidARN',\n message: 'Access Point ARN should have one resource accesspoint/{accesspointName}'\n });\n }\n\n var accessPoint = parsedArn.resource.split(delimiter)[1];\n var accessPointPrefix = accessPoint + '-' + parsedArn.accountId;\n if (!s3util.dnsCompatibleBucketName(accessPointPrefix) || accessPointPrefix.match(/\\./)) {\n throw AWS.util.error(new Error(), {\n code: 'InvalidARN',\n message: 'Access point resource in ARN is not DNS compatible. Got ' + accessPoint\n });\n }\n\n //set parsed valid access point\n req._parsedArn.accessPoint = accessPoint;\n },\n\n /**\n * Validate Outposts ARN supplied in Bucket parameter is a valid outposts ARN\n */\n validateOutpostsArn: function validateOutpostsArn(req) {\n var parsedArn = req._parsedArn;\n\n if (\n parsedArn.resource.indexOf('outpost:') !== 0 &&\n parsedArn.resource.indexOf('outpost/') !== 0\n ) {\n throw AWS.util.error(new Error(), {\n code: 'InvalidARN',\n message: 'ARN resource should begin with \\'outpost/\\''\n });\n }\n\n //can be ':' or '/'\n var delimiter = parsedArn.resource['outpost'.length];\n var outpostId = parsedArn.resource.split(delimiter)[1];\n var dnsHostRegex = new RegExp(/^([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9-]{0,61}[a-zA-Z0-9])$/);\n if (!dnsHostRegex.test(outpostId)) {\n throw AWS.util.error(new Error(), {\n code: 'InvalidARN',\n message: 'Outpost resource in ARN is not DNS compatible. Got ' + outpostId\n });\n }\n req._parsedArn.outpostId = outpostId;\n },\n\n /**\n * Validate Outposts ARN supplied in Bucket parameter is a valid outposts ARN\n */\n validateOutpostsAccessPointArn: function validateOutpostsAccessPointArn(req) {\n var parsedArn = req._parsedArn;\n\n //can be ':' or '/'\n var delimiter = parsedArn.resource['outpost'.length];\n\n if (parsedArn.resource.split(delimiter).length !== 4) {\n throw AWS.util.error(new Error(), {\n code: 'InvalidARN',\n message: 'Outposts ARN should have two resources outpost/{outpostId}/accesspoint/{accesspointName}'\n });\n }\n\n var accessPoint = parsedArn.resource.split(delimiter)[3];\n var accessPointPrefix = accessPoint + '-' + parsedArn.accountId;\n if (!s3util.dnsCompatibleBucketName(accessPointPrefix) || accessPointPrefix.match(/\\./)) {\n throw AWS.util.error(new Error(), {\n code: 'InvalidARN',\n message: 'Access point resource in ARN is not DNS compatible. Got ' + accessPoint\n });\n }\n\n //set parsed valid access point\n req._parsedArn.accessPoint = accessPoint;\n },\n\n /**\n * Validate region field in ARN supplied in Bucket parameter is a valid region\n */\n validateArnRegion: function validateArnRegion(req) {\n var useArnRegion = s3util.loadUseArnRegionConfig(req);\n var regionFromArn = req._parsedArn.region;\n var clientRegion = req.service.config.region;\n\n if (!regionFromArn) {\n throw AWS.util.error(new Error(), {\n code: 'InvalidARN',\n message: 'ARN region is empty'\n });\n }\n\n if (\n clientRegion.indexOf('fips') >= 0 ||\n regionFromArn.indexOf('fips') >= 0\n ) {\n throw AWS.util.error(new Error(), {\n code: 'InvalidConfiguration',\n message: 'ARN endpoint is not compatible with FIPS region'\n });\n }\n\n if (!useArnRegion && regionFromArn !== clientRegion) {\n throw AWS.util.error(new Error(), {\n code: 'InvalidConfiguration',\n message: 'Configured region conflicts with access point region'\n });\n } else if (\n useArnRegion &&\n regionUtil.getEndpointSuffix(regionFromArn) !== regionUtil.getEndpointSuffix(clientRegion)\n ) {\n throw AWS.util.error(new Error(), {\n code: 'InvalidConfiguration',\n message: 'Configured region and access point region not in same partition'\n });\n }\n\n if (req.service.config.useAccelerateEndpoint) {\n throw AWS.util.error(new Error(), {\n code: 'InvalidConfiguration',\n message: 'useAccelerateEndpoint config is not supported with access point ARN'\n });\n }\n\n if (req._parsedArn.service === 's3-outposts' && req.service.config.useDualstack) {\n throw AWS.util.error(new Error(), {\n code: 'InvalidConfiguration',\n message: 'useDualstack config is not supported with outposts access point ARN'\n });\n }\n },\n\n loadUseArnRegionConfig: function loadUseArnRegionConfig(req) {\n var envName = 'AWS_S3_USE_ARN_REGION';\n var configName = 's3_use_arn_region';\n var useArnRegion = true;\n var originalConfig = req.service._originalConfig || {};\n if (req.service.config.s3UseArnRegion !== undefined) {\n return req.service.config.s3UseArnRegion;\n } else if (originalConfig.s3UseArnRegion !== undefined) {\n useArnRegion = originalConfig.s3UseArnRegion === true;\n } else if (AWS.util.isNode()) {\n //load from environmental variable AWS_USE_ARN_REGION\n if (process.env[envName]) {\n var value = process.env[envName].trim().toLowerCase();\n if (['false', 'true'].indexOf(value) < 0) {\n throw AWS.util.error(new Error(), {\n code: 'InvalidConfiguration',\n message: envName + ' only accepts true or false. Got ' + process.env[envName],\n retryable: false\n });\n }\n useArnRegion = value === 'true';\n } else { //load from shared config property use_arn_region\n var profiles = {};\n var profile = {};\n try {\n profiles = AWS.util.getProfilesFromSharedConfig(AWS.util.iniLoader);\n profile = profiles[process.env.AWS_PROFILE || AWS.util.defaultProfile];\n } catch (e) {}\n if (profile[configName]) {\n if (['false', 'true'].indexOf(profile[configName].trim().toLowerCase()) < 0) {\n throw AWS.util.error(new Error(), {\n code: 'InvalidConfiguration',\n message: configName + ' only accepts true or false. Got ' + profile[configName],\n retryable: false\n });\n }\n useArnRegion = profile[configName].trim().toLowerCase() === 'true';\n }\n }\n }\n req.service.config.s3UseArnRegion = useArnRegion;\n return useArnRegion;\n },\n\n /**\n * Validations before URI can be populated\n */\n validatePopulateUriFromArn: function validatePopulateUriFromArn(req) {\n if (req.service._originalConfig && req.service._originalConfig.endpoint) {\n throw AWS.util.error(new Error(), {\n code: 'InvalidConfiguration',\n message: 'Custom endpoint is not compatible with access point ARN'\n });\n }\n\n if (req.service.config.s3ForcePathStyle) {\n throw AWS.util.error(new Error(), {\n code: 'InvalidConfiguration',\n message: 'Cannot construct path-style endpoint with access point'\n });\n }\n },\n\n /**\n * Returns true if the bucket name is DNS compatible. Buckets created\n * outside of the classic region MUST be DNS compatible.\n *\n * @api private\n */\n dnsCompatibleBucketName: function dnsCompatibleBucketName(bucketName) {\n var b = bucketName;\n var domain = new RegExp(/^[a-z0-9][a-z0-9\\.\\-]{1,61}[a-z0-9]$/);\n var ipAddress = new RegExp(/(\\d+\\.){3}\\d+/);\n var dots = new RegExp(/\\.\\./);\n return (b.match(domain) && !b.match(ipAddress) && !b.match(dots)) ? true : false;\n },\n};\n\n/**\n * @api private\n */\nmodule.exports = s3util;\n","var AWS = require('../core');\n\nAWS.util.update(AWS.SQS.prototype, {\n /**\n * @api private\n */\n setupRequestListeners: function setupRequestListeners(request) {\n request.addListener('build', this.buildEndpoint);\n\n if (request.service.config.computeChecksums) {\n if (request.operation === 'sendMessage') {\n request.addListener('extractData', this.verifySendMessageChecksum);\n } else if (request.operation === 'sendMessageBatch') {\n request.addListener('extractData', this.verifySendMessageBatchChecksum);\n } else if (request.operation === 'receiveMessage') {\n request.addListener('extractData', this.verifyReceiveMessageChecksum);\n }\n }\n },\n\n /**\n * @api private\n */\n verifySendMessageChecksum: function verifySendMessageChecksum(response) {\n if (!response.data) return;\n\n var md5 = response.data.MD5OfMessageBody;\n var body = this.params.MessageBody;\n var calculatedMd5 = this.service.calculateChecksum(body);\n if (calculatedMd5 !== md5) {\n var msg = 'Got \"' + response.data.MD5OfMessageBody +\n '\", expecting \"' + calculatedMd5 + '\".';\n this.service.throwInvalidChecksumError(response,\n [response.data.MessageId], msg);\n }\n },\n\n /**\n * @api private\n */\n verifySendMessageBatchChecksum: function verifySendMessageBatchChecksum(response) {\n if (!response.data) return;\n\n var service = this.service;\n var entries = {};\n var errors = [];\n var messageIds = [];\n AWS.util.arrayEach(response.data.Successful, function (entry) {\n entries[entry.Id] = entry;\n });\n AWS.util.arrayEach(this.params.Entries, function (entry) {\n if (entries[entry.Id]) {\n var md5 = entries[entry.Id].MD5OfMessageBody;\n var body = entry.MessageBody;\n if (!service.isChecksumValid(md5, body)) {\n errors.push(entry.Id);\n messageIds.push(entries[entry.Id].MessageId);\n }\n }\n });\n\n if (errors.length > 0) {\n service.throwInvalidChecksumError(response, messageIds,\n 'Invalid messages: ' + errors.join(', '));\n }\n },\n\n /**\n * @api private\n */\n verifyReceiveMessageChecksum: function verifyReceiveMessageChecksum(response) {\n if (!response.data) return;\n\n var service = this.service;\n var messageIds = [];\n AWS.util.arrayEach(response.data.Messages, function(message) {\n var md5 = message.MD5OfBody;\n var body = message.Body;\n if (!service.isChecksumValid(md5, body)) {\n messageIds.push(message.MessageId);\n }\n });\n\n if (messageIds.length > 0) {\n service.throwInvalidChecksumError(response, messageIds,\n 'Invalid messages: ' + messageIds.join(', '));\n }\n },\n\n /**\n * @api private\n */\n throwInvalidChecksumError: function throwInvalidChecksumError(response, ids, message) {\n response.error = AWS.util.error(new Error(), {\n retryable: true,\n code: 'InvalidChecksum',\n messageIds: ids,\n message: response.request.operation +\n ' returned an invalid MD5 response. ' + message\n });\n },\n\n /**\n * @api private\n */\n isChecksumValid: function isChecksumValid(checksum, data) {\n return this.calculateChecksum(data) === checksum;\n },\n\n /**\n * @api private\n */\n calculateChecksum: function calculateChecksum(data) {\n return AWS.util.crypto.md5(data, 'hex');\n },\n\n /**\n * @api private\n */\n buildEndpoint: function buildEndpoint(request) {\n var url = request.httpRequest.params.QueueUrl;\n if (url) {\n request.httpRequest.endpoint = new AWS.Endpoint(url);\n\n // signature version 4 requires the region name to be set,\n // sqs queue urls contain the region name\n var matches = request.httpRequest.endpoint.host.match(/^sqs\\.(.+?)\\./);\n if (matches) request.httpRequest.region = matches[1];\n }\n }\n});\n","var AWS = require('../core');\nvar resolveRegionalEndpointsFlag = require('../config_regional_endpoint');\nvar ENV_REGIONAL_ENDPOINT_ENABLED = 'AWS_STS_REGIONAL_ENDPOINTS';\nvar CONFIG_REGIONAL_ENDPOINT_ENABLED = 'sts_regional_endpoints';\n\nAWS.util.update(AWS.STS.prototype, {\n /**\n * @overload credentialsFrom(data, credentials = null)\n * Creates a credentials object from STS response data containing\n * credentials information. Useful for quickly setting AWS credentials.\n *\n * @note This is a low-level utility function. If you want to load temporary\n * credentials into your process for subsequent requests to AWS resources,\n * you should use {AWS.TemporaryCredentials} instead.\n * @param data [map] data retrieved from a call to {getFederatedToken},\n * {getSessionToken}, {assumeRole}, or {assumeRoleWithWebIdentity}.\n * @param credentials [AWS.Credentials] an optional credentials object to\n * fill instead of creating a new object. Useful when modifying an\n * existing credentials object from a refresh call.\n * @return [AWS.TemporaryCredentials] the set of temporary credentials\n * loaded from a raw STS operation response.\n * @example Using credentialsFrom to load global AWS credentials\n * var sts = new AWS.STS();\n * sts.getSessionToken(function (err, data) {\n * if (err) console.log(\"Error getting credentials\");\n * else {\n * AWS.config.credentials = sts.credentialsFrom(data);\n * }\n * });\n * @see AWS.TemporaryCredentials\n */\n credentialsFrom: function credentialsFrom(data, credentials) {\n if (!data) return null;\n if (!credentials) credentials = new AWS.TemporaryCredentials();\n credentials.expired = false;\n credentials.accessKeyId = data.Credentials.AccessKeyId;\n credentials.secretAccessKey = data.Credentials.SecretAccessKey;\n credentials.sessionToken = data.Credentials.SessionToken;\n credentials.expireTime = data.Credentials.Expiration;\n return credentials;\n },\n\n assumeRoleWithWebIdentity: function assumeRoleWithWebIdentity(params, callback) {\n return this.makeUnauthenticatedRequest('assumeRoleWithWebIdentity', params, callback);\n },\n\n assumeRoleWithSAML: function assumeRoleWithSAML(params, callback) {\n return this.makeUnauthenticatedRequest('assumeRoleWithSAML', params, callback);\n },\n\n /**\n * @api private\n */\n setupRequestListeners: function setupRequestListeners(request) {\n request.addListener('validate', this.optInRegionalEndpoint, true);\n },\n\n /**\n * @api private\n */\n optInRegionalEndpoint: function optInRegionalEndpoint(req) {\n var service = req.service;\n var config = service.config;\n config.stsRegionalEndpoints = resolveRegionalEndpointsFlag(service._originalConfig, {\n env: ENV_REGIONAL_ENDPOINT_ENABLED,\n sharedConfig: CONFIG_REGIONAL_ENDPOINT_ENABLED,\n clientConfig: 'stsRegionalEndpoints'\n });\n if (\n config.stsRegionalEndpoints === 'regional' &&\n service.isGlobalEndpoint\n ) {\n //client will throw if region is not supplied; request will be signed with specified region\n if (!config.region) {\n throw AWS.util.error(new Error(),\n {code: 'ConfigError', message: 'Missing region in config'});\n }\n var insertPoint = config.endpoint.indexOf('.amazonaws.com');\n var regionalEndpoint = config.endpoint.substring(0, insertPoint) +\n '.' + config.region + config.endpoint.substring(insertPoint);\n req.httpRequest.updateEndpoint(regionalEndpoint);\n req.httpRequest.region = config.region;\n }\n }\n\n});\n","var AWS = require('../core');\n\nAWS.util.hideProperties(AWS, ['SimpleWorkflow']);\n\n/**\n * @constant\n * @readonly\n * Backwards compatibility for access to the {AWS.SWF} service class.\n */\nAWS.SimpleWorkflow = AWS.SWF;\n","var IniLoader = require('./ini-loader').IniLoader;\n/**\n * Singleton object to load specified config/credentials files.\n * It will cache all the files ever loaded;\n */\nmodule.exports.iniLoader = new IniLoader();\n","var AWS = require('../core');\nvar os = require('os');\nvar path = require('path');\n\nfunction parseFile(filename, isConfig) {\n var content = AWS.util.ini.parse(AWS.util.readFileSync(filename));\n var tmpContent = {};\n Object.keys(content).forEach(function(profileName) {\n var profileContent = content[profileName];\n profileName = isConfig ? profileName.replace(/^profile\\s/, '') : profileName;\n Object.defineProperty(tmpContent, profileName, {\n value: profileContent,\n enumerable: true\n });\n });\n return tmpContent;\n}\n\n/**\n * Ini file loader class the same as that used in the SDK. It loads and\n * parses config and credentials files in .ini format and cache the content\n * to assure files are only read once.\n * Note that calling operations on the instance instantiated from this class\n * won't affect the behavior of SDK since SDK uses an internal singleton of\n * this class.\n * @!macro nobrowser\n */\nAWS.IniLoader = AWS.util.inherit({\n constructor: function IniLoader() {\n this.resolvedProfiles = {};\n },\n\n /** Remove all cached files. Used after config files are updated. */\n clearCachedFiles: function clearCachedFiles() {\n this.resolvedProfiles = {};\n },\n\n/**\n * Load configurations from config/credentials files and cache them\n * for later use. If no file is specified it will try to load default\n * files.\n * @param options [map] information describing the file\n * @option options filename [String] ('~/.aws/credentials' or defined by\n * AWS_SHARED_CREDENTIALS_FILE process env var or '~/.aws/config' if\n * isConfig is set to true)\n * path to the file to be read.\n * @option options isConfig [Boolean] (false) True to read config file.\n * @return [map] object containing contents from file in key-value\n * pairs.\n */\n loadFrom: function loadFrom(options) {\n options = options || {};\n var isConfig = options.isConfig === true;\n var filename = options.filename || this.getDefaultFilePath(isConfig);\n if (!this.resolvedProfiles[filename]) {\n var fileContent = this.parseFile(filename, isConfig);\n Object.defineProperty(this.resolvedProfiles, filename, { value: fileContent });\n }\n return this.resolvedProfiles[filename];\n },\n\n /**\n * @api private\n */\n parseFile: parseFile,\n\n /**\n * @api private\n */\n getDefaultFilePath: function getDefaultFilePath(isConfig) {\n return path.join(\n this.getHomeDir(),\n '.aws',\n isConfig ? 'config' : 'credentials'\n );\n },\n\n /**\n * @api private\n */\n getHomeDir: function getHomeDir() {\n var env = process.env;\n var home = env.HOME ||\n env.USERPROFILE ||\n (env.HOMEPATH ? ((env.HOMEDRIVE || 'C:/') + env.HOMEPATH) : null);\n\n if (home) {\n return home;\n }\n\n if (typeof os.homedir === 'function') {\n return os.homedir();\n }\n\n throw AWS.util.error(\n new Error('Cannot load credentials, HOME path not set')\n );\n }\n});\n\nvar IniLoader = AWS.IniLoader;\n\nmodule.exports = {\n IniLoader: IniLoader,\n parseFile: parseFile,\n};\n","var AWS = require('../core');\nvar inherit = AWS.util.inherit;\n\n/**\n * @api private\n */\nvar expiresHeader = 'presigned-expires';\n\n/**\n * @api private\n */\nfunction signedUrlBuilder(request) {\n var expires = request.httpRequest.headers[expiresHeader];\n var signerClass = request.service.getSignerClass(request);\n\n delete request.httpRequest.headers['User-Agent'];\n delete request.httpRequest.headers['X-Amz-User-Agent'];\n\n if (signerClass === AWS.Signers.V4) {\n if (expires > 604800) { // one week expiry is invalid\n var message = 'Presigning does not support expiry time greater ' +\n 'than a week with SigV4 signing.';\n throw AWS.util.error(new Error(), {\n code: 'InvalidExpiryTime', message: message, retryable: false\n });\n }\n request.httpRequest.headers[expiresHeader] = expires;\n } else if (signerClass === AWS.Signers.S3) {\n var now = request.service ? request.service.getSkewCorrectedDate() : AWS.util.date.getDate();\n request.httpRequest.headers[expiresHeader] = parseInt(\n AWS.util.date.unixTimestamp(now) + expires, 10).toString();\n } else {\n throw AWS.util.error(new Error(), {\n message: 'Presigning only supports S3 or SigV4 signing.',\n code: 'UnsupportedSigner', retryable: false\n });\n }\n}\n\n/**\n * @api private\n */\nfunction signedUrlSigner(request) {\n var endpoint = request.httpRequest.endpoint;\n var parsedUrl = AWS.util.urlParse(request.httpRequest.path);\n var queryParams = {};\n\n if (parsedUrl.search) {\n queryParams = AWS.util.queryStringParse(parsedUrl.search.substr(1));\n }\n\n var auth = request.httpRequest.headers['Authorization'].split(' ');\n if (auth[0] === 'AWS') {\n auth = auth[1].split(':');\n queryParams['Signature'] = auth.pop();\n queryParams['AWSAccessKeyId'] = auth.join(':');\n\n AWS.util.each(request.httpRequest.headers, function (key, value) {\n if (key === expiresHeader) key = 'Expires';\n if (key.indexOf('x-amz-meta-') === 0) {\n // Delete existing, potentially not normalized key\n delete queryParams[key];\n key = key.toLowerCase();\n }\n queryParams[key] = value;\n });\n delete request.httpRequest.headers[expiresHeader];\n delete queryParams['Authorization'];\n delete queryParams['Host'];\n } else if (auth[0] === 'AWS4-HMAC-SHA256') { // SigV4 signing\n auth.shift();\n var rest = auth.join(' ');\n var signature = rest.match(/Signature=(.*?)(?:,|\\s|\\r?\\n|$)/)[1];\n queryParams['X-Amz-Signature'] = signature;\n delete queryParams['Expires'];\n }\n\n // build URL\n endpoint.pathname = parsedUrl.pathname;\n endpoint.search = AWS.util.queryParamsToString(queryParams);\n}\n\n/**\n * @api private\n */\nAWS.Signers.Presign = inherit({\n /**\n * @api private\n */\n sign: function sign(request, expireTime, callback) {\n request.httpRequest.headers[expiresHeader] = expireTime || 3600;\n request.on('build', signedUrlBuilder);\n request.on('sign', signedUrlSigner);\n request.removeListener('afterBuild',\n AWS.EventListeners.Core.SET_CONTENT_LENGTH);\n request.removeListener('afterBuild',\n AWS.EventListeners.Core.COMPUTE_SHA256);\n\n request.emit('beforePresign', [request]);\n\n if (callback) {\n request.build(function() {\n if (this.response.error) callback(this.response.error);\n else {\n callback(null, AWS.util.urlFormat(request.httpRequest.endpoint));\n }\n });\n } else {\n request.build();\n if (request.response.error) throw request.response.error;\n return AWS.util.urlFormat(request.httpRequest.endpoint);\n }\n }\n});\n\n/**\n * @api private\n */\nmodule.exports = AWS.Signers.Presign;\n","var AWS = require('../core');\n\nvar inherit = AWS.util.inherit;\n\n/**\n * @api private\n */\nAWS.Signers.RequestSigner = inherit({\n constructor: function RequestSigner(request) {\n this.request = request;\n },\n\n setServiceClientId: function setServiceClientId(id) {\n this.serviceClientId = id;\n },\n\n getServiceClientId: function getServiceClientId() {\n return this.serviceClientId;\n }\n});\n\nAWS.Signers.RequestSigner.getVersion = function getVersion(version) {\n switch (version) {\n case 'v2': return AWS.Signers.V2;\n case 'v3': return AWS.Signers.V3;\n case 's3v4': return AWS.Signers.V4;\n case 'v4': return AWS.Signers.V4;\n case 's3': return AWS.Signers.S3;\n case 'v3https': return AWS.Signers.V3Https;\n }\n throw new Error('Unknown signing version ' + version);\n};\n\nrequire('./v2');\nrequire('./v3');\nrequire('./v3https');\nrequire('./v4');\nrequire('./s3');\nrequire('./presign');\n","var AWS = require('../core');\nvar inherit = AWS.util.inherit;\n\n/**\n * @api private\n */\nAWS.Signers.S3 = inherit(AWS.Signers.RequestSigner, {\n /**\n * When building the stringToSign, these sub resource params should be\n * part of the canonical resource string with their NON-decoded values\n */\n subResources: {\n 'acl': 1,\n 'accelerate': 1,\n 'analytics': 1,\n 'cors': 1,\n 'lifecycle': 1,\n 'delete': 1,\n 'inventory': 1,\n 'location': 1,\n 'logging': 1,\n 'metrics': 1,\n 'notification': 1,\n 'partNumber': 1,\n 'policy': 1,\n 'requestPayment': 1,\n 'replication': 1,\n 'restore': 1,\n 'tagging': 1,\n 'torrent': 1,\n 'uploadId': 1,\n 'uploads': 1,\n 'versionId': 1,\n 'versioning': 1,\n 'versions': 1,\n 'website': 1\n },\n\n // when building the stringToSign, these querystring params should be\n // part of the canonical resource string with their NON-encoded values\n responseHeaders: {\n 'response-content-type': 1,\n 'response-content-language': 1,\n 'response-expires': 1,\n 'response-cache-control': 1,\n 'response-content-disposition': 1,\n 'response-content-encoding': 1\n },\n\n addAuthorization: function addAuthorization(credentials, date) {\n if (!this.request.headers['presigned-expires']) {\n this.request.headers['X-Amz-Date'] = AWS.util.date.rfc822(date);\n }\n\n if (credentials.sessionToken) {\n // presigned URLs require this header to be lowercased\n this.request.headers['x-amz-security-token'] = credentials.sessionToken;\n }\n\n var signature = this.sign(credentials.secretAccessKey, this.stringToSign());\n var auth = 'AWS ' + credentials.accessKeyId + ':' + signature;\n\n this.request.headers['Authorization'] = auth;\n },\n\n stringToSign: function stringToSign() {\n var r = this.request;\n\n var parts = [];\n parts.push(r.method);\n parts.push(r.headers['Content-MD5'] || '');\n parts.push(r.headers['Content-Type'] || '');\n\n // This is the \"Date\" header, but we use X-Amz-Date.\n // The S3 signing mechanism requires us to pass an empty\n // string for this Date header regardless.\n parts.push(r.headers['presigned-expires'] || '');\n\n var headers = this.canonicalizedAmzHeaders();\n if (headers) parts.push(headers);\n parts.push(this.canonicalizedResource());\n\n return parts.join('\\n');\n\n },\n\n canonicalizedAmzHeaders: function canonicalizedAmzHeaders() {\n\n var amzHeaders = [];\n\n AWS.util.each(this.request.headers, function (name) {\n if (name.match(/^x-amz-/i))\n amzHeaders.push(name);\n });\n\n amzHeaders.sort(function (a, b) {\n return a.toLowerCase() < b.toLowerCase() ? -1 : 1;\n });\n\n var parts = [];\n AWS.util.arrayEach.call(this, amzHeaders, function (name) {\n parts.push(name.toLowerCase() + ':' + String(this.request.headers[name]));\n });\n\n return parts.join('\\n');\n\n },\n\n canonicalizedResource: function canonicalizedResource() {\n\n var r = this.request;\n\n var parts = r.path.split('?');\n var path = parts[0];\n var querystring = parts[1];\n\n var resource = '';\n\n if (r.virtualHostedBucket)\n resource += '/' + r.virtualHostedBucket;\n\n resource += path;\n\n if (querystring) {\n\n // collect a list of sub resources and query params that need to be signed\n var resources = [];\n\n AWS.util.arrayEach.call(this, querystring.split('&'), function (param) {\n var name = param.split('=')[0];\n var value = param.split('=')[1];\n if (this.subResources[name] || this.responseHeaders[name]) {\n var subresource = { name: name };\n if (value !== undefined) {\n if (this.subResources[name]) {\n subresource.value = value;\n } else {\n subresource.value = decodeURIComponent(value);\n }\n }\n resources.push(subresource);\n }\n });\n\n resources.sort(function (a, b) { return a.name < b.name ? -1 : 1; });\n\n if (resources.length) {\n\n querystring = [];\n AWS.util.arrayEach(resources, function (res) {\n if (res.value === undefined) {\n querystring.push(res.name);\n } else {\n querystring.push(res.name + '=' + res.value);\n }\n });\n\n resource += '?' + querystring.join('&');\n }\n\n }\n\n return resource;\n\n },\n\n sign: function sign(secret, string) {\n return AWS.util.crypto.hmac(secret, string, 'base64', 'sha1');\n }\n});\n\n/**\n * @api private\n */\nmodule.exports = AWS.Signers.S3;\n","var AWS = require('../core');\nvar inherit = AWS.util.inherit;\n\n/**\n * @api private\n */\nAWS.Signers.V2 = inherit(AWS.Signers.RequestSigner, {\n addAuthorization: function addAuthorization(credentials, date) {\n\n if (!date) date = AWS.util.date.getDate();\n\n var r = this.request;\n\n r.params.Timestamp = AWS.util.date.iso8601(date);\n r.params.SignatureVersion = '2';\n r.params.SignatureMethod = 'HmacSHA256';\n r.params.AWSAccessKeyId = credentials.accessKeyId;\n\n if (credentials.sessionToken) {\n r.params.SecurityToken = credentials.sessionToken;\n }\n\n delete r.params.Signature; // delete old Signature for re-signing\n r.params.Signature = this.signature(credentials);\n\n r.body = AWS.util.queryParamsToString(r.params);\n r.headers['Content-Length'] = r.body.length;\n },\n\n signature: function signature(credentials) {\n return AWS.util.crypto.hmac(credentials.secretAccessKey, this.stringToSign(), 'base64');\n },\n\n stringToSign: function stringToSign() {\n var parts = [];\n parts.push(this.request.method);\n parts.push(this.request.endpoint.host.toLowerCase());\n parts.push(this.request.pathname());\n parts.push(AWS.util.queryParamsToString(this.request.params));\n return parts.join('\\n');\n }\n\n});\n\n/**\n * @api private\n */\nmodule.exports = AWS.Signers.V2;\n","var AWS = require('../core');\nvar inherit = AWS.util.inherit;\n\n/**\n * @api private\n */\nAWS.Signers.V3 = inherit(AWS.Signers.RequestSigner, {\n addAuthorization: function addAuthorization(credentials, date) {\n\n var datetime = AWS.util.date.rfc822(date);\n\n this.request.headers['X-Amz-Date'] = datetime;\n\n if (credentials.sessionToken) {\n this.request.headers['x-amz-security-token'] = credentials.sessionToken;\n }\n\n this.request.headers['X-Amzn-Authorization'] =\n this.authorization(credentials, datetime);\n\n },\n\n authorization: function authorization(credentials) {\n return 'AWS3 ' +\n 'AWSAccessKeyId=' + credentials.accessKeyId + ',' +\n 'Algorithm=HmacSHA256,' +\n 'SignedHeaders=' + this.signedHeaders() + ',' +\n 'Signature=' + this.signature(credentials);\n },\n\n signedHeaders: function signedHeaders() {\n var headers = [];\n AWS.util.arrayEach(this.headersToSign(), function iterator(h) {\n headers.push(h.toLowerCase());\n });\n return headers.sort().join(';');\n },\n\n canonicalHeaders: function canonicalHeaders() {\n var headers = this.request.headers;\n var parts = [];\n AWS.util.arrayEach(this.headersToSign(), function iterator(h) {\n parts.push(h.toLowerCase().trim() + ':' + String(headers[h]).trim());\n });\n return parts.sort().join('\\n') + '\\n';\n },\n\n headersToSign: function headersToSign() {\n var headers = [];\n AWS.util.each(this.request.headers, function iterator(k) {\n if (k === 'Host' || k === 'Content-Encoding' || k.match(/^X-Amz/i)) {\n headers.push(k);\n }\n });\n return headers;\n },\n\n signature: function signature(credentials) {\n return AWS.util.crypto.hmac(credentials.secretAccessKey, this.stringToSign(), 'base64');\n },\n\n stringToSign: function stringToSign() {\n var parts = [];\n parts.push(this.request.method);\n parts.push('/');\n parts.push('');\n parts.push(this.canonicalHeaders());\n parts.push(this.request.body);\n return AWS.util.crypto.sha256(parts.join('\\n'));\n }\n\n});\n\n/**\n * @api private\n */\nmodule.exports = AWS.Signers.V3;\n","var AWS = require('../core');\nvar inherit = AWS.util.inherit;\n\nrequire('./v3');\n\n/**\n * @api private\n */\nAWS.Signers.V3Https = inherit(AWS.Signers.V3, {\n authorization: function authorization(credentials) {\n return 'AWS3-HTTPS ' +\n 'AWSAccessKeyId=' + credentials.accessKeyId + ',' +\n 'Algorithm=HmacSHA256,' +\n 'Signature=' + this.signature(credentials);\n },\n\n stringToSign: function stringToSign() {\n return this.request.headers['X-Amz-Date'];\n }\n});\n\n/**\n * @api private\n */\nmodule.exports = AWS.Signers.V3Https;\n","var AWS = require('../core');\nvar v4Credentials = require('./v4_credentials');\nvar inherit = AWS.util.inherit;\n\n/**\n * @api private\n */\nvar expiresHeader = 'presigned-expires';\n\n/**\n * @api private\n */\nAWS.Signers.V4 = inherit(AWS.Signers.RequestSigner, {\n constructor: function V4(request, serviceName, options) {\n AWS.Signers.RequestSigner.call(this, request);\n this.serviceName = serviceName;\n options = options || {};\n this.signatureCache = typeof options.signatureCache === 'boolean' ? options.signatureCache : true;\n this.operation = options.operation;\n this.signatureVersion = options.signatureVersion;\n },\n\n algorithm: 'AWS4-HMAC-SHA256',\n\n addAuthorization: function addAuthorization(credentials, date) {\n var datetime = AWS.util.date.iso8601(date).replace(/[:\\-]|\\.\\d{3}/g, '');\n\n if (this.isPresigned()) {\n this.updateForPresigned(credentials, datetime);\n } else {\n this.addHeaders(credentials, datetime);\n }\n\n this.request.headers['Authorization'] =\n this.authorization(credentials, datetime);\n },\n\n addHeaders: function addHeaders(credentials, datetime) {\n this.request.headers['X-Amz-Date'] = datetime;\n if (credentials.sessionToken) {\n this.request.headers['x-amz-security-token'] = credentials.sessionToken;\n }\n },\n\n updateForPresigned: function updateForPresigned(credentials, datetime) {\n var credString = this.credentialString(datetime);\n var qs = {\n 'X-Amz-Date': datetime,\n 'X-Amz-Algorithm': this.algorithm,\n 'X-Amz-Credential': credentials.accessKeyId + '/' + credString,\n 'X-Amz-Expires': this.request.headers[expiresHeader],\n 'X-Amz-SignedHeaders': this.signedHeaders()\n };\n\n if (credentials.sessionToken) {\n qs['X-Amz-Security-Token'] = credentials.sessionToken;\n }\n\n if (this.request.headers['Content-Type']) {\n qs['Content-Type'] = this.request.headers['Content-Type'];\n }\n if (this.request.headers['Content-MD5']) {\n qs['Content-MD5'] = this.request.headers['Content-MD5'];\n }\n if (this.request.headers['Cache-Control']) {\n qs['Cache-Control'] = this.request.headers['Cache-Control'];\n }\n\n // need to pull in any other X-Amz-* headers\n AWS.util.each.call(this, this.request.headers, function(key, value) {\n if (key === expiresHeader) return;\n if (this.isSignableHeader(key)) {\n var lowerKey = key.toLowerCase();\n // Metadata should be normalized\n if (lowerKey.indexOf('x-amz-meta-') === 0) {\n qs[lowerKey] = value;\n } else if (lowerKey.indexOf('x-amz-') === 0) {\n qs[key] = value;\n }\n }\n });\n\n var sep = this.request.path.indexOf('?') >= 0 ? '&' : '?';\n this.request.path += sep + AWS.util.queryParamsToString(qs);\n },\n\n authorization: function authorization(credentials, datetime) {\n var parts = [];\n var credString = this.credentialString(datetime);\n parts.push(this.algorithm + ' Credential=' +\n credentials.accessKeyId + '/' + credString);\n parts.push('SignedHeaders=' + this.signedHeaders());\n parts.push('Signature=' + this.signature(credentials, datetime));\n return parts.join(', ');\n },\n\n signature: function signature(credentials, datetime) {\n var signingKey = v4Credentials.getSigningKey(\n credentials,\n datetime.substr(0, 8),\n this.request.region,\n this.serviceName,\n this.signatureCache\n );\n return AWS.util.crypto.hmac(signingKey, this.stringToSign(datetime), 'hex');\n },\n\n stringToSign: function stringToSign(datetime) {\n var parts = [];\n parts.push('AWS4-HMAC-SHA256');\n parts.push(datetime);\n parts.push(this.credentialString(datetime));\n parts.push(this.hexEncodedHash(this.canonicalString()));\n return parts.join('\\n');\n },\n\n canonicalString: function canonicalString() {\n var parts = [], pathname = this.request.pathname();\n if (this.serviceName !== 's3' && this.signatureVersion !== 's3v4') pathname = AWS.util.uriEscapePath(pathname);\n\n parts.push(this.request.method);\n parts.push(pathname);\n parts.push(this.request.search());\n parts.push(this.canonicalHeaders() + '\\n');\n parts.push(this.signedHeaders());\n parts.push(this.hexEncodedBodyHash());\n return parts.join('\\n');\n },\n\n canonicalHeaders: function canonicalHeaders() {\n var headers = [];\n AWS.util.each.call(this, this.request.headers, function (key, item) {\n headers.push([key, item]);\n });\n headers.sort(function (a, b) {\n return a[0].toLowerCase() < b[0].toLowerCase() ? -1 : 1;\n });\n var parts = [];\n AWS.util.arrayEach.call(this, headers, function (item) {\n var key = item[0].toLowerCase();\n if (this.isSignableHeader(key)) {\n var value = item[1];\n if (typeof value === 'undefined' || value === null || typeof value.toString !== 'function') {\n throw AWS.util.error(new Error('Header ' + key + ' contains invalid value'), {\n code: 'InvalidHeader'\n });\n }\n parts.push(key + ':' +\n this.canonicalHeaderValues(value.toString()));\n }\n });\n return parts.join('\\n');\n },\n\n canonicalHeaderValues: function canonicalHeaderValues(values) {\n return values.replace(/\\s+/g, ' ').replace(/^\\s+|\\s+$/g, '');\n },\n\n signedHeaders: function signedHeaders() {\n var keys = [];\n AWS.util.each.call(this, this.request.headers, function (key) {\n key = key.toLowerCase();\n if (this.isSignableHeader(key)) keys.push(key);\n });\n return keys.sort().join(';');\n },\n\n credentialString: function credentialString(datetime) {\n return v4Credentials.createScope(\n datetime.substr(0, 8),\n this.request.region,\n this.serviceName\n );\n },\n\n hexEncodedHash: function hash(string) {\n return AWS.util.crypto.sha256(string, 'hex');\n },\n\n hexEncodedBodyHash: function hexEncodedBodyHash() {\n var request = this.request;\n if (this.isPresigned() && this.serviceName === 's3' && !request.body) {\n return 'UNSIGNED-PAYLOAD';\n } else if (request.headers['X-Amz-Content-Sha256']) {\n return request.headers['X-Amz-Content-Sha256'];\n } else {\n return this.hexEncodedHash(this.request.body || '');\n }\n },\n\n unsignableHeaders: [\n 'authorization',\n 'content-type',\n 'content-length',\n 'user-agent',\n expiresHeader,\n 'expect',\n 'x-amzn-trace-id'\n ],\n\n isSignableHeader: function isSignableHeader(key) {\n if (key.toLowerCase().indexOf('x-amz-') === 0) return true;\n return this.unsignableHeaders.indexOf(key) < 0;\n },\n\n isPresigned: function isPresigned() {\n return this.request.headers[expiresHeader] ? true : false;\n }\n\n});\n\n/**\n * @api private\n */\nmodule.exports = AWS.Signers.V4;\n","var AWS = require('../core');\n\n/**\n * @api private\n */\nvar cachedSecret = {};\n\n/**\n * @api private\n */\nvar cacheQueue = [];\n\n/**\n * @api private\n */\nvar maxCacheEntries = 50;\n\n/**\n * @api private\n */\nvar v4Identifier = 'aws4_request';\n\n/**\n * @api private\n */\nmodule.exports = {\n /**\n * @api private\n *\n * @param date [String]\n * @param region [String]\n * @param serviceName [String]\n * @return [String]\n */\n createScope: function createScope(date, region, serviceName) {\n return [\n date.substr(0, 8),\n region,\n serviceName,\n v4Identifier\n ].join('/');\n },\n\n /**\n * @api private\n *\n * @param credentials [Credentials]\n * @param date [String]\n * @param region [String]\n * @param service [String]\n * @param shouldCache [Boolean]\n * @return [String]\n */\n getSigningKey: function getSigningKey(\n credentials,\n date,\n region,\n service,\n shouldCache\n ) {\n var credsIdentifier = AWS.util.crypto\n .hmac(credentials.secretAccessKey, credentials.accessKeyId, 'base64');\n var cacheKey = [credsIdentifier, date, region, service].join('_');\n shouldCache = shouldCache !== false;\n if (shouldCache && (cacheKey in cachedSecret)) {\n return cachedSecret[cacheKey];\n }\n\n var kDate = AWS.util.crypto.hmac(\n 'AWS4' + credentials.secretAccessKey,\n date,\n 'buffer'\n );\n var kRegion = AWS.util.crypto.hmac(kDate, region, 'buffer');\n var kService = AWS.util.crypto.hmac(kRegion, service, 'buffer');\n\n var signingKey = AWS.util.crypto.hmac(kService, v4Identifier, 'buffer');\n if (shouldCache) {\n cachedSecret[cacheKey] = signingKey;\n cacheQueue.push(cacheKey);\n if (cacheQueue.length > maxCacheEntries) {\n // remove the oldest entry (not the least recently used)\n delete cachedSecret[cacheQueue.shift()];\n }\n }\n\n return signingKey;\n },\n\n /**\n * @api private\n *\n * Empties the derived signing key cache. Made available for testing purposes\n * only.\n */\n emptyCache: function emptyCache() {\n cachedSecret = {};\n cacheQueue = [];\n }\n};\n","function AcceptorStateMachine(states, state) {\n this.currentState = state || null;\n this.states = states || {};\n}\n\nAcceptorStateMachine.prototype.runTo = function runTo(finalState, done, bindObject, inputError) {\n if (typeof finalState === 'function') {\n inputError = bindObject; bindObject = done;\n done = finalState; finalState = null;\n }\n\n var self = this;\n var state = self.states[self.currentState];\n state.fn.call(bindObject || self, inputError, function(err) {\n if (err) {\n if (state.fail) self.currentState = state.fail;\n else return done ? done.call(bindObject, err) : null;\n } else {\n if (state.accept) self.currentState = state.accept;\n else return done ? done.call(bindObject) : null;\n }\n if (self.currentState === finalState) {\n return done ? done.call(bindObject, err) : null;\n }\n\n self.runTo(finalState, done, bindObject, err);\n });\n};\n\nAcceptorStateMachine.prototype.addState = function addState(name, acceptState, failState, fn) {\n if (typeof acceptState === 'function') {\n fn = acceptState; acceptState = null; failState = null;\n } else if (typeof failState === 'function') {\n fn = failState; failState = null;\n }\n\n if (!this.currentState) this.currentState = name;\n this.states[name] = { accept: acceptState, fail: failState, fn: fn };\n return this;\n};\n\n/**\n * @api private\n */\nmodule.exports = AcceptorStateMachine;\n","/* eslint guard-for-in:0 */\nvar AWS;\n\n/**\n * A set of utility methods for use with the AWS SDK.\n *\n * @!attribute abort\n * Return this value from an iterator function {each} or {arrayEach}\n * to break out of the iteration.\n * @example Breaking out of an iterator function\n * AWS.util.each({a: 1, b: 2, c: 3}, function(key, value) {\n * if (key == 'b') return AWS.util.abort;\n * });\n * @see each\n * @see arrayEach\n * @api private\n */\nvar util = {\n environment: 'nodejs',\n engine: function engine() {\n if (util.isBrowser() && typeof navigator !== 'undefined') {\n return navigator.userAgent;\n } else {\n var engine = process.platform + '/' + process.version;\n if (process.env.AWS_EXECUTION_ENV) {\n engine += ' exec-env/' + process.env.AWS_EXECUTION_ENV;\n }\n return engine;\n }\n },\n\n userAgent: function userAgent() {\n var name = util.environment;\n var agent = 'aws-sdk-' + name + '/' + require('./core').VERSION;\n if (name === 'nodejs') agent += ' ' + util.engine();\n return agent;\n },\n\n uriEscape: function uriEscape(string) {\n var output = encodeURIComponent(string);\n output = output.replace(/[^A-Za-z0-9_.~\\-%]+/g, escape);\n\n // AWS percent-encodes some extra non-standard characters in a URI\n output = output.replace(/[*]/g, function(ch) {\n return '%' + ch.charCodeAt(0).toString(16).toUpperCase();\n });\n\n return output;\n },\n\n uriEscapePath: function uriEscapePath(string) {\n var parts = [];\n util.arrayEach(string.split('/'), function (part) {\n parts.push(util.uriEscape(part));\n });\n return parts.join('/');\n },\n\n urlParse: function urlParse(url) {\n return util.url.parse(url);\n },\n\n urlFormat: function urlFormat(url) {\n return util.url.format(url);\n },\n\n queryStringParse: function queryStringParse(qs) {\n return util.querystring.parse(qs);\n },\n\n queryParamsToString: function queryParamsToString(params) {\n var items = [];\n var escape = util.uriEscape;\n var sortedKeys = Object.keys(params).sort();\n\n util.arrayEach(sortedKeys, function(name) {\n var value = params[name];\n var ename = escape(name);\n var result = ename + '=';\n if (Array.isArray(value)) {\n var vals = [];\n util.arrayEach(value, function(item) { vals.push(escape(item)); });\n result = ename + '=' + vals.sort().join('&' + ename + '=');\n } else if (value !== undefined && value !== null) {\n result = ename + '=' + escape(value);\n }\n items.push(result);\n });\n\n return items.join('&');\n },\n\n readFileSync: function readFileSync(path) {\n if (util.isBrowser()) return null;\n return require('fs').readFileSync(path, 'utf-8');\n },\n\n base64: {\n encode: function encode64(string) {\n if (typeof string === 'number') {\n throw util.error(new Error('Cannot base64 encode number ' + string));\n }\n if (string === null || typeof string === 'undefined') {\n return string;\n }\n var buf = util.buffer.toBuffer(string);\n return buf.toString('base64');\n },\n\n decode: function decode64(string) {\n if (typeof string === 'number') {\n throw util.error(new Error('Cannot base64 decode number ' + string));\n }\n if (string === null || typeof string === 'undefined') {\n return string;\n }\n return util.buffer.toBuffer(string, 'base64');\n }\n\n },\n\n buffer: {\n /**\n * Buffer constructor for Node buffer and buffer pollyfill\n */\n toBuffer: function(data, encoding) {\n return (typeof util.Buffer.from === 'function' && util.Buffer.from !== Uint8Array.from) ?\n util.Buffer.from(data, encoding) : new util.Buffer(data, encoding);\n },\n\n alloc: function(size, fill, encoding) {\n if (typeof size !== 'number') {\n throw new Error('size passed to alloc must be a number.');\n }\n if (typeof util.Buffer.alloc === 'function') {\n return util.Buffer.alloc(size, fill, encoding);\n } else {\n var buf = new util.Buffer(size);\n if (fill !== undefined && typeof buf.fill === 'function') {\n buf.fill(fill, undefined, undefined, encoding);\n }\n return buf;\n }\n },\n\n toStream: function toStream(buffer) {\n if (!util.Buffer.isBuffer(buffer)) buffer = util.buffer.toBuffer(buffer);\n\n var readable = new (util.stream.Readable)();\n var pos = 0;\n readable._read = function(size) {\n if (pos >= buffer.length) return readable.push(null);\n\n var end = pos + size;\n if (end > buffer.length) end = buffer.length;\n readable.push(buffer.slice(pos, end));\n pos = end;\n };\n\n return readable;\n },\n\n /**\n * Concatenates a list of Buffer objects.\n */\n concat: function(buffers) {\n var length = 0,\n offset = 0,\n buffer = null, i;\n\n for (i = 0; i < buffers.length; i++) {\n length += buffers[i].length;\n }\n\n buffer = util.buffer.alloc(length);\n\n for (i = 0; i < buffers.length; i++) {\n buffers[i].copy(buffer, offset);\n offset += buffers[i].length;\n }\n\n return buffer;\n }\n },\n\n string: {\n byteLength: function byteLength(string) {\n if (string === null || string === undefined) return 0;\n if (typeof string === 'string') string = util.buffer.toBuffer(string);\n\n if (typeof string.byteLength === 'number') {\n return string.byteLength;\n } else if (typeof string.length === 'number') {\n return string.length;\n } else if (typeof string.size === 'number') {\n return string.size;\n } else if (typeof string.path === 'string') {\n return require('fs').lstatSync(string.path).size;\n } else {\n throw util.error(new Error('Cannot determine length of ' + string),\n { object: string });\n }\n },\n\n upperFirst: function upperFirst(string) {\n return string[0].toUpperCase() + string.substr(1);\n },\n\n lowerFirst: function lowerFirst(string) {\n return string[0].toLowerCase() + string.substr(1);\n }\n },\n\n ini: {\n parse: function string(ini) {\n var currentSection, map = {};\n util.arrayEach(ini.split(/\\r?\\n/), function(line) {\n line = line.split(/(^|\\s)[;#]/)[0]; // remove comments\n var section = line.match(/^\\s*\\[([^\\[\\]]+)\\]\\s*$/);\n if (section) {\n currentSection = section[1];\n if (currentSection === '__proto__' || currentSection.split(/\\s/)[1] === '__proto__') {\n throw util.error(\n new Error('Cannot load profile name \\'' + currentSection + '\\' from shared ini file.')\n );\n }\n } else if (currentSection) {\n var item = line.match(/^\\s*(.+?)\\s*=\\s*(.+?)\\s*$/);\n if (item) {\n map[currentSection] = map[currentSection] || {};\n map[currentSection][item[1]] = item[2];\n }\n }\n });\n\n return map;\n }\n },\n\n fn: {\n noop: function() {},\n callback: function (err) { if (err) throw err; },\n\n /**\n * Turn a synchronous function into as \"async\" function by making it call\n * a callback. The underlying function is called with all but the last argument,\n * which is treated as the callback. The callback is passed passed a first argument\n * of null on success to mimick standard node callbacks.\n */\n makeAsync: function makeAsync(fn, expectedArgs) {\n if (expectedArgs && expectedArgs <= fn.length) {\n return fn;\n }\n\n return function() {\n var args = Array.prototype.slice.call(arguments, 0);\n var callback = args.pop();\n var result = fn.apply(null, args);\n callback(result);\n };\n }\n },\n\n /**\n * Date and time utility functions.\n */\n date: {\n\n /**\n * @return [Date] the current JavaScript date object. Since all\n * AWS services rely on this date object, you can override\n * this function to provide a special time value to AWS service\n * requests.\n */\n getDate: function getDate() {\n if (!AWS) AWS = require('./core');\n if (AWS.config.systemClockOffset) { // use offset when non-zero\n return new Date(new Date().getTime() + AWS.config.systemClockOffset);\n } else {\n return new Date();\n }\n },\n\n /**\n * @return [String] the date in ISO-8601 format\n */\n iso8601: function iso8601(date) {\n if (date === undefined) { date = util.date.getDate(); }\n return date.toISOString().replace(/\\.\\d{3}Z$/, 'Z');\n },\n\n /**\n * @return [String] the date in RFC 822 format\n */\n rfc822: function rfc822(date) {\n if (date === undefined) { date = util.date.getDate(); }\n return date.toUTCString();\n },\n\n /**\n * @return [Integer] the UNIX timestamp value for the current time\n */\n unixTimestamp: function unixTimestamp(date) {\n if (date === undefined) { date = util.date.getDate(); }\n return date.getTime() / 1000;\n },\n\n /**\n * @param [String,number,Date] date\n * @return [Date]\n */\n from: function format(date) {\n if (typeof date === 'number') {\n return new Date(date * 1000); // unix timestamp\n } else {\n return new Date(date);\n }\n },\n\n /**\n * Given a Date or date-like value, this function formats the\n * date into a string of the requested value.\n * @param [String,number,Date] date\n * @param [String] formatter Valid formats are:\n # * 'iso8601'\n # * 'rfc822'\n # * 'unixTimestamp'\n * @return [String]\n */\n format: function format(date, formatter) {\n if (!formatter) formatter = 'iso8601';\n return util.date[formatter](util.date.from(date));\n },\n\n parseTimestamp: function parseTimestamp(value) {\n if (typeof value === 'number') { // unix timestamp (number)\n return new Date(value * 1000);\n } else if (value.match(/^\\d+$/)) { // unix timestamp\n return new Date(value * 1000);\n } else if (value.match(/^\\d{4}/)) { // iso8601\n return new Date(value);\n } else if (value.match(/^\\w{3},/)) { // rfc822\n return new Date(value);\n } else {\n throw util.error(\n new Error('unhandled timestamp format: ' + value),\n {code: 'TimestampParserError'});\n }\n }\n\n },\n\n crypto: {\n crc32Table: [\n 0x00000000, 0x77073096, 0xEE0E612C, 0x990951BA, 0x076DC419,\n 0x706AF48F, 0xE963A535, 0x9E6495A3, 0x0EDB8832, 0x79DCB8A4,\n 0xE0D5E91E, 0x97D2D988, 0x09B64C2B, 0x7EB17CBD, 0xE7B82D07,\n 0x90BF1D91, 0x1DB71064, 0x6AB020F2, 0xF3B97148, 0x84BE41DE,\n 0x1ADAD47D, 0x6DDDE4EB, 0xF4D4B551, 0x83D385C7, 0x136C9856,\n 0x646BA8C0, 0xFD62F97A, 0x8A65C9EC, 0x14015C4F, 0x63066CD9,\n 0xFA0F3D63, 0x8D080DF5, 0x3B6E20C8, 0x4C69105E, 0xD56041E4,\n 0xA2677172, 0x3C03E4D1, 0x4B04D447, 0xD20D85FD, 0xA50AB56B,\n 0x35B5A8FA, 0x42B2986C, 0xDBBBC9D6, 0xACBCF940, 0x32D86CE3,\n 0x45DF5C75, 0xDCD60DCF, 0xABD13D59, 0x26D930AC, 0x51DE003A,\n 0xC8D75180, 0xBFD06116, 0x21B4F4B5, 0x56B3C423, 0xCFBA9599,\n 0xB8BDA50F, 0x2802B89E, 0x5F058808, 0xC60CD9B2, 0xB10BE924,\n 0x2F6F7C87, 0x58684C11, 0xC1611DAB, 0xB6662D3D, 0x76DC4190,\n 0x01DB7106, 0x98D220BC, 0xEFD5102A, 0x71B18589, 0x06B6B51F,\n 0x9FBFE4A5, 0xE8B8D433, 0x7807C9A2, 0x0F00F934, 0x9609A88E,\n 0xE10E9818, 0x7F6A0DBB, 0x086D3D2D, 0x91646C97, 0xE6635C01,\n 0x6B6B51F4, 0x1C6C6162, 0x856530D8, 0xF262004E, 0x6C0695ED,\n 0x1B01A57B, 0x8208F4C1, 0xF50FC457, 0x65B0D9C6, 0x12B7E950,\n 0x8BBEB8EA, 0xFCB9887C, 0x62DD1DDF, 0x15DA2D49, 0x8CD37CF3,\n 0xFBD44C65, 0x4DB26158, 0x3AB551CE, 0xA3BC0074, 0xD4BB30E2,\n 0x4ADFA541, 0x3DD895D7, 0xA4D1C46D, 0xD3D6F4FB, 0x4369E96A,\n 0x346ED9FC, 0xAD678846, 0xDA60B8D0, 0x44042D73, 0x33031DE5,\n 0xAA0A4C5F, 0xDD0D7CC9, 0x5005713C, 0x270241AA, 0xBE0B1010,\n 0xC90C2086, 0x5768B525, 0x206F85B3, 0xB966D409, 0xCE61E49F,\n 0x5EDEF90E, 0x29D9C998, 0xB0D09822, 0xC7D7A8B4, 0x59B33D17,\n 0x2EB40D81, 0xB7BD5C3B, 0xC0BA6CAD, 0xEDB88320, 0x9ABFB3B6,\n 0x03B6E20C, 0x74B1D29A, 0xEAD54739, 0x9DD277AF, 0x04DB2615,\n 0x73DC1683, 0xE3630B12, 0x94643B84, 0x0D6D6A3E, 0x7A6A5AA8,\n 0xE40ECF0B, 0x9309FF9D, 0x0A00AE27, 0x7D079EB1, 0xF00F9344,\n 0x8708A3D2, 0x1E01F268, 0x6906C2FE, 0xF762575D, 0x806567CB,\n 0x196C3671, 0x6E6B06E7, 0xFED41B76, 0x89D32BE0, 0x10DA7A5A,\n 0x67DD4ACC, 0xF9B9DF6F, 0x8EBEEFF9, 0x17B7BE43, 0x60B08ED5,\n 0xD6D6A3E8, 0xA1D1937E, 0x38D8C2C4, 0x4FDFF252, 0xD1BB67F1,\n 0xA6BC5767, 0x3FB506DD, 0x48B2364B, 0xD80D2BDA, 0xAF0A1B4C,\n 0x36034AF6, 0x41047A60, 0xDF60EFC3, 0xA867DF55, 0x316E8EEF,\n 0x4669BE79, 0xCB61B38C, 0xBC66831A, 0x256FD2A0, 0x5268E236,\n 0xCC0C7795, 0xBB0B4703, 0x220216B9, 0x5505262F, 0xC5BA3BBE,\n 0xB2BD0B28, 0x2BB45A92, 0x5CB36A04, 0xC2D7FFA7, 0xB5D0CF31,\n 0x2CD99E8B, 0x5BDEAE1D, 0x9B64C2B0, 0xEC63F226, 0x756AA39C,\n 0x026D930A, 0x9C0906A9, 0xEB0E363F, 0x72076785, 0x05005713,\n 0x95BF4A82, 0xE2B87A14, 0x7BB12BAE, 0x0CB61B38, 0x92D28E9B,\n 0xE5D5BE0D, 0x7CDCEFB7, 0x0BDBDF21, 0x86D3D2D4, 0xF1D4E242,\n 0x68DDB3F8, 0x1FDA836E, 0x81BE16CD, 0xF6B9265B, 0x6FB077E1,\n 0x18B74777, 0x88085AE6, 0xFF0F6A70, 0x66063BCA, 0x11010B5C,\n 0x8F659EFF, 0xF862AE69, 0x616BFFD3, 0x166CCF45, 0xA00AE278,\n 0xD70DD2EE, 0x4E048354, 0x3903B3C2, 0xA7672661, 0xD06016F7,\n 0x4969474D, 0x3E6E77DB, 0xAED16A4A, 0xD9D65ADC, 0x40DF0B66,\n 0x37D83BF0, 0xA9BCAE53, 0xDEBB9EC5, 0x47B2CF7F, 0x30B5FFE9,\n 0xBDBDF21C, 0xCABAC28A, 0x53B39330, 0x24B4A3A6, 0xBAD03605,\n 0xCDD70693, 0x54DE5729, 0x23D967BF, 0xB3667A2E, 0xC4614AB8,\n 0x5D681B02, 0x2A6F2B94, 0xB40BBE37, 0xC30C8EA1, 0x5A05DF1B,\n 0x2D02EF8D],\n\n crc32: function crc32(data) {\n var tbl = util.crypto.crc32Table;\n var crc = 0 ^ -1;\n\n if (typeof data === 'string') {\n data = util.buffer.toBuffer(data);\n }\n\n for (var i = 0; i < data.length; i++) {\n var code = data.readUInt8(i);\n crc = (crc >>> 8) ^ tbl[(crc ^ code) & 0xFF];\n }\n return (crc ^ -1) >>> 0;\n },\n\n hmac: function hmac(key, string, digest, fn) {\n if (!digest) digest = 'binary';\n if (digest === 'buffer') { digest = undefined; }\n if (!fn) fn = 'sha256';\n if (typeof string === 'string') string = util.buffer.toBuffer(string);\n return util.crypto.lib.createHmac(fn, key).update(string).digest(digest);\n },\n\n md5: function md5(data, digest, callback) {\n return util.crypto.hash('md5', data, digest, callback);\n },\n\n sha256: function sha256(data, digest, callback) {\n return util.crypto.hash('sha256', data, digest, callback);\n },\n\n hash: function(algorithm, data, digest, callback) {\n var hash = util.crypto.createHash(algorithm);\n if (!digest) { digest = 'binary'; }\n if (digest === 'buffer') { digest = undefined; }\n if (typeof data === 'string') data = util.buffer.toBuffer(data);\n var sliceFn = util.arraySliceFn(data);\n var isBuffer = util.Buffer.isBuffer(data);\n //Identifying objects with an ArrayBuffer as buffers\n if (util.isBrowser() && typeof ArrayBuffer !== 'undefined' && data && data.buffer instanceof ArrayBuffer) isBuffer = true;\n\n if (callback && typeof data === 'object' &&\n typeof data.on === 'function' && !isBuffer) {\n data.on('data', function(chunk) { hash.update(chunk); });\n data.on('error', function(err) { callback(err); });\n data.on('end', function() { callback(null, hash.digest(digest)); });\n } else if (callback && sliceFn && !isBuffer &&\n typeof FileReader !== 'undefined') {\n // this might be a File/Blob\n var index = 0, size = 1024 * 512;\n var reader = new FileReader();\n reader.onerror = function() {\n callback(new Error('Failed to read data.'));\n };\n reader.onload = function() {\n var buf = new util.Buffer(new Uint8Array(reader.result));\n hash.update(buf);\n index += buf.length;\n reader._continueReading();\n };\n reader._continueReading = function() {\n if (index >= data.size) {\n callback(null, hash.digest(digest));\n return;\n }\n\n var back = index + size;\n if (back > data.size) back = data.size;\n reader.readAsArrayBuffer(sliceFn.call(data, index, back));\n };\n\n reader._continueReading();\n } else {\n if (util.isBrowser() && typeof data === 'object' && !isBuffer) {\n data = new util.Buffer(new Uint8Array(data));\n }\n var out = hash.update(data).digest(digest);\n if (callback) callback(null, out);\n return out;\n }\n },\n\n toHex: function toHex(data) {\n var out = [];\n for (var i = 0; i < data.length; i++) {\n out.push(('0' + data.charCodeAt(i).toString(16)).substr(-2, 2));\n }\n return out.join('');\n },\n\n createHash: function createHash(algorithm) {\n return util.crypto.lib.createHash(algorithm);\n }\n\n },\n\n /** @!ignore */\n\n /* Abort constant */\n abort: {},\n\n each: function each(object, iterFunction) {\n for (var key in object) {\n if (Object.prototype.hasOwnProperty.call(object, key)) {\n var ret = iterFunction.call(this, key, object[key]);\n if (ret === util.abort) break;\n }\n }\n },\n\n arrayEach: function arrayEach(array, iterFunction) {\n for (var idx in array) {\n if (Object.prototype.hasOwnProperty.call(array, idx)) {\n var ret = iterFunction.call(this, array[idx], parseInt(idx, 10));\n if (ret === util.abort) break;\n }\n }\n },\n\n update: function update(obj1, obj2) {\n util.each(obj2, function iterator(key, item) {\n obj1[key] = item;\n });\n return obj1;\n },\n\n merge: function merge(obj1, obj2) {\n return util.update(util.copy(obj1), obj2);\n },\n\n copy: function copy(object) {\n if (object === null || object === undefined) return object;\n var dupe = {};\n // jshint forin:false\n for (var key in object) {\n dupe[key] = object[key];\n }\n return dupe;\n },\n\n isEmpty: function isEmpty(obj) {\n for (var prop in obj) {\n if (Object.prototype.hasOwnProperty.call(obj, prop)) {\n return false;\n }\n }\n return true;\n },\n\n arraySliceFn: function arraySliceFn(obj) {\n var fn = obj.slice || obj.webkitSlice || obj.mozSlice;\n return typeof fn === 'function' ? fn : null;\n },\n\n isType: function isType(obj, type) {\n // handle cross-\"frame\" objects\n if (typeof type === 'function') type = util.typeName(type);\n return Object.prototype.toString.call(obj) === '[object ' + type + ']';\n },\n\n typeName: function typeName(type) {\n if (Object.prototype.hasOwnProperty.call(type, 'name')) return type.name;\n var str = type.toString();\n var match = str.match(/^\\s*function (.+)\\(/);\n return match ? match[1] : str;\n },\n\n error: function error(err, options) {\n var originalError = null;\n if (typeof err.message === 'string' && err.message !== '') {\n if (typeof options === 'string' || (options && options.message)) {\n originalError = util.copy(err);\n originalError.message = err.message;\n }\n }\n err.message = err.message || null;\n\n if (typeof options === 'string') {\n err.message = options;\n } else if (typeof options === 'object' && options !== null) {\n util.update(err, options);\n if (options.message)\n err.message = options.message;\n if (options.code || options.name)\n err.code = options.code || options.name;\n if (options.stack)\n err.stack = options.stack;\n }\n\n if (typeof Object.defineProperty === 'function') {\n Object.defineProperty(err, 'name', {writable: true, enumerable: false});\n Object.defineProperty(err, 'message', {enumerable: true});\n }\n\n err.name = String(options && options.name || err.name || err.code || 'Error');\n err.time = new Date();\n\n if (originalError) err.originalError = originalError;\n\n return err;\n },\n\n /**\n * @api private\n */\n inherit: function inherit(klass, features) {\n var newObject = null;\n if (features === undefined) {\n features = klass;\n klass = Object;\n newObject = {};\n } else {\n var ctor = function ConstructorWrapper() {};\n ctor.prototype = klass.prototype;\n newObject = new ctor();\n }\n\n // constructor not supplied, create pass-through ctor\n if (features.constructor === Object) {\n features.constructor = function() {\n if (klass !== Object) {\n return klass.apply(this, arguments);\n }\n };\n }\n\n features.constructor.prototype = newObject;\n util.update(features.constructor.prototype, features);\n features.constructor.__super__ = klass;\n return features.constructor;\n },\n\n /**\n * @api private\n */\n mixin: function mixin() {\n var klass = arguments[0];\n for (var i = 1; i < arguments.length; i++) {\n // jshint forin:false\n for (var prop in arguments[i].prototype) {\n var fn = arguments[i].prototype[prop];\n if (prop !== 'constructor') {\n klass.prototype[prop] = fn;\n }\n }\n }\n return klass;\n },\n\n /**\n * @api private\n */\n hideProperties: function hideProperties(obj, props) {\n if (typeof Object.defineProperty !== 'function') return;\n\n util.arrayEach(props, function (key) {\n Object.defineProperty(obj, key, {\n enumerable: false, writable: true, configurable: true });\n });\n },\n\n /**\n * @api private\n */\n property: function property(obj, name, value, enumerable, isValue) {\n var opts = {\n configurable: true,\n enumerable: enumerable !== undefined ? enumerable : true\n };\n if (typeof value === 'function' && !isValue) {\n opts.get = value;\n }\n else {\n opts.value = value; opts.writable = true;\n }\n\n Object.defineProperty(obj, name, opts);\n },\n\n /**\n * @api private\n */\n memoizedProperty: function memoizedProperty(obj, name, get, enumerable) {\n var cachedValue = null;\n\n // build enumerable attribute for each value with lazy accessor.\n util.property(obj, name, function() {\n if (cachedValue === null) {\n cachedValue = get();\n }\n return cachedValue;\n }, enumerable);\n },\n\n /**\n * TODO Remove in major version revision\n * This backfill populates response data without the\n * top-level payload name.\n *\n * @api private\n */\n hoistPayloadMember: function hoistPayloadMember(resp) {\n var req = resp.request;\n var operationName = req.operation;\n var operation = req.service.api.operations[operationName];\n var output = operation.output;\n if (output.payload && !operation.hasEventOutput) {\n var payloadMember = output.members[output.payload];\n var responsePayload = resp.data[output.payload];\n if (payloadMember.type === 'structure') {\n util.each(responsePayload, function(key, value) {\n util.property(resp.data, key, value, false);\n });\n }\n }\n },\n\n /**\n * Compute SHA-256 checksums of streams\n *\n * @api private\n */\n computeSha256: function computeSha256(body, done) {\n if (util.isNode()) {\n var Stream = util.stream.Stream;\n var fs = require('fs');\n if (typeof Stream === 'function' && body instanceof Stream) {\n if (typeof body.path === 'string') { // assume file object\n var settings = {};\n if (typeof body.start === 'number') {\n settings.start = body.start;\n }\n if (typeof body.end === 'number') {\n settings.end = body.end;\n }\n body = fs.createReadStream(body.path, settings);\n } else { // TODO support other stream types\n return done(new Error('Non-file stream objects are ' +\n 'not supported with SigV4'));\n }\n }\n }\n\n util.crypto.sha256(body, 'hex', function(err, sha) {\n if (err) done(err);\n else done(null, sha);\n });\n },\n\n /**\n * @api private\n */\n isClockSkewed: function isClockSkewed(serverTime) {\n if (serverTime) {\n util.property(AWS.config, 'isClockSkewed',\n Math.abs(new Date().getTime() - serverTime) >= 300000, false);\n return AWS.config.isClockSkewed;\n }\n },\n\n applyClockOffset: function applyClockOffset(serverTime) {\n if (serverTime)\n AWS.config.systemClockOffset = serverTime - new Date().getTime();\n },\n\n /**\n * @api private\n */\n extractRequestId: function extractRequestId(resp) {\n var requestId = resp.httpResponse.headers['x-amz-request-id'] ||\n resp.httpResponse.headers['x-amzn-requestid'];\n\n if (!requestId && resp.data && resp.data.ResponseMetadata) {\n requestId = resp.data.ResponseMetadata.RequestId;\n }\n\n if (requestId) {\n resp.requestId = requestId;\n }\n\n if (resp.error) {\n resp.error.requestId = requestId;\n }\n },\n\n /**\n * @api private\n */\n addPromises: function addPromises(constructors, PromiseDependency) {\n var deletePromises = false;\n if (PromiseDependency === undefined && AWS && AWS.config) {\n PromiseDependency = AWS.config.getPromisesDependency();\n }\n if (PromiseDependency === undefined && typeof Promise !== 'undefined') {\n PromiseDependency = Promise;\n }\n if (typeof PromiseDependency !== 'function') deletePromises = true;\n if (!Array.isArray(constructors)) constructors = [constructors];\n\n for (var ind = 0; ind < constructors.length; ind++) {\n var constructor = constructors[ind];\n if (deletePromises) {\n if (constructor.deletePromisesFromClass) {\n constructor.deletePromisesFromClass();\n }\n } else if (constructor.addPromisesToClass) {\n constructor.addPromisesToClass(PromiseDependency);\n }\n }\n },\n\n /**\n * @api private\n * Return a function that will return a promise whose fate is decided by the\n * callback behavior of the given method with `methodName`. The method to be\n * promisified should conform to node.js convention of accepting a callback as\n * last argument and calling that callback with error as the first argument\n * and success value on the second argument.\n */\n promisifyMethod: function promisifyMethod(methodName, PromiseDependency) {\n return function promise() {\n var self = this;\n var args = Array.prototype.slice.call(arguments);\n return new PromiseDependency(function(resolve, reject) {\n args.push(function(err, data) {\n if (err) {\n reject(err);\n } else {\n resolve(data);\n }\n });\n self[methodName].apply(self, args);\n });\n };\n },\n\n /**\n * @api private\n */\n isDualstackAvailable: function isDualstackAvailable(service) {\n if (!service) return false;\n var metadata = require('../apis/metadata.json');\n if (typeof service !== 'string') service = service.serviceIdentifier;\n if (typeof service !== 'string' || !metadata.hasOwnProperty(service)) return false;\n return !!metadata[service].dualstackAvailable;\n },\n\n /**\n * @api private\n */\n calculateRetryDelay: function calculateRetryDelay(retryCount, retryDelayOptions, err) {\n if (!retryDelayOptions) retryDelayOptions = {};\n var customBackoff = retryDelayOptions.customBackoff || null;\n if (typeof customBackoff === 'function') {\n return customBackoff(retryCount, err);\n }\n var base = typeof retryDelayOptions.base === 'number' ? retryDelayOptions.base : 100;\n var delay = Math.random() * (Math.pow(2, retryCount) * base);\n return delay;\n },\n\n /**\n * @api private\n */\n handleRequestWithRetries: function handleRequestWithRetries(httpRequest, options, cb) {\n if (!options) options = {};\n var http = AWS.HttpClient.getInstance();\n var httpOptions = options.httpOptions || {};\n var retryCount = 0;\n\n var errCallback = function(err) {\n var maxRetries = options.maxRetries || 0;\n if (err && err.code === 'TimeoutError') err.retryable = true;\n\n // Call `calculateRetryDelay()` only when relevant, see #3401\n if (err && err.retryable && retryCount < maxRetries) {\n var delay = util.calculateRetryDelay(retryCount, options.retryDelayOptions, err);\n if (delay >= 0) {\n retryCount++;\n setTimeout(sendRequest, delay + (err.retryAfter || 0));\n return;\n }\n }\n cb(err);\n };\n\n var sendRequest = function() {\n var data = '';\n http.handleRequest(httpRequest, httpOptions, function(httpResponse) {\n httpResponse.on('data', function(chunk) { data += chunk.toString(); });\n httpResponse.on('end', function() {\n var statusCode = httpResponse.statusCode;\n if (statusCode < 300) {\n cb(null, data);\n } else {\n var retryAfter = parseInt(httpResponse.headers['retry-after'], 10) * 1000 || 0;\n var err = util.error(new Error(),\n {\n statusCode: statusCode,\n retryable: statusCode >= 500 || statusCode === 429\n }\n );\n if (retryAfter && err.retryable) err.retryAfter = retryAfter;\n errCallback(err);\n }\n });\n }, errCallback);\n };\n\n AWS.util.defer(sendRequest);\n },\n\n /**\n * @api private\n */\n uuid: {\n v4: function uuidV4() {\n return require('uuid').v4();\n }\n },\n\n /**\n * @api private\n */\n convertPayloadToString: function convertPayloadToString(resp) {\n var req = resp.request;\n var operation = req.operation;\n var rules = req.service.api.operations[operation].output || {};\n if (rules.payload && resp.data[rules.payload]) {\n resp.data[rules.payload] = resp.data[rules.payload].toString();\n }\n },\n\n /**\n * @api private\n */\n defer: function defer(callback) {\n if (typeof process === 'object' && typeof process.nextTick === 'function') {\n process.nextTick(callback);\n } else if (typeof setImmediate === 'function') {\n setImmediate(callback);\n } else {\n setTimeout(callback, 0);\n }\n },\n\n /**\n * @api private\n */\n getRequestPayloadShape: function getRequestPayloadShape(req) {\n var operations = req.service.api.operations;\n if (!operations) return undefined;\n var operation = (operations || {})[req.operation];\n if (!operation || !operation.input || !operation.input.payload) return undefined;\n return operation.input.members[operation.input.payload];\n },\n\n getProfilesFromSharedConfig: function getProfilesFromSharedConfig(iniLoader, filename) {\n var profiles = {};\n var profilesFromConfig = {};\n if (process.env[util.configOptInEnv]) {\n var profilesFromConfig = iniLoader.loadFrom({\n isConfig: true,\n filename: process.env[util.sharedConfigFileEnv]\n });\n }\n var profilesFromCreds= {};\n try {\n var profilesFromCreds = iniLoader.loadFrom({\n filename: filename ||\n (process.env[util.configOptInEnv] && process.env[util.sharedCredentialsFileEnv])\n });\n } catch (error) {\n // if using config, assume it is fully descriptive without a credentials file:\n if (!process.env[util.configOptInEnv]) throw error;\n }\n for (var i = 0, profileNames = Object.keys(profilesFromConfig); i < profileNames.length; i++) {\n profiles[profileNames[i]] = objectAssign(profiles[profileNames[i]] || {}, profilesFromConfig[profileNames[i]]);\n }\n for (var i = 0, profileNames = Object.keys(profilesFromCreds); i < profileNames.length; i++) {\n profiles[profileNames[i]] = objectAssign(profiles[profileNames[i]] || {}, profilesFromCreds[profileNames[i]]);\n }\n return profiles;\n\n /**\n * Roughly the semantics of `Object.assign(target, source)`\n */\n function objectAssign(target, source) {\n for (var i = 0, keys = Object.keys(source); i < keys.length; i++) {\n target[keys[i]] = source[keys[i]];\n }\n return target;\n }\n },\n\n /**\n * @api private\n */\n ARN: {\n validate: function validateARN(str) {\n return str && str.indexOf('arn:') === 0 && str.split(':').length >= 6;\n },\n parse: function parseARN(arn) {\n var matched = arn.split(':');\n return {\n partition: matched[1],\n service: matched[2],\n region: matched[3],\n accountId: matched[4],\n resource: matched.slice(5).join(':')\n };\n },\n build: function buildARN(arnObject) {\n if (\n arnObject.service === undefined ||\n arnObject.region === undefined ||\n arnObject.accountId === undefined ||\n arnObject.resource === undefined\n ) throw util.error(new Error('Input ARN object is invalid'));\n return 'arn:'+ (arnObject.partition || 'aws') + ':' + arnObject.service +\n ':' + arnObject.region + ':' + arnObject.accountId + ':' + arnObject.resource;\n }\n },\n\n /**\n * @api private\n */\n defaultProfile: 'default',\n\n /**\n * @api private\n */\n configOptInEnv: 'AWS_SDK_LOAD_CONFIG',\n\n /**\n * @api private\n */\n sharedCredentialsFileEnv: 'AWS_SHARED_CREDENTIALS_FILE',\n\n /**\n * @api private\n */\n sharedConfigFileEnv: 'AWS_CONFIG_FILE',\n\n /**\n * @api private\n */\n imdsDisabledEnv: 'AWS_EC2_METADATA_DISABLED'\n};\n\n/**\n * @api private\n */\nmodule.exports = util;\n","var util = require('../util');\nvar XmlNode = require('./xml-node').XmlNode;\nvar XmlText = require('./xml-text').XmlText;\n\nfunction XmlBuilder() { }\n\nXmlBuilder.prototype.toXML = function(params, shape, rootElement, noEmpty) {\n var xml = new XmlNode(rootElement);\n applyNamespaces(xml, shape, true);\n serialize(xml, params, shape);\n return xml.children.length > 0 || noEmpty ? xml.toString() : '';\n};\n\nfunction serialize(xml, value, shape) {\n switch (shape.type) {\n case 'structure': return serializeStructure(xml, value, shape);\n case 'map': return serializeMap(xml, value, shape);\n case 'list': return serializeList(xml, value, shape);\n default: return serializeScalar(xml, value, shape);\n }\n}\n\nfunction serializeStructure(xml, params, shape) {\n util.arrayEach(shape.memberNames, function(memberName) {\n var memberShape = shape.members[memberName];\n if (memberShape.location !== 'body') return;\n\n var value = params[memberName];\n var name = memberShape.name;\n if (value !== undefined && value !== null) {\n if (memberShape.isXmlAttribute) {\n xml.addAttribute(name, value);\n } else if (memberShape.flattened) {\n serialize(xml, value, memberShape);\n } else {\n var element = new XmlNode(name);\n xml.addChildNode(element);\n applyNamespaces(element, memberShape);\n serialize(element, value, memberShape);\n }\n }\n });\n}\n\nfunction serializeMap(xml, map, shape) {\n var xmlKey = shape.key.name || 'key';\n var xmlValue = shape.value.name || 'value';\n\n util.each(map, function(key, value) {\n var entry = new XmlNode(shape.flattened ? shape.name : 'entry');\n xml.addChildNode(entry);\n\n var entryKey = new XmlNode(xmlKey);\n var entryValue = new XmlNode(xmlValue);\n entry.addChildNode(entryKey);\n entry.addChildNode(entryValue);\n\n serialize(entryKey, key, shape.key);\n serialize(entryValue, value, shape.value);\n });\n}\n\nfunction serializeList(xml, list, shape) {\n if (shape.flattened) {\n util.arrayEach(list, function(value) {\n var name = shape.member.name || shape.name;\n var element = new XmlNode(name);\n xml.addChildNode(element);\n serialize(element, value, shape.member);\n });\n } else {\n util.arrayEach(list, function(value) {\n var name = shape.member.name || 'member';\n var element = new XmlNode(name);\n xml.addChildNode(element);\n serialize(element, value, shape.member);\n });\n }\n}\n\nfunction serializeScalar(xml, value, shape) {\n xml.addChildNode(\n new XmlText(shape.toWireFormat(value))\n );\n}\n\nfunction applyNamespaces(xml, shape, isRoot) {\n var uri, prefix = 'xmlns';\n if (shape.xmlNamespaceUri) {\n uri = shape.xmlNamespaceUri;\n if (shape.xmlNamespacePrefix) prefix += ':' + shape.xmlNamespacePrefix;\n } else if (isRoot && shape.api.xmlNamespaceUri) {\n uri = shape.api.xmlNamespaceUri;\n }\n\n if (uri) xml.addAttribute(prefix, uri);\n}\n\n/**\n * @api private\n */\nmodule.exports = XmlBuilder;\n","/**\n * Escapes characters that can not be in an XML attribute.\n */\nfunction escapeAttribute(value) {\n return value.replace(/&/g, '&').replace(/'/g, ''').replace(//g, '>').replace(/\"/g, '"');\n}\n\n/**\n * @api private\n */\nmodule.exports = {\n escapeAttribute: escapeAttribute\n};\n","/**\n * Escapes characters that can not be in an XML element.\n */\nfunction escapeElement(value) {\n return value.replace(/&/g, '&').replace(//g, '>');\n}\n\n/**\n * @api private\n */\nmodule.exports = {\n escapeElement: escapeElement\n};\n","var AWS = require('../core');\nvar util = AWS.util;\nvar Shape = AWS.Model.Shape;\n\nvar xml2js = require('xml2js');\n\n/**\n * @api private\n */\nvar options = { // options passed to xml2js parser\n explicitCharkey: false, // undocumented\n trim: false, // trim the leading/trailing whitespace from text nodes\n normalize: false, // trim interior whitespace inside text nodes\n explicitRoot: false, // return the root node in the resulting object?\n emptyTag: null, // the default value for empty nodes\n explicitArray: true, // always put child nodes in an array\n ignoreAttrs: false, // ignore attributes, only create text nodes\n mergeAttrs: false, // merge attributes and child elements\n validator: null // a callable validator\n};\n\nfunction NodeXmlParser() { }\n\nNodeXmlParser.prototype.parse = function(xml, shape) {\n shape = shape || {};\n\n var result = null;\n var error = null;\n\n var parser = new xml2js.Parser(options);\n parser.parseString(xml, function (e, r) {\n error = e;\n result = r;\n });\n\n if (result) {\n var data = parseXml(result, shape);\n if (result.ResponseMetadata) {\n data.ResponseMetadata = parseXml(result.ResponseMetadata[0], {});\n }\n return data;\n } else if (error) {\n throw util.error(error, {code: 'XMLParserError', retryable: true});\n } else { // empty xml document\n return parseXml({}, shape);\n }\n};\n\nfunction parseXml(xml, shape) {\n switch (shape.type) {\n case 'structure': return parseStructure(xml, shape);\n case 'map': return parseMap(xml, shape);\n case 'list': return parseList(xml, shape);\n case undefined: case null: return parseUnknown(xml);\n default: return parseScalar(xml, shape);\n }\n}\n\nfunction parseStructure(xml, shape) {\n var data = {};\n if (xml === null) return data;\n\n util.each(shape.members, function(memberName, memberShape) {\n var xmlName = memberShape.name;\n if (Object.prototype.hasOwnProperty.call(xml, xmlName) && Array.isArray(xml[xmlName])) {\n var xmlChild = xml[xmlName];\n if (!memberShape.flattened) xmlChild = xmlChild[0];\n\n data[memberName] = parseXml(xmlChild, memberShape);\n } else if (memberShape.isXmlAttribute &&\n xml.$ && Object.prototype.hasOwnProperty.call(xml.$, xmlName)) {\n data[memberName] = parseScalar(xml.$[xmlName], memberShape);\n } else if (memberShape.type === 'list' && !shape.api.xmlNoDefaultLists) {\n data[memberName] = memberShape.defaultValue;\n }\n });\n\n return data;\n}\n\nfunction parseMap(xml, shape) {\n var data = {};\n if (xml === null) return data;\n\n var xmlKey = shape.key.name || 'key';\n var xmlValue = shape.value.name || 'value';\n var iterable = shape.flattened ? xml : xml.entry;\n\n if (Array.isArray(iterable)) {\n util.arrayEach(iterable, function(child) {\n data[child[xmlKey][0]] = parseXml(child[xmlValue][0], shape.value);\n });\n }\n\n return data;\n}\n\nfunction parseList(xml, shape) {\n var data = [];\n var name = shape.member.name || 'member';\n if (shape.flattened) {\n util.arrayEach(xml, function(xmlChild) {\n data.push(parseXml(xmlChild, shape.member));\n });\n } else if (xml && Array.isArray(xml[name])) {\n util.arrayEach(xml[name], function(child) {\n data.push(parseXml(child, shape.member));\n });\n }\n\n return data;\n}\n\nfunction parseScalar(text, shape) {\n if (text && text.$ && text.$.encoding === 'base64') {\n shape = new Shape.create({type: text.$.encoding});\n }\n if (text && text._) text = text._;\n\n if (typeof shape.toType === 'function') {\n return shape.toType(text);\n } else {\n return text;\n }\n}\n\nfunction parseUnknown(xml) {\n if (xml === undefined || xml === null) return '';\n if (typeof xml === 'string') return xml;\n\n // parse a list\n if (Array.isArray(xml)) {\n var arr = [];\n for (i = 0; i < xml.length; i++) {\n arr.push(parseXml(xml[i], {}));\n }\n return arr;\n }\n\n // empty object\n var keys = Object.keys(xml), i;\n if (keys.length === 0 || (keys.length === 1 && keys[0] === '$')) {\n return {};\n }\n\n // object, parse as structure\n var data = {};\n for (i = 0; i < keys.length; i++) {\n var key = keys[i], value = xml[key];\n if (key === '$') continue;\n if (value.length > 1) { // this member is a list\n data[key] = parseList(value, {member: {}});\n } else { // this member is a single item\n data[key] = parseXml(value[0], {});\n }\n }\n return data;\n}\n\n/**\n * @api private\n */\nmodule.exports = NodeXmlParser;\n","var escapeAttribute = require('./escape-attribute').escapeAttribute;\n\n/**\n * Represents an XML node.\n * @api private\n */\nfunction XmlNode(name, children) {\n if (children === void 0) { children = []; }\n this.name = name;\n this.children = children;\n this.attributes = {};\n}\nXmlNode.prototype.addAttribute = function (name, value) {\n this.attributes[name] = value;\n return this;\n};\nXmlNode.prototype.addChildNode = function (child) {\n this.children.push(child);\n return this;\n};\nXmlNode.prototype.removeAttribute = function (name) {\n delete this.attributes[name];\n return this;\n};\nXmlNode.prototype.toString = function () {\n var hasChildren = Boolean(this.children.length);\n var xmlText = '<' + this.name;\n // add attributes\n var attributes = this.attributes;\n for (var i = 0, attributeNames = Object.keys(attributes); i < attributeNames.length; i++) {\n var attributeName = attributeNames[i];\n var attribute = attributes[attributeName];\n if (typeof attribute !== 'undefined' && attribute !== null) {\n xmlText += ' ' + attributeName + '=\\\"' + escapeAttribute('' + attribute) + '\\\"';\n }\n }\n return xmlText += !hasChildren ? '/>' : '>' + this.children.map(function (c) { return c.toString(); }).join('') + '';\n};\n\n/**\n * @api private\n */\nmodule.exports = {\n XmlNode: XmlNode\n};\n","var escapeElement = require('./escape-element').escapeElement;\n\n/**\n * Represents an XML text value.\n * @api private\n */\nfunction XmlText(value) {\n this.value = value;\n}\n\nXmlText.prototype.toString = function () {\n return escapeElement('' + this.value);\n};\n\n/**\n * @api private\n */\nmodule.exports = {\n XmlText: XmlText\n};\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar LRU_1 = require(\"./utils/LRU\");\nvar CACHE_SIZE = 1000;\n/**\n * Inspired node-lru-cache[https://github.com/isaacs/node-lru-cache]\n */\nvar EndpointCache = /** @class */ (function () {\n function EndpointCache(maxSize) {\n if (maxSize === void 0) { maxSize = CACHE_SIZE; }\n this.maxSize = maxSize;\n this.cache = new LRU_1.LRUCache(maxSize);\n }\n ;\n Object.defineProperty(EndpointCache.prototype, \"size\", {\n get: function () {\n return this.cache.length;\n },\n enumerable: true,\n configurable: true\n });\n EndpointCache.prototype.put = function (key, value) {\n var keyString = typeof key !== 'string' ? EndpointCache.getKeyString(key) : key;\n var endpointRecord = this.populateValue(value);\n this.cache.put(keyString, endpointRecord);\n };\n EndpointCache.prototype.get = function (key) {\n var keyString = typeof key !== 'string' ? EndpointCache.getKeyString(key) : key;\n var now = Date.now();\n var records = this.cache.get(keyString);\n if (records) {\n for (var i = 0; i < records.length; i++) {\n var record = records[i];\n if (record.Expire < now) {\n this.cache.remove(keyString);\n return undefined;\n }\n }\n }\n return records;\n };\n EndpointCache.getKeyString = function (key) {\n var identifiers = [];\n var identifierNames = Object.keys(key).sort();\n for (var i = 0; i < identifierNames.length; i++) {\n var identifierName = identifierNames[i];\n if (key[identifierName] === undefined)\n continue;\n identifiers.push(key[identifierName]);\n }\n return identifiers.join(' ');\n };\n EndpointCache.prototype.populateValue = function (endpoints) {\n var now = Date.now();\n return endpoints.map(function (endpoint) { return ({\n Address: endpoint.Address || '',\n Expire: now + (endpoint.CachePeriodInMinutes || 1) * 60 * 1000\n }); });\n };\n EndpointCache.prototype.empty = function () {\n this.cache.empty();\n };\n EndpointCache.prototype.remove = function (key) {\n var keyString = typeof key !== 'string' ? EndpointCache.getKeyString(key) : key;\n this.cache.remove(keyString);\n };\n return EndpointCache;\n}());\nexports.EndpointCache = EndpointCache;","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar LinkedListNode = /** @class */ (function () {\n function LinkedListNode(key, value) {\n this.key = key;\n this.value = value;\n }\n return LinkedListNode;\n}());\nvar LRUCache = /** @class */ (function () {\n function LRUCache(size) {\n this.nodeMap = {};\n this.size = 0;\n if (typeof size !== 'number' || size < 1) {\n throw new Error('Cache size can only be positive number');\n }\n this.sizeLimit = size;\n }\n Object.defineProperty(LRUCache.prototype, \"length\", {\n get: function () {\n return this.size;\n },\n enumerable: true,\n configurable: true\n });\n LRUCache.prototype.prependToList = function (node) {\n if (!this.headerNode) {\n this.tailNode = node;\n }\n else {\n this.headerNode.prev = node;\n node.next = this.headerNode;\n }\n this.headerNode = node;\n this.size++;\n };\n LRUCache.prototype.removeFromTail = function () {\n if (!this.tailNode) {\n return undefined;\n }\n var node = this.tailNode;\n var prevNode = node.prev;\n if (prevNode) {\n prevNode.next = undefined;\n }\n node.prev = undefined;\n this.tailNode = prevNode;\n this.size--;\n return node;\n };\n LRUCache.prototype.detachFromList = function (node) {\n if (this.headerNode === node) {\n this.headerNode = node.next;\n }\n if (this.tailNode === node) {\n this.tailNode = node.prev;\n }\n if (node.prev) {\n node.prev.next = node.next;\n }\n if (node.next) {\n node.next.prev = node.prev;\n }\n node.next = undefined;\n node.prev = undefined;\n this.size--;\n };\n LRUCache.prototype.get = function (key) {\n if (this.nodeMap[key]) {\n var node = this.nodeMap[key];\n this.detachFromList(node);\n this.prependToList(node);\n return node.value;\n }\n };\n LRUCache.prototype.remove = function (key) {\n if (this.nodeMap[key]) {\n var node = this.nodeMap[key];\n this.detachFromList(node);\n delete this.nodeMap[key];\n }\n };\n LRUCache.prototype.put = function (key, value) {\n if (this.nodeMap[key]) {\n this.remove(key);\n }\n else if (this.size === this.sizeLimit) {\n var tailNode = this.removeFromTail();\n var key_1 = tailNode.key;\n delete this.nodeMap[key_1];\n }\n var newNode = new LinkedListNode(key, value);\n this.nodeMap[key] = newNode;\n this.prependToList(newNode);\n };\n LRUCache.prototype.empty = function () {\n var keys = Object.keys(this.nodeMap);\n for (var i = 0; i < keys.length; i++) {\n var key = keys[i];\n var node = this.nodeMap[key];\n this.detachFromList(node);\n delete this.nodeMap[key];\n }\n };\n return LRUCache;\n}());\nexports.LRUCache = LRUCache;","\n/*!\n * Copyright 2010 LearnBoost \n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n/**\n * Module dependencies.\n */\n\nvar crypto = require('crypto')\n , parse = require('url').parse\n ;\n\n/**\n * Valid keys.\n */\n\nvar keys = \n [ 'acl'\n , 'location'\n , 'logging'\n , 'notification'\n , 'partNumber'\n , 'policy'\n , 'requestPayment'\n , 'torrent'\n , 'uploadId'\n , 'uploads'\n , 'versionId'\n , 'versioning'\n , 'versions'\n , 'website'\n ]\n\n/**\n * Return an \"Authorization\" header value with the given `options`\n * in the form of \"AWS :\"\n *\n * @param {Object} options\n * @return {String}\n * @api private\n */\n\nfunction authorization (options) {\n return 'AWS ' + options.key + ':' + sign(options)\n}\n\nmodule.exports = authorization\nmodule.exports.authorization = authorization\n\n/**\n * Simple HMAC-SHA1 Wrapper\n *\n * @param {Object} options\n * @return {String}\n * @api private\n */ \n\nfunction hmacSha1 (options) {\n return crypto.createHmac('sha1', options.secret).update(options.message).digest('base64')\n}\n\nmodule.exports.hmacSha1 = hmacSha1\n\n/**\n * Create a base64 sha1 HMAC for `options`. \n * \n * @param {Object} options\n * @return {String}\n * @api private\n */\n\nfunction sign (options) {\n options.message = stringToSign(options)\n return hmacSha1(options)\n}\nmodule.exports.sign = sign\n\n/**\n * Create a base64 sha1 HMAC for `options`. \n *\n * Specifically to be used with S3 presigned URLs\n * \n * @param {Object} options\n * @return {String}\n * @api private\n */\n\nfunction signQuery (options) {\n options.message = queryStringToSign(options)\n return hmacSha1(options)\n}\nmodule.exports.signQuery= signQuery\n\n/**\n * Return a string for sign() with the given `options`.\n *\n * Spec:\n * \n * \\n\n * \\n\n * \\n\n * \\n\n * [headers\\n]\n * \n *\n * @param {Object} options\n * @return {String}\n * @api private\n */\n\nfunction stringToSign (options) {\n var headers = options.amazonHeaders || ''\n if (headers) headers += '\\n'\n var r = \n [ options.verb\n , options.md5\n , options.contentType\n , options.date ? options.date.toUTCString() : ''\n , headers + options.resource\n ]\n return r.join('\\n')\n}\nmodule.exports.stringToSign = stringToSign\n\n/**\n * Return a string for sign() with the given `options`, but is meant exclusively\n * for S3 presigned URLs\n *\n * Spec:\n * \n * \\n\n * \n *\n * @param {Object} options\n * @return {String}\n * @api private\n */\n\nfunction queryStringToSign (options){\n return 'GET\\n\\n\\n' + options.date + '\\n' + options.resource\n}\nmodule.exports.queryStringToSign = queryStringToSign\n\n/**\n * Perform the following:\n *\n * - ignore non-amazon headers\n * - lowercase fields\n * - sort lexicographically\n * - trim whitespace between \":\"\n * - join with newline\n *\n * @param {Object} headers\n * @return {String}\n * @api private\n */\n\nfunction canonicalizeHeaders (headers) {\n var buf = []\n , fields = Object.keys(headers)\n ;\n for (var i = 0, len = fields.length; i < len; ++i) {\n var field = fields[i]\n , val = headers[field]\n , field = field.toLowerCase()\n ;\n if (0 !== field.indexOf('x-amz')) continue\n buf.push(field + ':' + val)\n }\n return buf.sort().join('\\n')\n}\nmodule.exports.canonicalizeHeaders = canonicalizeHeaders\n\n/**\n * Perform the following:\n *\n * - ignore non sub-resources\n * - sort lexicographically\n *\n * @param {String} resource\n * @return {String}\n * @api private\n */\n\nfunction canonicalizeResource (resource) {\n var url = parse(resource, true)\n , path = url.pathname\n , buf = []\n ;\n\n Object.keys(url.query).forEach(function(key){\n if (!~keys.indexOf(key)) return\n var val = '' == url.query[key] ? '' : '=' + encodeURIComponent(url.query[key])\n buf.push(key + val)\n })\n\n return path + (buf.length ? '?' + buf.sort().join('&') : '')\n}\nmodule.exports.canonicalizeResource = canonicalizeResource\n","var aws4 = exports,\n url = require('url'),\n querystring = require('querystring'),\n crypto = require('crypto'),\n lru = require('./lru'),\n credentialsCache = lru(1000)\n\n// http://docs.amazonwebservices.com/general/latest/gr/signature-version-4.html\n\nfunction hmac(key, string, encoding) {\n return crypto.createHmac('sha256', key).update(string, 'utf8').digest(encoding)\n}\n\nfunction hash(string, encoding) {\n return crypto.createHash('sha256').update(string, 'utf8').digest(encoding)\n}\n\n// This function assumes the string has already been percent encoded\nfunction encodeRfc3986(urlEncodedString) {\n return urlEncodedString.replace(/[!'()*]/g, function(c) {\n return '%' + c.charCodeAt(0).toString(16).toUpperCase()\n })\n}\n\nfunction encodeRfc3986Full(str) {\n return encodeRfc3986(encodeURIComponent(str))\n}\n\n// A bit of a combination of:\n// https://github.com/aws/aws-sdk-java-v2/blob/dc695de6ab49ad03934e1b02e7263abbd2354be0/core/auth/src/main/java/software/amazon/awssdk/auth/signer/internal/AbstractAws4Signer.java#L59\n// https://github.com/aws/aws-sdk-js/blob/18cb7e5b463b46239f9fdd4a65e2ff8c81831e8f/lib/signers/v4.js#L191-L199\n// https://github.com/mhart/aws4fetch/blob/b3aed16b6f17384cf36ea33bcba3c1e9f3bdfefd/src/main.js#L25-L34\nvar HEADERS_TO_IGNORE = {\n 'authorization': true,\n 'connection': true,\n 'x-amzn-trace-id': true,\n 'user-agent': true,\n 'expect': true,\n 'presigned-expires': true,\n 'range': true,\n}\n\n// request: { path | body, [host], [method], [headers], [service], [region] }\n// credentials: { accessKeyId, secretAccessKey, [sessionToken] }\nfunction RequestSigner(request, credentials) {\n\n if (typeof request === 'string') request = url.parse(request)\n\n var headers = request.headers = (request.headers || {}),\n hostParts = (!this.service || !this.region) && this.matchHost(request.hostname || request.host || headers.Host || headers.host)\n\n this.request = request\n this.credentials = credentials || this.defaultCredentials()\n\n this.service = request.service || hostParts[0] || ''\n this.region = request.region || hostParts[1] || 'us-east-1'\n\n // SES uses a different domain from the service name\n if (this.service === 'email') this.service = 'ses'\n\n if (!request.method && request.body)\n request.method = 'POST'\n\n if (!headers.Host && !headers.host) {\n headers.Host = request.hostname || request.host || this.createHost()\n\n // If a port is specified explicitly, use it as is\n if (request.port)\n headers.Host += ':' + request.port\n }\n if (!request.hostname && !request.host)\n request.hostname = headers.Host || headers.host\n\n this.isCodeCommitGit = this.service === 'codecommit' && request.method === 'GIT'\n}\n\nRequestSigner.prototype.matchHost = function(host) {\n var match = (host || '').match(/([^\\.]+)\\.(?:([^\\.]*)\\.)?amazonaws\\.com(\\.cn)?$/)\n var hostParts = (match || []).slice(1, 3)\n\n // ES's hostParts are sometimes the other way round, if the value that is expected\n // to be region equals ‘es’ switch them back\n // e.g. search-cluster-name-aaaa00aaaa0aaa0aaaaaaa0aaa.us-east-1.es.amazonaws.com\n if (hostParts[1] === 'es')\n hostParts = hostParts.reverse()\n\n if (hostParts[1] == 's3') {\n hostParts[0] = 's3'\n hostParts[1] = 'us-east-1'\n } else {\n for (var i = 0; i < 2; i++) {\n if (/^s3-/.test(hostParts[i])) {\n hostParts[1] = hostParts[i].slice(3)\n hostParts[0] = 's3'\n break\n }\n }\n }\n\n return hostParts\n}\n\n// http://docs.aws.amazon.com/general/latest/gr/rande.html\nRequestSigner.prototype.isSingleRegion = function() {\n // Special case for S3 and SimpleDB in us-east-1\n if (['s3', 'sdb'].indexOf(this.service) >= 0 && this.region === 'us-east-1') return true\n\n return ['cloudfront', 'ls', 'route53', 'iam', 'importexport', 'sts']\n .indexOf(this.service) >= 0\n}\n\nRequestSigner.prototype.createHost = function() {\n var region = this.isSingleRegion() ? '' : '.' + this.region,\n subdomain = this.service === 'ses' ? 'email' : this.service\n return subdomain + region + '.amazonaws.com'\n}\n\nRequestSigner.prototype.prepareRequest = function() {\n this.parsePath()\n\n var request = this.request, headers = request.headers, query\n\n if (request.signQuery) {\n\n this.parsedPath.query = query = this.parsedPath.query || {}\n\n if (this.credentials.sessionToken)\n query['X-Amz-Security-Token'] = this.credentials.sessionToken\n\n if (this.service === 's3' && !query['X-Amz-Expires'])\n query['X-Amz-Expires'] = 86400\n\n if (query['X-Amz-Date'])\n this.datetime = query['X-Amz-Date']\n else\n query['X-Amz-Date'] = this.getDateTime()\n\n query['X-Amz-Algorithm'] = 'AWS4-HMAC-SHA256'\n query['X-Amz-Credential'] = this.credentials.accessKeyId + '/' + this.credentialString()\n query['X-Amz-SignedHeaders'] = this.signedHeaders()\n\n } else {\n\n if (!request.doNotModifyHeaders && !this.isCodeCommitGit) {\n if (request.body && !headers['Content-Type'] && !headers['content-type'])\n headers['Content-Type'] = 'application/x-www-form-urlencoded; charset=utf-8'\n\n if (request.body && !headers['Content-Length'] && !headers['content-length'])\n headers['Content-Length'] = Buffer.byteLength(request.body)\n\n if (this.credentials.sessionToken && !headers['X-Amz-Security-Token'] && !headers['x-amz-security-token'])\n headers['X-Amz-Security-Token'] = this.credentials.sessionToken\n\n if (this.service === 's3' && !headers['X-Amz-Content-Sha256'] && !headers['x-amz-content-sha256'])\n headers['X-Amz-Content-Sha256'] = hash(this.request.body || '', 'hex')\n\n if (headers['X-Amz-Date'] || headers['x-amz-date'])\n this.datetime = headers['X-Amz-Date'] || headers['x-amz-date']\n else\n headers['X-Amz-Date'] = this.getDateTime()\n }\n\n delete headers.Authorization\n delete headers.authorization\n }\n}\n\nRequestSigner.prototype.sign = function() {\n if (!this.parsedPath) this.prepareRequest()\n\n if (this.request.signQuery) {\n this.parsedPath.query['X-Amz-Signature'] = this.signature()\n } else {\n this.request.headers.Authorization = this.authHeader()\n }\n\n this.request.path = this.formatPath()\n\n return this.request\n}\n\nRequestSigner.prototype.getDateTime = function() {\n if (!this.datetime) {\n var headers = this.request.headers,\n date = new Date(headers.Date || headers.date || new Date)\n\n this.datetime = date.toISOString().replace(/[:\\-]|\\.\\d{3}/g, '')\n\n // Remove the trailing 'Z' on the timestamp string for CodeCommit git access\n if (this.isCodeCommitGit) this.datetime = this.datetime.slice(0, -1)\n }\n return this.datetime\n}\n\nRequestSigner.prototype.getDate = function() {\n return this.getDateTime().substr(0, 8)\n}\n\nRequestSigner.prototype.authHeader = function() {\n return [\n 'AWS4-HMAC-SHA256 Credential=' + this.credentials.accessKeyId + '/' + this.credentialString(),\n 'SignedHeaders=' + this.signedHeaders(),\n 'Signature=' + this.signature(),\n ].join(', ')\n}\n\nRequestSigner.prototype.signature = function() {\n var date = this.getDate(),\n cacheKey = [this.credentials.secretAccessKey, date, this.region, this.service].join(),\n kDate, kRegion, kService, kCredentials = credentialsCache.get(cacheKey)\n if (!kCredentials) {\n kDate = hmac('AWS4' + this.credentials.secretAccessKey, date)\n kRegion = hmac(kDate, this.region)\n kService = hmac(kRegion, this.service)\n kCredentials = hmac(kService, 'aws4_request')\n credentialsCache.set(cacheKey, kCredentials)\n }\n return hmac(kCredentials, this.stringToSign(), 'hex')\n}\n\nRequestSigner.prototype.stringToSign = function() {\n return [\n 'AWS4-HMAC-SHA256',\n this.getDateTime(),\n this.credentialString(),\n hash(this.canonicalString(), 'hex'),\n ].join('\\n')\n}\n\nRequestSigner.prototype.canonicalString = function() {\n if (!this.parsedPath) this.prepareRequest()\n\n var pathStr = this.parsedPath.path,\n query = this.parsedPath.query,\n headers = this.request.headers,\n queryStr = '',\n normalizePath = this.service !== 's3',\n decodePath = this.service === 's3' || this.request.doNotEncodePath,\n decodeSlashesInPath = this.service === 's3',\n firstValOnly = this.service === 's3',\n bodyHash\n\n if (this.service === 's3' && this.request.signQuery) {\n bodyHash = 'UNSIGNED-PAYLOAD'\n } else if (this.isCodeCommitGit) {\n bodyHash = ''\n } else {\n bodyHash = headers['X-Amz-Content-Sha256'] || headers['x-amz-content-sha256'] ||\n hash(this.request.body || '', 'hex')\n }\n\n if (query) {\n var reducedQuery = Object.keys(query).reduce(function(obj, key) {\n if (!key) return obj\n obj[encodeRfc3986Full(key)] = !Array.isArray(query[key]) ? query[key] :\n (firstValOnly ? query[key][0] : query[key])\n return obj\n }, {})\n var encodedQueryPieces = []\n Object.keys(reducedQuery).sort().forEach(function(key) {\n if (!Array.isArray(reducedQuery[key])) {\n encodedQueryPieces.push(key + '=' + encodeRfc3986Full(reducedQuery[key]))\n } else {\n reducedQuery[key].map(encodeRfc3986Full).sort()\n .forEach(function(val) { encodedQueryPieces.push(key + '=' + val) })\n }\n })\n queryStr = encodedQueryPieces.join('&')\n }\n if (pathStr !== '/') {\n if (normalizePath) pathStr = pathStr.replace(/\\/{2,}/g, '/')\n pathStr = pathStr.split('/').reduce(function(path, piece) {\n if (normalizePath && piece === '..') {\n path.pop()\n } else if (!normalizePath || piece !== '.') {\n if (decodePath) piece = decodeURIComponent(piece.replace(/\\+/g, ' '))\n path.push(encodeRfc3986Full(piece))\n }\n return path\n }, []).join('/')\n if (pathStr[0] !== '/') pathStr = '/' + pathStr\n if (decodeSlashesInPath) pathStr = pathStr.replace(/%2F/g, '/')\n }\n\n return [\n this.request.method || 'GET',\n pathStr,\n queryStr,\n this.canonicalHeaders() + '\\n',\n this.signedHeaders(),\n bodyHash,\n ].join('\\n')\n}\n\nRequestSigner.prototype.canonicalHeaders = function() {\n var headers = this.request.headers\n function trimAll(header) {\n return header.toString().trim().replace(/\\s+/g, ' ')\n }\n return Object.keys(headers)\n .filter(function(key) { return HEADERS_TO_IGNORE[key.toLowerCase()] == null })\n .sort(function(a, b) { return a.toLowerCase() < b.toLowerCase() ? -1 : 1 })\n .map(function(key) { return key.toLowerCase() + ':' + trimAll(headers[key]) })\n .join('\\n')\n}\n\nRequestSigner.prototype.signedHeaders = function() {\n return Object.keys(this.request.headers)\n .map(function(key) { return key.toLowerCase() })\n .filter(function(key) { return HEADERS_TO_IGNORE[key] == null })\n .sort()\n .join(';')\n}\n\nRequestSigner.prototype.credentialString = function() {\n return [\n this.getDate(),\n this.region,\n this.service,\n 'aws4_request',\n ].join('/')\n}\n\nRequestSigner.prototype.defaultCredentials = function() {\n var env = process.env\n return {\n accessKeyId: env.AWS_ACCESS_KEY_ID || env.AWS_ACCESS_KEY,\n secretAccessKey: env.AWS_SECRET_ACCESS_KEY || env.AWS_SECRET_KEY,\n sessionToken: env.AWS_SESSION_TOKEN,\n }\n}\n\nRequestSigner.prototype.parsePath = function() {\n var path = this.request.path || '/'\n\n // S3 doesn't always encode characters > 127 correctly and\n // all services don't encode characters > 255 correctly\n // So if there are non-reserved chars (and it's not already all % encoded), just encode them all\n if (/[^0-9A-Za-z;,/?:@&=+$\\-_.!~*'()#%]/.test(path)) {\n path = encodeURI(decodeURI(path))\n }\n\n var queryIx = path.indexOf('?'),\n query = null\n\n if (queryIx >= 0) {\n query = querystring.parse(path.slice(queryIx + 1))\n path = path.slice(0, queryIx)\n }\n\n this.parsedPath = {\n path: path,\n query: query,\n }\n}\n\nRequestSigner.prototype.formatPath = function() {\n var path = this.parsedPath.path,\n query = this.parsedPath.query\n\n if (!query) return path\n\n // Services don't support empty query string keys\n if (query[''] != null) delete query['']\n\n return path + '?' + encodeRfc3986(querystring.stringify(query))\n}\n\naws4.RequestSigner = RequestSigner\n\naws4.sign = function(request, credentials) {\n return new RequestSigner(request, credentials).sign()\n}\n","module.exports = function(size) {\n return new LruCache(size)\n}\n\nfunction LruCache(size) {\n this.capacity = size | 0\n this.map = Object.create(null)\n this.list = new DoublyLinkedList()\n}\n\nLruCache.prototype.get = function(key) {\n var node = this.map[key]\n if (node == null) return undefined\n this.used(node)\n return node.val\n}\n\nLruCache.prototype.set = function(key, val) {\n var node = this.map[key]\n if (node != null) {\n node.val = val\n } else {\n if (!this.capacity) this.prune()\n if (!this.capacity) return false\n node = new DoublyLinkedNode(key, val)\n this.map[key] = node\n this.capacity--\n }\n this.used(node)\n return true\n}\n\nLruCache.prototype.used = function(node) {\n this.list.moveToFront(node)\n}\n\nLruCache.prototype.prune = function() {\n var node = this.list.pop()\n if (node != null) {\n delete this.map[node.key]\n this.capacity++\n }\n}\n\n\nfunction DoublyLinkedList() {\n this.firstNode = null\n this.lastNode = null\n}\n\nDoublyLinkedList.prototype.moveToFront = function(node) {\n if (this.firstNode == node) return\n\n this.remove(node)\n\n if (this.firstNode == null) {\n this.firstNode = node\n this.lastNode = node\n node.prev = null\n node.next = null\n } else {\n node.prev = null\n node.next = this.firstNode\n node.next.prev = node\n this.firstNode = node\n }\n}\n\nDoublyLinkedList.prototype.pop = function() {\n var lastNode = this.lastNode\n if (lastNode != null) {\n this.remove(lastNode)\n }\n return lastNode\n}\n\nDoublyLinkedList.prototype.remove = function(node) {\n if (this.firstNode == node) {\n this.firstNode = node.next\n } else if (node.prev != null) {\n node.prev.next = node.next\n }\n if (this.lastNode == node) {\n this.lastNode = node.prev\n } else if (node.next != null) {\n node.next.prev = node.prev\n }\n}\n\n\nfunction DoublyLinkedNode(key, val) {\n this.key = key\n this.val = val\n this.prev = null\n this.next = null\n}\n","'use strict';\nmodule.exports = balanced;\nfunction balanced(a, b, str) {\n if (a instanceof RegExp) a = maybeMatch(a, str);\n if (b instanceof RegExp) b = maybeMatch(b, str);\n\n var r = range(a, b, str);\n\n return r && {\n start: r[0],\n end: r[1],\n pre: str.slice(0, r[0]),\n body: str.slice(r[0] + a.length, r[1]),\n post: str.slice(r[1] + b.length)\n };\n}\n\nfunction maybeMatch(reg, str) {\n var m = str.match(reg);\n return m ? m[0] : null;\n}\n\nbalanced.range = range;\nfunction range(a, b, str) {\n var begs, beg, left, right, result;\n var ai = str.indexOf(a);\n var bi = str.indexOf(b, ai + 1);\n var i = ai;\n\n if (ai >= 0 && bi > 0) {\n if(a===b) {\n return [ai, bi];\n }\n begs = [];\n left = str.length;\n\n while (i >= 0 && !result) {\n if (i == ai) {\n begs.push(i);\n ai = str.indexOf(a, i + 1);\n } else if (begs.length == 1) {\n result = [ begs.pop(), bi ];\n } else {\n beg = begs.pop();\n if (beg < left) {\n left = beg;\n right = bi;\n }\n\n bi = str.indexOf(b, i + 1);\n }\n\n i = ai < bi && ai >= 0 ? ai : bi;\n }\n\n if (begs.length) {\n result = [ left, right ];\n }\n }\n\n return result;\n}\n","/*! https://mths.be/base64 v1.0.0 by @mathias | MIT license */\n;(function(root) {\n\n\t// Detect free variables `exports`.\n\tvar freeExports = typeof exports == 'object' && exports;\n\n\t// Detect free variable `module`.\n\tvar freeModule = typeof module == 'object' && module &&\n\t\tmodule.exports == freeExports && module;\n\n\t// Detect free variable `global`, from Node.js or Browserified code, and use\n\t// it as `root`.\n\tvar freeGlobal = typeof global == 'object' && global;\n\tif (freeGlobal.global === freeGlobal || freeGlobal.window === freeGlobal) {\n\t\troot = freeGlobal;\n\t}\n\n\t/*--------------------------------------------------------------------------*/\n\n\tvar InvalidCharacterError = function(message) {\n\t\tthis.message = message;\n\t};\n\tInvalidCharacterError.prototype = new Error;\n\tInvalidCharacterError.prototype.name = 'InvalidCharacterError';\n\n\tvar error = function(message) {\n\t\t// Note: the error messages used throughout this file match those used by\n\t\t// the native `atob`/`btoa` implementation in Chromium.\n\t\tthrow new InvalidCharacterError(message);\n\t};\n\n\tvar TABLE = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/';\n\t// http://whatwg.org/html/common-microsyntaxes.html#space-character\n\tvar REGEX_SPACE_CHARACTERS = /[\\t\\n\\f\\r ]/g;\n\n\t// `decode` is designed to be fully compatible with `atob` as described in the\n\t// HTML Standard. http://whatwg.org/html/webappapis.html#dom-windowbase64-atob\n\t// The optimized base64-decoding algorithm used is based on @atk’s excellent\n\t// implementation. https://gist.github.com/atk/1020396\n\tvar decode = function(input) {\n\t\tinput = String(input)\n\t\t\t.replace(REGEX_SPACE_CHARACTERS, '');\n\t\tvar length = input.length;\n\t\tif (length % 4 == 0) {\n\t\t\tinput = input.replace(/==?$/, '');\n\t\t\tlength = input.length;\n\t\t}\n\t\tif (\n\t\t\tlength % 4 == 1 ||\n\t\t\t// http://whatwg.org/C#alphanumeric-ascii-characters\n\t\t\t/[^+a-zA-Z0-9/]/.test(input)\n\t\t) {\n\t\t\terror(\n\t\t\t\t'Invalid character: the string to be decoded is not correctly encoded.'\n\t\t\t);\n\t\t}\n\t\tvar bitCounter = 0;\n\t\tvar bitStorage;\n\t\tvar buffer;\n\t\tvar output = '';\n\t\tvar position = -1;\n\t\twhile (++position < length) {\n\t\t\tbuffer = TABLE.indexOf(input.charAt(position));\n\t\t\tbitStorage = bitCounter % 4 ? bitStorage * 64 + buffer : buffer;\n\t\t\t// Unless this is the first of a group of 4 characters…\n\t\t\tif (bitCounter++ % 4) {\n\t\t\t\t// …convert the first 8 bits to a single ASCII character.\n\t\t\t\toutput += String.fromCharCode(\n\t\t\t\t\t0xFF & bitStorage >> (-2 * bitCounter & 6)\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\t\treturn output;\n\t};\n\n\t// `encode` is designed to be fully compatible with `btoa` as described in the\n\t// HTML Standard: http://whatwg.org/html/webappapis.html#dom-windowbase64-btoa\n\tvar encode = function(input) {\n\t\tinput = String(input);\n\t\tif (/[^\\0-\\xFF]/.test(input)) {\n\t\t\t// Note: no need to special-case astral symbols here, as surrogates are\n\t\t\t// matched, and the input is supposed to only contain ASCII anyway.\n\t\t\terror(\n\t\t\t\t'The string to be encoded contains characters outside of the ' +\n\t\t\t\t'Latin1 range.'\n\t\t\t);\n\t\t}\n\t\tvar padding = input.length % 3;\n\t\tvar output = '';\n\t\tvar position = -1;\n\t\tvar a;\n\t\tvar b;\n\t\tvar c;\n\t\tvar buffer;\n\t\t// Make sure any padding is handled outside of the loop.\n\t\tvar length = input.length - padding;\n\n\t\twhile (++position < length) {\n\t\t\t// Read three bytes, i.e. 24 bits.\n\t\t\ta = input.charCodeAt(position) << 16;\n\t\t\tb = input.charCodeAt(++position) << 8;\n\t\t\tc = input.charCodeAt(++position);\n\t\t\tbuffer = a + b + c;\n\t\t\t// Turn the 24 bits into four chunks of 6 bits each, and append the\n\t\t\t// matching character for each of them to the output.\n\t\t\toutput += (\n\t\t\t\tTABLE.charAt(buffer >> 18 & 0x3F) +\n\t\t\t\tTABLE.charAt(buffer >> 12 & 0x3F) +\n\t\t\t\tTABLE.charAt(buffer >> 6 & 0x3F) +\n\t\t\t\tTABLE.charAt(buffer & 0x3F)\n\t\t\t);\n\t\t}\n\n\t\tif (padding == 2) {\n\t\t\ta = input.charCodeAt(position) << 8;\n\t\t\tb = input.charCodeAt(++position);\n\t\t\tbuffer = a + b;\n\t\t\toutput += (\n\t\t\t\tTABLE.charAt(buffer >> 10) +\n\t\t\t\tTABLE.charAt((buffer >> 4) & 0x3F) +\n\t\t\t\tTABLE.charAt((buffer << 2) & 0x3F) +\n\t\t\t\t'='\n\t\t\t);\n\t\t} else if (padding == 1) {\n\t\t\tbuffer = input.charCodeAt(position);\n\t\t\toutput += (\n\t\t\t\tTABLE.charAt(buffer >> 2) +\n\t\t\t\tTABLE.charAt((buffer << 4) & 0x3F) +\n\t\t\t\t'=='\n\t\t\t);\n\t\t}\n\n\t\treturn output;\n\t};\n\n\tvar base64 = {\n\t\t'encode': encode,\n\t\t'decode': decode,\n\t\t'version': '1.0.0'\n\t};\n\n\t// Some AMD build optimizers, like r.js, check for specific condition patterns\n\t// like the following:\n\tif (\n\t\ttypeof define == 'function' &&\n\t\ttypeof define.amd == 'object' &&\n\t\tdefine.amd\n\t) {\n\t\tdefine(function() {\n\t\t\treturn base64;\n\t\t});\n\t}\telse if (freeExports && !freeExports.nodeType) {\n\t\tif (freeModule) { // in Node.js or RingoJS v0.8.0+\n\t\t\tfreeModule.exports = base64;\n\t\t} else { // in Narwhal or RingoJS v0.7.0-\n\t\t\tfor (var key in base64) {\n\t\t\t\tbase64.hasOwnProperty(key) && (freeExports[key] = base64[key]);\n\t\t\t}\n\t\t}\n\t} else { // in Rhino or a web browser\n\t\troot.base64 = base64;\n\t}\n\n}(this));\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar pad_string_1 = require(\"./pad-string\");\nfunction encode(input, encoding) {\n if (encoding === void 0) { encoding = \"utf8\"; }\n if (Buffer.isBuffer(input)) {\n return fromBase64(input.toString(\"base64\"));\n }\n return fromBase64(Buffer.from(input, encoding).toString(\"base64\"));\n}\n;\nfunction decode(base64url, encoding) {\n if (encoding === void 0) { encoding = \"utf8\"; }\n return Buffer.from(toBase64(base64url), \"base64\").toString(encoding);\n}\nfunction toBase64(base64url) {\n base64url = base64url.toString();\n return pad_string_1.default(base64url)\n .replace(/\\-/g, \"+\")\n .replace(/_/g, \"/\");\n}\nfunction fromBase64(base64) {\n return base64\n .replace(/=/g, \"\")\n .replace(/\\+/g, \"-\")\n .replace(/\\//g, \"_\");\n}\nfunction toBuffer(base64url) {\n return Buffer.from(toBase64(base64url), \"base64\");\n}\nvar base64url = encode;\nbase64url.encode = encode;\nbase64url.decode = decode;\nbase64url.toBase64 = toBase64;\nbase64url.fromBase64 = fromBase64;\nbase64url.toBuffer = toBuffer;\nexports.default = base64url;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nfunction padString(input) {\n var segmentLength = 4;\n var stringLength = input.length;\n var diff = stringLength % segmentLength;\n if (!diff) {\n return input;\n }\n var position = stringLength;\n var padLength = segmentLength - diff;\n var paddedStringLength = stringLength + padLength;\n var buffer = Buffer.alloc(paddedStringLength);\n buffer.write(input);\n while (padLength--) {\n buffer.write(\"=\", position++);\n }\n return buffer.toString();\n}\nexports.default = padString;\n","module.exports = require('./dist/base64url').default;\nmodule.exports.default = module.exports;\n","'use strict';\n\nvar crypto_hash_sha512 = require('tweetnacl').lowlevel.crypto_hash;\n\n/*\n * This file is a 1:1 port from the OpenBSD blowfish.c and bcrypt_pbkdf.c. As a\n * result, it retains the original copyright and license. The two files are\n * under slightly different (but compatible) licenses, and are here combined in\n * one file.\n *\n * Credit for the actual porting work goes to:\n * Devi Mandiri \n */\n\n/*\n * The Blowfish portions are under the following license:\n *\n * Blowfish block cipher for OpenBSD\n * Copyright 1997 Niels Provos \n * All rights reserved.\n *\n * Implementation advice by David Mazieres .\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions\n * are met:\n * 1. Redistributions of source code must retain the above copyright\n * notice, this list of conditions and the following disclaimer.\n * 2. Redistributions in binary form must reproduce the above copyright\n * notice, this list of conditions and the following disclaimer in the\n * documentation and/or other materials provided with the distribution.\n * 3. The name of the author may not be used to endorse or promote products\n * derived from this software without specific prior written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR\n * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.\n * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,\n * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF\n * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\n/*\n * The bcrypt_pbkdf portions are under the following license:\n *\n * Copyright (c) 2013 Ted Unangst \n *\n * Permission to use, copy, modify, and distribute this software for any\n * purpose with or without fee is hereby granted, provided that the above\n * copyright notice and this permission notice appear in all copies.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES\n * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF\n * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR\n * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES\n * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN\n * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF\n * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.\n */\n\n/*\n * Performance improvements (Javascript-specific):\n *\n * Copyright 2016, Joyent Inc\n * Author: Alex Wilson \n *\n * Permission to use, copy, modify, and distribute this software for any\n * purpose with or without fee is hereby granted, provided that the above\n * copyright notice and this permission notice appear in all copies.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES\n * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF\n * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR\n * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES\n * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN\n * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF\n * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.\n */\n\n// Ported from OpenBSD bcrypt_pbkdf.c v1.9\n\nvar BLF_J = 0;\n\nvar Blowfish = function() {\n this.S = [\n new Uint32Array([\n 0xd1310ba6, 0x98dfb5ac, 0x2ffd72db, 0xd01adfb7,\n 0xb8e1afed, 0x6a267e96, 0xba7c9045, 0xf12c7f99,\n 0x24a19947, 0xb3916cf7, 0x0801f2e2, 0x858efc16,\n 0x636920d8, 0x71574e69, 0xa458fea3, 0xf4933d7e,\n 0x0d95748f, 0x728eb658, 0x718bcd58, 0x82154aee,\n 0x7b54a41d, 0xc25a59b5, 0x9c30d539, 0x2af26013,\n 0xc5d1b023, 0x286085f0, 0xca417918, 0xb8db38ef,\n 0x8e79dcb0, 0x603a180e, 0x6c9e0e8b, 0xb01e8a3e,\n 0xd71577c1, 0xbd314b27, 0x78af2fda, 0x55605c60,\n 0xe65525f3, 0xaa55ab94, 0x57489862, 0x63e81440,\n 0x55ca396a, 0x2aab10b6, 0xb4cc5c34, 0x1141e8ce,\n 0xa15486af, 0x7c72e993, 0xb3ee1411, 0x636fbc2a,\n 0x2ba9c55d, 0x741831f6, 0xce5c3e16, 0x9b87931e,\n 0xafd6ba33, 0x6c24cf5c, 0x7a325381, 0x28958677,\n 0x3b8f4898, 0x6b4bb9af, 0xc4bfe81b, 0x66282193,\n 0x61d809cc, 0xfb21a991, 0x487cac60, 0x5dec8032,\n 0xef845d5d, 0xe98575b1, 0xdc262302, 0xeb651b88,\n 0x23893e81, 0xd396acc5, 0x0f6d6ff3, 0x83f44239,\n 0x2e0b4482, 0xa4842004, 0x69c8f04a, 0x9e1f9b5e,\n 0x21c66842, 0xf6e96c9a, 0x670c9c61, 0xabd388f0,\n 0x6a51a0d2, 0xd8542f68, 0x960fa728, 0xab5133a3,\n 0x6eef0b6c, 0x137a3be4, 0xba3bf050, 0x7efb2a98,\n 0xa1f1651d, 0x39af0176, 0x66ca593e, 0x82430e88,\n 0x8cee8619, 0x456f9fb4, 0x7d84a5c3, 0x3b8b5ebe,\n 0xe06f75d8, 0x85c12073, 0x401a449f, 0x56c16aa6,\n 0x4ed3aa62, 0x363f7706, 0x1bfedf72, 0x429b023d,\n 0x37d0d724, 0xd00a1248, 0xdb0fead3, 0x49f1c09b,\n 0x075372c9, 0x80991b7b, 0x25d479d8, 0xf6e8def7,\n 0xe3fe501a, 0xb6794c3b, 0x976ce0bd, 0x04c006ba,\n 0xc1a94fb6, 0x409f60c4, 0x5e5c9ec2, 0x196a2463,\n 0x68fb6faf, 0x3e6c53b5, 0x1339b2eb, 0x3b52ec6f,\n 0x6dfc511f, 0x9b30952c, 0xcc814544, 0xaf5ebd09,\n 0xbee3d004, 0xde334afd, 0x660f2807, 0x192e4bb3,\n 0xc0cba857, 0x45c8740f, 0xd20b5f39, 0xb9d3fbdb,\n 0x5579c0bd, 0x1a60320a, 0xd6a100c6, 0x402c7279,\n 0x679f25fe, 0xfb1fa3cc, 0x8ea5e9f8, 0xdb3222f8,\n 0x3c7516df, 0xfd616b15, 0x2f501ec8, 0xad0552ab,\n 0x323db5fa, 0xfd238760, 0x53317b48, 0x3e00df82,\n 0x9e5c57bb, 0xca6f8ca0, 0x1a87562e, 0xdf1769db,\n 0xd542a8f6, 0x287effc3, 0xac6732c6, 0x8c4f5573,\n 0x695b27b0, 0xbbca58c8, 0xe1ffa35d, 0xb8f011a0,\n 0x10fa3d98, 0xfd2183b8, 0x4afcb56c, 0x2dd1d35b,\n 0x9a53e479, 0xb6f84565, 0xd28e49bc, 0x4bfb9790,\n 0xe1ddf2da, 0xa4cb7e33, 0x62fb1341, 0xcee4c6e8,\n 0xef20cada, 0x36774c01, 0xd07e9efe, 0x2bf11fb4,\n 0x95dbda4d, 0xae909198, 0xeaad8e71, 0x6b93d5a0,\n 0xd08ed1d0, 0xafc725e0, 0x8e3c5b2f, 0x8e7594b7,\n 0x8ff6e2fb, 0xf2122b64, 0x8888b812, 0x900df01c,\n 0x4fad5ea0, 0x688fc31c, 0xd1cff191, 0xb3a8c1ad,\n 0x2f2f2218, 0xbe0e1777, 0xea752dfe, 0x8b021fa1,\n 0xe5a0cc0f, 0xb56f74e8, 0x18acf3d6, 0xce89e299,\n 0xb4a84fe0, 0xfd13e0b7, 0x7cc43b81, 0xd2ada8d9,\n 0x165fa266, 0x80957705, 0x93cc7314, 0x211a1477,\n 0xe6ad2065, 0x77b5fa86, 0xc75442f5, 0xfb9d35cf,\n 0xebcdaf0c, 0x7b3e89a0, 0xd6411bd3, 0xae1e7e49,\n 0x00250e2d, 0x2071b35e, 0x226800bb, 0x57b8e0af,\n 0x2464369b, 0xf009b91e, 0x5563911d, 0x59dfa6aa,\n 0x78c14389, 0xd95a537f, 0x207d5ba2, 0x02e5b9c5,\n 0x83260376, 0x6295cfa9, 0x11c81968, 0x4e734a41,\n 0xb3472dca, 0x7b14a94a, 0x1b510052, 0x9a532915,\n 0xd60f573f, 0xbc9bc6e4, 0x2b60a476, 0x81e67400,\n 0x08ba6fb5, 0x571be91f, 0xf296ec6b, 0x2a0dd915,\n 0xb6636521, 0xe7b9f9b6, 0xff34052e, 0xc5855664,\n 0x53b02d5d, 0xa99f8fa1, 0x08ba4799, 0x6e85076a]),\n new Uint32Array([\n 0x4b7a70e9, 0xb5b32944, 0xdb75092e, 0xc4192623,\n 0xad6ea6b0, 0x49a7df7d, 0x9cee60b8, 0x8fedb266,\n 0xecaa8c71, 0x699a17ff, 0x5664526c, 0xc2b19ee1,\n 0x193602a5, 0x75094c29, 0xa0591340, 0xe4183a3e,\n 0x3f54989a, 0x5b429d65, 0x6b8fe4d6, 0x99f73fd6,\n 0xa1d29c07, 0xefe830f5, 0x4d2d38e6, 0xf0255dc1,\n 0x4cdd2086, 0x8470eb26, 0x6382e9c6, 0x021ecc5e,\n 0x09686b3f, 0x3ebaefc9, 0x3c971814, 0x6b6a70a1,\n 0x687f3584, 0x52a0e286, 0xb79c5305, 0xaa500737,\n 0x3e07841c, 0x7fdeae5c, 0x8e7d44ec, 0x5716f2b8,\n 0xb03ada37, 0xf0500c0d, 0xf01c1f04, 0x0200b3ff,\n 0xae0cf51a, 0x3cb574b2, 0x25837a58, 0xdc0921bd,\n 0xd19113f9, 0x7ca92ff6, 0x94324773, 0x22f54701,\n 0x3ae5e581, 0x37c2dadc, 0xc8b57634, 0x9af3dda7,\n 0xa9446146, 0x0fd0030e, 0xecc8c73e, 0xa4751e41,\n 0xe238cd99, 0x3bea0e2f, 0x3280bba1, 0x183eb331,\n 0x4e548b38, 0x4f6db908, 0x6f420d03, 0xf60a04bf,\n 0x2cb81290, 0x24977c79, 0x5679b072, 0xbcaf89af,\n 0xde9a771f, 0xd9930810, 0xb38bae12, 0xdccf3f2e,\n 0x5512721f, 0x2e6b7124, 0x501adde6, 0x9f84cd87,\n 0x7a584718, 0x7408da17, 0xbc9f9abc, 0xe94b7d8c,\n 0xec7aec3a, 0xdb851dfa, 0x63094366, 0xc464c3d2,\n 0xef1c1847, 0x3215d908, 0xdd433b37, 0x24c2ba16,\n 0x12a14d43, 0x2a65c451, 0x50940002, 0x133ae4dd,\n 0x71dff89e, 0x10314e55, 0x81ac77d6, 0x5f11199b,\n 0x043556f1, 0xd7a3c76b, 0x3c11183b, 0x5924a509,\n 0xf28fe6ed, 0x97f1fbfa, 0x9ebabf2c, 0x1e153c6e,\n 0x86e34570, 0xeae96fb1, 0x860e5e0a, 0x5a3e2ab3,\n 0x771fe71c, 0x4e3d06fa, 0x2965dcb9, 0x99e71d0f,\n 0x803e89d6, 0x5266c825, 0x2e4cc978, 0x9c10b36a,\n 0xc6150eba, 0x94e2ea78, 0xa5fc3c53, 0x1e0a2df4,\n 0xf2f74ea7, 0x361d2b3d, 0x1939260f, 0x19c27960,\n 0x5223a708, 0xf71312b6, 0xebadfe6e, 0xeac31f66,\n 0xe3bc4595, 0xa67bc883, 0xb17f37d1, 0x018cff28,\n 0xc332ddef, 0xbe6c5aa5, 0x65582185, 0x68ab9802,\n 0xeecea50f, 0xdb2f953b, 0x2aef7dad, 0x5b6e2f84,\n 0x1521b628, 0x29076170, 0xecdd4775, 0x619f1510,\n 0x13cca830, 0xeb61bd96, 0x0334fe1e, 0xaa0363cf,\n 0xb5735c90, 0x4c70a239, 0xd59e9e0b, 0xcbaade14,\n 0xeecc86bc, 0x60622ca7, 0x9cab5cab, 0xb2f3846e,\n 0x648b1eaf, 0x19bdf0ca, 0xa02369b9, 0x655abb50,\n 0x40685a32, 0x3c2ab4b3, 0x319ee9d5, 0xc021b8f7,\n 0x9b540b19, 0x875fa099, 0x95f7997e, 0x623d7da8,\n 0xf837889a, 0x97e32d77, 0x11ed935f, 0x16681281,\n 0x0e358829, 0xc7e61fd6, 0x96dedfa1, 0x7858ba99,\n 0x57f584a5, 0x1b227263, 0x9b83c3ff, 0x1ac24696,\n 0xcdb30aeb, 0x532e3054, 0x8fd948e4, 0x6dbc3128,\n 0x58ebf2ef, 0x34c6ffea, 0xfe28ed61, 0xee7c3c73,\n 0x5d4a14d9, 0xe864b7e3, 0x42105d14, 0x203e13e0,\n 0x45eee2b6, 0xa3aaabea, 0xdb6c4f15, 0xfacb4fd0,\n 0xc742f442, 0xef6abbb5, 0x654f3b1d, 0x41cd2105,\n 0xd81e799e, 0x86854dc7, 0xe44b476a, 0x3d816250,\n 0xcf62a1f2, 0x5b8d2646, 0xfc8883a0, 0xc1c7b6a3,\n 0x7f1524c3, 0x69cb7492, 0x47848a0b, 0x5692b285,\n 0x095bbf00, 0xad19489d, 0x1462b174, 0x23820e00,\n 0x58428d2a, 0x0c55f5ea, 0x1dadf43e, 0x233f7061,\n 0x3372f092, 0x8d937e41, 0xd65fecf1, 0x6c223bdb,\n 0x7cde3759, 0xcbee7460, 0x4085f2a7, 0xce77326e,\n 0xa6078084, 0x19f8509e, 0xe8efd855, 0x61d99735,\n 0xa969a7aa, 0xc50c06c2, 0x5a04abfc, 0x800bcadc,\n 0x9e447a2e, 0xc3453484, 0xfdd56705, 0x0e1e9ec9,\n 0xdb73dbd3, 0x105588cd, 0x675fda79, 0xe3674340,\n 0xc5c43465, 0x713e38d8, 0x3d28f89e, 0xf16dff20,\n 0x153e21e7, 0x8fb03d4a, 0xe6e39f2b, 0xdb83adf7]),\n new Uint32Array([\n 0xe93d5a68, 0x948140f7, 0xf64c261c, 0x94692934,\n 0x411520f7, 0x7602d4f7, 0xbcf46b2e, 0xd4a20068,\n 0xd4082471, 0x3320f46a, 0x43b7d4b7, 0x500061af,\n 0x1e39f62e, 0x97244546, 0x14214f74, 0xbf8b8840,\n 0x4d95fc1d, 0x96b591af, 0x70f4ddd3, 0x66a02f45,\n 0xbfbc09ec, 0x03bd9785, 0x7fac6dd0, 0x31cb8504,\n 0x96eb27b3, 0x55fd3941, 0xda2547e6, 0xabca0a9a,\n 0x28507825, 0x530429f4, 0x0a2c86da, 0xe9b66dfb,\n 0x68dc1462, 0xd7486900, 0x680ec0a4, 0x27a18dee,\n 0x4f3ffea2, 0xe887ad8c, 0xb58ce006, 0x7af4d6b6,\n 0xaace1e7c, 0xd3375fec, 0xce78a399, 0x406b2a42,\n 0x20fe9e35, 0xd9f385b9, 0xee39d7ab, 0x3b124e8b,\n 0x1dc9faf7, 0x4b6d1856, 0x26a36631, 0xeae397b2,\n 0x3a6efa74, 0xdd5b4332, 0x6841e7f7, 0xca7820fb,\n 0xfb0af54e, 0xd8feb397, 0x454056ac, 0xba489527,\n 0x55533a3a, 0x20838d87, 0xfe6ba9b7, 0xd096954b,\n 0x55a867bc, 0xa1159a58, 0xcca92963, 0x99e1db33,\n 0xa62a4a56, 0x3f3125f9, 0x5ef47e1c, 0x9029317c,\n 0xfdf8e802, 0x04272f70, 0x80bb155c, 0x05282ce3,\n 0x95c11548, 0xe4c66d22, 0x48c1133f, 0xc70f86dc,\n 0x07f9c9ee, 0x41041f0f, 0x404779a4, 0x5d886e17,\n 0x325f51eb, 0xd59bc0d1, 0xf2bcc18f, 0x41113564,\n 0x257b7834, 0x602a9c60, 0xdff8e8a3, 0x1f636c1b,\n 0x0e12b4c2, 0x02e1329e, 0xaf664fd1, 0xcad18115,\n 0x6b2395e0, 0x333e92e1, 0x3b240b62, 0xeebeb922,\n 0x85b2a20e, 0xe6ba0d99, 0xde720c8c, 0x2da2f728,\n 0xd0127845, 0x95b794fd, 0x647d0862, 0xe7ccf5f0,\n 0x5449a36f, 0x877d48fa, 0xc39dfd27, 0xf33e8d1e,\n 0x0a476341, 0x992eff74, 0x3a6f6eab, 0xf4f8fd37,\n 0xa812dc60, 0xa1ebddf8, 0x991be14c, 0xdb6e6b0d,\n 0xc67b5510, 0x6d672c37, 0x2765d43b, 0xdcd0e804,\n 0xf1290dc7, 0xcc00ffa3, 0xb5390f92, 0x690fed0b,\n 0x667b9ffb, 0xcedb7d9c, 0xa091cf0b, 0xd9155ea3,\n 0xbb132f88, 0x515bad24, 0x7b9479bf, 0x763bd6eb,\n 0x37392eb3, 0xcc115979, 0x8026e297, 0xf42e312d,\n 0x6842ada7, 0xc66a2b3b, 0x12754ccc, 0x782ef11c,\n 0x6a124237, 0xb79251e7, 0x06a1bbe6, 0x4bfb6350,\n 0x1a6b1018, 0x11caedfa, 0x3d25bdd8, 0xe2e1c3c9,\n 0x44421659, 0x0a121386, 0xd90cec6e, 0xd5abea2a,\n 0x64af674e, 0xda86a85f, 0xbebfe988, 0x64e4c3fe,\n 0x9dbc8057, 0xf0f7c086, 0x60787bf8, 0x6003604d,\n 0xd1fd8346, 0xf6381fb0, 0x7745ae04, 0xd736fccc,\n 0x83426b33, 0xf01eab71, 0xb0804187, 0x3c005e5f,\n 0x77a057be, 0xbde8ae24, 0x55464299, 0xbf582e61,\n 0x4e58f48f, 0xf2ddfda2, 0xf474ef38, 0x8789bdc2,\n 0x5366f9c3, 0xc8b38e74, 0xb475f255, 0x46fcd9b9,\n 0x7aeb2661, 0x8b1ddf84, 0x846a0e79, 0x915f95e2,\n 0x466e598e, 0x20b45770, 0x8cd55591, 0xc902de4c,\n 0xb90bace1, 0xbb8205d0, 0x11a86248, 0x7574a99e,\n 0xb77f19b6, 0xe0a9dc09, 0x662d09a1, 0xc4324633,\n 0xe85a1f02, 0x09f0be8c, 0x4a99a025, 0x1d6efe10,\n 0x1ab93d1d, 0x0ba5a4df, 0xa186f20f, 0x2868f169,\n 0xdcb7da83, 0x573906fe, 0xa1e2ce9b, 0x4fcd7f52,\n 0x50115e01, 0xa70683fa, 0xa002b5c4, 0x0de6d027,\n 0x9af88c27, 0x773f8641, 0xc3604c06, 0x61a806b5,\n 0xf0177a28, 0xc0f586e0, 0x006058aa, 0x30dc7d62,\n 0x11e69ed7, 0x2338ea63, 0x53c2dd94, 0xc2c21634,\n 0xbbcbee56, 0x90bcb6de, 0xebfc7da1, 0xce591d76,\n 0x6f05e409, 0x4b7c0188, 0x39720a3d, 0x7c927c24,\n 0x86e3725f, 0x724d9db9, 0x1ac15bb4, 0xd39eb8fc,\n 0xed545578, 0x08fca5b5, 0xd83d7cd3, 0x4dad0fc4,\n 0x1e50ef5e, 0xb161e6f8, 0xa28514d9, 0x6c51133c,\n 0x6fd5c7e7, 0x56e14ec4, 0x362abfce, 0xddc6c837,\n 0xd79a3234, 0x92638212, 0x670efa8e, 0x406000e0]),\n new Uint32Array([\n 0x3a39ce37, 0xd3faf5cf, 0xabc27737, 0x5ac52d1b,\n 0x5cb0679e, 0x4fa33742, 0xd3822740, 0x99bc9bbe,\n 0xd5118e9d, 0xbf0f7315, 0xd62d1c7e, 0xc700c47b,\n 0xb78c1b6b, 0x21a19045, 0xb26eb1be, 0x6a366eb4,\n 0x5748ab2f, 0xbc946e79, 0xc6a376d2, 0x6549c2c8,\n 0x530ff8ee, 0x468dde7d, 0xd5730a1d, 0x4cd04dc6,\n 0x2939bbdb, 0xa9ba4650, 0xac9526e8, 0xbe5ee304,\n 0xa1fad5f0, 0x6a2d519a, 0x63ef8ce2, 0x9a86ee22,\n 0xc089c2b8, 0x43242ef6, 0xa51e03aa, 0x9cf2d0a4,\n 0x83c061ba, 0x9be96a4d, 0x8fe51550, 0xba645bd6,\n 0x2826a2f9, 0xa73a3ae1, 0x4ba99586, 0xef5562e9,\n 0xc72fefd3, 0xf752f7da, 0x3f046f69, 0x77fa0a59,\n 0x80e4a915, 0x87b08601, 0x9b09e6ad, 0x3b3ee593,\n 0xe990fd5a, 0x9e34d797, 0x2cf0b7d9, 0x022b8b51,\n 0x96d5ac3a, 0x017da67d, 0xd1cf3ed6, 0x7c7d2d28,\n 0x1f9f25cf, 0xadf2b89b, 0x5ad6b472, 0x5a88f54c,\n 0xe029ac71, 0xe019a5e6, 0x47b0acfd, 0xed93fa9b,\n 0xe8d3c48d, 0x283b57cc, 0xf8d56629, 0x79132e28,\n 0x785f0191, 0xed756055, 0xf7960e44, 0xe3d35e8c,\n 0x15056dd4, 0x88f46dba, 0x03a16125, 0x0564f0bd,\n 0xc3eb9e15, 0x3c9057a2, 0x97271aec, 0xa93a072a,\n 0x1b3f6d9b, 0x1e6321f5, 0xf59c66fb, 0x26dcf319,\n 0x7533d928, 0xb155fdf5, 0x03563482, 0x8aba3cbb,\n 0x28517711, 0xc20ad9f8, 0xabcc5167, 0xccad925f,\n 0x4de81751, 0x3830dc8e, 0x379d5862, 0x9320f991,\n 0xea7a90c2, 0xfb3e7bce, 0x5121ce64, 0x774fbe32,\n 0xa8b6e37e, 0xc3293d46, 0x48de5369, 0x6413e680,\n 0xa2ae0810, 0xdd6db224, 0x69852dfd, 0x09072166,\n 0xb39a460a, 0x6445c0dd, 0x586cdecf, 0x1c20c8ae,\n 0x5bbef7dd, 0x1b588d40, 0xccd2017f, 0x6bb4e3bb,\n 0xdda26a7e, 0x3a59ff45, 0x3e350a44, 0xbcb4cdd5,\n 0x72eacea8, 0xfa6484bb, 0x8d6612ae, 0xbf3c6f47,\n 0xd29be463, 0x542f5d9e, 0xaec2771b, 0xf64e6370,\n 0x740e0d8d, 0xe75b1357, 0xf8721671, 0xaf537d5d,\n 0x4040cb08, 0x4eb4e2cc, 0x34d2466a, 0x0115af84,\n 0xe1b00428, 0x95983a1d, 0x06b89fb4, 0xce6ea048,\n 0x6f3f3b82, 0x3520ab82, 0x011a1d4b, 0x277227f8,\n 0x611560b1, 0xe7933fdc, 0xbb3a792b, 0x344525bd,\n 0xa08839e1, 0x51ce794b, 0x2f32c9b7, 0xa01fbac9,\n 0xe01cc87e, 0xbcc7d1f6, 0xcf0111c3, 0xa1e8aac7,\n 0x1a908749, 0xd44fbd9a, 0xd0dadecb, 0xd50ada38,\n 0x0339c32a, 0xc6913667, 0x8df9317c, 0xe0b12b4f,\n 0xf79e59b7, 0x43f5bb3a, 0xf2d519ff, 0x27d9459c,\n 0xbf97222c, 0x15e6fc2a, 0x0f91fc71, 0x9b941525,\n 0xfae59361, 0xceb69ceb, 0xc2a86459, 0x12baa8d1,\n 0xb6c1075e, 0xe3056a0c, 0x10d25065, 0xcb03a442,\n 0xe0ec6e0e, 0x1698db3b, 0x4c98a0be, 0x3278e964,\n 0x9f1f9532, 0xe0d392df, 0xd3a0342b, 0x8971f21e,\n 0x1b0a7441, 0x4ba3348c, 0xc5be7120, 0xc37632d8,\n 0xdf359f8d, 0x9b992f2e, 0xe60b6f47, 0x0fe3f11d,\n 0xe54cda54, 0x1edad891, 0xce6279cf, 0xcd3e7e6f,\n 0x1618b166, 0xfd2c1d05, 0x848fd2c5, 0xf6fb2299,\n 0xf523f357, 0xa6327623, 0x93a83531, 0x56cccd02,\n 0xacf08162, 0x5a75ebb5, 0x6e163697, 0x88d273cc,\n 0xde966292, 0x81b949d0, 0x4c50901b, 0x71c65614,\n 0xe6c6c7bd, 0x327a140a, 0x45e1d006, 0xc3f27b9a,\n 0xc9aa53fd, 0x62a80f00, 0xbb25bfe2, 0x35bdd2f6,\n 0x71126905, 0xb2040222, 0xb6cbcf7c, 0xcd769c2b,\n 0x53113ec0, 0x1640e3d3, 0x38abbd60, 0x2547adf0,\n 0xba38209c, 0xf746ce76, 0x77afa1c5, 0x20756060,\n 0x85cbfe4e, 0x8ae88dd8, 0x7aaaf9b0, 0x4cf9aa7e,\n 0x1948c25c, 0x02fb8a8c, 0x01c36ae4, 0xd6ebe1f9,\n 0x90d4f869, 0xa65cdea0, 0x3f09252d, 0xc208e69f,\n 0xb74e6132, 0xce77e25b, 0x578fdfe3, 0x3ac372e6])\n ];\n this.P = new Uint32Array([\n 0x243f6a88, 0x85a308d3, 0x13198a2e, 0x03707344,\n 0xa4093822, 0x299f31d0, 0x082efa98, 0xec4e6c89,\n 0x452821e6, 0x38d01377, 0xbe5466cf, 0x34e90c6c,\n 0xc0ac29b7, 0xc97c50dd, 0x3f84d5b5, 0xb5470917,\n 0x9216d5d9, 0x8979fb1b]);\n};\n\nfunction F(S, x8, i) {\n return (((S[0][x8[i+3]] +\n S[1][x8[i+2]]) ^\n S[2][x8[i+1]]) +\n S[3][x8[i]]);\n};\n\nBlowfish.prototype.encipher = function(x, x8) {\n if (x8 === undefined) {\n x8 = new Uint8Array(x.buffer);\n if (x.byteOffset !== 0)\n x8 = x8.subarray(x.byteOffset);\n }\n x[0] ^= this.P[0];\n for (var i = 1; i < 16; i += 2) {\n x[1] ^= F(this.S, x8, 0) ^ this.P[i];\n x[0] ^= F(this.S, x8, 4) ^ this.P[i+1];\n }\n var t = x[0];\n x[0] = x[1] ^ this.P[17];\n x[1] = t;\n};\n\nBlowfish.prototype.decipher = function(x) {\n var x8 = new Uint8Array(x.buffer);\n if (x.byteOffset !== 0)\n x8 = x8.subarray(x.byteOffset);\n x[0] ^= this.P[17];\n for (var i = 16; i > 0; i -= 2) {\n x[1] ^= F(this.S, x8, 0) ^ this.P[i];\n x[0] ^= F(this.S, x8, 4) ^ this.P[i-1];\n }\n var t = x[0];\n x[0] = x[1] ^ this.P[0];\n x[1] = t;\n};\n\nfunction stream2word(data, databytes){\n var i, temp = 0;\n for (i = 0; i < 4; i++, BLF_J++) {\n if (BLF_J >= databytes) BLF_J = 0;\n temp = (temp << 8) | data[BLF_J];\n }\n return temp;\n};\n\nBlowfish.prototype.expand0state = function(key, keybytes) {\n var d = new Uint32Array(2), i, k;\n var d8 = new Uint8Array(d.buffer);\n\n for (i = 0, BLF_J = 0; i < 18; i++) {\n this.P[i] ^= stream2word(key, keybytes);\n }\n BLF_J = 0;\n\n for (i = 0; i < 18; i += 2) {\n this.encipher(d, d8);\n this.P[i] = d[0];\n this.P[i+1] = d[1];\n }\n\n for (i = 0; i < 4; i++) {\n for (k = 0; k < 256; k += 2) {\n this.encipher(d, d8);\n this.S[i][k] = d[0];\n this.S[i][k+1] = d[1];\n }\n }\n};\n\nBlowfish.prototype.expandstate = function(data, databytes, key, keybytes) {\n var d = new Uint32Array(2), i, k;\n\n for (i = 0, BLF_J = 0; i < 18; i++) {\n this.P[i] ^= stream2word(key, keybytes);\n }\n\n for (i = 0, BLF_J = 0; i < 18; i += 2) {\n d[0] ^= stream2word(data, databytes);\n d[1] ^= stream2word(data, databytes);\n this.encipher(d);\n this.P[i] = d[0];\n this.P[i+1] = d[1];\n }\n\n for (i = 0; i < 4; i++) {\n for (k = 0; k < 256; k += 2) {\n d[0] ^= stream2word(data, databytes);\n d[1] ^= stream2word(data, databytes);\n this.encipher(d);\n this.S[i][k] = d[0];\n this.S[i][k+1] = d[1];\n }\n }\n BLF_J = 0;\n};\n\nBlowfish.prototype.enc = function(data, blocks) {\n for (var i = 0; i < blocks; i++) {\n this.encipher(data.subarray(i*2));\n }\n};\n\nBlowfish.prototype.dec = function(data, blocks) {\n for (var i = 0; i < blocks; i++) {\n this.decipher(data.subarray(i*2));\n }\n};\n\nvar BCRYPT_BLOCKS = 8,\n BCRYPT_HASHSIZE = 32;\n\nfunction bcrypt_hash(sha2pass, sha2salt, out) {\n var state = new Blowfish(),\n cdata = new Uint32Array(BCRYPT_BLOCKS), i,\n ciphertext = new Uint8Array([79,120,121,99,104,114,111,109,97,116,105,\n 99,66,108,111,119,102,105,115,104,83,119,97,116,68,121,110,97,109,\n 105,116,101]); //\"OxychromaticBlowfishSwatDynamite\"\n\n state.expandstate(sha2salt, 64, sha2pass, 64);\n for (i = 0; i < 64; i++) {\n state.expand0state(sha2salt, 64);\n state.expand0state(sha2pass, 64);\n }\n\n for (i = 0; i < BCRYPT_BLOCKS; i++)\n cdata[i] = stream2word(ciphertext, ciphertext.byteLength);\n for (i = 0; i < 64; i++)\n state.enc(cdata, cdata.byteLength / 8);\n\n for (i = 0; i < BCRYPT_BLOCKS; i++) {\n out[4*i+3] = cdata[i] >>> 24;\n out[4*i+2] = cdata[i] >>> 16;\n out[4*i+1] = cdata[i] >>> 8;\n out[4*i+0] = cdata[i];\n }\n};\n\nfunction bcrypt_pbkdf(pass, passlen, salt, saltlen, key, keylen, rounds) {\n var sha2pass = new Uint8Array(64),\n sha2salt = new Uint8Array(64),\n out = new Uint8Array(BCRYPT_HASHSIZE),\n tmpout = new Uint8Array(BCRYPT_HASHSIZE),\n countsalt = new Uint8Array(saltlen+4),\n i, j, amt, stride, dest, count,\n origkeylen = keylen;\n\n if (rounds < 1)\n return -1;\n if (passlen === 0 || saltlen === 0 || keylen === 0 ||\n keylen > (out.byteLength * out.byteLength) || saltlen > (1<<20))\n return -1;\n\n stride = Math.floor((keylen + out.byteLength - 1) / out.byteLength);\n amt = Math.floor((keylen + stride - 1) / stride);\n\n for (i = 0; i < saltlen; i++)\n countsalt[i] = salt[i];\n\n crypto_hash_sha512(sha2pass, pass, passlen);\n\n for (count = 1; keylen > 0; count++) {\n countsalt[saltlen+0] = count >>> 24;\n countsalt[saltlen+1] = count >>> 16;\n countsalt[saltlen+2] = count >>> 8;\n countsalt[saltlen+3] = count;\n\n crypto_hash_sha512(sha2salt, countsalt, saltlen + 4);\n bcrypt_hash(sha2pass, sha2salt, tmpout);\n for (i = out.byteLength; i--;)\n out[i] = tmpout[i];\n\n for (i = 1; i < rounds; i++) {\n crypto_hash_sha512(sha2salt, tmpout, tmpout.byteLength);\n bcrypt_hash(sha2pass, sha2salt, tmpout);\n for (j = 0; j < out.byteLength; j++)\n out[j] ^= tmpout[j];\n }\n\n amt = Math.min(amt, keylen);\n for (i = 0; i < amt; i++) {\n dest = i * stride + (count - 1);\n if (dest >= origkeylen)\n break;\n key[dest] = out[i];\n }\n keylen -= i;\n }\n\n return 0;\n};\n\nmodule.exports = {\n BLOCKS: BCRYPT_BLOCKS,\n HASHSIZE: BCRYPT_HASHSIZE,\n hash: bcrypt_hash,\n pbkdf: bcrypt_pbkdf\n};\n","var concatMap = require('concat-map');\nvar balanced = require('balanced-match');\n\nmodule.exports = expandTop;\n\nvar escSlash = '\\0SLASH'+Math.random()+'\\0';\nvar escOpen = '\\0OPEN'+Math.random()+'\\0';\nvar escClose = '\\0CLOSE'+Math.random()+'\\0';\nvar escComma = '\\0COMMA'+Math.random()+'\\0';\nvar escPeriod = '\\0PERIOD'+Math.random()+'\\0';\n\nfunction numeric(str) {\n return parseInt(str, 10) == str\n ? parseInt(str, 10)\n : str.charCodeAt(0);\n}\n\nfunction escapeBraces(str) {\n return str.split('\\\\\\\\').join(escSlash)\n .split('\\\\{').join(escOpen)\n .split('\\\\}').join(escClose)\n .split('\\\\,').join(escComma)\n .split('\\\\.').join(escPeriod);\n}\n\nfunction unescapeBraces(str) {\n return str.split(escSlash).join('\\\\')\n .split(escOpen).join('{')\n .split(escClose).join('}')\n .split(escComma).join(',')\n .split(escPeriod).join('.');\n}\n\n\n// Basically just str.split(\",\"), but handling cases\n// where we have nested braced sections, which should be\n// treated as individual members, like {a,{b,c},d}\nfunction parseCommaParts(str) {\n if (!str)\n return [''];\n\n var parts = [];\n var m = balanced('{', '}', str);\n\n if (!m)\n return str.split(',');\n\n var pre = m.pre;\n var body = m.body;\n var post = m.post;\n var p = pre.split(',');\n\n p[p.length-1] += '{' + body + '}';\n var postParts = parseCommaParts(post);\n if (post.length) {\n p[p.length-1] += postParts.shift();\n p.push.apply(p, postParts);\n }\n\n parts.push.apply(parts, p);\n\n return parts;\n}\n\nfunction expandTop(str) {\n if (!str)\n return [];\n\n // I don't know why Bash 4.3 does this, but it does.\n // Anything starting with {} will have the first two bytes preserved\n // but *only* at the top level, so {},a}b will not expand to anything,\n // but a{},b}c will be expanded to [a}c,abc].\n // One could argue that this is a bug in Bash, but since the goal of\n // this module is to match Bash's rules, we escape a leading {}\n if (str.substr(0, 2) === '{}') {\n str = '\\\\{\\\\}' + str.substr(2);\n }\n\n return expand(escapeBraces(str), true).map(unescapeBraces);\n}\n\nfunction identity(e) {\n return e;\n}\n\nfunction embrace(str) {\n return '{' + str + '}';\n}\nfunction isPadded(el) {\n return /^-?0\\d/.test(el);\n}\n\nfunction lte(i, y) {\n return i <= y;\n}\nfunction gte(i, y) {\n return i >= y;\n}\n\nfunction expand(str, isTop) {\n var expansions = [];\n\n var m = balanced('{', '}', str);\n if (!m || /\\$$/.test(m.pre)) return [str];\n\n var isNumericSequence = /^-?\\d+\\.\\.-?\\d+(?:\\.\\.-?\\d+)?$/.test(m.body);\n var isAlphaSequence = /^[a-zA-Z]\\.\\.[a-zA-Z](?:\\.\\.-?\\d+)?$/.test(m.body);\n var isSequence = isNumericSequence || isAlphaSequence;\n var isOptions = m.body.indexOf(',') >= 0;\n if (!isSequence && !isOptions) {\n // {a},b}\n if (m.post.match(/,.*\\}/)) {\n str = m.pre + '{' + m.body + escClose + m.post;\n return expand(str);\n }\n return [str];\n }\n\n var n;\n if (isSequence) {\n n = m.body.split(/\\.\\./);\n } else {\n n = parseCommaParts(m.body);\n if (n.length === 1) {\n // x{{a,b}}y ==> x{a}y x{b}y\n n = expand(n[0], false).map(embrace);\n if (n.length === 1) {\n var post = m.post.length\n ? expand(m.post, false)\n : [''];\n return post.map(function(p) {\n return m.pre + n[0] + p;\n });\n }\n }\n }\n\n // at this point, n is the parts, and we know it's not a comma set\n // with a single entry.\n\n // no need to expand pre, since it is guaranteed to be free of brace-sets\n var pre = m.pre;\n var post = m.post.length\n ? expand(m.post, false)\n : [''];\n\n var N;\n\n if (isSequence) {\n var x = numeric(n[0]);\n var y = numeric(n[1]);\n var width = Math.max(n[0].length, n[1].length)\n var incr = n.length == 3\n ? Math.abs(numeric(n[2]))\n : 1;\n var test = lte;\n var reverse = y < x;\n if (reverse) {\n incr *= -1;\n test = gte;\n }\n var pad = n.some(isPadded);\n\n N = [];\n\n for (var i = x; test(i, y); i += incr) {\n var c;\n if (isAlphaSequence) {\n c = String.fromCharCode(i);\n if (c === '\\\\')\n c = '';\n } else {\n c = String(i);\n if (pad) {\n var need = width - c.length;\n if (need > 0) {\n var z = new Array(need + 1).join('0');\n if (i < 0)\n c = '-' + z + c.slice(1);\n else\n c = z + c;\n }\n }\n }\n N.push(c);\n }\n } else {\n N = concatMap(n, function(el) { return expand(el, false) });\n }\n\n for (var j = 0; j < N.length; j++) {\n for (var k = 0; k < post.length; k++) {\n var expansion = pre + N[j] + post[k];\n if (!isTop || isSequence || expansion)\n expansions.push(expansion);\n }\n }\n\n return expansions;\n}\n\n","'use strict';\nconst {PassThrough: PassThroughStream} = require('stream');\n\nmodule.exports = options => {\n\toptions = {...options};\n\n\tconst {array} = options;\n\tlet {encoding} = options;\n\tconst isBuffer = encoding === 'buffer';\n\tlet objectMode = false;\n\n\tif (array) {\n\t\tobjectMode = !(encoding || isBuffer);\n\t} else {\n\t\tencoding = encoding || 'utf8';\n\t}\n\n\tif (isBuffer) {\n\t\tencoding = null;\n\t}\n\n\tconst stream = new PassThroughStream({objectMode});\n\n\tif (encoding) {\n\t\tstream.setEncoding(encoding);\n\t}\n\n\tlet length = 0;\n\tconst chunks = [];\n\n\tstream.on('data', chunk => {\n\t\tchunks.push(chunk);\n\n\t\tif (objectMode) {\n\t\t\tlength = chunks.length;\n\t\t} else {\n\t\t\tlength += chunk.length;\n\t\t}\n\t});\n\n\tstream.getBufferedValue = () => {\n\t\tif (array) {\n\t\t\treturn chunks;\n\t\t}\n\n\t\treturn isBuffer ? Buffer.concat(chunks, length) : chunks.join('');\n\t};\n\n\tstream.getBufferedLength = () => length;\n\n\treturn stream;\n};\n","'use strict';\nconst {constants: BufferConstants} = require('buffer');\nconst pump = require('pump');\nconst bufferStream = require('./buffer-stream');\n\nclass MaxBufferError extends Error {\n\tconstructor() {\n\t\tsuper('maxBuffer exceeded');\n\t\tthis.name = 'MaxBufferError';\n\t}\n}\n\nasync function getStream(inputStream, options) {\n\tif (!inputStream) {\n\t\treturn Promise.reject(new Error('Expected a stream'));\n\t}\n\n\toptions = {\n\t\tmaxBuffer: Infinity,\n\t\t...options\n\t};\n\n\tconst {maxBuffer} = options;\n\n\tlet stream;\n\tawait new Promise((resolve, reject) => {\n\t\tconst rejectPromise = error => {\n\t\t\t// Don't retrieve an oversized buffer.\n\t\t\tif (error && stream.getBufferedLength() <= BufferConstants.MAX_LENGTH) {\n\t\t\t\terror.bufferedData = stream.getBufferedValue();\n\t\t\t}\n\n\t\t\treject(error);\n\t\t};\n\n\t\tstream = pump(inputStream, bufferStream(options), error => {\n\t\t\tif (error) {\n\t\t\t\trejectPromise(error);\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tresolve();\n\t\t});\n\n\t\tstream.on('data', () => {\n\t\t\tif (stream.getBufferedLength() > maxBuffer) {\n\t\t\t\trejectPromise(new MaxBufferError());\n\t\t\t}\n\t\t});\n\t});\n\n\treturn stream.getBufferedValue();\n}\n\nmodule.exports = getStream;\n// TODO: Remove this for the next major release\nmodule.exports.default = getStream;\nmodule.exports.buffer = (stream, options) => getStream(stream, {...options, encoding: 'buffer'});\nmodule.exports.array = (stream, options) => getStream(stream, {...options, array: true});\nmodule.exports.MaxBufferError = MaxBufferError;\n","'use strict';\nmodule.exports = object => {\n\tconst result = {};\n\n\tfor (const [key, value] of Object.entries(object)) {\n\t\tresult[key.toLowerCase()] = value;\n\t}\n\n\treturn result;\n};\n","'use strict';\n\nconst EventEmitter = require('events');\nconst urlLib = require('url');\nconst normalizeUrl = require('normalize-url');\nconst getStream = require('get-stream');\nconst CachePolicy = require('http-cache-semantics');\nconst Response = require('responselike');\nconst lowercaseKeys = require('lowercase-keys');\nconst cloneResponse = require('clone-response');\nconst Keyv = require('keyv');\n\nclass CacheableRequest {\n\tconstructor(request, cacheAdapter) {\n\t\tif (typeof request !== 'function') {\n\t\t\tthrow new TypeError('Parameter `request` must be a function');\n\t\t}\n\n\t\tthis.cache = new Keyv({\n\t\t\turi: typeof cacheAdapter === 'string' && cacheAdapter,\n\t\t\tstore: typeof cacheAdapter !== 'string' && cacheAdapter,\n\t\t\tnamespace: 'cacheable-request'\n\t\t});\n\n\t\treturn this.createCacheableRequest(request);\n\t}\n\n\tcreateCacheableRequest(request) {\n\t\treturn (opts, cb) => {\n\t\t\tlet url;\n\t\t\tif (typeof opts === 'string') {\n\t\t\t\turl = normalizeUrlObject(urlLib.parse(opts));\n\t\t\t\topts = {};\n\t\t\t} else if (opts instanceof urlLib.URL) {\n\t\t\t\turl = normalizeUrlObject(urlLib.parse(opts.toString()));\n\t\t\t\topts = {};\n\t\t\t} else {\n\t\t\t\tconst [pathname, ...searchParts] = (opts.path || '').split('?');\n\t\t\t\tconst search = searchParts.length > 0 ?\n\t\t\t\t\t`?${searchParts.join('?')}` :\n\t\t\t\t\t'';\n\t\t\t\turl = normalizeUrlObject({ ...opts, pathname, search });\n\t\t\t}\n\n\t\t\topts = {\n\t\t\t\theaders: {},\n\t\t\t\tmethod: 'GET',\n\t\t\t\tcache: true,\n\t\t\t\tstrictTtl: false,\n\t\t\t\tautomaticFailover: false,\n\t\t\t\t...opts,\n\t\t\t\t...urlObjectToRequestOptions(url)\n\t\t\t};\n\t\t\topts.headers = lowercaseKeys(opts.headers);\n\n\t\t\tconst ee = new EventEmitter();\n\t\t\tconst normalizedUrlString = normalizeUrl(\n\t\t\t\turlLib.format(url),\n\t\t\t\t{\n\t\t\t\t\tstripWWW: false,\n\t\t\t\t\tremoveTrailingSlash: false,\n\t\t\t\t\tstripAuthentication: false\n\t\t\t\t}\n\t\t\t);\n\t\t\tconst key = `${opts.method}:${normalizedUrlString}`;\n\t\t\tlet revalidate = false;\n\t\t\tlet madeRequest = false;\n\n\t\t\tconst makeRequest = opts => {\n\t\t\t\tmadeRequest = true;\n\t\t\t\tlet requestErrored = false;\n\t\t\t\tlet requestErrorCallback;\n\n\t\t\t\tconst requestErrorPromise = new Promise(resolve => {\n\t\t\t\t\trequestErrorCallback = () => {\n\t\t\t\t\t\tif (!requestErrored) {\n\t\t\t\t\t\t\trequestErrored = true;\n\t\t\t\t\t\t\tresolve();\n\t\t\t\t\t\t}\n\t\t\t\t\t};\n\t\t\t\t});\n\n\t\t\t\tconst handler = response => {\n\t\t\t\t\tif (revalidate && !opts.forceRefresh) {\n\t\t\t\t\t\tresponse.status = response.statusCode;\n\t\t\t\t\t\tconst revalidatedPolicy = CachePolicy.fromObject(revalidate.cachePolicy).revalidatedPolicy(opts, response);\n\t\t\t\t\t\tif (!revalidatedPolicy.modified) {\n\t\t\t\t\t\t\tconst headers = revalidatedPolicy.policy.responseHeaders();\n\t\t\t\t\t\t\tresponse = new Response(revalidate.statusCode, headers, revalidate.body, revalidate.url);\n\t\t\t\t\t\t\tresponse.cachePolicy = revalidatedPolicy.policy;\n\t\t\t\t\t\t\tresponse.fromCache = true;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tif (!response.fromCache) {\n\t\t\t\t\t\tresponse.cachePolicy = new CachePolicy(opts, response, opts);\n\t\t\t\t\t\tresponse.fromCache = false;\n\t\t\t\t\t}\n\n\t\t\t\t\tlet clonedResponse;\n\t\t\t\t\tif (opts.cache && response.cachePolicy.storable()) {\n\t\t\t\t\t\tclonedResponse = cloneResponse(response);\n\n\t\t\t\t\t\t(async () => {\n\t\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\t\tconst bodyPromise = getStream.buffer(response);\n\n\t\t\t\t\t\t\t\tawait Promise.race([\n\t\t\t\t\t\t\t\t\trequestErrorPromise,\n\t\t\t\t\t\t\t\t\tnew Promise(resolve => response.once('end', resolve))\n\t\t\t\t\t\t\t\t]);\n\n\t\t\t\t\t\t\t\tif (requestErrored) {\n\t\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\tconst body = await bodyPromise;\n\n\t\t\t\t\t\t\t\tconst value = {\n\t\t\t\t\t\t\t\t\tcachePolicy: response.cachePolicy.toObject(),\n\t\t\t\t\t\t\t\t\turl: response.url,\n\t\t\t\t\t\t\t\t\tstatusCode: response.fromCache ? revalidate.statusCode : response.statusCode,\n\t\t\t\t\t\t\t\t\tbody\n\t\t\t\t\t\t\t\t};\n\n\t\t\t\t\t\t\t\tlet ttl = opts.strictTtl ? response.cachePolicy.timeToLive() : undefined;\n\t\t\t\t\t\t\t\tif (opts.maxTtl) {\n\t\t\t\t\t\t\t\t\tttl = ttl ? Math.min(ttl, opts.maxTtl) : opts.maxTtl;\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\tawait this.cache.set(key, value, ttl);\n\t\t\t\t\t\t\t} catch (error) {\n\t\t\t\t\t\t\t\tee.emit('error', new CacheableRequest.CacheError(error));\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t})();\n\t\t\t\t\t} else if (opts.cache && revalidate) {\n\t\t\t\t\t\t(async () => {\n\t\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\t\tawait this.cache.delete(key);\n\t\t\t\t\t\t\t} catch (error) {\n\t\t\t\t\t\t\t\tee.emit('error', new CacheableRequest.CacheError(error));\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t})();\n\t\t\t\t\t}\n\n\t\t\t\t\tee.emit('response', clonedResponse || response);\n\t\t\t\t\tif (typeof cb === 'function') {\n\t\t\t\t\t\tcb(clonedResponse || response);\n\t\t\t\t\t}\n\t\t\t\t};\n\n\t\t\t\ttry {\n\t\t\t\t\tconst req = request(opts, handler);\n\t\t\t\t\treq.once('error', requestErrorCallback);\n\t\t\t\t\treq.once('abort', requestErrorCallback);\n\t\t\t\t\tee.emit('request', req);\n\t\t\t\t} catch (error) {\n\t\t\t\t\tee.emit('error', new CacheableRequest.RequestError(error));\n\t\t\t\t}\n\t\t\t};\n\n\t\t\t(async () => {\n\t\t\t\tconst get = async opts => {\n\t\t\t\t\tawait Promise.resolve();\n\n\t\t\t\t\tconst cacheEntry = opts.cache ? await this.cache.get(key) : undefined;\n\t\t\t\t\tif (typeof cacheEntry === 'undefined') {\n\t\t\t\t\t\treturn makeRequest(opts);\n\t\t\t\t\t}\n\n\t\t\t\t\tconst policy = CachePolicy.fromObject(cacheEntry.cachePolicy);\n\t\t\t\t\tif (policy.satisfiesWithoutRevalidation(opts) && !opts.forceRefresh) {\n\t\t\t\t\t\tconst headers = policy.responseHeaders();\n\t\t\t\t\t\tconst response = new Response(cacheEntry.statusCode, headers, cacheEntry.body, cacheEntry.url);\n\t\t\t\t\t\tresponse.cachePolicy = policy;\n\t\t\t\t\t\tresponse.fromCache = true;\n\n\t\t\t\t\t\tee.emit('response', response);\n\t\t\t\t\t\tif (typeof cb === 'function') {\n\t\t\t\t\t\t\tcb(response);\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\trevalidate = cacheEntry;\n\t\t\t\t\t\topts.headers = policy.revalidationHeaders(opts);\n\t\t\t\t\t\tmakeRequest(opts);\n\t\t\t\t\t}\n\t\t\t\t};\n\n\t\t\t\tconst errorHandler = error => ee.emit('error', new CacheableRequest.CacheError(error));\n\t\t\t\tthis.cache.once('error', errorHandler);\n\t\t\t\tee.on('response', () => this.cache.removeListener('error', errorHandler));\n\n\t\t\t\ttry {\n\t\t\t\t\tawait get(opts);\n\t\t\t\t} catch (error) {\n\t\t\t\t\tif (opts.automaticFailover && !madeRequest) {\n\t\t\t\t\t\tmakeRequest(opts);\n\t\t\t\t\t}\n\n\t\t\t\t\tee.emit('error', new CacheableRequest.CacheError(error));\n\t\t\t\t}\n\t\t\t})();\n\n\t\t\treturn ee;\n\t\t};\n\t}\n}\n\nfunction urlObjectToRequestOptions(url) {\n\tconst options = { ...url };\n\toptions.path = `${url.pathname || '/'}${url.search || ''}`;\n\tdelete options.pathname;\n\tdelete options.search;\n\treturn options;\n}\n\nfunction normalizeUrlObject(url) {\n\t// If url was parsed by url.parse or new URL:\n\t// - hostname will be set\n\t// - host will be hostname[:port]\n\t// - port will be set if it was explicit in the parsed string\n\t// Otherwise, url was from request options:\n\t// - hostname or host may be set\n\t// - host shall not have port encoded\n\treturn {\n\t\tprotocol: url.protocol,\n\t\tauth: url.auth,\n\t\thostname: url.hostname || url.host || 'localhost',\n\t\tport: url.port,\n\t\tpathname: url.pathname,\n\t\tsearch: url.search\n\t};\n}\n\nCacheableRequest.RequestError = class extends Error {\n\tconstructor(error) {\n\t\tsuper(error.message);\n\t\tthis.name = 'RequestError';\n\t\tObject.assign(this, error);\n\t}\n};\n\nCacheableRequest.CacheError = class extends Error {\n\tconstructor(error) {\n\t\tsuper(error.message);\n\t\tthis.name = 'CacheError';\n\t\tObject.assign(this, error);\n\t}\n};\n\nmodule.exports = CacheableRequest;\n","'use strict';\n\nvar GetIntrinsic = require('get-intrinsic');\n\nvar callBind = require('./');\n\nvar $indexOf = callBind(GetIntrinsic('String.prototype.indexOf'));\n\nmodule.exports = function callBoundIntrinsic(name, allowMissing) {\n\tvar intrinsic = GetIntrinsic(name, !!allowMissing);\n\tif (typeof intrinsic === 'function' && $indexOf(name, '.prototype.') > -1) {\n\t\treturn callBind(intrinsic);\n\t}\n\treturn intrinsic;\n};\n","'use strict';\n\nvar bind = require('function-bind');\nvar GetIntrinsic = require('get-intrinsic');\n\nvar $apply = GetIntrinsic('%Function.prototype.apply%');\nvar $call = GetIntrinsic('%Function.prototype.call%');\nvar $reflectApply = GetIntrinsic('%Reflect.apply%', true) || bind.call($call, $apply);\n\nvar $gOPD = GetIntrinsic('%Object.getOwnPropertyDescriptor%', true);\nvar $defineProperty = GetIntrinsic('%Object.defineProperty%', true);\nvar $max = GetIntrinsic('%Math.max%');\n\nif ($defineProperty) {\n\ttry {\n\t\t$defineProperty({}, 'a', { value: 1 });\n\t} catch (e) {\n\t\t// IE 8 has a broken defineProperty\n\t\t$defineProperty = null;\n\t}\n}\n\nmodule.exports = function callBind(originalFunction) {\n\tvar func = $reflectApply(bind, $call, arguments);\n\tif ($gOPD && $defineProperty) {\n\t\tvar desc = $gOPD(func, 'length');\n\t\tif (desc.configurable) {\n\t\t\t// original length, plus the receiver, minus any additional arguments (after the receiver)\n\t\t\t$defineProperty(\n\t\t\t\tfunc,\n\t\t\t\t'length',\n\t\t\t\t{ value: 1 + $max(0, originalFunction.length - (arguments.length - 1)) }\n\t\t\t);\n\t\t}\n\t}\n\treturn func;\n};\n\nvar applyBind = function applyBind() {\n\treturn $reflectApply(bind, $apply, arguments);\n};\n\nif ($defineProperty) {\n\t$defineProperty(module.exports, 'apply', { value: applyBind });\n} else {\n\tmodule.exports.apply = applyBind;\n}\n","function Caseless (dict) {\n this.dict = dict || {}\n}\nCaseless.prototype.set = function (name, value, clobber) {\n if (typeof name === 'object') {\n for (var i in name) {\n this.set(i, name[i], value)\n }\n } else {\n if (typeof clobber === 'undefined') clobber = true\n var has = this.has(name)\n\n if (!clobber && has) this.dict[has] = this.dict[has] + ',' + value\n else this.dict[has || name] = value\n return has\n }\n}\nCaseless.prototype.has = function (name) {\n var keys = Object.keys(this.dict)\n , name = name.toLowerCase()\n ;\n for (var i=0;i {\n\toptions = Object.assign({pretty: false}, options);\n\n\treturn stack.replace(/\\\\/g, '/')\n\t\t.split('\\n')\n\t\t.filter(line => {\n\t\t\tconst pathMatches = line.match(extractPathRegex);\n\t\t\tif (pathMatches === null || !pathMatches[1]) {\n\t\t\t\treturn true;\n\t\t\t}\n\n\t\t\tconst match = pathMatches[1];\n\n\t\t\t// Electron\n\t\t\tif (\n\t\t\t\tmatch.includes('.app/Contents/Resources/electron.asar') ||\n\t\t\t\tmatch.includes('.app/Contents/Resources/default_app.asar')\n\t\t\t) {\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\treturn !pathRegex.test(match);\n\t\t})\n\t\t.filter(line => line.trim() !== '')\n\t\t.map(line => {\n\t\t\tif (options.pretty) {\n\t\t\t\treturn line.replace(extractPathRegex, (m, p1) => m.replace(p1, p1.replace(homeDir, '~')));\n\t\t\t}\n\n\t\t\treturn line;\n\t\t})\n\t\t.join('\\n');\n};\n","'use strict';\n\nconst PassThrough = require('stream').PassThrough;\nconst mimicResponse = require('mimic-response');\n\nconst cloneResponse = response => {\n\tif (!(response && response.pipe)) {\n\t\tthrow new TypeError('Parameter `response` must be a response stream.');\n\t}\n\n\tconst clone = new PassThrough();\n\tmimicResponse(response, clone);\n\n\treturn response.pipe(clone);\n};\n\nmodule.exports = cloneResponse;\n","var util = require('util');\nvar Stream = require('stream').Stream;\nvar DelayedStream = require('delayed-stream');\n\nmodule.exports = CombinedStream;\nfunction CombinedStream() {\n this.writable = false;\n this.readable = true;\n this.dataSize = 0;\n this.maxDataSize = 2 * 1024 * 1024;\n this.pauseStreams = true;\n\n this._released = false;\n this._streams = [];\n this._currentStream = null;\n this._insideLoop = false;\n this._pendingNext = false;\n}\nutil.inherits(CombinedStream, Stream);\n\nCombinedStream.create = function(options) {\n var combinedStream = new this();\n\n options = options || {};\n for (var option in options) {\n combinedStream[option] = options[option];\n }\n\n return combinedStream;\n};\n\nCombinedStream.isStreamLike = function(stream) {\n return (typeof stream !== 'function')\n && (typeof stream !== 'string')\n && (typeof stream !== 'boolean')\n && (typeof stream !== 'number')\n && (!Buffer.isBuffer(stream));\n};\n\nCombinedStream.prototype.append = function(stream) {\n var isStreamLike = CombinedStream.isStreamLike(stream);\n\n if (isStreamLike) {\n if (!(stream instanceof DelayedStream)) {\n var newStream = DelayedStream.create(stream, {\n maxDataSize: Infinity,\n pauseStream: this.pauseStreams,\n });\n stream.on('data', this._checkDataSize.bind(this));\n stream = newStream;\n }\n\n this._handleErrors(stream);\n\n if (this.pauseStreams) {\n stream.pause();\n }\n }\n\n this._streams.push(stream);\n return this;\n};\n\nCombinedStream.prototype.pipe = function(dest, options) {\n Stream.prototype.pipe.call(this, dest, options);\n this.resume();\n return dest;\n};\n\nCombinedStream.prototype._getNext = function() {\n this._currentStream = null;\n\n if (this._insideLoop) {\n this._pendingNext = true;\n return; // defer call\n }\n\n this._insideLoop = true;\n try {\n do {\n this._pendingNext = false;\n this._realGetNext();\n } while (this._pendingNext);\n } finally {\n this._insideLoop = false;\n }\n};\n\nCombinedStream.prototype._realGetNext = function() {\n var stream = this._streams.shift();\n\n\n if (typeof stream == 'undefined') {\n this.end();\n return;\n }\n\n if (typeof stream !== 'function') {\n this._pipeNext(stream);\n return;\n }\n\n var getStream = stream;\n getStream(function(stream) {\n var isStreamLike = CombinedStream.isStreamLike(stream);\n if (isStreamLike) {\n stream.on('data', this._checkDataSize.bind(this));\n this._handleErrors(stream);\n }\n\n this._pipeNext(stream);\n }.bind(this));\n};\n\nCombinedStream.prototype._pipeNext = function(stream) {\n this._currentStream = stream;\n\n var isStreamLike = CombinedStream.isStreamLike(stream);\n if (isStreamLike) {\n stream.on('end', this._getNext.bind(this));\n stream.pipe(this, {end: false});\n return;\n }\n\n var value = stream;\n this.write(value);\n this._getNext();\n};\n\nCombinedStream.prototype._handleErrors = function(stream) {\n var self = this;\n stream.on('error', function(err) {\n self._emitError(err);\n });\n};\n\nCombinedStream.prototype.write = function(data) {\n this.emit('data', data);\n};\n\nCombinedStream.prototype.pause = function() {\n if (!this.pauseStreams) {\n return;\n }\n\n if(this.pauseStreams && this._currentStream && typeof(this._currentStream.pause) == 'function') this._currentStream.pause();\n this.emit('pause');\n};\n\nCombinedStream.prototype.resume = function() {\n if (!this._released) {\n this._released = true;\n this.writable = true;\n this._getNext();\n }\n\n if(this.pauseStreams && this._currentStream && typeof(this._currentStream.resume) == 'function') this._currentStream.resume();\n this.emit('resume');\n};\n\nCombinedStream.prototype.end = function() {\n this._reset();\n this.emit('end');\n};\n\nCombinedStream.prototype.destroy = function() {\n this._reset();\n this.emit('close');\n};\n\nCombinedStream.prototype._reset = function() {\n this.writable = false;\n this._streams = [];\n this._currentStream = null;\n};\n\nCombinedStream.prototype._checkDataSize = function() {\n this._updateDataSize();\n if (this.dataSize <= this.maxDataSize) {\n return;\n }\n\n var message =\n 'DelayedStream#maxDataSize of ' + this.maxDataSize + ' bytes exceeded.';\n this._emitError(new Error(message));\n};\n\nCombinedStream.prototype._updateDataSize = function() {\n this.dataSize = 0;\n\n var self = this;\n this._streams.forEach(function(stream) {\n if (!stream.dataSize) {\n return;\n }\n\n self.dataSize += stream.dataSize;\n });\n\n if (this._currentStream && this._currentStream.dataSize) {\n this.dataSize += this._currentStream.dataSize;\n }\n};\n\nCombinedStream.prototype._emitError = function(err) {\n this._reset();\n this.emit('error', err);\n};\n","module.exports = function (xs, fn) {\n var res = [];\n for (var i = 0; i < xs.length; i++) {\n var x = fn(xs[i], i);\n if (isArray(x)) res.push.apply(res, x);\n else res.push(x);\n }\n return res;\n};\n\nvar isArray = Array.isArray || function (xs) {\n return Object.prototype.toString.call(xs) === '[object Array]';\n};\n","// Copyright Joyent, Inc. and other Node contributors.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a\n// copy of this software and associated documentation files (the\n// \"Software\"), to deal in the Software without restriction, including\n// without limitation the rights to use, copy, modify, merge, publish,\n// distribute, sublicense, and/or sell copies of the Software, and to permit\n// persons to whom the Software is furnished to do so, subject to the\n// following conditions:\n//\n// The above copyright notice and this permission notice shall be included\n// in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\n// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN\n// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,\n// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE\n// USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n// NOTE: These type checking functions intentionally don't use `instanceof`\n// because it is fragile and can be easily faked with `Object.create()`.\n\nfunction isArray(arg) {\n if (Array.isArray) {\n return Array.isArray(arg);\n }\n return objectToString(arg) === '[object Array]';\n}\nexports.isArray = isArray;\n\nfunction isBoolean(arg) {\n return typeof arg === 'boolean';\n}\nexports.isBoolean = isBoolean;\n\nfunction isNull(arg) {\n return arg === null;\n}\nexports.isNull = isNull;\n\nfunction isNullOrUndefined(arg) {\n return arg == null;\n}\nexports.isNullOrUndefined = isNullOrUndefined;\n\nfunction isNumber(arg) {\n return typeof arg === 'number';\n}\nexports.isNumber = isNumber;\n\nfunction isString(arg) {\n return typeof arg === 'string';\n}\nexports.isString = isString;\n\nfunction isSymbol(arg) {\n return typeof arg === 'symbol';\n}\nexports.isSymbol = isSymbol;\n\nfunction isUndefined(arg) {\n return arg === void 0;\n}\nexports.isUndefined = isUndefined;\n\nfunction isRegExp(re) {\n return objectToString(re) === '[object RegExp]';\n}\nexports.isRegExp = isRegExp;\n\nfunction isObject(arg) {\n return typeof arg === 'object' && arg !== null;\n}\nexports.isObject = isObject;\n\nfunction isDate(d) {\n return objectToString(d) === '[object Date]';\n}\nexports.isDate = isDate;\n\nfunction isError(e) {\n return (objectToString(e) === '[object Error]' || e instanceof Error);\n}\nexports.isError = isError;\n\nfunction isFunction(arg) {\n return typeof arg === 'function';\n}\nexports.isFunction = isFunction;\n\nfunction isPrimitive(arg) {\n return arg === null ||\n typeof arg === 'boolean' ||\n typeof arg === 'number' ||\n typeof arg === 'string' ||\n typeof arg === 'symbol' || // ES6 symbol\n typeof arg === 'undefined';\n}\nexports.isPrimitive = isPrimitive;\n\nexports.isBuffer = Buffer.isBuffer;\n\nfunction objectToString(o) {\n return Object.prototype.toString.call(o);\n}\n","'use strict';\nconst PassThrough = require('stream').PassThrough;\nconst zlib = require('zlib');\nconst mimicResponse = require('mimic-response');\n\nmodule.exports = response => {\n\t// TODO: Use Array#includes when targeting Node.js 6\n\tif (['gzip', 'deflate'].indexOf(response.headers['content-encoding']) === -1) {\n\t\treturn response;\n\t}\n\n\tconst unzip = zlib.createUnzip();\n\tconst stream = new PassThrough();\n\n\tmimicResponse(response, stream);\n\n\tunzip.on('error', err => {\n\t\tif (err.code === 'Z_BUF_ERROR') {\n\t\t\tstream.end();\n\t\t\treturn;\n\t\t}\n\n\t\tstream.emit('error', err);\n\t});\n\n\tresponse.pipe(unzip).pipe(stream);\n\n\treturn stream;\n};\n","'use strict';\n\nvar isMergeableObject = function isMergeableObject(value) {\n\treturn isNonNullObject(value)\n\t\t&& !isSpecial(value)\n};\n\nfunction isNonNullObject(value) {\n\treturn !!value && typeof value === 'object'\n}\n\nfunction isSpecial(value) {\n\tvar stringValue = Object.prototype.toString.call(value);\n\n\treturn stringValue === '[object RegExp]'\n\t\t|| stringValue === '[object Date]'\n\t\t|| isReactElement(value)\n}\n\n// see https://github.com/facebook/react/blob/b5ac963fb791d1298e7f396236383bc955f916c1/src/isomorphic/classic/element/ReactElement.js#L21-L25\nvar canUseSymbol = typeof Symbol === 'function' && Symbol.for;\nvar REACT_ELEMENT_TYPE = canUseSymbol ? Symbol.for('react.element') : 0xeac7;\n\nfunction isReactElement(value) {\n\treturn value.$$typeof === REACT_ELEMENT_TYPE\n}\n\nfunction emptyTarget(val) {\n\treturn Array.isArray(val) ? [] : {}\n}\n\nfunction cloneUnlessOtherwiseSpecified(value, options) {\n\treturn (options.clone !== false && options.isMergeableObject(value))\n\t\t? deepmerge(emptyTarget(value), value, options)\n\t\t: value\n}\n\nfunction defaultArrayMerge(target, source, options) {\n\treturn target.concat(source).map(function(element) {\n\t\treturn cloneUnlessOtherwiseSpecified(element, options)\n\t})\n}\n\nfunction getMergeFunction(key, options) {\n\tif (!options.customMerge) {\n\t\treturn deepmerge\n\t}\n\tvar customMerge = options.customMerge(key);\n\treturn typeof customMerge === 'function' ? customMerge : deepmerge\n}\n\nfunction getEnumerableOwnPropertySymbols(target) {\n\treturn Object.getOwnPropertySymbols\n\t\t? Object.getOwnPropertySymbols(target).filter(function(symbol) {\n\t\t\treturn target.propertyIsEnumerable(symbol)\n\t\t})\n\t\t: []\n}\n\nfunction getKeys(target) {\n\treturn Object.keys(target).concat(getEnumerableOwnPropertySymbols(target))\n}\n\nfunction propertyIsOnObject(object, property) {\n\ttry {\n\t\treturn property in object\n\t} catch(_) {\n\t\treturn false\n\t}\n}\n\n// Protects from prototype poisoning and unexpected merging up the prototype chain.\nfunction propertyIsUnsafe(target, key) {\n\treturn propertyIsOnObject(target, key) // Properties are safe to merge if they don't exist in the target yet,\n\t\t&& !(Object.hasOwnProperty.call(target, key) // unsafe if they exist up the prototype chain,\n\t\t\t&& Object.propertyIsEnumerable.call(target, key)) // and also unsafe if they're nonenumerable.\n}\n\nfunction mergeObject(target, source, options) {\n\tvar destination = {};\n\tif (options.isMergeableObject(target)) {\n\t\tgetKeys(target).forEach(function(key) {\n\t\t\tdestination[key] = cloneUnlessOtherwiseSpecified(target[key], options);\n\t\t});\n\t}\n\tgetKeys(source).forEach(function(key) {\n\t\tif (propertyIsUnsafe(target, key)) {\n\t\t\treturn\n\t\t}\n\n\t\tif (propertyIsOnObject(target, key) && options.isMergeableObject(source[key])) {\n\t\t\tdestination[key] = getMergeFunction(key, options)(target[key], source[key], options);\n\t\t} else {\n\t\t\tdestination[key] = cloneUnlessOtherwiseSpecified(source[key], options);\n\t\t}\n\t});\n\treturn destination\n}\n\nfunction deepmerge(target, source, options) {\n\toptions = options || {};\n\toptions.arrayMerge = options.arrayMerge || defaultArrayMerge;\n\toptions.isMergeableObject = options.isMergeableObject || isMergeableObject;\n\t// cloneUnlessOtherwiseSpecified is added to `options` so that custom arrayMerge()\n\t// implementations can use it. The caller may not replace it.\n\toptions.cloneUnlessOtherwiseSpecified = cloneUnlessOtherwiseSpecified;\n\n\tvar sourceIsArray = Array.isArray(source);\n\tvar targetIsArray = Array.isArray(target);\n\tvar sourceAndTargetTypesMatch = sourceIsArray === targetIsArray;\n\n\tif (!sourceAndTargetTypesMatch) {\n\t\treturn cloneUnlessOtherwiseSpecified(source, options)\n\t} else if (sourceIsArray) {\n\t\treturn options.arrayMerge(target, source, options)\n\t} else {\n\t\treturn mergeObject(target, source, options)\n\t}\n}\n\ndeepmerge.all = function deepmergeAll(array, options) {\n\tif (!Array.isArray(array)) {\n\t\tthrow new Error('first argument should be an array')\n\t}\n\n\treturn array.reduce(function(prev, next) {\n\t\treturn deepmerge(prev, next, options)\n\t}, {})\n};\n\nvar deepmerge_1 = deepmerge;\n\nmodule.exports = deepmerge_1;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst tls_1 = require(\"tls\");\nconst deferToConnect = (socket, fn) => {\n let listeners;\n if (typeof fn === 'function') {\n const connect = fn;\n listeners = { connect };\n }\n else {\n listeners = fn;\n }\n const hasConnectListener = typeof listeners.connect === 'function';\n const hasSecureConnectListener = typeof listeners.secureConnect === 'function';\n const hasCloseListener = typeof listeners.close === 'function';\n const onConnect = () => {\n if (hasConnectListener) {\n listeners.connect();\n }\n if (socket instanceof tls_1.TLSSocket && hasSecureConnectListener) {\n if (socket.authorized) {\n listeners.secureConnect();\n }\n else if (!socket.authorizationError) {\n socket.once('secureConnect', listeners.secureConnect);\n }\n }\n if (hasCloseListener) {\n socket.once('close', listeners.close);\n }\n };\n if (socket.writable && !socket.connecting) {\n onConnect();\n }\n else if (socket.connecting) {\n socket.once('connect', onConnect);\n }\n else if (socket.destroyed && hasCloseListener) {\n listeners.close(socket._hadError);\n }\n};\nexports.default = deferToConnect;\n// For CommonJS default export support\nmodule.exports = deferToConnect;\nmodule.exports.default = deferToConnect;\n","var Stream = require('stream').Stream;\nvar util = require('util');\n\nmodule.exports = DelayedStream;\nfunction DelayedStream() {\n this.source = null;\n this.dataSize = 0;\n this.maxDataSize = 1024 * 1024;\n this.pauseStream = true;\n\n this._maxDataSizeExceeded = false;\n this._released = false;\n this._bufferedEvents = [];\n}\nutil.inherits(DelayedStream, Stream);\n\nDelayedStream.create = function(source, options) {\n var delayedStream = new this();\n\n options = options || {};\n for (var option in options) {\n delayedStream[option] = options[option];\n }\n\n delayedStream.source = source;\n\n var realEmit = source.emit;\n source.emit = function() {\n delayedStream._handleEmit(arguments);\n return realEmit.apply(source, arguments);\n };\n\n source.on('error', function() {});\n if (delayedStream.pauseStream) {\n source.pause();\n }\n\n return delayedStream;\n};\n\nObject.defineProperty(DelayedStream.prototype, 'readable', {\n configurable: true,\n enumerable: true,\n get: function() {\n return this.source.readable;\n }\n});\n\nDelayedStream.prototype.setEncoding = function() {\n return this.source.setEncoding.apply(this.source, arguments);\n};\n\nDelayedStream.prototype.resume = function() {\n if (!this._released) {\n this.release();\n }\n\n this.source.resume();\n};\n\nDelayedStream.prototype.pause = function() {\n this.source.pause();\n};\n\nDelayedStream.prototype.release = function() {\n this._released = true;\n\n this._bufferedEvents.forEach(function(args) {\n this.emit.apply(this, args);\n }.bind(this));\n this._bufferedEvents = [];\n};\n\nDelayedStream.prototype.pipe = function() {\n var r = Stream.prototype.pipe.apply(this, arguments);\n this.resume();\n return r;\n};\n\nDelayedStream.prototype._handleEmit = function(args) {\n if (this._released) {\n this.emit.apply(this, args);\n return;\n }\n\n if (args[0] === 'data') {\n this.dataSize += args[1].length;\n this._checkIfMaxDataSizeExceeded();\n }\n\n this._bufferedEvents.push(args);\n};\n\nDelayedStream.prototype._checkIfMaxDataSizeExceeded = function() {\n if (this._maxDataSizeExceeded) {\n return;\n }\n\n if (this.dataSize <= this.maxDataSize) {\n return;\n }\n\n this._maxDataSizeExceeded = true;\n var message =\n 'DelayedStream#maxDataSize of ' + this.maxDataSize + ' bytes exceeded.'\n this.emit('error', new Error(message));\n};\n","/*!\n * depd\n * Copyright(c) 2014-2018 Douglas Christopher Wilson\n * MIT Licensed\n */\n\n/**\n * Module dependencies.\n */\n\nvar relative = require('path').relative\n\n/**\n * Module exports.\n */\n\nmodule.exports = depd\n\n/**\n * Get the path to base files on.\n */\n\nvar basePath = process.cwd()\n\n/**\n * Determine if namespace is contained in the string.\n */\n\nfunction containsNamespace (str, namespace) {\n var vals = str.split(/[ ,]+/)\n var ns = String(namespace).toLowerCase()\n\n for (var i = 0; i < vals.length; i++) {\n var val = vals[i]\n\n // namespace contained\n if (val && (val === '*' || val.toLowerCase() === ns)) {\n return true\n }\n }\n\n return false\n}\n\n/**\n * Convert a data descriptor to accessor descriptor.\n */\n\nfunction convertDataDescriptorToAccessor (obj, prop, message) {\n var descriptor = Object.getOwnPropertyDescriptor(obj, prop)\n var value = descriptor.value\n\n descriptor.get = function getter () { return value }\n\n if (descriptor.writable) {\n descriptor.set = function setter (val) { return (value = val) }\n }\n\n delete descriptor.value\n delete descriptor.writable\n\n Object.defineProperty(obj, prop, descriptor)\n\n return descriptor\n}\n\n/**\n * Create arguments string to keep arity.\n */\n\nfunction createArgumentsString (arity) {\n var str = ''\n\n for (var i = 0; i < arity; i++) {\n str += ', arg' + i\n }\n\n return str.substr(2)\n}\n\n/**\n * Create stack string from stack.\n */\n\nfunction createStackString (stack) {\n var str = this.name + ': ' + this.namespace\n\n if (this.message) {\n str += ' deprecated ' + this.message\n }\n\n for (var i = 0; i < stack.length; i++) {\n str += '\\n at ' + stack[i].toString()\n }\n\n return str\n}\n\n/**\n * Create deprecate for namespace in caller.\n */\n\nfunction depd (namespace) {\n if (!namespace) {\n throw new TypeError('argument namespace is required')\n }\n\n var stack = getStack()\n var site = callSiteLocation(stack[1])\n var file = site[0]\n\n function deprecate (message) {\n // call to self as log\n log.call(deprecate, message)\n }\n\n deprecate._file = file\n deprecate._ignored = isignored(namespace)\n deprecate._namespace = namespace\n deprecate._traced = istraced(namespace)\n deprecate._warned = Object.create(null)\n\n deprecate.function = wrapfunction\n deprecate.property = wrapproperty\n\n return deprecate\n}\n\n/**\n * Determine if event emitter has listeners of a given type.\n *\n * The way to do this check is done three different ways in Node.js >= 0.8\n * so this consolidates them into a minimal set using instance methods.\n *\n * @param {EventEmitter} emitter\n * @param {string} type\n * @returns {boolean}\n * @private\n */\n\nfunction eehaslisteners (emitter, type) {\n var count = typeof emitter.listenerCount !== 'function'\n ? emitter.listeners(type).length\n : emitter.listenerCount(type)\n\n return count > 0\n}\n\n/**\n * Determine if namespace is ignored.\n */\n\nfunction isignored (namespace) {\n if (process.noDeprecation) {\n // --no-deprecation support\n return true\n }\n\n var str = process.env.NO_DEPRECATION || ''\n\n // namespace ignored\n return containsNamespace(str, namespace)\n}\n\n/**\n * Determine if namespace is traced.\n */\n\nfunction istraced (namespace) {\n if (process.traceDeprecation) {\n // --trace-deprecation support\n return true\n }\n\n var str = process.env.TRACE_DEPRECATION || ''\n\n // namespace traced\n return containsNamespace(str, namespace)\n}\n\n/**\n * Display deprecation message.\n */\n\nfunction log (message, site) {\n var haslisteners = eehaslisteners(process, 'deprecation')\n\n // abort early if no destination\n if (!haslisteners && this._ignored) {\n return\n }\n\n var caller\n var callFile\n var callSite\n var depSite\n var i = 0\n var seen = false\n var stack = getStack()\n var file = this._file\n\n if (site) {\n // provided site\n depSite = site\n callSite = callSiteLocation(stack[1])\n callSite.name = depSite.name\n file = callSite[0]\n } else {\n // get call site\n i = 2\n depSite = callSiteLocation(stack[i])\n callSite = depSite\n }\n\n // get caller of deprecated thing in relation to file\n for (; i < stack.length; i++) {\n caller = callSiteLocation(stack[i])\n callFile = caller[0]\n\n if (callFile === file) {\n seen = true\n } else if (callFile === this._file) {\n file = this._file\n } else if (seen) {\n break\n }\n }\n\n var key = caller\n ? depSite.join(':') + '__' + caller.join(':')\n : undefined\n\n if (key !== undefined && key in this._warned) {\n // already warned\n return\n }\n\n this._warned[key] = true\n\n // generate automatic message from call site\n var msg = message\n if (!msg) {\n msg = callSite === depSite || !callSite.name\n ? defaultMessage(depSite)\n : defaultMessage(callSite)\n }\n\n // emit deprecation if listeners exist\n if (haslisteners) {\n var err = DeprecationError(this._namespace, msg, stack.slice(i))\n process.emit('deprecation', err)\n return\n }\n\n // format and write message\n var format = process.stderr.isTTY\n ? formatColor\n : formatPlain\n var output = format.call(this, msg, caller, stack.slice(i))\n process.stderr.write(output + '\\n', 'utf8')\n}\n\n/**\n * Get call site location as array.\n */\n\nfunction callSiteLocation (callSite) {\n var file = callSite.getFileName() || ''\n var line = callSite.getLineNumber()\n var colm = callSite.getColumnNumber()\n\n if (callSite.isEval()) {\n file = callSite.getEvalOrigin() + ', ' + file\n }\n\n var site = [file, line, colm]\n\n site.callSite = callSite\n site.name = callSite.getFunctionName()\n\n return site\n}\n\n/**\n * Generate a default message from the site.\n */\n\nfunction defaultMessage (site) {\n var callSite = site.callSite\n var funcName = site.name\n\n // make useful anonymous name\n if (!funcName) {\n funcName = ''\n }\n\n var context = callSite.getThis()\n var typeName = context && callSite.getTypeName()\n\n // ignore useless type name\n if (typeName === 'Object') {\n typeName = undefined\n }\n\n // make useful type name\n if (typeName === 'Function') {\n typeName = context.name || typeName\n }\n\n return typeName && callSite.getMethodName()\n ? typeName + '.' + funcName\n : funcName\n}\n\n/**\n * Format deprecation message without color.\n */\n\nfunction formatPlain (msg, caller, stack) {\n var timestamp = new Date().toUTCString()\n\n var formatted = timestamp +\n ' ' + this._namespace +\n ' deprecated ' + msg\n\n // add stack trace\n if (this._traced) {\n for (var i = 0; i < stack.length; i++) {\n formatted += '\\n at ' + stack[i].toString()\n }\n\n return formatted\n }\n\n if (caller) {\n formatted += ' at ' + formatLocation(caller)\n }\n\n return formatted\n}\n\n/**\n * Format deprecation message with color.\n */\n\nfunction formatColor (msg, caller, stack) {\n var formatted = '\\x1b[36;1m' + this._namespace + '\\x1b[22;39m' + // bold cyan\n ' \\x1b[33;1mdeprecated\\x1b[22;39m' + // bold yellow\n ' \\x1b[0m' + msg + '\\x1b[39m' // reset\n\n // add stack trace\n if (this._traced) {\n for (var i = 0; i < stack.length; i++) {\n formatted += '\\n \\x1b[36mat ' + stack[i].toString() + '\\x1b[39m' // cyan\n }\n\n return formatted\n }\n\n if (caller) {\n formatted += ' \\x1b[36m' + formatLocation(caller) + '\\x1b[39m' // cyan\n }\n\n return formatted\n}\n\n/**\n * Format call site location.\n */\n\nfunction formatLocation (callSite) {\n return relative(basePath, callSite[0]) +\n ':' + callSite[1] +\n ':' + callSite[2]\n}\n\n/**\n * Get the stack as array of call sites.\n */\n\nfunction getStack () {\n var limit = Error.stackTraceLimit\n var obj = {}\n var prep = Error.prepareStackTrace\n\n Error.prepareStackTrace = prepareObjectStackTrace\n Error.stackTraceLimit = Math.max(10, limit)\n\n // capture the stack\n Error.captureStackTrace(obj)\n\n // slice this function off the top\n var stack = obj.stack.slice(1)\n\n Error.prepareStackTrace = prep\n Error.stackTraceLimit = limit\n\n return stack\n}\n\n/**\n * Capture call site stack from v8.\n */\n\nfunction prepareObjectStackTrace (obj, stack) {\n return stack\n}\n\n/**\n * Return a wrapped function in a deprecation message.\n */\n\nfunction wrapfunction (fn, message) {\n if (typeof fn !== 'function') {\n throw new TypeError('argument fn must be a function')\n }\n\n var args = createArgumentsString(fn.length)\n var stack = getStack()\n var site = callSiteLocation(stack[1])\n\n site.name = fn.name\n\n // eslint-disable-next-line no-new-func\n var deprecatedfn = new Function('fn', 'log', 'deprecate', 'message', 'site',\n '\"use strict\"\\n' +\n 'return function (' + args + ') {' +\n 'log.call(deprecate, message, site)\\n' +\n 'return fn.apply(this, arguments)\\n' +\n '}')(fn, log, this, message, site)\n\n return deprecatedfn\n}\n\n/**\n * Wrap property in a deprecation message.\n */\n\nfunction wrapproperty (obj, prop, message) {\n if (!obj || (typeof obj !== 'object' && typeof obj !== 'function')) {\n throw new TypeError('argument obj must be object')\n }\n\n var descriptor = Object.getOwnPropertyDescriptor(obj, prop)\n\n if (!descriptor) {\n throw new TypeError('must call property on owner object')\n }\n\n if (!descriptor.configurable) {\n throw new TypeError('property must be configurable')\n }\n\n var deprecate = this\n var stack = getStack()\n var site = callSiteLocation(stack[1])\n\n // set site name\n site.name = prop\n\n // convert data descriptor\n if ('value' in descriptor) {\n descriptor = convertDataDescriptorToAccessor(obj, prop, message)\n }\n\n var get = descriptor.get\n var set = descriptor.set\n\n // wrap getter\n if (typeof get === 'function') {\n descriptor.get = function getter () {\n log.call(deprecate, message, site)\n return get.apply(this, arguments)\n }\n }\n\n // wrap setter\n if (typeof set === 'function') {\n descriptor.set = function setter () {\n log.call(deprecate, message, site)\n return set.apply(this, arguments)\n }\n }\n\n Object.defineProperty(obj, prop, descriptor)\n}\n\n/**\n * Create DeprecationError for deprecation\n */\n\nfunction DeprecationError (namespace, message, stack) {\n var error = new Error()\n var stackString\n\n Object.defineProperty(error, 'constructor', {\n value: DeprecationError\n })\n\n Object.defineProperty(error, 'message', {\n configurable: true,\n enumerable: false,\n value: message,\n writable: true\n })\n\n Object.defineProperty(error, 'name', {\n enumerable: false,\n configurable: true,\n value: 'DeprecationError',\n writable: true\n })\n\n Object.defineProperty(error, 'namespace', {\n configurable: true,\n enumerable: false,\n value: namespace,\n writable: true\n })\n\n Object.defineProperty(error, 'stack', {\n configurable: true,\n enumerable: false,\n get: function () {\n if (stackString !== undefined) {\n return stackString\n }\n\n // prepare stack trace\n return (stackString = createStackString.call(this, stack))\n },\n set: function setter (val) {\n stackString = val\n }\n })\n\n return error\n}\n","\"use strict\";\n\nvar stream = require(\"stream\");\n\nfunction DuplexWrapper(options, writable, readable) {\n if (typeof readable === \"undefined\") {\n readable = writable;\n writable = options;\n options = null;\n }\n\n stream.Duplex.call(this, options);\n\n if (typeof readable.read !== \"function\") {\n readable = (new stream.Readable(options)).wrap(readable);\n }\n\n this._writable = writable;\n this._readable = readable;\n this._waiting = false;\n\n var self = this;\n\n writable.once(\"finish\", function() {\n self.end();\n });\n\n this.once(\"finish\", function() {\n writable.end();\n });\n\n readable.on(\"readable\", function() {\n if (self._waiting) {\n self._waiting = false;\n self._read();\n }\n });\n\n readable.once(\"end\", function() {\n self.push(null);\n });\n\n if (!options || typeof options.bubbleErrors === \"undefined\" || options.bubbleErrors) {\n writable.on(\"error\", function(err) {\n self.emit(\"error\", err);\n });\n\n readable.on(\"error\", function(err) {\n self.emit(\"error\", err);\n });\n }\n}\n\nDuplexWrapper.prototype = Object.create(stream.Duplex.prototype, {constructor: {value: DuplexWrapper}});\n\nDuplexWrapper.prototype._write = function _write(input, encoding, done) {\n this._writable.write(input, encoding, done);\n};\n\nDuplexWrapper.prototype._read = function _read() {\n var buf;\n var reads = 0;\n while ((buf = this._readable.read()) !== null) {\n this.push(buf);\n reads++;\n }\n if (reads === 0) {\n this._waiting = true;\n }\n};\n\nmodule.exports = function duplex2(options, writable, readable) {\n return new DuplexWrapper(options, writable, readable);\n};\n\nmodule.exports.DuplexWrapper = DuplexWrapper;\n","var crypto = require(\"crypto\");\nvar BigInteger = require(\"jsbn\").BigInteger;\nvar ECPointFp = require(\"./lib/ec.js\").ECPointFp;\nvar Buffer = require(\"safer-buffer\").Buffer;\nexports.ECCurves = require(\"./lib/sec.js\");\n\n// zero prepad\nfunction unstupid(hex,len)\n{\n\treturn (hex.length >= len) ? hex : unstupid(\"0\"+hex,len);\n}\n\nexports.ECKey = function(curve, key, isPublic)\n{\n var priv;\n\tvar c = curve();\n\tvar n = c.getN();\n var bytes = Math.floor(n.bitLength()/8);\n\n if(key)\n {\n if(isPublic)\n {\n var curve = c.getCurve();\n// var x = key.slice(1,bytes+1); // skip the 04 for uncompressed format\n// var y = key.slice(bytes+1);\n// this.P = new ECPointFp(curve,\n// curve.fromBigInteger(new BigInteger(x.toString(\"hex\"), 16)),\n// curve.fromBigInteger(new BigInteger(y.toString(\"hex\"), 16))); \n this.P = curve.decodePointHex(key.toString(\"hex\"));\n }else{\n if(key.length != bytes) return false;\n priv = new BigInteger(key.toString(\"hex\"), 16); \n }\n }else{\n var n1 = n.subtract(BigInteger.ONE);\n var r = new BigInteger(crypto.randomBytes(n.bitLength()));\n priv = r.mod(n1).add(BigInteger.ONE);\n this.P = c.getG().multiply(priv);\n }\n if(this.P)\n {\n// var pubhex = unstupid(this.P.getX().toBigInteger().toString(16),bytes*2)+unstupid(this.P.getY().toBigInteger().toString(16),bytes*2);\n// this.PublicKey = Buffer.from(\"04\"+pubhex,\"hex\");\n this.PublicKey = Buffer.from(c.getCurve().encodeCompressedPointHex(this.P),\"hex\");\n }\n if(priv)\n {\n this.PrivateKey = Buffer.from(unstupid(priv.toString(16),bytes*2),\"hex\");\n this.deriveSharedSecret = function(key)\n {\n if(!key || !key.P) return false;\n var S = key.P.multiply(priv);\n return Buffer.from(unstupid(S.getX().toBigInteger().toString(16),bytes*2),\"hex\");\n } \n }\n}\n\n","// Basic Javascript Elliptic Curve implementation\n// Ported loosely from BouncyCastle's Java EC code\n// Only Fp curves implemented for now\n\n// Requires jsbn.js and jsbn2.js\nvar BigInteger = require('jsbn').BigInteger\nvar Barrett = BigInteger.prototype.Barrett\n\n// ----------------\n// ECFieldElementFp\n\n// constructor\nfunction ECFieldElementFp(q,x) {\n this.x = x;\n // TODO if(x.compareTo(q) >= 0) error\n this.q = q;\n}\n\nfunction feFpEquals(other) {\n if(other == this) return true;\n return (this.q.equals(other.q) && this.x.equals(other.x));\n}\n\nfunction feFpToBigInteger() {\n return this.x;\n}\n\nfunction feFpNegate() {\n return new ECFieldElementFp(this.q, this.x.negate().mod(this.q));\n}\n\nfunction feFpAdd(b) {\n return new ECFieldElementFp(this.q, this.x.add(b.toBigInteger()).mod(this.q));\n}\n\nfunction feFpSubtract(b) {\n return new ECFieldElementFp(this.q, this.x.subtract(b.toBigInteger()).mod(this.q));\n}\n\nfunction feFpMultiply(b) {\n return new ECFieldElementFp(this.q, this.x.multiply(b.toBigInteger()).mod(this.q));\n}\n\nfunction feFpSquare() {\n return new ECFieldElementFp(this.q, this.x.square().mod(this.q));\n}\n\nfunction feFpDivide(b) {\n return new ECFieldElementFp(this.q, this.x.multiply(b.toBigInteger().modInverse(this.q)).mod(this.q));\n}\n\nECFieldElementFp.prototype.equals = feFpEquals;\nECFieldElementFp.prototype.toBigInteger = feFpToBigInteger;\nECFieldElementFp.prototype.negate = feFpNegate;\nECFieldElementFp.prototype.add = feFpAdd;\nECFieldElementFp.prototype.subtract = feFpSubtract;\nECFieldElementFp.prototype.multiply = feFpMultiply;\nECFieldElementFp.prototype.square = feFpSquare;\nECFieldElementFp.prototype.divide = feFpDivide;\n\n// ----------------\n// ECPointFp\n\n// constructor\nfunction ECPointFp(curve,x,y,z) {\n this.curve = curve;\n this.x = x;\n this.y = y;\n // Projective coordinates: either zinv == null or z * zinv == 1\n // z and zinv are just BigIntegers, not fieldElements\n if(z == null) {\n this.z = BigInteger.ONE;\n }\n else {\n this.z = z;\n }\n this.zinv = null;\n //TODO: compression flag\n}\n\nfunction pointFpGetX() {\n if(this.zinv == null) {\n this.zinv = this.z.modInverse(this.curve.q);\n }\n var r = this.x.toBigInteger().multiply(this.zinv);\n this.curve.reduce(r);\n return this.curve.fromBigInteger(r);\n}\n\nfunction pointFpGetY() {\n if(this.zinv == null) {\n this.zinv = this.z.modInverse(this.curve.q);\n }\n var r = this.y.toBigInteger().multiply(this.zinv);\n this.curve.reduce(r);\n return this.curve.fromBigInteger(r);\n}\n\nfunction pointFpEquals(other) {\n if(other == this) return true;\n if(this.isInfinity()) return other.isInfinity();\n if(other.isInfinity()) return this.isInfinity();\n var u, v;\n // u = Y2 * Z1 - Y1 * Z2\n u = other.y.toBigInteger().multiply(this.z).subtract(this.y.toBigInteger().multiply(other.z)).mod(this.curve.q);\n if(!u.equals(BigInteger.ZERO)) return false;\n // v = X2 * Z1 - X1 * Z2\n v = other.x.toBigInteger().multiply(this.z).subtract(this.x.toBigInteger().multiply(other.z)).mod(this.curve.q);\n return v.equals(BigInteger.ZERO);\n}\n\nfunction pointFpIsInfinity() {\n if((this.x == null) && (this.y == null)) return true;\n return this.z.equals(BigInteger.ZERO) && !this.y.toBigInteger().equals(BigInteger.ZERO);\n}\n\nfunction pointFpNegate() {\n return new ECPointFp(this.curve, this.x, this.y.negate(), this.z);\n}\n\nfunction pointFpAdd(b) {\n if(this.isInfinity()) return b;\n if(b.isInfinity()) return this;\n\n // u = Y2 * Z1 - Y1 * Z2\n var u = b.y.toBigInteger().multiply(this.z).subtract(this.y.toBigInteger().multiply(b.z)).mod(this.curve.q);\n // v = X2 * Z1 - X1 * Z2\n var v = b.x.toBigInteger().multiply(this.z).subtract(this.x.toBigInteger().multiply(b.z)).mod(this.curve.q);\n\n if(BigInteger.ZERO.equals(v)) {\n if(BigInteger.ZERO.equals(u)) {\n return this.twice(); // this == b, so double\n }\n\treturn this.curve.getInfinity(); // this = -b, so infinity\n }\n\n var THREE = new BigInteger(\"3\");\n var x1 = this.x.toBigInteger();\n var y1 = this.y.toBigInteger();\n var x2 = b.x.toBigInteger();\n var y2 = b.y.toBigInteger();\n\n var v2 = v.square();\n var v3 = v2.multiply(v);\n var x1v2 = x1.multiply(v2);\n var zu2 = u.square().multiply(this.z);\n\n // x3 = v * (z2 * (z1 * u^2 - 2 * x1 * v^2) - v^3)\n var x3 = zu2.subtract(x1v2.shiftLeft(1)).multiply(b.z).subtract(v3).multiply(v).mod(this.curve.q);\n // y3 = z2 * (3 * x1 * u * v^2 - y1 * v^3 - z1 * u^3) + u * v^3\n var y3 = x1v2.multiply(THREE).multiply(u).subtract(y1.multiply(v3)).subtract(zu2.multiply(u)).multiply(b.z).add(u.multiply(v3)).mod(this.curve.q);\n // z3 = v^3 * z1 * z2\n var z3 = v3.multiply(this.z).multiply(b.z).mod(this.curve.q);\n\n return new ECPointFp(this.curve, this.curve.fromBigInteger(x3), this.curve.fromBigInteger(y3), z3);\n}\n\nfunction pointFpTwice() {\n if(this.isInfinity()) return this;\n if(this.y.toBigInteger().signum() == 0) return this.curve.getInfinity();\n\n // TODO: optimized handling of constants\n var THREE = new BigInteger(\"3\");\n var x1 = this.x.toBigInteger();\n var y1 = this.y.toBigInteger();\n\n var y1z1 = y1.multiply(this.z);\n var y1sqz1 = y1z1.multiply(y1).mod(this.curve.q);\n var a = this.curve.a.toBigInteger();\n\n // w = 3 * x1^2 + a * z1^2\n var w = x1.square().multiply(THREE);\n if(!BigInteger.ZERO.equals(a)) {\n w = w.add(this.z.square().multiply(a));\n }\n w = w.mod(this.curve.q);\n //this.curve.reduce(w);\n // x3 = 2 * y1 * z1 * (w^2 - 8 * x1 * y1^2 * z1)\n var x3 = w.square().subtract(x1.shiftLeft(3).multiply(y1sqz1)).shiftLeft(1).multiply(y1z1).mod(this.curve.q);\n // y3 = 4 * y1^2 * z1 * (3 * w * x1 - 2 * y1^2 * z1) - w^3\n var y3 = w.multiply(THREE).multiply(x1).subtract(y1sqz1.shiftLeft(1)).shiftLeft(2).multiply(y1sqz1).subtract(w.square().multiply(w)).mod(this.curve.q);\n // z3 = 8 * (y1 * z1)^3\n var z3 = y1z1.square().multiply(y1z1).shiftLeft(3).mod(this.curve.q);\n\n return new ECPointFp(this.curve, this.curve.fromBigInteger(x3), this.curve.fromBigInteger(y3), z3);\n}\n\n// Simple NAF (Non-Adjacent Form) multiplication algorithm\n// TODO: modularize the multiplication algorithm\nfunction pointFpMultiply(k) {\n if(this.isInfinity()) return this;\n if(k.signum() == 0) return this.curve.getInfinity();\n\n var e = k;\n var h = e.multiply(new BigInteger(\"3\"));\n\n var neg = this.negate();\n var R = this;\n\n var i;\n for(i = h.bitLength() - 2; i > 0; --i) {\n\tR = R.twice();\n\n\tvar hBit = h.testBit(i);\n\tvar eBit = e.testBit(i);\n\n\tif (hBit != eBit) {\n\t R = R.add(hBit ? this : neg);\n\t}\n }\n\n return R;\n}\n\n// Compute this*j + x*k (simultaneous multiplication)\nfunction pointFpMultiplyTwo(j,x,k) {\n var i;\n if(j.bitLength() > k.bitLength())\n i = j.bitLength() - 1;\n else\n i = k.bitLength() - 1;\n\n var R = this.curve.getInfinity();\n var both = this.add(x);\n while(i >= 0) {\n R = R.twice();\n if(j.testBit(i)) {\n if(k.testBit(i)) {\n R = R.add(both);\n }\n else {\n R = R.add(this);\n }\n }\n else {\n if(k.testBit(i)) {\n R = R.add(x);\n }\n }\n --i;\n }\n\n return R;\n}\n\nECPointFp.prototype.getX = pointFpGetX;\nECPointFp.prototype.getY = pointFpGetY;\nECPointFp.prototype.equals = pointFpEquals;\nECPointFp.prototype.isInfinity = pointFpIsInfinity;\nECPointFp.prototype.negate = pointFpNegate;\nECPointFp.prototype.add = pointFpAdd;\nECPointFp.prototype.twice = pointFpTwice;\nECPointFp.prototype.multiply = pointFpMultiply;\nECPointFp.prototype.multiplyTwo = pointFpMultiplyTwo;\n\n// ----------------\n// ECCurveFp\n\n// constructor\nfunction ECCurveFp(q,a,b) {\n this.q = q;\n this.a = this.fromBigInteger(a);\n this.b = this.fromBigInteger(b);\n this.infinity = new ECPointFp(this, null, null);\n this.reducer = new Barrett(this.q);\n}\n\nfunction curveFpGetQ() {\n return this.q;\n}\n\nfunction curveFpGetA() {\n return this.a;\n}\n\nfunction curveFpGetB() {\n return this.b;\n}\n\nfunction curveFpEquals(other) {\n if(other == this) return true;\n return(this.q.equals(other.q) && this.a.equals(other.a) && this.b.equals(other.b));\n}\n\nfunction curveFpGetInfinity() {\n return this.infinity;\n}\n\nfunction curveFpFromBigInteger(x) {\n return new ECFieldElementFp(this.q, x);\n}\n\nfunction curveReduce(x) {\n this.reducer.reduce(x);\n}\n\n// for now, work with hex strings because they're easier in JS\nfunction curveFpDecodePointHex(s) {\n switch(parseInt(s.substr(0,2), 16)) { // first byte\n case 0:\n\treturn this.infinity;\n case 2:\n case 3:\n\t// point compression not supported yet\n\treturn null;\n case 4:\n case 6:\n case 7:\n\tvar len = (s.length - 2) / 2;\n\tvar xHex = s.substr(2, len);\n\tvar yHex = s.substr(len+2, len);\n\n\treturn new ECPointFp(this,\n\t\t\t this.fromBigInteger(new BigInteger(xHex, 16)),\n\t\t\t this.fromBigInteger(new BigInteger(yHex, 16)));\n\n default: // unsupported\n\treturn null;\n }\n}\n\nfunction curveFpEncodePointHex(p) {\n\tif (p.isInfinity()) return \"00\";\n\tvar xHex = p.getX().toBigInteger().toString(16);\n\tvar yHex = p.getY().toBigInteger().toString(16);\n\tvar oLen = this.getQ().toString(16).length;\n\tif ((oLen % 2) != 0) oLen++;\n\twhile (xHex.length < oLen) {\n\t\txHex = \"0\" + xHex;\n\t}\n\twhile (yHex.length < oLen) {\n\t\tyHex = \"0\" + yHex;\n\t}\n\treturn \"04\" + xHex + yHex;\n}\n\nECCurveFp.prototype.getQ = curveFpGetQ;\nECCurveFp.prototype.getA = curveFpGetA;\nECCurveFp.prototype.getB = curveFpGetB;\nECCurveFp.prototype.equals = curveFpEquals;\nECCurveFp.prototype.getInfinity = curveFpGetInfinity;\nECCurveFp.prototype.fromBigInteger = curveFpFromBigInteger;\nECCurveFp.prototype.reduce = curveReduce;\n//ECCurveFp.prototype.decodePointHex = curveFpDecodePointHex;\nECCurveFp.prototype.encodePointHex = curveFpEncodePointHex;\n\n// from: https://github.com/kaielvin/jsbn-ec-point-compression\nECCurveFp.prototype.decodePointHex = function(s)\n{\n\tvar yIsEven;\n switch(parseInt(s.substr(0,2), 16)) { // first byte\n case 0:\n\treturn this.infinity;\n case 2:\n\tyIsEven = false;\n case 3:\n\tif(yIsEven == undefined) yIsEven = true;\n\tvar len = s.length - 2;\n\tvar xHex = s.substr(2, len);\n\tvar x = this.fromBigInteger(new BigInteger(xHex,16));\n\tvar alpha = x.multiply(x.square().add(this.getA())).add(this.getB());\n\tvar beta = alpha.sqrt();\n\n if (beta == null) throw \"Invalid point compression\";\n\n var betaValue = beta.toBigInteger();\n if (betaValue.testBit(0) != yIsEven)\n {\n // Use the other root\n beta = this.fromBigInteger(this.getQ().subtract(betaValue));\n }\n return new ECPointFp(this,x,beta);\n case 4:\n case 6:\n case 7:\n\tvar len = (s.length - 2) / 2;\n\tvar xHex = s.substr(2, len);\n\tvar yHex = s.substr(len+2, len);\n\n\treturn new ECPointFp(this,\n\t\t\t this.fromBigInteger(new BigInteger(xHex, 16)),\n\t\t\t this.fromBigInteger(new BigInteger(yHex, 16)));\n\n default: // unsupported\n\treturn null;\n }\n}\nECCurveFp.prototype.encodeCompressedPointHex = function(p)\n{\n\tif (p.isInfinity()) return \"00\";\n\tvar xHex = p.getX().toBigInteger().toString(16);\n\tvar oLen = this.getQ().toString(16).length;\n\tif ((oLen % 2) != 0) oLen++;\n\twhile (xHex.length < oLen)\n\t\txHex = \"0\" + xHex;\n\tvar yPrefix;\n\tif(p.getY().toBigInteger().isEven()) yPrefix = \"02\";\n\telse yPrefix = \"03\";\n\n\treturn yPrefix + xHex;\n}\n\n\nECFieldElementFp.prototype.getR = function()\n{\n\tif(this.r != undefined) return this.r;\n\n this.r = null;\n var bitLength = this.q.bitLength();\n if (bitLength > 128)\n {\n var firstWord = this.q.shiftRight(bitLength - 64);\n if (firstWord.intValue() == -1)\n {\n this.r = BigInteger.ONE.shiftLeft(bitLength).subtract(this.q);\n }\n }\n return this.r;\n}\nECFieldElementFp.prototype.modMult = function(x1,x2)\n{\n return this.modReduce(x1.multiply(x2));\n}\nECFieldElementFp.prototype.modReduce = function(x)\n{\n if (this.getR() != null)\n {\n var qLen = q.bitLength();\n while (x.bitLength() > (qLen + 1))\n {\n var u = x.shiftRight(qLen);\n var v = x.subtract(u.shiftLeft(qLen));\n if (!this.getR().equals(BigInteger.ONE))\n {\n u = u.multiply(this.getR());\n }\n x = u.add(v); \n }\n while (x.compareTo(q) >= 0)\n {\n x = x.subtract(q);\n }\n }\n else\n {\n x = x.mod(q);\n }\n return x;\n}\nECFieldElementFp.prototype.sqrt = function()\n{\n if (!this.q.testBit(0)) throw \"unsupported\";\n\n // p mod 4 == 3\n if (this.q.testBit(1))\n {\n \tvar z = new ECFieldElementFp(this.q,this.x.modPow(this.q.shiftRight(2).add(BigInteger.ONE),this.q));\n \treturn z.square().equals(this) ? z : null;\n }\n\n // p mod 4 == 1\n var qMinusOne = this.q.subtract(BigInteger.ONE);\n\n var legendreExponent = qMinusOne.shiftRight(1);\n if (!(this.x.modPow(legendreExponent, this.q).equals(BigInteger.ONE)))\n {\n return null;\n }\n\n var u = qMinusOne.shiftRight(2);\n var k = u.shiftLeft(1).add(BigInteger.ONE);\n\n var Q = this.x;\n var fourQ = modDouble(modDouble(Q));\n\n var U, V;\n do\n {\n var P;\n do\n {\n P = new BigInteger(this.q.bitLength(), new SecureRandom());\n }\n while (P.compareTo(this.q) >= 0\n || !(P.multiply(P).subtract(fourQ).modPow(legendreExponent, this.q).equals(qMinusOne)));\n\n var result = this.lucasSequence(P, Q, k);\n U = result[0];\n V = result[1];\n\n if (this.modMult(V, V).equals(fourQ))\n {\n // Integer division by 2, mod q\n if (V.testBit(0))\n {\n V = V.add(q);\n }\n\n V = V.shiftRight(1);\n\n return new ECFieldElementFp(q,V);\n }\n }\n while (U.equals(BigInteger.ONE) || U.equals(qMinusOne));\n\n return null;\n}\nECFieldElementFp.prototype.lucasSequence = function(P,Q,k)\n{\n var n = k.bitLength();\n var s = k.getLowestSetBit();\n\n var Uh = BigInteger.ONE;\n var Vl = BigInteger.TWO;\n var Vh = P;\n var Ql = BigInteger.ONE;\n var Qh = BigInteger.ONE;\n\n for (var j = n - 1; j >= s + 1; --j)\n {\n Ql = this.modMult(Ql, Qh);\n\n if (k.testBit(j))\n {\n Qh = this.modMult(Ql, Q);\n Uh = this.modMult(Uh, Vh);\n Vl = this.modReduce(Vh.multiply(Vl).subtract(P.multiply(Ql)));\n Vh = this.modReduce(Vh.multiply(Vh).subtract(Qh.shiftLeft(1)));\n }\n else\n {\n Qh = Ql;\n Uh = this.modReduce(Uh.multiply(Vl).subtract(Ql));\n Vh = this.modReduce(Vh.multiply(Vl).subtract(P.multiply(Ql)));\n Vl = this.modReduce(Vl.multiply(Vl).subtract(Ql.shiftLeft(1)));\n }\n }\n\n Ql = this.modMult(Ql, Qh);\n Qh = this.modMult(Ql, Q);\n Uh = this.modReduce(Uh.multiply(Vl).subtract(Ql));\n Vl = this.modReduce(Vh.multiply(Vl).subtract(P.multiply(Ql)));\n Ql = this.modMult(Ql, Qh);\n\n for (var j = 1; j <= s; ++j)\n {\n Uh = this.modMult(Uh, Vl);\n Vl = this.modReduce(Vl.multiply(Vl).subtract(Ql.shiftLeft(1)));\n Ql = this.modMult(Ql, Ql);\n }\n\n return [ Uh, Vl ];\n}\n\nvar exports = {\n ECCurveFp: ECCurveFp,\n ECPointFp: ECPointFp,\n ECFieldElementFp: ECFieldElementFp\n}\n\nmodule.exports = exports\n","// Named EC curves\n\n// Requires ec.js, jsbn.js, and jsbn2.js\nvar BigInteger = require('jsbn').BigInteger\nvar ECCurveFp = require('./ec.js').ECCurveFp\n\n\n// ----------------\n// X9ECParameters\n\n// constructor\nfunction X9ECParameters(curve,g,n,h) {\n this.curve = curve;\n this.g = g;\n this.n = n;\n this.h = h;\n}\n\nfunction x9getCurve() {\n return this.curve;\n}\n\nfunction x9getG() {\n return this.g;\n}\n\nfunction x9getN() {\n return this.n;\n}\n\nfunction x9getH() {\n return this.h;\n}\n\nX9ECParameters.prototype.getCurve = x9getCurve;\nX9ECParameters.prototype.getG = x9getG;\nX9ECParameters.prototype.getN = x9getN;\nX9ECParameters.prototype.getH = x9getH;\n\n// ----------------\n// SECNamedCurves\n\nfunction fromHex(s) { return new BigInteger(s, 16); }\n\nfunction secp128r1() {\n // p = 2^128 - 2^97 - 1\n var p = fromHex(\"FFFFFFFDFFFFFFFFFFFFFFFFFFFFFFFF\");\n var a = fromHex(\"FFFFFFFDFFFFFFFFFFFFFFFFFFFFFFFC\");\n var b = fromHex(\"E87579C11079F43DD824993C2CEE5ED3\");\n //byte[] S = Hex.decode(\"000E0D4D696E6768756151750CC03A4473D03679\");\n var n = fromHex(\"FFFFFFFE0000000075A30D1B9038A115\");\n var h = BigInteger.ONE;\n var curve = new ECCurveFp(p, a, b);\n var G = curve.decodePointHex(\"04\"\n + \"161FF7528B899B2D0C28607CA52C5B86\"\n\t\t+ \"CF5AC8395BAFEB13C02DA292DDED7A83\");\n return new X9ECParameters(curve, G, n, h);\n}\n\nfunction secp160k1() {\n // p = 2^160 - 2^32 - 2^14 - 2^12 - 2^9 - 2^8 - 2^7 - 2^3 - 2^2 - 1\n var p = fromHex(\"FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFAC73\");\n var a = BigInteger.ZERO;\n var b = fromHex(\"7\");\n //byte[] S = null;\n var n = fromHex(\"0100000000000000000001B8FA16DFAB9ACA16B6B3\");\n var h = BigInteger.ONE;\n var curve = new ECCurveFp(p, a, b);\n var G = curve.decodePointHex(\"04\"\n + \"3B4C382CE37AA192A4019E763036F4F5DD4D7EBB\"\n + \"938CF935318FDCED6BC28286531733C3F03C4FEE\");\n return new X9ECParameters(curve, G, n, h);\n}\n\nfunction secp160r1() {\n // p = 2^160 - 2^31 - 1\n var p = fromHex(\"FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF7FFFFFFF\");\n var a = fromHex(\"FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF7FFFFFFC\");\n var b = fromHex(\"1C97BEFC54BD7A8B65ACF89F81D4D4ADC565FA45\");\n //byte[] S = Hex.decode(\"1053CDE42C14D696E67687561517533BF3F83345\");\n var n = fromHex(\"0100000000000000000001F4C8F927AED3CA752257\");\n var h = BigInteger.ONE;\n var curve = new ECCurveFp(p, a, b);\n var G = curve.decodePointHex(\"04\"\n\t\t+ \"4A96B5688EF573284664698968C38BB913CBFC82\"\n\t\t+ \"23A628553168947D59DCC912042351377AC5FB32\");\n return new X9ECParameters(curve, G, n, h);\n}\n\nfunction secp192k1() {\n // p = 2^192 - 2^32 - 2^12 - 2^8 - 2^7 - 2^6 - 2^3 - 1\n var p = fromHex(\"FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFEE37\");\n var a = BigInteger.ZERO;\n var b = fromHex(\"3\");\n //byte[] S = null;\n var n = fromHex(\"FFFFFFFFFFFFFFFFFFFFFFFE26F2FC170F69466A74DEFD8D\");\n var h = BigInteger.ONE;\n var curve = new ECCurveFp(p, a, b);\n var G = curve.decodePointHex(\"04\"\n + \"DB4FF10EC057E9AE26B07D0280B7F4341DA5D1B1EAE06C7D\"\n + \"9B2F2F6D9C5628A7844163D015BE86344082AA88D95E2F9D\");\n return new X9ECParameters(curve, G, n, h);\n}\n\nfunction secp192r1() {\n // p = 2^192 - 2^64 - 1\n var p = fromHex(\"FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFFFFFFFFFFFF\");\n var a = fromHex(\"FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFFFFFFFFFFFC\");\n var b = fromHex(\"64210519E59C80E70FA7E9AB72243049FEB8DEECC146B9B1\");\n //byte[] S = Hex.decode(\"3045AE6FC8422F64ED579528D38120EAE12196D5\");\n var n = fromHex(\"FFFFFFFFFFFFFFFFFFFFFFFF99DEF836146BC9B1B4D22831\");\n var h = BigInteger.ONE;\n var curve = new ECCurveFp(p, a, b);\n var G = curve.decodePointHex(\"04\"\n + \"188DA80EB03090F67CBF20EB43A18800F4FF0AFD82FF1012\"\n + \"07192B95FFC8DA78631011ED6B24CDD573F977A11E794811\");\n return new X9ECParameters(curve, G, n, h);\n}\n\nfunction secp224r1() {\n // p = 2^224 - 2^96 + 1\n var p = fromHex(\"FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF000000000000000000000001\");\n var a = fromHex(\"FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFFFFFFFFFFFFFFFFFFFE\");\n var b = fromHex(\"B4050A850C04B3ABF54132565044B0B7D7BFD8BA270B39432355FFB4\");\n //byte[] S = Hex.decode(\"BD71344799D5C7FCDC45B59FA3B9AB8F6A948BC5\");\n var n = fromHex(\"FFFFFFFFFFFFFFFFFFFFFFFFFFFF16A2E0B8F03E13DD29455C5C2A3D\");\n var h = BigInteger.ONE;\n var curve = new ECCurveFp(p, a, b);\n var G = curve.decodePointHex(\"04\"\n + \"B70E0CBD6BB4BF7F321390B94A03C1D356C21122343280D6115C1D21\"\n + \"BD376388B5F723FB4C22DFE6CD4375A05A07476444D5819985007E34\");\n return new X9ECParameters(curve, G, n, h);\n}\n\nfunction secp256r1() {\n // p = 2^224 (2^32 - 1) + 2^192 + 2^96 - 1\n var p = fromHex(\"FFFFFFFF00000001000000000000000000000000FFFFFFFFFFFFFFFFFFFFFFFF\");\n var a = fromHex(\"FFFFFFFF00000001000000000000000000000000FFFFFFFFFFFFFFFFFFFFFFFC\");\n var b = fromHex(\"5AC635D8AA3A93E7B3EBBD55769886BC651D06B0CC53B0F63BCE3C3E27D2604B\");\n //byte[] S = Hex.decode(\"C49D360886E704936A6678E1139D26B7819F7E90\");\n var n = fromHex(\"FFFFFFFF00000000FFFFFFFFFFFFFFFFBCE6FAADA7179E84F3B9CAC2FC632551\");\n var h = BigInteger.ONE;\n var curve = new ECCurveFp(p, a, b);\n var G = curve.decodePointHex(\"04\"\n + \"6B17D1F2E12C4247F8BCE6E563A440F277037D812DEB33A0F4A13945D898C296\"\n\t\t+ \"4FE342E2FE1A7F9B8EE7EB4A7C0F9E162BCE33576B315ECECBB6406837BF51F5\");\n return new X9ECParameters(curve, G, n, h);\n}\n\n// TODO: make this into a proper hashtable\nfunction getSECCurveByName(name) {\n if(name == \"secp128r1\") return secp128r1();\n if(name == \"secp160k1\") return secp160k1();\n if(name == \"secp160r1\") return secp160r1();\n if(name == \"secp192k1\") return secp192k1();\n if(name == \"secp192r1\") return secp192r1();\n if(name == \"secp224r1\") return secp224r1();\n if(name == \"secp256r1\") return secp256r1();\n return null;\n}\n\nmodule.exports = {\n \"secp128r1\":secp128r1,\n \"secp160k1\":secp160k1,\n \"secp160r1\":secp160r1,\n \"secp192k1\":secp192k1,\n \"secp192r1\":secp192r1,\n \"secp224r1\":secp224r1,\n \"secp256r1\":secp256r1\n}\n","var once = require('once');\n\nvar noop = function() {};\n\nvar isRequest = function(stream) {\n\treturn stream.setHeader && typeof stream.abort === 'function';\n};\n\nvar isChildProcess = function(stream) {\n\treturn stream.stdio && Array.isArray(stream.stdio) && stream.stdio.length === 3\n};\n\nvar eos = function(stream, opts, callback) {\n\tif (typeof opts === 'function') return eos(stream, null, opts);\n\tif (!opts) opts = {};\n\n\tcallback = once(callback || noop);\n\n\tvar ws = stream._writableState;\n\tvar rs = stream._readableState;\n\tvar readable = opts.readable || (opts.readable !== false && stream.readable);\n\tvar writable = opts.writable || (opts.writable !== false && stream.writable);\n\tvar cancelled = false;\n\n\tvar onlegacyfinish = function() {\n\t\tif (!stream.writable) onfinish();\n\t};\n\n\tvar onfinish = function() {\n\t\twritable = false;\n\t\tif (!readable) callback.call(stream);\n\t};\n\n\tvar onend = function() {\n\t\treadable = false;\n\t\tif (!writable) callback.call(stream);\n\t};\n\n\tvar onexit = function(exitCode) {\n\t\tcallback.call(stream, exitCode ? new Error('exited with error code: ' + exitCode) : null);\n\t};\n\n\tvar onerror = function(err) {\n\t\tcallback.call(stream, err);\n\t};\n\n\tvar onclose = function() {\n\t\tprocess.nextTick(onclosenexttick);\n\t};\n\n\tvar onclosenexttick = function() {\n\t\tif (cancelled) return;\n\t\tif (readable && !(rs && (rs.ended && !rs.destroyed))) return callback.call(stream, new Error('premature close'));\n\t\tif (writable && !(ws && (ws.ended && !ws.destroyed))) return callback.call(stream, new Error('premature close'));\n\t};\n\n\tvar onrequest = function() {\n\t\tstream.req.on('finish', onfinish);\n\t};\n\n\tif (isRequest(stream)) {\n\t\tstream.on('complete', onfinish);\n\t\tstream.on('abort', onclose);\n\t\tif (stream.req) onrequest();\n\t\telse stream.on('request', onrequest);\n\t} else if (writable && !ws) { // legacy streams\n\t\tstream.on('end', onlegacyfinish);\n\t\tstream.on('close', onlegacyfinish);\n\t}\n\n\tif (isChildProcess(stream)) stream.on('exit', onexit);\n\n\tstream.on('end', onend);\n\tstream.on('finish', onfinish);\n\tif (opts.error !== false) stream.on('error', onerror);\n\tstream.on('close', onclose);\n\n\treturn function() {\n\t\tcancelled = true;\n\t\tstream.removeListener('complete', onfinish);\n\t\tstream.removeListener('abort', onclose);\n\t\tstream.removeListener('request', onrequest);\n\t\tif (stream.req) stream.req.removeListener('finish', onfinish);\n\t\tstream.removeListener('end', onlegacyfinish);\n\t\tstream.removeListener('close', onlegacyfinish);\n\t\tstream.removeListener('finish', onfinish);\n\t\tstream.removeListener('exit', onexit);\n\t\tstream.removeListener('end', onend);\n\t\tstream.removeListener('error', onerror);\n\t\tstream.removeListener('close', onclose);\n\t};\n};\n\nmodule.exports = eos;\n","'use strict';\n\nvar hasOwn = Object.prototype.hasOwnProperty;\nvar toStr = Object.prototype.toString;\nvar defineProperty = Object.defineProperty;\nvar gOPD = Object.getOwnPropertyDescriptor;\n\nvar isArray = function isArray(arr) {\n\tif (typeof Array.isArray === 'function') {\n\t\treturn Array.isArray(arr);\n\t}\n\n\treturn toStr.call(arr) === '[object Array]';\n};\n\nvar isPlainObject = function isPlainObject(obj) {\n\tif (!obj || toStr.call(obj) !== '[object Object]') {\n\t\treturn false;\n\t}\n\n\tvar hasOwnConstructor = hasOwn.call(obj, 'constructor');\n\tvar hasIsPrototypeOf = obj.constructor && obj.constructor.prototype && hasOwn.call(obj.constructor.prototype, 'isPrototypeOf');\n\t// Not own constructor property must be Object\n\tif (obj.constructor && !hasOwnConstructor && !hasIsPrototypeOf) {\n\t\treturn false;\n\t}\n\n\t// Own properties are enumerated firstly, so to speed up,\n\t// if last one is own, then all properties are own.\n\tvar key;\n\tfor (key in obj) { /**/ }\n\n\treturn typeof key === 'undefined' || hasOwn.call(obj, key);\n};\n\n// If name is '__proto__', and Object.defineProperty is available, define __proto__ as an own property on target\nvar setProperty = function setProperty(target, options) {\n\tif (defineProperty && options.name === '__proto__') {\n\t\tdefineProperty(target, options.name, {\n\t\t\tenumerable: true,\n\t\t\tconfigurable: true,\n\t\t\tvalue: options.newValue,\n\t\t\twritable: true\n\t\t});\n\t} else {\n\t\ttarget[options.name] = options.newValue;\n\t}\n};\n\n// Return undefined instead of __proto__ if '__proto__' is not an own property\nvar getProperty = function getProperty(obj, name) {\n\tif (name === '__proto__') {\n\t\tif (!hasOwn.call(obj, name)) {\n\t\t\treturn void 0;\n\t\t} else if (gOPD) {\n\t\t\t// In early versions of node, obj['__proto__'] is buggy when obj has\n\t\t\t// __proto__ as an own property. Object.getOwnPropertyDescriptor() works.\n\t\t\treturn gOPD(obj, name).value;\n\t\t}\n\t}\n\n\treturn obj[name];\n};\n\nmodule.exports = function extend() {\n\tvar options, name, src, copy, copyIsArray, clone;\n\tvar target = arguments[0];\n\tvar i = 1;\n\tvar length = arguments.length;\n\tvar deep = false;\n\n\t// Handle a deep copy situation\n\tif (typeof target === 'boolean') {\n\t\tdeep = target;\n\t\ttarget = arguments[1] || {};\n\t\t// skip the boolean and the target\n\t\ti = 2;\n\t}\n\tif (target == null || (typeof target !== 'object' && typeof target !== 'function')) {\n\t\ttarget = {};\n\t}\n\n\tfor (; i < length; ++i) {\n\t\toptions = arguments[i];\n\t\t// Only deal with non-null/undefined values\n\t\tif (options != null) {\n\t\t\t// Extend the base object\n\t\t\tfor (name in options) {\n\t\t\t\tsrc = getProperty(target, name);\n\t\t\t\tcopy = getProperty(options, name);\n\n\t\t\t\t// Prevent never-ending loop\n\t\t\t\tif (target !== copy) {\n\t\t\t\t\t// Recurse if we're merging plain objects or arrays\n\t\t\t\t\tif (deep && copy && (isPlainObject(copy) || (copyIsArray = isArray(copy)))) {\n\t\t\t\t\t\tif (copyIsArray) {\n\t\t\t\t\t\t\tcopyIsArray = false;\n\t\t\t\t\t\t\tclone = src && isArray(src) ? src : [];\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tclone = src && isPlainObject(src) ? src : {};\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// Never move original objects, clone them\n\t\t\t\t\t\tsetProperty(target, { name: name, newValue: extend(deep, clone, copy) });\n\n\t\t\t\t\t// Don't bring in undefined values\n\t\t\t\t\t} else if (typeof copy !== 'undefined') {\n\t\t\t\t\t\tsetProperty(target, { name: name, newValue: copy });\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\t// Return the modified object\n\treturn target;\n};\n","/*\n * extsprintf.js: extended POSIX-style sprintf\n */\n\nvar mod_assert = require('assert');\nvar mod_util = require('util');\n\n/*\n * Public interface\n */\nexports.sprintf = jsSprintf;\nexports.printf = jsPrintf;\nexports.fprintf = jsFprintf;\n\n/*\n * Stripped down version of s[n]printf(3c). We make a best effort to throw an\n * exception when given a format string we don't understand, rather than\n * ignoring it, so that we won't break existing programs if/when we go implement\n * the rest of this.\n *\n * This implementation currently supports specifying\n *\t- field alignment ('-' flag),\n * \t- zero-pad ('0' flag)\n *\t- always show numeric sign ('+' flag),\n *\t- field width\n *\t- conversions for strings, decimal integers, and floats (numbers).\n *\t- argument size specifiers. These are all accepted but ignored, since\n *\t Javascript has no notion of the physical size of an argument.\n *\n * Everything else is currently unsupported, most notably precision, unsigned\n * numbers, non-decimal numbers, and characters.\n */\nfunction jsSprintf(fmt)\n{\n\tvar regex = [\n\t '([^%]*)',\t\t\t\t/* normal text */\n\t '%',\t\t\t\t/* start of format */\n\t '([\\'\\\\-+ #0]*?)',\t\t\t/* flags (optional) */\n\t '([1-9]\\\\d*)?',\t\t\t/* width (optional) */\n\t '(\\\\.([1-9]\\\\d*))?',\t\t/* precision (optional) */\n\t '[lhjztL]*?',\t\t\t/* length mods (ignored) */\n\t '([diouxXfFeEgGaAcCsSp%jr])'\t/* conversion */\n\t].join('');\n\n\tvar re = new RegExp(regex);\n\tvar args = Array.prototype.slice.call(arguments, 1);\n\tvar flags, width, precision, conversion;\n\tvar left, pad, sign, arg, match;\n\tvar ret = '';\n\tvar argn = 1;\n\n\tmod_assert.equal('string', typeof (fmt));\n\n\twhile ((match = re.exec(fmt)) !== null) {\n\t\tret += match[1];\n\t\tfmt = fmt.substring(match[0].length);\n\n\t\tflags = match[2] || '';\n\t\twidth = match[3] || 0;\n\t\tprecision = match[4] || '';\n\t\tconversion = match[6];\n\t\tleft = false;\n\t\tsign = false;\n\t\tpad = ' ';\n\n\t\tif (conversion == '%') {\n\t\t\tret += '%';\n\t\t\tcontinue;\n\t\t}\n\n\t\tif (args.length === 0)\n\t\t\tthrow (new Error('too few args to sprintf'));\n\n\t\targ = args.shift();\n\t\targn++;\n\n\t\tif (flags.match(/[\\' #]/))\n\t\t\tthrow (new Error(\n\t\t\t 'unsupported flags: ' + flags));\n\n\t\tif (precision.length > 0)\n\t\t\tthrow (new Error(\n\t\t\t 'non-zero precision not supported'));\n\n\t\tif (flags.match(/-/))\n\t\t\tleft = true;\n\n\t\tif (flags.match(/0/))\n\t\t\tpad = '0';\n\n\t\tif (flags.match(/\\+/))\n\t\t\tsign = true;\n\n\t\tswitch (conversion) {\n\t\tcase 's':\n\t\t\tif (arg === undefined || arg === null)\n\t\t\t\tthrow (new Error('argument ' + argn +\n\t\t\t\t ': attempted to print undefined or null ' +\n\t\t\t\t 'as a string'));\n\t\t\tret += doPad(pad, width, left, arg.toString());\n\t\t\tbreak;\n\n\t\tcase 'd':\n\t\t\targ = Math.floor(arg);\n\t\t\t/*jsl:fallthru*/\n\t\tcase 'f':\n\t\t\tsign = sign && arg > 0 ? '+' : '';\n\t\t\tret += sign + doPad(pad, width, left,\n\t\t\t arg.toString());\n\t\t\tbreak;\n\n\t\tcase 'x':\n\t\t\tret += doPad(pad, width, left, arg.toString(16));\n\t\t\tbreak;\n\n\t\tcase 'j': /* non-standard */\n\t\t\tif (width === 0)\n\t\t\t\twidth = 10;\n\t\t\tret += mod_util.inspect(arg, false, width);\n\t\t\tbreak;\n\n\t\tcase 'r': /* non-standard */\n\t\t\tret += dumpException(arg);\n\t\t\tbreak;\n\n\t\tdefault:\n\t\t\tthrow (new Error('unsupported conversion: ' +\n\t\t\t conversion));\n\t\t}\n\t}\n\n\tret += fmt;\n\treturn (ret);\n}\n\nfunction jsPrintf() {\n\tvar args = Array.prototype.slice.call(arguments);\n\targs.unshift(process.stdout);\n\tjsFprintf.apply(null, args);\n}\n\nfunction jsFprintf(stream) {\n\tvar args = Array.prototype.slice.call(arguments, 1);\n\treturn (stream.write(jsSprintf.apply(this, args)));\n}\n\nfunction doPad(chr, width, left, str)\n{\n\tvar ret = str;\n\n\twhile (ret.length < width) {\n\t\tif (left)\n\t\t\tret += chr;\n\t\telse\n\t\t\tret = chr + ret;\n\t}\n\n\treturn (ret);\n}\n\n/*\n * This function dumps long stack traces for exceptions having a cause() method.\n * See node-verror for an example.\n */\nfunction dumpException(ex)\n{\n\tvar ret;\n\n\tif (!(ex instanceof Error))\n\t\tthrow (new Error(jsSprintf('invalid type for %%r: %j', ex)));\n\n\t/* Note that V8 prepends \"ex.stack\" with ex.toString(). */\n\tret = 'EXCEPTION: ' + ex.constructor.name + ': ' + ex.stack;\n\n\tif (ex.cause && typeof (ex.cause) === 'function') {\n\t\tvar cex = ex.cause();\n\t\tif (cex) {\n\t\t\tret += '\\nCaused by: ' + dumpException(cex);\n\t\t}\n\t}\n\n\treturn (ret);\n}\n","'use strict';\n\n// do not edit .js files directly - edit src/index.jst\n\n\n\nmodule.exports = function equal(a, b) {\n if (a === b) return true;\n\n if (a && b && typeof a == 'object' && typeof b == 'object') {\n if (a.constructor !== b.constructor) return false;\n\n var length, i, keys;\n if (Array.isArray(a)) {\n length = a.length;\n if (length != b.length) return false;\n for (i = length; i-- !== 0;)\n if (!equal(a[i], b[i])) return false;\n return true;\n }\n\n\n\n if (a.constructor === RegExp) return a.source === b.source && a.flags === b.flags;\n if (a.valueOf !== Object.prototype.valueOf) return a.valueOf() === b.valueOf();\n if (a.toString !== Object.prototype.toString) return a.toString() === b.toString();\n\n keys = Object.keys(a);\n length = keys.length;\n if (length !== Object.keys(b).length) return false;\n\n for (i = length; i-- !== 0;)\n if (!Object.prototype.hasOwnProperty.call(b, keys[i])) return false;\n\n for (i = length; i-- !== 0;) {\n var key = keys[i];\n\n if (!equal(a[key], b[key])) return false;\n }\n\n return true;\n }\n\n // true if both NaN, false otherwise\n return a!==a && b!==b;\n};\n","'use strict';\n\nmodule.exports = function (data, opts) {\n if (!opts) opts = {};\n if (typeof opts === 'function') opts = { cmp: opts };\n var cycles = (typeof opts.cycles === 'boolean') ? opts.cycles : false;\n\n var cmp = opts.cmp && (function (f) {\n return function (node) {\n return function (a, b) {\n var aobj = { key: a, value: node[a] };\n var bobj = { key: b, value: node[b] };\n return f(aobj, bobj);\n };\n };\n })(opts.cmp);\n\n var seen = [];\n return (function stringify (node) {\n if (node && node.toJSON && typeof node.toJSON === 'function') {\n node = node.toJSON();\n }\n\n if (node === undefined) return;\n if (typeof node == 'number') return isFinite(node) ? '' + node : 'null';\n if (typeof node !== 'object') return JSON.stringify(node);\n\n var i, out;\n if (Array.isArray(node)) {\n out = '[';\n for (i = 0; i < node.length; i++) {\n if (i) out += ',';\n out += stringify(node[i]) || 'null';\n }\n return out + ']';\n }\n\n if (node === null) return 'null';\n\n if (seen.indexOf(node) !== -1) {\n if (cycles) return JSON.stringify('__cycle__');\n throw new TypeError('Converting circular structure to JSON');\n }\n\n var seenIndex = seen.push(node) - 1;\n var keys = Object.keys(node).sort(cmp && cmp(node));\n out = '';\n for (i = 0; i < keys.length; i++) {\n var key = keys[i];\n var value = stringify(node[key]);\n\n if (!value) continue;\n if (out) out += ',';\n out += JSON.stringify(key) + ':' + value;\n }\n seen.splice(seenIndex, 1);\n return '{' + out + '}';\n })(data);\n};\n","module.exports = ForeverAgent\nForeverAgent.SSL = ForeverAgentSSL\n\nvar util = require('util')\n , Agent = require('http').Agent\n , net = require('net')\n , tls = require('tls')\n , AgentSSL = require('https').Agent\n \nfunction getConnectionName(host, port) { \n var name = ''\n if (typeof host === 'string') {\n name = host + ':' + port\n } else {\n // For node.js v012.0 and iojs-v1.5.1, host is an object. And any existing localAddress is part of the connection name.\n name = host.host + ':' + host.port + ':' + (host.localAddress ? (host.localAddress + ':') : ':')\n }\n return name\n} \n\nfunction ForeverAgent(options) {\n var self = this\n self.options = options || {}\n self.requests = {}\n self.sockets = {}\n self.freeSockets = {}\n self.maxSockets = self.options.maxSockets || Agent.defaultMaxSockets\n self.minSockets = self.options.minSockets || ForeverAgent.defaultMinSockets\n self.on('free', function(socket, host, port) {\n var name = getConnectionName(host, port)\n\n if (self.requests[name] && self.requests[name].length) {\n self.requests[name].shift().onSocket(socket)\n } else if (self.sockets[name].length < self.minSockets) {\n if (!self.freeSockets[name]) self.freeSockets[name] = []\n self.freeSockets[name].push(socket)\n \n // if an error happens while we don't use the socket anyway, meh, throw the socket away\n var onIdleError = function() {\n socket.destroy()\n }\n socket._onIdleError = onIdleError\n socket.on('error', onIdleError)\n } else {\n // If there are no pending requests just destroy the\n // socket and it will get removed from the pool. This\n // gets us out of timeout issues and allows us to\n // default to Connection:keep-alive.\n socket.destroy()\n }\n })\n\n}\nutil.inherits(ForeverAgent, Agent)\n\nForeverAgent.defaultMinSockets = 5\n\n\nForeverAgent.prototype.createConnection = net.createConnection\nForeverAgent.prototype.addRequestNoreuse = Agent.prototype.addRequest\nForeverAgent.prototype.addRequest = function(req, host, port) {\n var name = getConnectionName(host, port)\n \n if (typeof host !== 'string') {\n var options = host\n port = options.port\n host = options.host\n }\n\n if (this.freeSockets[name] && this.freeSockets[name].length > 0 && !req.useChunkedEncodingByDefault) {\n var idleSocket = this.freeSockets[name].pop()\n idleSocket.removeListener('error', idleSocket._onIdleError)\n delete idleSocket._onIdleError\n req._reusedSocket = true\n req.onSocket(idleSocket)\n } else {\n this.addRequestNoreuse(req, host, port)\n }\n}\n\nForeverAgent.prototype.removeSocket = function(s, name, host, port) {\n if (this.sockets[name]) {\n var index = this.sockets[name].indexOf(s)\n if (index !== -1) {\n this.sockets[name].splice(index, 1)\n }\n } else if (this.sockets[name] && this.sockets[name].length === 0) {\n // don't leak\n delete this.sockets[name]\n delete this.requests[name]\n }\n \n if (this.freeSockets[name]) {\n var index = this.freeSockets[name].indexOf(s)\n if (index !== -1) {\n this.freeSockets[name].splice(index, 1)\n if (this.freeSockets[name].length === 0) {\n delete this.freeSockets[name]\n }\n }\n }\n\n if (this.requests[name] && this.requests[name].length) {\n // If we have pending requests and a socket gets closed a new one\n // needs to be created to take over in the pool for the one that closed.\n this.createSocket(name, host, port).emit('free')\n }\n}\n\nfunction ForeverAgentSSL (options) {\n ForeverAgent.call(this, options)\n}\nutil.inherits(ForeverAgentSSL, ForeverAgent)\n\nForeverAgentSSL.prototype.createConnection = createConnectionSSL\nForeverAgentSSL.prototype.addRequestNoreuse = AgentSSL.prototype.addRequest\n\nfunction createConnectionSSL (port, host, options) {\n if (typeof port === 'object') {\n options = port;\n } else if (typeof host === 'object') {\n options = host;\n } else if (typeof options === 'object') {\n options = options;\n } else {\n options = {};\n }\n\n if (typeof port === 'number') {\n options.port = port;\n }\n\n if (typeof host === 'string') {\n options.host = host;\n }\n\n return tls.connect(options);\n}\n","module.exports = realpath\nrealpath.realpath = realpath\nrealpath.sync = realpathSync\nrealpath.realpathSync = realpathSync\nrealpath.monkeypatch = monkeypatch\nrealpath.unmonkeypatch = unmonkeypatch\n\nvar fs = require('fs')\nvar origRealpath = fs.realpath\nvar origRealpathSync = fs.realpathSync\n\nvar version = process.version\nvar ok = /^v[0-5]\\./.test(version)\nvar old = require('./old.js')\n\nfunction newError (er) {\n return er && er.syscall === 'realpath' && (\n er.code === 'ELOOP' ||\n er.code === 'ENOMEM' ||\n er.code === 'ENAMETOOLONG'\n )\n}\n\nfunction realpath (p, cache, cb) {\n if (ok) {\n return origRealpath(p, cache, cb)\n }\n\n if (typeof cache === 'function') {\n cb = cache\n cache = null\n }\n origRealpath(p, cache, function (er, result) {\n if (newError(er)) {\n old.realpath(p, cache, cb)\n } else {\n cb(er, result)\n }\n })\n}\n\nfunction realpathSync (p, cache) {\n if (ok) {\n return origRealpathSync(p, cache)\n }\n\n try {\n return origRealpathSync(p, cache)\n } catch (er) {\n if (newError(er)) {\n return old.realpathSync(p, cache)\n } else {\n throw er\n }\n }\n}\n\nfunction monkeypatch () {\n fs.realpath = realpath\n fs.realpathSync = realpathSync\n}\n\nfunction unmonkeypatch () {\n fs.realpath = origRealpath\n fs.realpathSync = origRealpathSync\n}\n","// Copyright Joyent, Inc. and other Node contributors.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a\n// copy of this software and associated documentation files (the\n// \"Software\"), to deal in the Software without restriction, including\n// without limitation the rights to use, copy, modify, merge, publish,\n// distribute, sublicense, and/or sell copies of the Software, and to permit\n// persons to whom the Software is furnished to do so, subject to the\n// following conditions:\n//\n// The above copyright notice and this permission notice shall be included\n// in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\n// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN\n// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,\n// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE\n// USE OR OTHER DEALINGS IN THE SOFTWARE.\n\nvar pathModule = require('path');\nvar isWindows = process.platform === 'win32';\nvar fs = require('fs');\n\n// JavaScript implementation of realpath, ported from node pre-v6\n\nvar DEBUG = process.env.NODE_DEBUG && /fs/.test(process.env.NODE_DEBUG);\n\nfunction rethrow() {\n // Only enable in debug mode. A backtrace uses ~1000 bytes of heap space and\n // is fairly slow to generate.\n var callback;\n if (DEBUG) {\n var backtrace = new Error;\n callback = debugCallback;\n } else\n callback = missingCallback;\n\n return callback;\n\n function debugCallback(err) {\n if (err) {\n backtrace.message = err.message;\n err = backtrace;\n missingCallback(err);\n }\n }\n\n function missingCallback(err) {\n if (err) {\n if (process.throwDeprecation)\n throw err; // Forgot a callback but don't know where? Use NODE_DEBUG=fs\n else if (!process.noDeprecation) {\n var msg = 'fs: missing callback ' + (err.stack || err.message);\n if (process.traceDeprecation)\n console.trace(msg);\n else\n console.error(msg);\n }\n }\n }\n}\n\nfunction maybeCallback(cb) {\n return typeof cb === 'function' ? cb : rethrow();\n}\n\nvar normalize = pathModule.normalize;\n\n// Regexp that finds the next partion of a (partial) path\n// result is [base_with_slash, base], e.g. ['somedir/', 'somedir']\nif (isWindows) {\n var nextPartRe = /(.*?)(?:[\\/\\\\]+|$)/g;\n} else {\n var nextPartRe = /(.*?)(?:[\\/]+|$)/g;\n}\n\n// Regex to find the device root, including trailing slash. E.g. 'c:\\\\'.\nif (isWindows) {\n var splitRootRe = /^(?:[a-zA-Z]:|[\\\\\\/]{2}[^\\\\\\/]+[\\\\\\/][^\\\\\\/]+)?[\\\\\\/]*/;\n} else {\n var splitRootRe = /^[\\/]*/;\n}\n\nexports.realpathSync = function realpathSync(p, cache) {\n // make p is absolute\n p = pathModule.resolve(p);\n\n if (cache && Object.prototype.hasOwnProperty.call(cache, p)) {\n return cache[p];\n }\n\n var original = p,\n seenLinks = {},\n knownHard = {};\n\n // current character position in p\n var pos;\n // the partial path so far, including a trailing slash if any\n var current;\n // the partial path without a trailing slash (except when pointing at a root)\n var base;\n // the partial path scanned in the previous round, with slash\n var previous;\n\n start();\n\n function start() {\n // Skip over roots\n var m = splitRootRe.exec(p);\n pos = m[0].length;\n current = m[0];\n base = m[0];\n previous = '';\n\n // On windows, check that the root exists. On unix there is no need.\n if (isWindows && !knownHard[base]) {\n fs.lstatSync(base);\n knownHard[base] = true;\n }\n }\n\n // walk down the path, swapping out linked pathparts for their real\n // values\n // NB: p.length changes.\n while (pos < p.length) {\n // find the next part\n nextPartRe.lastIndex = pos;\n var result = nextPartRe.exec(p);\n previous = current;\n current += result[0];\n base = previous + result[1];\n pos = nextPartRe.lastIndex;\n\n // continue if not a symlink\n if (knownHard[base] || (cache && cache[base] === base)) {\n continue;\n }\n\n var resolvedLink;\n if (cache && Object.prototype.hasOwnProperty.call(cache, base)) {\n // some known symbolic link. no need to stat again.\n resolvedLink = cache[base];\n } else {\n var stat = fs.lstatSync(base);\n if (!stat.isSymbolicLink()) {\n knownHard[base] = true;\n if (cache) cache[base] = base;\n continue;\n }\n\n // read the link if it wasn't read before\n // dev/ino always return 0 on windows, so skip the check.\n var linkTarget = null;\n if (!isWindows) {\n var id = stat.dev.toString(32) + ':' + stat.ino.toString(32);\n if (seenLinks.hasOwnProperty(id)) {\n linkTarget = seenLinks[id];\n }\n }\n if (linkTarget === null) {\n fs.statSync(base);\n linkTarget = fs.readlinkSync(base);\n }\n resolvedLink = pathModule.resolve(previous, linkTarget);\n // track this, if given a cache.\n if (cache) cache[base] = resolvedLink;\n if (!isWindows) seenLinks[id] = linkTarget;\n }\n\n // resolve the link, then start over\n p = pathModule.resolve(resolvedLink, p.slice(pos));\n start();\n }\n\n if (cache) cache[original] = p;\n\n return p;\n};\n\n\nexports.realpath = function realpath(p, cache, cb) {\n if (typeof cb !== 'function') {\n cb = maybeCallback(cache);\n cache = null;\n }\n\n // make p is absolute\n p = pathModule.resolve(p);\n\n if (cache && Object.prototype.hasOwnProperty.call(cache, p)) {\n return process.nextTick(cb.bind(null, null, cache[p]));\n }\n\n var original = p,\n seenLinks = {},\n knownHard = {};\n\n // current character position in p\n var pos;\n // the partial path so far, including a trailing slash if any\n var current;\n // the partial path without a trailing slash (except when pointing at a root)\n var base;\n // the partial path scanned in the previous round, with slash\n var previous;\n\n start();\n\n function start() {\n // Skip over roots\n var m = splitRootRe.exec(p);\n pos = m[0].length;\n current = m[0];\n base = m[0];\n previous = '';\n\n // On windows, check that the root exists. On unix there is no need.\n if (isWindows && !knownHard[base]) {\n fs.lstat(base, function(err) {\n if (err) return cb(err);\n knownHard[base] = true;\n LOOP();\n });\n } else {\n process.nextTick(LOOP);\n }\n }\n\n // walk down the path, swapping out linked pathparts for their real\n // values\n function LOOP() {\n // stop if scanned past end of path\n if (pos >= p.length) {\n if (cache) cache[original] = p;\n return cb(null, p);\n }\n\n // find the next part\n nextPartRe.lastIndex = pos;\n var result = nextPartRe.exec(p);\n previous = current;\n current += result[0];\n base = previous + result[1];\n pos = nextPartRe.lastIndex;\n\n // continue if not a symlink\n if (knownHard[base] || (cache && cache[base] === base)) {\n return process.nextTick(LOOP);\n }\n\n if (cache && Object.prototype.hasOwnProperty.call(cache, base)) {\n // known symbolic link. no need to stat again.\n return gotResolvedLink(cache[base]);\n }\n\n return fs.lstat(base, gotStat);\n }\n\n function gotStat(err, stat) {\n if (err) return cb(err);\n\n // if not a symlink, skip to the next path part\n if (!stat.isSymbolicLink()) {\n knownHard[base] = true;\n if (cache) cache[base] = base;\n return process.nextTick(LOOP);\n }\n\n // stat & read the link if not read before\n // call gotTarget as soon as the link target is known\n // dev/ino always return 0 on windows, so skip the check.\n if (!isWindows) {\n var id = stat.dev.toString(32) + ':' + stat.ino.toString(32);\n if (seenLinks.hasOwnProperty(id)) {\n return gotTarget(null, seenLinks[id], base);\n }\n }\n fs.stat(base, function(err) {\n if (err) return cb(err);\n\n fs.readlink(base, function(err, target) {\n if (!isWindows) seenLinks[id] = target;\n gotTarget(err, target);\n });\n });\n }\n\n function gotTarget(err, target, base) {\n if (err) return cb(err);\n\n var resolvedLink = pathModule.resolve(previous, target);\n if (cache) cache[base] = resolvedLink;\n gotResolvedLink(resolvedLink);\n }\n\n function gotResolvedLink(resolvedLink) {\n // resolve the link, then start over\n p = pathModule.resolve(resolvedLink, p.slice(pos));\n start();\n }\n};\n","'use strict';\n\n/* eslint no-invalid-this: 1 */\n\nvar ERROR_MESSAGE = 'Function.prototype.bind called on incompatible ';\nvar slice = Array.prototype.slice;\nvar toStr = Object.prototype.toString;\nvar funcType = '[object Function]';\n\nmodule.exports = function bind(that) {\n var target = this;\n if (typeof target !== 'function' || toStr.call(target) !== funcType) {\n throw new TypeError(ERROR_MESSAGE + target);\n }\n var args = slice.call(arguments, 1);\n\n var bound;\n var binder = function () {\n if (this instanceof bound) {\n var result = target.apply(\n this,\n args.concat(slice.call(arguments))\n );\n if (Object(result) === result) {\n return result;\n }\n return this;\n } else {\n return target.apply(\n that,\n args.concat(slice.call(arguments))\n );\n }\n };\n\n var boundLength = Math.max(0, target.length - args.length);\n var boundArgs = [];\n for (var i = 0; i < boundLength; i++) {\n boundArgs.push('$' + i);\n }\n\n bound = Function('binder', 'return function (' + boundArgs.join(',') + '){ return binder.apply(this,arguments); }')(binder);\n\n if (target.prototype) {\n var Empty = function Empty() {};\n Empty.prototype = target.prototype;\n bound.prototype = new Empty();\n Empty.prototype = null;\n }\n\n return bound;\n};\n","'use strict';\n\nvar implementation = require('./implementation');\n\nmodule.exports = Function.prototype.bind || implementation;\n","'use strict';\n\nvar undefined;\n\nvar $SyntaxError = SyntaxError;\nvar $Function = Function;\nvar $TypeError = TypeError;\n\n// eslint-disable-next-line consistent-return\nvar getEvalledConstructor = function (expressionSyntax) {\n\ttry {\n\t\treturn $Function('\"use strict\"; return (' + expressionSyntax + ').constructor;')();\n\t} catch (e) {}\n};\n\nvar $gOPD = Object.getOwnPropertyDescriptor;\nif ($gOPD) {\n\ttry {\n\t\t$gOPD({}, '');\n\t} catch (e) {\n\t\t$gOPD = null; // this is IE 8, which has a broken gOPD\n\t}\n}\n\nvar throwTypeError = function () {\n\tthrow new $TypeError();\n};\nvar ThrowTypeError = $gOPD\n\t? (function () {\n\t\ttry {\n\t\t\t// eslint-disable-next-line no-unused-expressions, no-caller, no-restricted-properties\n\t\t\targuments.callee; // IE 8 does not throw here\n\t\t\treturn throwTypeError;\n\t\t} catch (calleeThrows) {\n\t\t\ttry {\n\t\t\t\t// IE 8 throws on Object.getOwnPropertyDescriptor(arguments, '')\n\t\t\t\treturn $gOPD(arguments, 'callee').get;\n\t\t\t} catch (gOPDthrows) {\n\t\t\t\treturn throwTypeError;\n\t\t\t}\n\t\t}\n\t}())\n\t: throwTypeError;\n\nvar hasSymbols = require('has-symbols')();\n\nvar getProto = Object.getPrototypeOf || function (x) { return x.__proto__; }; // eslint-disable-line no-proto\n\nvar needsEval = {};\n\nvar TypedArray = typeof Uint8Array === 'undefined' ? undefined : getProto(Uint8Array);\n\nvar INTRINSICS = {\n\t'%AggregateError%': typeof AggregateError === 'undefined' ? undefined : AggregateError,\n\t'%Array%': Array,\n\t'%ArrayBuffer%': typeof ArrayBuffer === 'undefined' ? undefined : ArrayBuffer,\n\t'%ArrayIteratorPrototype%': hasSymbols ? getProto([][Symbol.iterator]()) : undefined,\n\t'%AsyncFromSyncIteratorPrototype%': undefined,\n\t'%AsyncFunction%': needsEval,\n\t'%AsyncGenerator%': needsEval,\n\t'%AsyncGeneratorFunction%': needsEval,\n\t'%AsyncIteratorPrototype%': needsEval,\n\t'%Atomics%': typeof Atomics === 'undefined' ? undefined : Atomics,\n\t'%BigInt%': typeof BigInt === 'undefined' ? undefined : BigInt,\n\t'%Boolean%': Boolean,\n\t'%DataView%': typeof DataView === 'undefined' ? undefined : DataView,\n\t'%Date%': Date,\n\t'%decodeURI%': decodeURI,\n\t'%decodeURIComponent%': decodeURIComponent,\n\t'%encodeURI%': encodeURI,\n\t'%encodeURIComponent%': encodeURIComponent,\n\t'%Error%': Error,\n\t'%eval%': eval, // eslint-disable-line no-eval\n\t'%EvalError%': EvalError,\n\t'%Float32Array%': typeof Float32Array === 'undefined' ? undefined : Float32Array,\n\t'%Float64Array%': typeof Float64Array === 'undefined' ? undefined : Float64Array,\n\t'%FinalizationRegistry%': typeof FinalizationRegistry === 'undefined' ? undefined : FinalizationRegistry,\n\t'%Function%': $Function,\n\t'%GeneratorFunction%': needsEval,\n\t'%Int8Array%': typeof Int8Array === 'undefined' ? undefined : Int8Array,\n\t'%Int16Array%': typeof Int16Array === 'undefined' ? undefined : Int16Array,\n\t'%Int32Array%': typeof Int32Array === 'undefined' ? undefined : Int32Array,\n\t'%isFinite%': isFinite,\n\t'%isNaN%': isNaN,\n\t'%IteratorPrototype%': hasSymbols ? getProto(getProto([][Symbol.iterator]())) : undefined,\n\t'%JSON%': typeof JSON === 'object' ? JSON : undefined,\n\t'%Map%': typeof Map === 'undefined' ? undefined : Map,\n\t'%MapIteratorPrototype%': typeof Map === 'undefined' || !hasSymbols ? undefined : getProto(new Map()[Symbol.iterator]()),\n\t'%Math%': Math,\n\t'%Number%': Number,\n\t'%Object%': Object,\n\t'%parseFloat%': parseFloat,\n\t'%parseInt%': parseInt,\n\t'%Promise%': typeof Promise === 'undefined' ? undefined : Promise,\n\t'%Proxy%': typeof Proxy === 'undefined' ? undefined : Proxy,\n\t'%RangeError%': RangeError,\n\t'%ReferenceError%': ReferenceError,\n\t'%Reflect%': typeof Reflect === 'undefined' ? undefined : Reflect,\n\t'%RegExp%': RegExp,\n\t'%Set%': typeof Set === 'undefined' ? undefined : Set,\n\t'%SetIteratorPrototype%': typeof Set === 'undefined' || !hasSymbols ? undefined : getProto(new Set()[Symbol.iterator]()),\n\t'%SharedArrayBuffer%': typeof SharedArrayBuffer === 'undefined' ? undefined : SharedArrayBuffer,\n\t'%String%': String,\n\t'%StringIteratorPrototype%': hasSymbols ? getProto(''[Symbol.iterator]()) : undefined,\n\t'%Symbol%': hasSymbols ? Symbol : undefined,\n\t'%SyntaxError%': $SyntaxError,\n\t'%ThrowTypeError%': ThrowTypeError,\n\t'%TypedArray%': TypedArray,\n\t'%TypeError%': $TypeError,\n\t'%Uint8Array%': typeof Uint8Array === 'undefined' ? undefined : Uint8Array,\n\t'%Uint8ClampedArray%': typeof Uint8ClampedArray === 'undefined' ? undefined : Uint8ClampedArray,\n\t'%Uint16Array%': typeof Uint16Array === 'undefined' ? undefined : Uint16Array,\n\t'%Uint32Array%': typeof Uint32Array === 'undefined' ? undefined : Uint32Array,\n\t'%URIError%': URIError,\n\t'%WeakMap%': typeof WeakMap === 'undefined' ? undefined : WeakMap,\n\t'%WeakRef%': typeof WeakRef === 'undefined' ? undefined : WeakRef,\n\t'%WeakSet%': typeof WeakSet === 'undefined' ? undefined : WeakSet\n};\n\nvar doEval = function doEval(name) {\n\tvar value;\n\tif (name === '%AsyncFunction%') {\n\t\tvalue = getEvalledConstructor('async function () {}');\n\t} else if (name === '%GeneratorFunction%') {\n\t\tvalue = getEvalledConstructor('function* () {}');\n\t} else if (name === '%AsyncGeneratorFunction%') {\n\t\tvalue = getEvalledConstructor('async function* () {}');\n\t} else if (name === '%AsyncGenerator%') {\n\t\tvar fn = doEval('%AsyncGeneratorFunction%');\n\t\tif (fn) {\n\t\t\tvalue = fn.prototype;\n\t\t}\n\t} else if (name === '%AsyncIteratorPrototype%') {\n\t\tvar gen = doEval('%AsyncGenerator%');\n\t\tif (gen) {\n\t\t\tvalue = getProto(gen.prototype);\n\t\t}\n\t}\n\n\tINTRINSICS[name] = value;\n\n\treturn value;\n};\n\nvar LEGACY_ALIASES = {\n\t'%ArrayBufferPrototype%': ['ArrayBuffer', 'prototype'],\n\t'%ArrayPrototype%': ['Array', 'prototype'],\n\t'%ArrayProto_entries%': ['Array', 'prototype', 'entries'],\n\t'%ArrayProto_forEach%': ['Array', 'prototype', 'forEach'],\n\t'%ArrayProto_keys%': ['Array', 'prototype', 'keys'],\n\t'%ArrayProto_values%': ['Array', 'prototype', 'values'],\n\t'%AsyncFunctionPrototype%': ['AsyncFunction', 'prototype'],\n\t'%AsyncGenerator%': ['AsyncGeneratorFunction', 'prototype'],\n\t'%AsyncGeneratorPrototype%': ['AsyncGeneratorFunction', 'prototype', 'prototype'],\n\t'%BooleanPrototype%': ['Boolean', 'prototype'],\n\t'%DataViewPrototype%': ['DataView', 'prototype'],\n\t'%DatePrototype%': ['Date', 'prototype'],\n\t'%ErrorPrototype%': ['Error', 'prototype'],\n\t'%EvalErrorPrototype%': ['EvalError', 'prototype'],\n\t'%Float32ArrayPrototype%': ['Float32Array', 'prototype'],\n\t'%Float64ArrayPrototype%': ['Float64Array', 'prototype'],\n\t'%FunctionPrototype%': ['Function', 'prototype'],\n\t'%Generator%': ['GeneratorFunction', 'prototype'],\n\t'%GeneratorPrototype%': ['GeneratorFunction', 'prototype', 'prototype'],\n\t'%Int8ArrayPrototype%': ['Int8Array', 'prototype'],\n\t'%Int16ArrayPrototype%': ['Int16Array', 'prototype'],\n\t'%Int32ArrayPrototype%': ['Int32Array', 'prototype'],\n\t'%JSONParse%': ['JSON', 'parse'],\n\t'%JSONStringify%': ['JSON', 'stringify'],\n\t'%MapPrototype%': ['Map', 'prototype'],\n\t'%NumberPrototype%': ['Number', 'prototype'],\n\t'%ObjectPrototype%': ['Object', 'prototype'],\n\t'%ObjProto_toString%': ['Object', 'prototype', 'toString'],\n\t'%ObjProto_valueOf%': ['Object', 'prototype', 'valueOf'],\n\t'%PromisePrototype%': ['Promise', 'prototype'],\n\t'%PromiseProto_then%': ['Promise', 'prototype', 'then'],\n\t'%Promise_all%': ['Promise', 'all'],\n\t'%Promise_reject%': ['Promise', 'reject'],\n\t'%Promise_resolve%': ['Promise', 'resolve'],\n\t'%RangeErrorPrototype%': ['RangeError', 'prototype'],\n\t'%ReferenceErrorPrototype%': ['ReferenceError', 'prototype'],\n\t'%RegExpPrototype%': ['RegExp', 'prototype'],\n\t'%SetPrototype%': ['Set', 'prototype'],\n\t'%SharedArrayBufferPrototype%': ['SharedArrayBuffer', 'prototype'],\n\t'%StringPrototype%': ['String', 'prototype'],\n\t'%SymbolPrototype%': ['Symbol', 'prototype'],\n\t'%SyntaxErrorPrototype%': ['SyntaxError', 'prototype'],\n\t'%TypedArrayPrototype%': ['TypedArray', 'prototype'],\n\t'%TypeErrorPrototype%': ['TypeError', 'prototype'],\n\t'%Uint8ArrayPrototype%': ['Uint8Array', 'prototype'],\n\t'%Uint8ClampedArrayPrototype%': ['Uint8ClampedArray', 'prototype'],\n\t'%Uint16ArrayPrototype%': ['Uint16Array', 'prototype'],\n\t'%Uint32ArrayPrototype%': ['Uint32Array', 'prototype'],\n\t'%URIErrorPrototype%': ['URIError', 'prototype'],\n\t'%WeakMapPrototype%': ['WeakMap', 'prototype'],\n\t'%WeakSetPrototype%': ['WeakSet', 'prototype']\n};\n\nvar bind = require('function-bind');\nvar hasOwn = require('has');\nvar $concat = bind.call(Function.call, Array.prototype.concat);\nvar $spliceApply = bind.call(Function.apply, Array.prototype.splice);\nvar $replace = bind.call(Function.call, String.prototype.replace);\nvar $strSlice = bind.call(Function.call, String.prototype.slice);\n\n/* adapted from https://github.com/lodash/lodash/blob/4.17.15/dist/lodash.js#L6735-L6744 */\nvar rePropName = /[^%.[\\]]+|\\[(?:(-?\\d+(?:\\.\\d+)?)|([\"'])((?:(?!\\2)[^\\\\]|\\\\.)*?)\\2)\\]|(?=(?:\\.|\\[\\])(?:\\.|\\[\\]|%$))/g;\nvar reEscapeChar = /\\\\(\\\\)?/g; /** Used to match backslashes in property paths. */\nvar stringToPath = function stringToPath(string) {\n\tvar first = $strSlice(string, 0, 1);\n\tvar last = $strSlice(string, -1);\n\tif (first === '%' && last !== '%') {\n\t\tthrow new $SyntaxError('invalid intrinsic syntax, expected closing `%`');\n\t} else if (last === '%' && first !== '%') {\n\t\tthrow new $SyntaxError('invalid intrinsic syntax, expected opening `%`');\n\t}\n\tvar result = [];\n\t$replace(string, rePropName, function (match, number, quote, subString) {\n\t\tresult[result.length] = quote ? $replace(subString, reEscapeChar, '$1') : number || match;\n\t});\n\treturn result;\n};\n/* end adaptation */\n\nvar getBaseIntrinsic = function getBaseIntrinsic(name, allowMissing) {\n\tvar intrinsicName = name;\n\tvar alias;\n\tif (hasOwn(LEGACY_ALIASES, intrinsicName)) {\n\t\talias = LEGACY_ALIASES[intrinsicName];\n\t\tintrinsicName = '%' + alias[0] + '%';\n\t}\n\n\tif (hasOwn(INTRINSICS, intrinsicName)) {\n\t\tvar value = INTRINSICS[intrinsicName];\n\t\tif (value === needsEval) {\n\t\t\tvalue = doEval(intrinsicName);\n\t\t}\n\t\tif (typeof value === 'undefined' && !allowMissing) {\n\t\t\tthrow new $TypeError('intrinsic ' + name + ' exists, but is not available. Please file an issue!');\n\t\t}\n\n\t\treturn {\n\t\t\talias: alias,\n\t\t\tname: intrinsicName,\n\t\t\tvalue: value\n\t\t};\n\t}\n\n\tthrow new $SyntaxError('intrinsic ' + name + ' does not exist!');\n};\n\nmodule.exports = function GetIntrinsic(name, allowMissing) {\n\tif (typeof name !== 'string' || name.length === 0) {\n\t\tthrow new $TypeError('intrinsic name must be a non-empty string');\n\t}\n\tif (arguments.length > 1 && typeof allowMissing !== 'boolean') {\n\t\tthrow new $TypeError('\"allowMissing\" argument must be a boolean');\n\t}\n\n\tvar parts = stringToPath(name);\n\tvar intrinsicBaseName = parts.length > 0 ? parts[0] : '';\n\n\tvar intrinsic = getBaseIntrinsic('%' + intrinsicBaseName + '%', allowMissing);\n\tvar intrinsicRealName = intrinsic.name;\n\tvar value = intrinsic.value;\n\tvar skipFurtherCaching = false;\n\n\tvar alias = intrinsic.alias;\n\tif (alias) {\n\t\tintrinsicBaseName = alias[0];\n\t\t$spliceApply(parts, $concat([0, 1], alias));\n\t}\n\n\tfor (var i = 1, isOwn = true; i < parts.length; i += 1) {\n\t\tvar part = parts[i];\n\t\tvar first = $strSlice(part, 0, 1);\n\t\tvar last = $strSlice(part, -1);\n\t\tif (\n\t\t\t(\n\t\t\t\t(first === '\"' || first === \"'\" || first === '`')\n\t\t\t\t|| (last === '\"' || last === \"'\" || last === '`')\n\t\t\t)\n\t\t\t&& first !== last\n\t\t) {\n\t\t\tthrow new $SyntaxError('property names with quotes must have matching quotes');\n\t\t}\n\t\tif (part === 'constructor' || !isOwn) {\n\t\t\tskipFurtherCaching = true;\n\t\t}\n\n\t\tintrinsicBaseName += '.' + part;\n\t\tintrinsicRealName = '%' + intrinsicBaseName + '%';\n\n\t\tif (hasOwn(INTRINSICS, intrinsicRealName)) {\n\t\t\tvalue = INTRINSICS[intrinsicRealName];\n\t\t} else if (value != null) {\n\t\t\tif (!(part in value)) {\n\t\t\t\tif (!allowMissing) {\n\t\t\t\t\tthrow new $TypeError('base intrinsic for ' + name + ' exists, but the property is not available.');\n\t\t\t\t}\n\t\t\t\treturn void undefined;\n\t\t\t}\n\t\t\tif ($gOPD && (i + 1) >= parts.length) {\n\t\t\t\tvar desc = $gOPD(value, part);\n\t\t\t\tisOwn = !!desc;\n\n\t\t\t\t// By convention, when a data property is converted to an accessor\n\t\t\t\t// property to emulate a data property that does not suffer from\n\t\t\t\t// the override mistake, that accessor's getter is marked with\n\t\t\t\t// an `originalValue` property. Here, when we detect this, we\n\t\t\t\t// uphold the illusion by pretending to see that original data\n\t\t\t\t// property, i.e., returning the value rather than the getter\n\t\t\t\t// itself.\n\t\t\t\tif (isOwn && 'get' in desc && !('originalValue' in desc.get)) {\n\t\t\t\t\tvalue = desc.get;\n\t\t\t\t} else {\n\t\t\t\t\tvalue = value[part];\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tisOwn = hasOwn(value, part);\n\t\t\t\tvalue = value[part];\n\t\t\t}\n\n\t\t\tif (isOwn && !skipFurtherCaching) {\n\t\t\t\tINTRINSICS[intrinsicRealName] = value;\n\t\t\t}\n\t\t}\n\t}\n\treturn value;\n};\n","'use strict';\nconst {PassThrough} = require('stream');\n\nmodule.exports = options => {\n\toptions = Object.assign({}, options);\n\n\tconst {array} = options;\n\tlet {encoding} = options;\n\tconst buffer = encoding === 'buffer';\n\tlet objectMode = false;\n\n\tif (array) {\n\t\tobjectMode = !(encoding || buffer);\n\t} else {\n\t\tencoding = encoding || 'utf8';\n\t}\n\n\tif (buffer) {\n\t\tencoding = null;\n\t}\n\n\tlet len = 0;\n\tconst ret = [];\n\tconst stream = new PassThrough({objectMode});\n\n\tif (encoding) {\n\t\tstream.setEncoding(encoding);\n\t}\n\n\tstream.on('data', chunk => {\n\t\tret.push(chunk);\n\n\t\tif (objectMode) {\n\t\t\tlen = ret.length;\n\t\t} else {\n\t\t\tlen += chunk.length;\n\t\t}\n\t});\n\n\tstream.getBufferedValue = () => {\n\t\tif (array) {\n\t\t\treturn ret;\n\t\t}\n\n\t\treturn buffer ? Buffer.concat(ret, len) : ret.join('');\n\t};\n\n\tstream.getBufferedLength = () => len;\n\n\treturn stream;\n};\n","'use strict';\nconst pump = require('pump');\nconst bufferStream = require('./buffer-stream');\n\nclass MaxBufferError extends Error {\n\tconstructor() {\n\t\tsuper('maxBuffer exceeded');\n\t\tthis.name = 'MaxBufferError';\n\t}\n}\n\nfunction getStream(inputStream, options) {\n\tif (!inputStream) {\n\t\treturn Promise.reject(new Error('Expected a stream'));\n\t}\n\n\toptions = Object.assign({maxBuffer: Infinity}, options);\n\n\tconst {maxBuffer} = options;\n\n\tlet stream;\n\treturn new Promise((resolve, reject) => {\n\t\tconst rejectPromise = error => {\n\t\t\tif (error) { // A null check\n\t\t\t\terror.bufferedData = stream.getBufferedValue();\n\t\t\t}\n\t\t\treject(error);\n\t\t};\n\n\t\tstream = pump(inputStream, bufferStream(options), error => {\n\t\t\tif (error) {\n\t\t\t\trejectPromise(error);\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tresolve();\n\t\t});\n\n\t\tstream.on('data', () => {\n\t\t\tif (stream.getBufferedLength() > maxBuffer) {\n\t\t\t\trejectPromise(new MaxBufferError());\n\t\t\t}\n\t\t});\n\t}).then(() => stream.getBufferedValue());\n}\n\nmodule.exports = getStream;\nmodule.exports.buffer = (stream, options) => getStream(stream, Object.assign({}, options, {encoding: 'buffer'}));\nmodule.exports.array = (stream, options) => getStream(stream, Object.assign({}, options, {array: true}));\nmodule.exports.MaxBufferError = MaxBufferError;\n","exports.alphasort = alphasort\nexports.alphasorti = alphasorti\nexports.setopts = setopts\nexports.ownProp = ownProp\nexports.makeAbs = makeAbs\nexports.finish = finish\nexports.mark = mark\nexports.isIgnored = isIgnored\nexports.childrenIgnored = childrenIgnored\n\nfunction ownProp (obj, field) {\n return Object.prototype.hasOwnProperty.call(obj, field)\n}\n\nvar path = require(\"path\")\nvar minimatch = require(\"minimatch\")\nvar isAbsolute = require(\"path-is-absolute\")\nvar Minimatch = minimatch.Minimatch\n\nfunction alphasorti (a, b) {\n return a.toLowerCase().localeCompare(b.toLowerCase())\n}\n\nfunction alphasort (a, b) {\n return a.localeCompare(b)\n}\n\nfunction setupIgnores (self, options) {\n self.ignore = options.ignore || []\n\n if (!Array.isArray(self.ignore))\n self.ignore = [self.ignore]\n\n if (self.ignore.length) {\n self.ignore = self.ignore.map(ignoreMap)\n }\n}\n\n// ignore patterns are always in dot:true mode.\nfunction ignoreMap (pattern) {\n var gmatcher = null\n if (pattern.slice(-3) === '/**') {\n var gpattern = pattern.replace(/(\\/\\*\\*)+$/, '')\n gmatcher = new Minimatch(gpattern, { dot: true })\n }\n\n return {\n matcher: new Minimatch(pattern, { dot: true }),\n gmatcher: gmatcher\n }\n}\n\nfunction setopts (self, pattern, options) {\n if (!options)\n options = {}\n\n // base-matching: just use globstar for that.\n if (options.matchBase && -1 === pattern.indexOf(\"/\")) {\n if (options.noglobstar) {\n throw new Error(\"base matching requires globstar\")\n }\n pattern = \"**/\" + pattern\n }\n\n self.silent = !!options.silent\n self.pattern = pattern\n self.strict = options.strict !== false\n self.realpath = !!options.realpath\n self.realpathCache = options.realpathCache || Object.create(null)\n self.follow = !!options.follow\n self.dot = !!options.dot\n self.mark = !!options.mark\n self.nodir = !!options.nodir\n if (self.nodir)\n self.mark = true\n self.sync = !!options.sync\n self.nounique = !!options.nounique\n self.nonull = !!options.nonull\n self.nosort = !!options.nosort\n self.nocase = !!options.nocase\n self.stat = !!options.stat\n self.noprocess = !!options.noprocess\n self.absolute = !!options.absolute\n\n self.maxLength = options.maxLength || Infinity\n self.cache = options.cache || Object.create(null)\n self.statCache = options.statCache || Object.create(null)\n self.symlinks = options.symlinks || Object.create(null)\n\n setupIgnores(self, options)\n\n self.changedCwd = false\n var cwd = process.cwd()\n if (!ownProp(options, \"cwd\"))\n self.cwd = cwd\n else {\n self.cwd = path.resolve(options.cwd)\n self.changedCwd = self.cwd !== cwd\n }\n\n self.root = options.root || path.resolve(self.cwd, \"/\")\n self.root = path.resolve(self.root)\n if (process.platform === \"win32\")\n self.root = self.root.replace(/\\\\/g, \"/\")\n\n // TODO: is an absolute `cwd` supposed to be resolved against `root`?\n // e.g. { cwd: '/test', root: __dirname } === path.join(__dirname, '/test')\n self.cwdAbs = isAbsolute(self.cwd) ? self.cwd : makeAbs(self, self.cwd)\n if (process.platform === \"win32\")\n self.cwdAbs = self.cwdAbs.replace(/\\\\/g, \"/\")\n self.nomount = !!options.nomount\n\n // disable comments and negation in Minimatch.\n // Note that they are not supported in Glob itself anyway.\n options.nonegate = true\n options.nocomment = true\n\n self.minimatch = new Minimatch(pattern, options)\n self.options = self.minimatch.options\n}\n\nfunction finish (self) {\n var nou = self.nounique\n var all = nou ? [] : Object.create(null)\n\n for (var i = 0, l = self.matches.length; i < l; i ++) {\n var matches = self.matches[i]\n if (!matches || Object.keys(matches).length === 0) {\n if (self.nonull) {\n // do like the shell, and spit out the literal glob\n var literal = self.minimatch.globSet[i]\n if (nou)\n all.push(literal)\n else\n all[literal] = true\n }\n } else {\n // had matches\n var m = Object.keys(matches)\n if (nou)\n all.push.apply(all, m)\n else\n m.forEach(function (m) {\n all[m] = true\n })\n }\n }\n\n if (!nou)\n all = Object.keys(all)\n\n if (!self.nosort)\n all = all.sort(self.nocase ? alphasorti : alphasort)\n\n // at *some* point we statted all of these\n if (self.mark) {\n for (var i = 0; i < all.length; i++) {\n all[i] = self._mark(all[i])\n }\n if (self.nodir) {\n all = all.filter(function (e) {\n var notDir = !(/\\/$/.test(e))\n var c = self.cache[e] || self.cache[makeAbs(self, e)]\n if (notDir && c)\n notDir = c !== 'DIR' && !Array.isArray(c)\n return notDir\n })\n }\n }\n\n if (self.ignore.length)\n all = all.filter(function(m) {\n return !isIgnored(self, m)\n })\n\n self.found = all\n}\n\nfunction mark (self, p) {\n var abs = makeAbs(self, p)\n var c = self.cache[abs]\n var m = p\n if (c) {\n var isDir = c === 'DIR' || Array.isArray(c)\n var slash = p.slice(-1) === '/'\n\n if (isDir && !slash)\n m += '/'\n else if (!isDir && slash)\n m = m.slice(0, -1)\n\n if (m !== p) {\n var mabs = makeAbs(self, m)\n self.statCache[mabs] = self.statCache[abs]\n self.cache[mabs] = self.cache[abs]\n }\n }\n\n return m\n}\n\n// lotta situps...\nfunction makeAbs (self, f) {\n var abs = f\n if (f.charAt(0) === '/') {\n abs = path.join(self.root, f)\n } else if (isAbsolute(f) || f === '') {\n abs = f\n } else if (self.changedCwd) {\n abs = path.resolve(self.cwd, f)\n } else {\n abs = path.resolve(f)\n }\n\n if (process.platform === 'win32')\n abs = abs.replace(/\\\\/g, '/')\n\n return abs\n}\n\n\n// Return true, if pattern ends with globstar '**', for the accompanying parent directory.\n// Ex:- If node_modules/** is the pattern, add 'node_modules' to ignore list along with it's contents\nfunction isIgnored (self, path) {\n if (!self.ignore.length)\n return false\n\n return self.ignore.some(function(item) {\n return item.matcher.match(path) || !!(item.gmatcher && item.gmatcher.match(path))\n })\n}\n\nfunction childrenIgnored (self, path) {\n if (!self.ignore.length)\n return false\n\n return self.ignore.some(function(item) {\n return !!(item.gmatcher && item.gmatcher.match(path))\n })\n}\n","// Approach:\n//\n// 1. Get the minimatch set\n// 2. For each pattern in the set, PROCESS(pattern, false)\n// 3. Store matches per-set, then uniq them\n//\n// PROCESS(pattern, inGlobStar)\n// Get the first [n] items from pattern that are all strings\n// Join these together. This is PREFIX.\n// If there is no more remaining, then stat(PREFIX) and\n// add to matches if it succeeds. END.\n//\n// If inGlobStar and PREFIX is symlink and points to dir\n// set ENTRIES = []\n// else readdir(PREFIX) as ENTRIES\n// If fail, END\n//\n// with ENTRIES\n// If pattern[n] is GLOBSTAR\n// // handle the case where the globstar match is empty\n// // by pruning it out, and testing the resulting pattern\n// PROCESS(pattern[0..n] + pattern[n+1 .. $], false)\n// // handle other cases.\n// for ENTRY in ENTRIES (not dotfiles)\n// // attach globstar + tail onto the entry\n// // Mark that this entry is a globstar match\n// PROCESS(pattern[0..n] + ENTRY + pattern[n .. $], true)\n//\n// else // not globstar\n// for ENTRY in ENTRIES (not dotfiles, unless pattern[n] is dot)\n// Test ENTRY against pattern[n]\n// If fails, continue\n// If passes, PROCESS(pattern[0..n] + item + pattern[n+1 .. $])\n//\n// Caveat:\n// Cache all stats and readdirs results to minimize syscall. Since all\n// we ever care about is existence and directory-ness, we can just keep\n// `true` for files, and [children,...] for directories, or `false` for\n// things that don't exist.\n\nmodule.exports = glob\n\nvar fs = require('fs')\nvar rp = require('fs.realpath')\nvar minimatch = require('minimatch')\nvar Minimatch = minimatch.Minimatch\nvar inherits = require('inherits')\nvar EE = require('events').EventEmitter\nvar path = require('path')\nvar assert = require('assert')\nvar isAbsolute = require('path-is-absolute')\nvar globSync = require('./sync.js')\nvar common = require('./common.js')\nvar alphasort = common.alphasort\nvar alphasorti = common.alphasorti\nvar setopts = common.setopts\nvar ownProp = common.ownProp\nvar inflight = require('inflight')\nvar util = require('util')\nvar childrenIgnored = common.childrenIgnored\nvar isIgnored = common.isIgnored\n\nvar once = require('once')\n\nfunction glob (pattern, options, cb) {\n if (typeof options === 'function') cb = options, options = {}\n if (!options) options = {}\n\n if (options.sync) {\n if (cb)\n throw new TypeError('callback provided to sync glob')\n return globSync(pattern, options)\n }\n\n return new Glob(pattern, options, cb)\n}\n\nglob.sync = globSync\nvar GlobSync = glob.GlobSync = globSync.GlobSync\n\n// old api surface\nglob.glob = glob\n\nfunction extend (origin, add) {\n if (add === null || typeof add !== 'object') {\n return origin\n }\n\n var keys = Object.keys(add)\n var i = keys.length\n while (i--) {\n origin[keys[i]] = add[keys[i]]\n }\n return origin\n}\n\nglob.hasMagic = function (pattern, options_) {\n var options = extend({}, options_)\n options.noprocess = true\n\n var g = new Glob(pattern, options)\n var set = g.minimatch.set\n\n if (!pattern)\n return false\n\n if (set.length > 1)\n return true\n\n for (var j = 0; j < set[0].length; j++) {\n if (typeof set[0][j] !== 'string')\n return true\n }\n\n return false\n}\n\nglob.Glob = Glob\ninherits(Glob, EE)\nfunction Glob (pattern, options, cb) {\n if (typeof options === 'function') {\n cb = options\n options = null\n }\n\n if (options && options.sync) {\n if (cb)\n throw new TypeError('callback provided to sync glob')\n return new GlobSync(pattern, options)\n }\n\n if (!(this instanceof Glob))\n return new Glob(pattern, options, cb)\n\n setopts(this, pattern, options)\n this._didRealPath = false\n\n // process each pattern in the minimatch set\n var n = this.minimatch.set.length\n\n // The matches are stored as {: true,...} so that\n // duplicates are automagically pruned.\n // Later, we do an Object.keys() on these.\n // Keep them as a list so we can fill in when nonull is set.\n this.matches = new Array(n)\n\n if (typeof cb === 'function') {\n cb = once(cb)\n this.on('error', cb)\n this.on('end', function (matches) {\n cb(null, matches)\n })\n }\n\n var self = this\n this._processing = 0\n\n this._emitQueue = []\n this._processQueue = []\n this.paused = false\n\n if (this.noprocess)\n return this\n\n if (n === 0)\n return done()\n\n var sync = true\n for (var i = 0; i < n; i ++) {\n this._process(this.minimatch.set[i], i, false, done)\n }\n sync = false\n\n function done () {\n --self._processing\n if (self._processing <= 0) {\n if (sync) {\n process.nextTick(function () {\n self._finish()\n })\n } else {\n self._finish()\n }\n }\n }\n}\n\nGlob.prototype._finish = function () {\n assert(this instanceof Glob)\n if (this.aborted)\n return\n\n if (this.realpath && !this._didRealpath)\n return this._realpath()\n\n common.finish(this)\n this.emit('end', this.found)\n}\n\nGlob.prototype._realpath = function () {\n if (this._didRealpath)\n return\n\n this._didRealpath = true\n\n var n = this.matches.length\n if (n === 0)\n return this._finish()\n\n var self = this\n for (var i = 0; i < this.matches.length; i++)\n this._realpathSet(i, next)\n\n function next () {\n if (--n === 0)\n self._finish()\n }\n}\n\nGlob.prototype._realpathSet = function (index, cb) {\n var matchset = this.matches[index]\n if (!matchset)\n return cb()\n\n var found = Object.keys(matchset)\n var self = this\n var n = found.length\n\n if (n === 0)\n return cb()\n\n var set = this.matches[index] = Object.create(null)\n found.forEach(function (p, i) {\n // If there's a problem with the stat, then it means that\n // one or more of the links in the realpath couldn't be\n // resolved. just return the abs value in that case.\n p = self._makeAbs(p)\n rp.realpath(p, self.realpathCache, function (er, real) {\n if (!er)\n set[real] = true\n else if (er.syscall === 'stat')\n set[p] = true\n else\n self.emit('error', er) // srsly wtf right here\n\n if (--n === 0) {\n self.matches[index] = set\n cb()\n }\n })\n })\n}\n\nGlob.prototype._mark = function (p) {\n return common.mark(this, p)\n}\n\nGlob.prototype._makeAbs = function (f) {\n return common.makeAbs(this, f)\n}\n\nGlob.prototype.abort = function () {\n this.aborted = true\n this.emit('abort')\n}\n\nGlob.prototype.pause = function () {\n if (!this.paused) {\n this.paused = true\n this.emit('pause')\n }\n}\n\nGlob.prototype.resume = function () {\n if (this.paused) {\n this.emit('resume')\n this.paused = false\n if (this._emitQueue.length) {\n var eq = this._emitQueue.slice(0)\n this._emitQueue.length = 0\n for (var i = 0; i < eq.length; i ++) {\n var e = eq[i]\n this._emitMatch(e[0], e[1])\n }\n }\n if (this._processQueue.length) {\n var pq = this._processQueue.slice(0)\n this._processQueue.length = 0\n for (var i = 0; i < pq.length; i ++) {\n var p = pq[i]\n this._processing--\n this._process(p[0], p[1], p[2], p[3])\n }\n }\n }\n}\n\nGlob.prototype._process = function (pattern, index, inGlobStar, cb) {\n assert(this instanceof Glob)\n assert(typeof cb === 'function')\n\n if (this.aborted)\n return\n\n this._processing++\n if (this.paused) {\n this._processQueue.push([pattern, index, inGlobStar, cb])\n return\n }\n\n //console.error('PROCESS %d', this._processing, pattern)\n\n // Get the first [n] parts of pattern that are all strings.\n var n = 0\n while (typeof pattern[n] === 'string') {\n n ++\n }\n // now n is the index of the first one that is *not* a string.\n\n // see if there's anything else\n var prefix\n switch (n) {\n // if not, then this is rather simple\n case pattern.length:\n this._processSimple(pattern.join('/'), index, cb)\n return\n\n case 0:\n // pattern *starts* with some non-trivial item.\n // going to readdir(cwd), but not include the prefix in matches.\n prefix = null\n break\n\n default:\n // pattern has some string bits in the front.\n // whatever it starts with, whether that's 'absolute' like /foo/bar,\n // or 'relative' like '../baz'\n prefix = pattern.slice(0, n).join('/')\n break\n }\n\n var remain = pattern.slice(n)\n\n // get the list of entries.\n var read\n if (prefix === null)\n read = '.'\n else if (isAbsolute(prefix) || isAbsolute(pattern.join('/'))) {\n if (!prefix || !isAbsolute(prefix))\n prefix = '/' + prefix\n read = prefix\n } else\n read = prefix\n\n var abs = this._makeAbs(read)\n\n //if ignored, skip _processing\n if (childrenIgnored(this, read))\n return cb()\n\n var isGlobStar = remain[0] === minimatch.GLOBSTAR\n if (isGlobStar)\n this._processGlobStar(prefix, read, abs, remain, index, inGlobStar, cb)\n else\n this._processReaddir(prefix, read, abs, remain, index, inGlobStar, cb)\n}\n\nGlob.prototype._processReaddir = function (prefix, read, abs, remain, index, inGlobStar, cb) {\n var self = this\n this._readdir(abs, inGlobStar, function (er, entries) {\n return self._processReaddir2(prefix, read, abs, remain, index, inGlobStar, entries, cb)\n })\n}\n\nGlob.prototype._processReaddir2 = function (prefix, read, abs, remain, index, inGlobStar, entries, cb) {\n\n // if the abs isn't a dir, then nothing can match!\n if (!entries)\n return cb()\n\n // It will only match dot entries if it starts with a dot, or if\n // dot is set. Stuff like @(.foo|.bar) isn't allowed.\n var pn = remain[0]\n var negate = !!this.minimatch.negate\n var rawGlob = pn._glob\n var dotOk = this.dot || rawGlob.charAt(0) === '.'\n\n var matchedEntries = []\n for (var i = 0; i < entries.length; i++) {\n var e = entries[i]\n if (e.charAt(0) !== '.' || dotOk) {\n var m\n if (negate && !prefix) {\n m = !e.match(pn)\n } else {\n m = e.match(pn)\n }\n if (m)\n matchedEntries.push(e)\n }\n }\n\n //console.error('prd2', prefix, entries, remain[0]._glob, matchedEntries)\n\n var len = matchedEntries.length\n // If there are no matched entries, then nothing matches.\n if (len === 0)\n return cb()\n\n // if this is the last remaining pattern bit, then no need for\n // an additional stat *unless* the user has specified mark or\n // stat explicitly. We know they exist, since readdir returned\n // them.\n\n if (remain.length === 1 && !this.mark && !this.stat) {\n if (!this.matches[index])\n this.matches[index] = Object.create(null)\n\n for (var i = 0; i < len; i ++) {\n var e = matchedEntries[i]\n if (prefix) {\n if (prefix !== '/')\n e = prefix + '/' + e\n else\n e = prefix + e\n }\n\n if (e.charAt(0) === '/' && !this.nomount) {\n e = path.join(this.root, e)\n }\n this._emitMatch(index, e)\n }\n // This was the last one, and no stats were needed\n return cb()\n }\n\n // now test all matched entries as stand-ins for that part\n // of the pattern.\n remain.shift()\n for (var i = 0; i < len; i ++) {\n var e = matchedEntries[i]\n var newPattern\n if (prefix) {\n if (prefix !== '/')\n e = prefix + '/' + e\n else\n e = prefix + e\n }\n this._process([e].concat(remain), index, inGlobStar, cb)\n }\n cb()\n}\n\nGlob.prototype._emitMatch = function (index, e) {\n if (this.aborted)\n return\n\n if (isIgnored(this, e))\n return\n\n if (this.paused) {\n this._emitQueue.push([index, e])\n return\n }\n\n var abs = isAbsolute(e) ? e : this._makeAbs(e)\n\n if (this.mark)\n e = this._mark(e)\n\n if (this.absolute)\n e = abs\n\n if (this.matches[index][e])\n return\n\n if (this.nodir) {\n var c = this.cache[abs]\n if (c === 'DIR' || Array.isArray(c))\n return\n }\n\n this.matches[index][e] = true\n\n var st = this.statCache[abs]\n if (st)\n this.emit('stat', e, st)\n\n this.emit('match', e)\n}\n\nGlob.prototype._readdirInGlobStar = function (abs, cb) {\n if (this.aborted)\n return\n\n // follow all symlinked directories forever\n // just proceed as if this is a non-globstar situation\n if (this.follow)\n return this._readdir(abs, false, cb)\n\n var lstatkey = 'lstat\\0' + abs\n var self = this\n var lstatcb = inflight(lstatkey, lstatcb_)\n\n if (lstatcb)\n fs.lstat(abs, lstatcb)\n\n function lstatcb_ (er, lstat) {\n if (er && er.code === 'ENOENT')\n return cb()\n\n var isSym = lstat && lstat.isSymbolicLink()\n self.symlinks[abs] = isSym\n\n // If it's not a symlink or a dir, then it's definitely a regular file.\n // don't bother doing a readdir in that case.\n if (!isSym && lstat && !lstat.isDirectory()) {\n self.cache[abs] = 'FILE'\n cb()\n } else\n self._readdir(abs, false, cb)\n }\n}\n\nGlob.prototype._readdir = function (abs, inGlobStar, cb) {\n if (this.aborted)\n return\n\n cb = inflight('readdir\\0'+abs+'\\0'+inGlobStar, cb)\n if (!cb)\n return\n\n //console.error('RD %j %j', +inGlobStar, abs)\n if (inGlobStar && !ownProp(this.symlinks, abs))\n return this._readdirInGlobStar(abs, cb)\n\n if (ownProp(this.cache, abs)) {\n var c = this.cache[abs]\n if (!c || c === 'FILE')\n return cb()\n\n if (Array.isArray(c))\n return cb(null, c)\n }\n\n var self = this\n fs.readdir(abs, readdirCb(this, abs, cb))\n}\n\nfunction readdirCb (self, abs, cb) {\n return function (er, entries) {\n if (er)\n self._readdirError(abs, er, cb)\n else\n self._readdirEntries(abs, entries, cb)\n }\n}\n\nGlob.prototype._readdirEntries = function (abs, entries, cb) {\n if (this.aborted)\n return\n\n // if we haven't asked to stat everything, then just\n // assume that everything in there exists, so we can avoid\n // having to stat it a second time.\n if (!this.mark && !this.stat) {\n for (var i = 0; i < entries.length; i ++) {\n var e = entries[i]\n if (abs === '/')\n e = abs + e\n else\n e = abs + '/' + e\n this.cache[e] = true\n }\n }\n\n this.cache[abs] = entries\n return cb(null, entries)\n}\n\nGlob.prototype._readdirError = function (f, er, cb) {\n if (this.aborted)\n return\n\n // handle errors, and cache the information\n switch (er.code) {\n case 'ENOTSUP': // https://github.com/isaacs/node-glob/issues/205\n case 'ENOTDIR': // totally normal. means it *does* exist.\n var abs = this._makeAbs(f)\n this.cache[abs] = 'FILE'\n if (abs === this.cwdAbs) {\n var error = new Error(er.code + ' invalid cwd ' + this.cwd)\n error.path = this.cwd\n error.code = er.code\n this.emit('error', error)\n this.abort()\n }\n break\n\n case 'ENOENT': // not terribly unusual\n case 'ELOOP':\n case 'ENAMETOOLONG':\n case 'UNKNOWN':\n this.cache[this._makeAbs(f)] = false\n break\n\n default: // some unusual error. Treat as failure.\n this.cache[this._makeAbs(f)] = false\n if (this.strict) {\n this.emit('error', er)\n // If the error is handled, then we abort\n // if not, we threw out of here\n this.abort()\n }\n if (!this.silent)\n console.error('glob error', er)\n break\n }\n\n return cb()\n}\n\nGlob.prototype._processGlobStar = function (prefix, read, abs, remain, index, inGlobStar, cb) {\n var self = this\n this._readdir(abs, inGlobStar, function (er, entries) {\n self._processGlobStar2(prefix, read, abs, remain, index, inGlobStar, entries, cb)\n })\n}\n\n\nGlob.prototype._processGlobStar2 = function (prefix, read, abs, remain, index, inGlobStar, entries, cb) {\n //console.error('pgs2', prefix, remain[0], entries)\n\n // no entries means not a dir, so it can never have matches\n // foo.txt/** doesn't match foo.txt\n if (!entries)\n return cb()\n\n // test without the globstar, and with every child both below\n // and replacing the globstar.\n var remainWithoutGlobStar = remain.slice(1)\n var gspref = prefix ? [ prefix ] : []\n var noGlobStar = gspref.concat(remainWithoutGlobStar)\n\n // the noGlobStar pattern exits the inGlobStar state\n this._process(noGlobStar, index, false, cb)\n\n var isSym = this.symlinks[abs]\n var len = entries.length\n\n // If it's a symlink, and we're in a globstar, then stop\n if (isSym && inGlobStar)\n return cb()\n\n for (var i = 0; i < len; i++) {\n var e = entries[i]\n if (e.charAt(0) === '.' && !this.dot)\n continue\n\n // these two cases enter the inGlobStar state\n var instead = gspref.concat(entries[i], remainWithoutGlobStar)\n this._process(instead, index, true, cb)\n\n var below = gspref.concat(entries[i], remain)\n this._process(below, index, true, cb)\n }\n\n cb()\n}\n\nGlob.prototype._processSimple = function (prefix, index, cb) {\n // XXX review this. Shouldn't it be doing the mounting etc\n // before doing stat? kinda weird?\n var self = this\n this._stat(prefix, function (er, exists) {\n self._processSimple2(prefix, index, er, exists, cb)\n })\n}\nGlob.prototype._processSimple2 = function (prefix, index, er, exists, cb) {\n\n //console.error('ps2', prefix, exists)\n\n if (!this.matches[index])\n this.matches[index] = Object.create(null)\n\n // If it doesn't exist, then just mark the lack of results\n if (!exists)\n return cb()\n\n if (prefix && isAbsolute(prefix) && !this.nomount) {\n var trail = /[\\/\\\\]$/.test(prefix)\n if (prefix.charAt(0) === '/') {\n prefix = path.join(this.root, prefix)\n } else {\n prefix = path.resolve(this.root, prefix)\n if (trail)\n prefix += '/'\n }\n }\n\n if (process.platform === 'win32')\n prefix = prefix.replace(/\\\\/g, '/')\n\n // Mark this as a match\n this._emitMatch(index, prefix)\n cb()\n}\n\n// Returns either 'DIR', 'FILE', or false\nGlob.prototype._stat = function (f, cb) {\n var abs = this._makeAbs(f)\n var needDir = f.slice(-1) === '/'\n\n if (f.length > this.maxLength)\n return cb()\n\n if (!this.stat && ownProp(this.cache, abs)) {\n var c = this.cache[abs]\n\n if (Array.isArray(c))\n c = 'DIR'\n\n // It exists, but maybe not how we need it\n if (!needDir || c === 'DIR')\n return cb(null, c)\n\n if (needDir && c === 'FILE')\n return cb()\n\n // otherwise we have to stat, because maybe c=true\n // if we know it exists, but not what it is.\n }\n\n var exists\n var stat = this.statCache[abs]\n if (stat !== undefined) {\n if (stat === false)\n return cb(null, stat)\n else {\n var type = stat.isDirectory() ? 'DIR' : 'FILE'\n if (needDir && type === 'FILE')\n return cb()\n else\n return cb(null, type, stat)\n }\n }\n\n var self = this\n var statcb = inflight('stat\\0' + abs, lstatcb_)\n if (statcb)\n fs.lstat(abs, statcb)\n\n function lstatcb_ (er, lstat) {\n if (lstat && lstat.isSymbolicLink()) {\n // If it's a symlink, then treat it as the target, unless\n // the target does not exist, then treat it as a file.\n return fs.stat(abs, function (er, stat) {\n if (er)\n self._stat2(f, abs, null, lstat, cb)\n else\n self._stat2(f, abs, er, stat, cb)\n })\n } else {\n self._stat2(f, abs, er, lstat, cb)\n }\n }\n}\n\nGlob.prototype._stat2 = function (f, abs, er, stat, cb) {\n if (er && (er.code === 'ENOENT' || er.code === 'ENOTDIR')) {\n this.statCache[abs] = false\n return cb()\n }\n\n var needDir = f.slice(-1) === '/'\n this.statCache[abs] = stat\n\n if (abs.slice(-1) === '/' && stat && !stat.isDirectory())\n return cb(null, false, stat)\n\n var c = true\n if (stat)\n c = stat.isDirectory() ? 'DIR' : 'FILE'\n this.cache[abs] = this.cache[abs] || c\n\n if (needDir && c === 'FILE')\n return cb()\n\n return cb(null, c, stat)\n}\n","module.exports = globSync\nglobSync.GlobSync = GlobSync\n\nvar fs = require('fs')\nvar rp = require('fs.realpath')\nvar minimatch = require('minimatch')\nvar Minimatch = minimatch.Minimatch\nvar Glob = require('./glob.js').Glob\nvar util = require('util')\nvar path = require('path')\nvar assert = require('assert')\nvar isAbsolute = require('path-is-absolute')\nvar common = require('./common.js')\nvar alphasort = common.alphasort\nvar alphasorti = common.alphasorti\nvar setopts = common.setopts\nvar ownProp = common.ownProp\nvar childrenIgnored = common.childrenIgnored\nvar isIgnored = common.isIgnored\n\nfunction globSync (pattern, options) {\n if (typeof options === 'function' || arguments.length === 3)\n throw new TypeError('callback provided to sync glob\\n'+\n 'See: https://github.com/isaacs/node-glob/issues/167')\n\n return new GlobSync(pattern, options).found\n}\n\nfunction GlobSync (pattern, options) {\n if (!pattern)\n throw new Error('must provide pattern')\n\n if (typeof options === 'function' || arguments.length === 3)\n throw new TypeError('callback provided to sync glob\\n'+\n 'See: https://github.com/isaacs/node-glob/issues/167')\n\n if (!(this instanceof GlobSync))\n return new GlobSync(pattern, options)\n\n setopts(this, pattern, options)\n\n if (this.noprocess)\n return this\n\n var n = this.minimatch.set.length\n this.matches = new Array(n)\n for (var i = 0; i < n; i ++) {\n this._process(this.minimatch.set[i], i, false)\n }\n this._finish()\n}\n\nGlobSync.prototype._finish = function () {\n assert(this instanceof GlobSync)\n if (this.realpath) {\n var self = this\n this.matches.forEach(function (matchset, index) {\n var set = self.matches[index] = Object.create(null)\n for (var p in matchset) {\n try {\n p = self._makeAbs(p)\n var real = rp.realpathSync(p, self.realpathCache)\n set[real] = true\n } catch (er) {\n if (er.syscall === 'stat')\n set[self._makeAbs(p)] = true\n else\n throw er\n }\n }\n })\n }\n common.finish(this)\n}\n\n\nGlobSync.prototype._process = function (pattern, index, inGlobStar) {\n assert(this instanceof GlobSync)\n\n // Get the first [n] parts of pattern that are all strings.\n var n = 0\n while (typeof pattern[n] === 'string') {\n n ++\n }\n // now n is the index of the first one that is *not* a string.\n\n // See if there's anything else\n var prefix\n switch (n) {\n // if not, then this is rather simple\n case pattern.length:\n this._processSimple(pattern.join('/'), index)\n return\n\n case 0:\n // pattern *starts* with some non-trivial item.\n // going to readdir(cwd), but not include the prefix in matches.\n prefix = null\n break\n\n default:\n // pattern has some string bits in the front.\n // whatever it starts with, whether that's 'absolute' like /foo/bar,\n // or 'relative' like '../baz'\n prefix = pattern.slice(0, n).join('/')\n break\n }\n\n var remain = pattern.slice(n)\n\n // get the list of entries.\n var read\n if (prefix === null)\n read = '.'\n else if (isAbsolute(prefix) || isAbsolute(pattern.join('/'))) {\n if (!prefix || !isAbsolute(prefix))\n prefix = '/' + prefix\n read = prefix\n } else\n read = prefix\n\n var abs = this._makeAbs(read)\n\n //if ignored, skip processing\n if (childrenIgnored(this, read))\n return\n\n var isGlobStar = remain[0] === minimatch.GLOBSTAR\n if (isGlobStar)\n this._processGlobStar(prefix, read, abs, remain, index, inGlobStar)\n else\n this._processReaddir(prefix, read, abs, remain, index, inGlobStar)\n}\n\n\nGlobSync.prototype._processReaddir = function (prefix, read, abs, remain, index, inGlobStar) {\n var entries = this._readdir(abs, inGlobStar)\n\n // if the abs isn't a dir, then nothing can match!\n if (!entries)\n return\n\n // It will only match dot entries if it starts with a dot, or if\n // dot is set. Stuff like @(.foo|.bar) isn't allowed.\n var pn = remain[0]\n var negate = !!this.minimatch.negate\n var rawGlob = pn._glob\n var dotOk = this.dot || rawGlob.charAt(0) === '.'\n\n var matchedEntries = []\n for (var i = 0; i < entries.length; i++) {\n var e = entries[i]\n if (e.charAt(0) !== '.' || dotOk) {\n var m\n if (negate && !prefix) {\n m = !e.match(pn)\n } else {\n m = e.match(pn)\n }\n if (m)\n matchedEntries.push(e)\n }\n }\n\n var len = matchedEntries.length\n // If there are no matched entries, then nothing matches.\n if (len === 0)\n return\n\n // if this is the last remaining pattern bit, then no need for\n // an additional stat *unless* the user has specified mark or\n // stat explicitly. We know they exist, since readdir returned\n // them.\n\n if (remain.length === 1 && !this.mark && !this.stat) {\n if (!this.matches[index])\n this.matches[index] = Object.create(null)\n\n for (var i = 0; i < len; i ++) {\n var e = matchedEntries[i]\n if (prefix) {\n if (prefix.slice(-1) !== '/')\n e = prefix + '/' + e\n else\n e = prefix + e\n }\n\n if (e.charAt(0) === '/' && !this.nomount) {\n e = path.join(this.root, e)\n }\n this._emitMatch(index, e)\n }\n // This was the last one, and no stats were needed\n return\n }\n\n // now test all matched entries as stand-ins for that part\n // of the pattern.\n remain.shift()\n for (var i = 0; i < len; i ++) {\n var e = matchedEntries[i]\n var newPattern\n if (prefix)\n newPattern = [prefix, e]\n else\n newPattern = [e]\n this._process(newPattern.concat(remain), index, inGlobStar)\n }\n}\n\n\nGlobSync.prototype._emitMatch = function (index, e) {\n if (isIgnored(this, e))\n return\n\n var abs = this._makeAbs(e)\n\n if (this.mark)\n e = this._mark(e)\n\n if (this.absolute) {\n e = abs\n }\n\n if (this.matches[index][e])\n return\n\n if (this.nodir) {\n var c = this.cache[abs]\n if (c === 'DIR' || Array.isArray(c))\n return\n }\n\n this.matches[index][e] = true\n\n if (this.stat)\n this._stat(e)\n}\n\n\nGlobSync.prototype._readdirInGlobStar = function (abs) {\n // follow all symlinked directories forever\n // just proceed as if this is a non-globstar situation\n if (this.follow)\n return this._readdir(abs, false)\n\n var entries\n var lstat\n var stat\n try {\n lstat = fs.lstatSync(abs)\n } catch (er) {\n if (er.code === 'ENOENT') {\n // lstat failed, doesn't exist\n return null\n }\n }\n\n var isSym = lstat && lstat.isSymbolicLink()\n this.symlinks[abs] = isSym\n\n // If it's not a symlink or a dir, then it's definitely a regular file.\n // don't bother doing a readdir in that case.\n if (!isSym && lstat && !lstat.isDirectory())\n this.cache[abs] = 'FILE'\n else\n entries = this._readdir(abs, false)\n\n return entries\n}\n\nGlobSync.prototype._readdir = function (abs, inGlobStar) {\n var entries\n\n if (inGlobStar && !ownProp(this.symlinks, abs))\n return this._readdirInGlobStar(abs)\n\n if (ownProp(this.cache, abs)) {\n var c = this.cache[abs]\n if (!c || c === 'FILE')\n return null\n\n if (Array.isArray(c))\n return c\n }\n\n try {\n return this._readdirEntries(abs, fs.readdirSync(abs))\n } catch (er) {\n this._readdirError(abs, er)\n return null\n }\n}\n\nGlobSync.prototype._readdirEntries = function (abs, entries) {\n // if we haven't asked to stat everything, then just\n // assume that everything in there exists, so we can avoid\n // having to stat it a second time.\n if (!this.mark && !this.stat) {\n for (var i = 0; i < entries.length; i ++) {\n var e = entries[i]\n if (abs === '/')\n e = abs + e\n else\n e = abs + '/' + e\n this.cache[e] = true\n }\n }\n\n this.cache[abs] = entries\n\n // mark and cache dir-ness\n return entries\n}\n\nGlobSync.prototype._readdirError = function (f, er) {\n // handle errors, and cache the information\n switch (er.code) {\n case 'ENOTSUP': // https://github.com/isaacs/node-glob/issues/205\n case 'ENOTDIR': // totally normal. means it *does* exist.\n var abs = this._makeAbs(f)\n this.cache[abs] = 'FILE'\n if (abs === this.cwdAbs) {\n var error = new Error(er.code + ' invalid cwd ' + this.cwd)\n error.path = this.cwd\n error.code = er.code\n throw error\n }\n break\n\n case 'ENOENT': // not terribly unusual\n case 'ELOOP':\n case 'ENAMETOOLONG':\n case 'UNKNOWN':\n this.cache[this._makeAbs(f)] = false\n break\n\n default: // some unusual error. Treat as failure.\n this.cache[this._makeAbs(f)] = false\n if (this.strict)\n throw er\n if (!this.silent)\n console.error('glob error', er)\n break\n }\n}\n\nGlobSync.prototype._processGlobStar = function (prefix, read, abs, remain, index, inGlobStar) {\n\n var entries = this._readdir(abs, inGlobStar)\n\n // no entries means not a dir, so it can never have matches\n // foo.txt/** doesn't match foo.txt\n if (!entries)\n return\n\n // test without the globstar, and with every child both below\n // and replacing the globstar.\n var remainWithoutGlobStar = remain.slice(1)\n var gspref = prefix ? [ prefix ] : []\n var noGlobStar = gspref.concat(remainWithoutGlobStar)\n\n // the noGlobStar pattern exits the inGlobStar state\n this._process(noGlobStar, index, false)\n\n var len = entries.length\n var isSym = this.symlinks[abs]\n\n // If it's a symlink, and we're in a globstar, then stop\n if (isSym && inGlobStar)\n return\n\n for (var i = 0; i < len; i++) {\n var e = entries[i]\n if (e.charAt(0) === '.' && !this.dot)\n continue\n\n // these two cases enter the inGlobStar state\n var instead = gspref.concat(entries[i], remainWithoutGlobStar)\n this._process(instead, index, true)\n\n var below = gspref.concat(entries[i], remain)\n this._process(below, index, true)\n }\n}\n\nGlobSync.prototype._processSimple = function (prefix, index) {\n // XXX review this. Shouldn't it be doing the mounting etc\n // before doing stat? kinda weird?\n var exists = this._stat(prefix)\n\n if (!this.matches[index])\n this.matches[index] = Object.create(null)\n\n // If it doesn't exist, then just mark the lack of results\n if (!exists)\n return\n\n if (prefix && isAbsolute(prefix) && !this.nomount) {\n var trail = /[\\/\\\\]$/.test(prefix)\n if (prefix.charAt(0) === '/') {\n prefix = path.join(this.root, prefix)\n } else {\n prefix = path.resolve(this.root, prefix)\n if (trail)\n prefix += '/'\n }\n }\n\n if (process.platform === 'win32')\n prefix = prefix.replace(/\\\\/g, '/')\n\n // Mark this as a match\n this._emitMatch(index, prefix)\n}\n\n// Returns either 'DIR', 'FILE', or false\nGlobSync.prototype._stat = function (f) {\n var abs = this._makeAbs(f)\n var needDir = f.slice(-1) === '/'\n\n if (f.length > this.maxLength)\n return false\n\n if (!this.stat && ownProp(this.cache, abs)) {\n var c = this.cache[abs]\n\n if (Array.isArray(c))\n c = 'DIR'\n\n // It exists, but maybe not how we need it\n if (!needDir || c === 'DIR')\n return c\n\n if (needDir && c === 'FILE')\n return false\n\n // otherwise we have to stat, because maybe c=true\n // if we know it exists, but not what it is.\n }\n\n var exists\n var stat = this.statCache[abs]\n if (!stat) {\n var lstat\n try {\n lstat = fs.lstatSync(abs)\n } catch (er) {\n if (er && (er.code === 'ENOENT' || er.code === 'ENOTDIR')) {\n this.statCache[abs] = false\n return false\n }\n }\n\n if (lstat && lstat.isSymbolicLink()) {\n try {\n stat = fs.statSync(abs)\n } catch (er) {\n stat = lstat\n }\n } else {\n stat = lstat\n }\n }\n\n this.statCache[abs] = stat\n\n var c = true\n if (stat)\n c = stat.isDirectory() ? 'DIR' : 'FILE'\n\n this.cache[abs] = this.cache[abs] || c\n\n if (needDir && c === 'FILE')\n return false\n\n return c\n}\n\nGlobSync.prototype._mark = function (p) {\n return common.mark(this, p)\n}\n\nGlobSync.prototype._makeAbs = function (f) {\n return common.makeAbs(this, f)\n}\n","'use strict';\n\nclass CancelError extends Error {\n\tconstructor(reason) {\n\t\tsuper(reason || 'Promise was canceled');\n\t\tthis.name = 'CancelError';\n\t}\n\n\tget isCanceled() {\n\t\treturn true;\n\t}\n}\n\nclass PCancelable {\n\tstatic fn(userFn) {\n\t\treturn (...args) => {\n\t\t\treturn new PCancelable((resolve, reject, onCancel) => {\n\t\t\t\targs.push(onCancel);\n\t\t\t\tuserFn(...args).then(resolve, reject);\n\t\t\t});\n\t\t};\n\t}\n\n\tconstructor(executor) {\n\t\tthis._cancelHandlers = [];\n\t\tthis._isPending = true;\n\t\tthis._isCanceled = false;\n\t\tthis._rejectOnCancel = true;\n\n\t\tthis._promise = new Promise((resolve, reject) => {\n\t\t\tthis._reject = reject;\n\n\t\t\tconst onResolve = value => {\n\t\t\t\tthis._isPending = false;\n\t\t\t\tresolve(value);\n\t\t\t};\n\n\t\t\tconst onReject = error => {\n\t\t\t\tthis._isPending = false;\n\t\t\t\treject(error);\n\t\t\t};\n\n\t\t\tconst onCancel = handler => {\n\t\t\t\tthis._cancelHandlers.push(handler);\n\t\t\t};\n\n\t\t\tObject.defineProperties(onCancel, {\n\t\t\t\tshouldReject: {\n\t\t\t\t\tget: () => this._rejectOnCancel,\n\t\t\t\t\tset: bool => {\n\t\t\t\t\t\tthis._rejectOnCancel = bool;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t});\n\n\t\t\treturn executor(onResolve, onReject, onCancel);\n\t\t});\n\t}\n\n\tthen(onFulfilled, onRejected) {\n\t\treturn this._promise.then(onFulfilled, onRejected);\n\t}\n\n\tcatch(onRejected) {\n\t\treturn this._promise.catch(onRejected);\n\t}\n\n\tfinally(onFinally) {\n\t\treturn this._promise.finally(onFinally);\n\t}\n\n\tcancel(reason) {\n\t\tif (!this._isPending || this._isCanceled) {\n\t\t\treturn;\n\t\t}\n\n\t\tif (this._cancelHandlers.length > 0) {\n\t\t\ttry {\n\t\t\t\tfor (const handler of this._cancelHandlers) {\n\t\t\t\t\thandler();\n\t\t\t\t}\n\t\t\t} catch (error) {\n\t\t\t\tthis._reject(error);\n\t\t\t}\n\t\t}\n\n\t\tthis._isCanceled = true;\n\t\tif (this._rejectOnCancel) {\n\t\t\tthis._reject(new CancelError(reason));\n\t\t}\n\t}\n\n\tget isCanceled() {\n\t\treturn this._isCanceled;\n\t}\n}\n\nObject.setPrototypeOf(PCancelable.prototype, Promise.prototype);\n\nmodule.exports = PCancelable;\nmodule.exports.default = PCancelable;\n\nmodule.exports.CancelError = CancelError;\n","'use strict';\nconst EventEmitter = require('events');\nconst getStream = require('get-stream');\nconst is = require('@sindresorhus/is');\nconst PCancelable = require('p-cancelable');\nconst requestAsEventEmitter = require('./request-as-event-emitter');\nconst {HTTPError, ParseError, ReadError} = require('./errors');\nconst {options: mergeOptions} = require('./merge');\nconst {reNormalize} = require('./normalize-arguments');\n\nconst asPromise = options => {\n\tconst proxy = new EventEmitter();\n\n\tconst promise = new PCancelable((resolve, reject, onCancel) => {\n\t\tconst emitter = requestAsEventEmitter(options);\n\n\t\tonCancel(emitter.abort);\n\n\t\temitter.on('response', async response => {\n\t\t\tproxy.emit('response', response);\n\n\t\t\tconst stream = is.null(options.encoding) ? getStream.buffer(response) : getStream(response, options);\n\n\t\t\tlet data;\n\t\t\ttry {\n\t\t\t\tdata = await stream;\n\t\t\t} catch (error) {\n\t\t\t\treject(new ReadError(error, options));\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst limitStatusCode = options.followRedirect ? 299 : 399;\n\n\t\t\tresponse.body = data;\n\n\t\t\ttry {\n\t\t\t\tfor (const [index, hook] of Object.entries(options.hooks.afterResponse)) {\n\t\t\t\t\t// eslint-disable-next-line no-await-in-loop\n\t\t\t\t\tresponse = await hook(response, updatedOptions => {\n\t\t\t\t\t\tupdatedOptions = reNormalize(mergeOptions(options, {\n\t\t\t\t\t\t\t...updatedOptions,\n\t\t\t\t\t\t\tretry: 0,\n\t\t\t\t\t\t\tthrowHttpErrors: false\n\t\t\t\t\t\t}));\n\n\t\t\t\t\t\t// Remove any further hooks for that request, because we we'll call them anyway.\n\t\t\t\t\t\t// The loop continues. We don't want duplicates (asPromise recursion).\n\t\t\t\t\t\tupdatedOptions.hooks.afterResponse = options.hooks.afterResponse.slice(0, index);\n\n\t\t\t\t\t\treturn asPromise(updatedOptions);\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t} catch (error) {\n\t\t\t\treject(error);\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst {statusCode} = response;\n\n\t\t\tif (options.json && response.body) {\n\t\t\t\ttry {\n\t\t\t\t\tresponse.body = JSON.parse(response.body);\n\t\t\t\t} catch (error) {\n\t\t\t\t\tif (statusCode >= 200 && statusCode < 300) {\n\t\t\t\t\t\tconst parseError = new ParseError(error, statusCode, options, data);\n\t\t\t\t\t\tObject.defineProperty(parseError, 'response', {value: response});\n\t\t\t\t\t\treject(parseError);\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (statusCode !== 304 && (statusCode < 200 || statusCode > limitStatusCode)) {\n\t\t\t\tconst error = new HTTPError(response, options);\n\t\t\t\tObject.defineProperty(error, 'response', {value: response});\n\t\t\t\tif (emitter.retry(error) === false) {\n\t\t\t\t\tif (options.throwHttpErrors) {\n\t\t\t\t\t\treject(error);\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\n\t\t\t\t\tresolve(response);\n\t\t\t\t}\n\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tresolve(response);\n\t\t});\n\n\t\temitter.once('error', reject);\n\t\t[\n\t\t\t'request',\n\t\t\t'redirect',\n\t\t\t'uploadProgress',\n\t\t\t'downloadProgress'\n\t\t].forEach(event => emitter.on(event, (...args) => proxy.emit(event, ...args)));\n\t});\n\n\tpromise.on = (name, fn) => {\n\t\tproxy.on(name, fn);\n\t\treturn promise;\n\t};\n\n\treturn promise;\n};\n\nmodule.exports = asPromise;\n","'use strict';\nconst {PassThrough} = require('stream');\nconst duplexer3 = require('duplexer3');\nconst requestAsEventEmitter = require('./request-as-event-emitter');\nconst {HTTPError, ReadError} = require('./errors');\n\nmodule.exports = options => {\n\tconst input = new PassThrough();\n\tconst output = new PassThrough();\n\tconst proxy = duplexer3(input, output);\n\tconst piped = new Set();\n\tlet isFinished = false;\n\n\toptions.retry.retries = () => 0;\n\n\tif (options.body) {\n\t\tproxy.write = () => {\n\t\t\tthrow new Error('Got\\'s stream is not writable when the `body` option is used');\n\t\t};\n\t}\n\n\tconst emitter = requestAsEventEmitter(options, input);\n\n\t// Cancels the request\n\tproxy._destroy = emitter.abort;\n\n\temitter.on('response', response => {\n\t\tconst {statusCode} = response;\n\n\t\tresponse.on('error', error => {\n\t\t\tproxy.emit('error', new ReadError(error, options));\n\t\t});\n\n\t\tif (options.throwHttpErrors && statusCode !== 304 && (statusCode < 200 || statusCode > 299)) {\n\t\t\tproxy.emit('error', new HTTPError(response, options), null, response);\n\t\t\treturn;\n\t\t}\n\n\t\tisFinished = true;\n\n\t\tresponse.pipe(output);\n\n\t\tfor (const destination of piped) {\n\t\t\tif (destination.headersSent) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tfor (const [key, value] of Object.entries(response.headers)) {\n\t\t\t\t// Got gives *decompressed* data. Overriding `content-encoding` header would result in an error.\n\t\t\t\t// It's not possible to decompress already decompressed data, is it?\n\t\t\t\tconst allowed = options.decompress ? key !== 'content-encoding' : true;\n\t\t\t\tif (allowed) {\n\t\t\t\t\tdestination.setHeader(key, value);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tdestination.statusCode = response.statusCode;\n\t\t}\n\n\t\tproxy.emit('response', response);\n\t});\n\n\t[\n\t\t'error',\n\t\t'request',\n\t\t'redirect',\n\t\t'uploadProgress',\n\t\t'downloadProgress'\n\t].forEach(event => emitter.on(event, (...args) => proxy.emit(event, ...args)));\n\n\tconst pipe = proxy.pipe.bind(proxy);\n\tconst unpipe = proxy.unpipe.bind(proxy);\n\tproxy.pipe = (destination, options) => {\n\t\tif (isFinished) {\n\t\t\tthrow new Error('Failed to pipe. The response has been emitted already.');\n\t\t}\n\n\t\tconst result = pipe(destination, options);\n\n\t\tif (Reflect.has(destination, 'setHeader')) {\n\t\t\tpiped.add(destination);\n\t\t}\n\n\t\treturn result;\n\t};\n\n\tproxy.unpipe = stream => {\n\t\tpiped.delete(stream);\n\t\treturn unpipe(stream);\n\t};\n\n\treturn proxy;\n};\n","'use strict';\nconst errors = require('./errors');\nconst asStream = require('./as-stream');\nconst asPromise = require('./as-promise');\nconst normalizeArguments = require('./normalize-arguments');\nconst merge = require('./merge');\nconst deepFreeze = require('./utils/deep-freeze');\n\nconst getPromiseOrStream = options => options.stream ? asStream(options) : asPromise(options);\n\nconst aliases = [\n\t'get',\n\t'post',\n\t'put',\n\t'patch',\n\t'head',\n\t'delete'\n];\n\nconst create = defaults => {\n\tdefaults = merge({}, defaults);\n\tnormalizeArguments.preNormalize(defaults.options);\n\n\tif (!defaults.handler) {\n\t\t// This can't be getPromiseOrStream, because when merging\n\t\t// the chain would stop at this point and no further handlers would be called.\n\t\tdefaults.handler = (options, next) => next(options);\n\t}\n\n\tfunction got(url, options) {\n\t\ttry {\n\t\t\treturn defaults.handler(normalizeArguments(url, options, defaults), getPromiseOrStream);\n\t\t} catch (error) {\n\t\t\tif (options && options.stream) {\n\t\t\t\tthrow error;\n\t\t\t} else {\n\t\t\t\treturn Promise.reject(error);\n\t\t\t}\n\t\t}\n\t}\n\n\tgot.create = create;\n\tgot.extend = options => {\n\t\tlet mutableDefaults;\n\t\tif (options && Reflect.has(options, 'mutableDefaults')) {\n\t\t\tmutableDefaults = options.mutableDefaults;\n\t\t\tdelete options.mutableDefaults;\n\t\t} else {\n\t\t\tmutableDefaults = defaults.mutableDefaults;\n\t\t}\n\n\t\treturn create({\n\t\t\toptions: merge.options(defaults.options, options),\n\t\t\thandler: defaults.handler,\n\t\t\tmutableDefaults\n\t\t});\n\t};\n\n\tgot.mergeInstances = (...args) => create(merge.instances(args));\n\n\tgot.stream = (url, options) => got(url, {...options, stream: true});\n\n\tfor (const method of aliases) {\n\t\tgot[method] = (url, options) => got(url, {...options, method});\n\t\tgot.stream[method] = (url, options) => got.stream(url, {...options, method});\n\t}\n\n\tObject.assign(got, {...errors, mergeOptions: merge.options});\n\tObject.defineProperty(got, 'defaults', {\n\t\tvalue: defaults.mutableDefaults ? defaults : deepFreeze(defaults),\n\t\twritable: defaults.mutableDefaults,\n\t\tconfigurable: defaults.mutableDefaults,\n\t\tenumerable: true\n\t});\n\n\treturn got;\n};\n\nmodule.exports = create;\n","'use strict';\nconst urlLib = require('url');\nconst http = require('http');\nconst PCancelable = require('p-cancelable');\nconst is = require('@sindresorhus/is');\n\nclass GotError extends Error {\n\tconstructor(message, error, options) {\n\t\tsuper(message);\n\t\tError.captureStackTrace(this, this.constructor);\n\t\tthis.name = 'GotError';\n\n\t\tif (!is.undefined(error.code)) {\n\t\t\tthis.code = error.code;\n\t\t}\n\n\t\tObject.assign(this, {\n\t\t\thost: options.host,\n\t\t\thostname: options.hostname,\n\t\t\tmethod: options.method,\n\t\t\tpath: options.path,\n\t\t\tsocketPath: options.socketPath,\n\t\t\tprotocol: options.protocol,\n\t\t\turl: options.href,\n\t\t\tgotOptions: options\n\t\t});\n\t}\n}\n\nmodule.exports.GotError = GotError;\n\nmodule.exports.CacheError = class extends GotError {\n\tconstructor(error, options) {\n\t\tsuper(error.message, error, options);\n\t\tthis.name = 'CacheError';\n\t}\n};\n\nmodule.exports.RequestError = class extends GotError {\n\tconstructor(error, options) {\n\t\tsuper(error.message, error, options);\n\t\tthis.name = 'RequestError';\n\t}\n};\n\nmodule.exports.ReadError = class extends GotError {\n\tconstructor(error, options) {\n\t\tsuper(error.message, error, options);\n\t\tthis.name = 'ReadError';\n\t}\n};\n\nmodule.exports.ParseError = class extends GotError {\n\tconstructor(error, statusCode, options, data) {\n\t\tsuper(`${error.message} in \"${urlLib.format(options)}\": \\n${data.slice(0, 77)}...`, error, options);\n\t\tthis.name = 'ParseError';\n\t\tthis.statusCode = statusCode;\n\t\tthis.statusMessage = http.STATUS_CODES[this.statusCode];\n\t}\n};\n\nmodule.exports.HTTPError = class extends GotError {\n\tconstructor(response, options) {\n\t\tconst {statusCode} = response;\n\t\tlet {statusMessage} = response;\n\n\t\tif (statusMessage) {\n\t\t\tstatusMessage = statusMessage.replace(/\\r?\\n/g, ' ').trim();\n\t\t} else {\n\t\t\tstatusMessage = http.STATUS_CODES[statusCode];\n\t\t}\n\n\t\tsuper(`Response code ${statusCode} (${statusMessage})`, {}, options);\n\t\tthis.name = 'HTTPError';\n\t\tthis.statusCode = statusCode;\n\t\tthis.statusMessage = statusMessage;\n\t\tthis.headers = response.headers;\n\t\tthis.body = response.body;\n\t}\n};\n\nmodule.exports.MaxRedirectsError = class extends GotError {\n\tconstructor(statusCode, redirectUrls, options) {\n\t\tsuper('Redirected 10 times. Aborting.', {}, options);\n\t\tthis.name = 'MaxRedirectsError';\n\t\tthis.statusCode = statusCode;\n\t\tthis.statusMessage = http.STATUS_CODES[this.statusCode];\n\t\tthis.redirectUrls = redirectUrls;\n\t}\n};\n\nmodule.exports.UnsupportedProtocolError = class extends GotError {\n\tconstructor(options) {\n\t\tsuper(`Unsupported protocol \"${options.protocol}\"`, {}, options);\n\t\tthis.name = 'UnsupportedProtocolError';\n\t}\n};\n\nmodule.exports.TimeoutError = class extends GotError {\n\tconstructor(error, options) {\n\t\tsuper(error.message, {code: 'ETIMEDOUT'}, options);\n\t\tthis.name = 'TimeoutError';\n\t\tthis.event = error.event;\n\t}\n};\n\nmodule.exports.CancelError = PCancelable.CancelError;\n","'use strict';\nconst decompressResponse = require('decompress-response');\nconst is = require('@sindresorhus/is');\nconst mimicResponse = require('mimic-response');\nconst progress = require('./progress');\n\nmodule.exports = (response, options, emitter) => {\n\tconst downloadBodySize = Number(response.headers['content-length']) || null;\n\n\tconst progressStream = progress.download(response, emitter, downloadBodySize);\n\n\tmimicResponse(response, progressStream);\n\n\tconst newResponse = options.decompress === true &&\n\t\tis.function(decompressResponse) &&\n\t\toptions.method !== 'HEAD' ? decompressResponse(progressStream) : progressStream;\n\n\tif (!options.decompress && ['gzip', 'deflate'].includes(response.headers['content-encoding'])) {\n\t\toptions.encoding = null;\n\t}\n\n\temitter.emit('response', newResponse);\n\n\temitter.emit('downloadProgress', {\n\t\tpercent: 0,\n\t\ttransferred: 0,\n\t\ttotal: downloadBodySize\n\t});\n\n\tresponse.pipe(progressStream);\n};\n","'use strict';\nconst pkg = require('../package.json');\nconst create = require('./create');\n\nconst defaults = {\n\toptions: {\n\t\tretry: {\n\t\t\tretries: 2,\n\t\t\tmethods: [\n\t\t\t\t'GET',\n\t\t\t\t'PUT',\n\t\t\t\t'HEAD',\n\t\t\t\t'DELETE',\n\t\t\t\t'OPTIONS',\n\t\t\t\t'TRACE'\n\t\t\t],\n\t\t\tstatusCodes: [\n\t\t\t\t408,\n\t\t\t\t413,\n\t\t\t\t429,\n\t\t\t\t500,\n\t\t\t\t502,\n\t\t\t\t503,\n\t\t\t\t504\n\t\t\t],\n\t\t\terrorCodes: [\n\t\t\t\t'ETIMEDOUT',\n\t\t\t\t'ECONNRESET',\n\t\t\t\t'EADDRINUSE',\n\t\t\t\t'ECONNREFUSED',\n\t\t\t\t'EPIPE',\n\t\t\t\t'ENOTFOUND',\n\t\t\t\t'ENETUNREACH',\n\t\t\t\t'EAI_AGAIN'\n\t\t\t]\n\t\t},\n\t\theaders: {\n\t\t\t'user-agent': `${pkg.name}/${pkg.version} (https://github.com/sindresorhus/got)`\n\t\t},\n\t\thooks: {\n\t\t\tbeforeRequest: [],\n\t\t\tbeforeRedirect: [],\n\t\t\tbeforeRetry: [],\n\t\t\tafterResponse: []\n\t\t},\n\t\tdecompress: true,\n\t\tthrowHttpErrors: true,\n\t\tfollowRedirect: true,\n\t\tstream: false,\n\t\tform: false,\n\t\tjson: false,\n\t\tcache: false,\n\t\tuseElectronNet: false\n\t},\n\tmutableDefaults: false\n};\n\nconst got = create(defaults);\n\nmodule.exports = got;\n","'use strict';\n\nmodule.exports = [\n\t'beforeError',\n\t'init',\n\t'beforeRequest',\n\t'beforeRedirect',\n\t'beforeRetry',\n\t'afterResponse'\n];\n","'use strict';\nconst {URL} = require('url');\nconst is = require('@sindresorhus/is');\nconst knownHookEvents = require('./known-hook-events');\n\nconst merge = (target, ...sources) => {\n\tfor (const source of sources) {\n\t\tfor (const [key, sourceValue] of Object.entries(source)) {\n\t\t\tif (is.undefined(sourceValue)) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tconst targetValue = target[key];\n\t\t\tif (is.urlInstance(targetValue) && (is.urlInstance(sourceValue) || is.string(sourceValue))) {\n\t\t\t\ttarget[key] = new URL(sourceValue, targetValue);\n\t\t\t} else if (is.plainObject(sourceValue)) {\n\t\t\t\tif (is.plainObject(targetValue)) {\n\t\t\t\t\ttarget[key] = merge({}, targetValue, sourceValue);\n\t\t\t\t} else {\n\t\t\t\t\ttarget[key] = merge({}, sourceValue);\n\t\t\t\t}\n\t\t\t} else if (is.array(sourceValue)) {\n\t\t\t\ttarget[key] = merge([], sourceValue);\n\t\t\t} else {\n\t\t\t\ttarget[key] = sourceValue;\n\t\t\t}\n\t\t}\n\t}\n\n\treturn target;\n};\n\nconst mergeOptions = (...sources) => {\n\tsources = sources.map(source => source || {});\n\tconst merged = merge({}, ...sources);\n\n\tconst hooks = {};\n\tfor (const hook of knownHookEvents) {\n\t\thooks[hook] = [];\n\t}\n\n\tfor (const source of sources) {\n\t\tif (source.hooks) {\n\t\t\tfor (const hook of knownHookEvents) {\n\t\t\t\thooks[hook] = hooks[hook].concat(source.hooks[hook]);\n\t\t\t}\n\t\t}\n\t}\n\n\tmerged.hooks = hooks;\n\n\treturn merged;\n};\n\nconst mergeInstances = (instances, methods) => {\n\tconst handlers = instances.map(instance => instance.defaults.handler);\n\tconst size = instances.length - 1;\n\n\treturn {\n\t\tmethods,\n\t\toptions: mergeOptions(...instances.map(instance => instance.defaults.options)),\n\t\thandler: (options, next) => {\n\t\t\tlet iteration = -1;\n\t\t\tconst iterate = options => handlers[++iteration](options, iteration === size ? next : iterate);\n\n\t\t\treturn iterate(options);\n\t\t}\n\t};\n};\n\nmodule.exports = merge;\nmodule.exports.options = mergeOptions;\nmodule.exports.instances = mergeInstances;\n","'use strict';\nconst {URL, URLSearchParams} = require('url'); // TODO: Use the `URL` global when targeting Node.js 10\nconst urlLib = require('url');\nconst is = require('@sindresorhus/is');\nconst urlParseLax = require('url-parse-lax');\nconst lowercaseKeys = require('lowercase-keys');\nconst urlToOptions = require('./utils/url-to-options');\nconst isFormData = require('./utils/is-form-data');\nconst merge = require('./merge');\nconst knownHookEvents = require('./known-hook-events');\n\nconst retryAfterStatusCodes = new Set([413, 429, 503]);\n\n// `preNormalize` handles static options (e.g. headers).\n// For example, when you create a custom instance and make a request\n// with no static changes, they won't be normalized again.\n//\n// `normalize` operates on dynamic options - they cannot be saved.\n// For example, `body` is everytime different per request.\n// When it's done normalizing the new options, it performs merge()\n// on the prenormalized options and the normalized ones.\n\nconst preNormalize = (options, defaults) => {\n\tif (is.nullOrUndefined(options.headers)) {\n\t\toptions.headers = {};\n\t} else {\n\t\toptions.headers = lowercaseKeys(options.headers);\n\t}\n\n\tif (options.baseUrl && !options.baseUrl.toString().endsWith('/')) {\n\t\toptions.baseUrl += '/';\n\t}\n\n\tif (options.stream) {\n\t\toptions.json = false;\n\t}\n\n\tif (is.nullOrUndefined(options.hooks)) {\n\t\toptions.hooks = {};\n\t} else if (!is.object(options.hooks)) {\n\t\tthrow new TypeError(`Parameter \\`hooks\\` must be an object, not ${is(options.hooks)}`);\n\t}\n\n\tfor (const event of knownHookEvents) {\n\t\tif (is.nullOrUndefined(options.hooks[event])) {\n\t\t\tif (defaults) {\n\t\t\t\toptions.hooks[event] = [...defaults.hooks[event]];\n\t\t\t} else {\n\t\t\t\toptions.hooks[event] = [];\n\t\t\t}\n\t\t}\n\t}\n\n\tif (is.number(options.timeout)) {\n\t\toptions.gotTimeout = {request: options.timeout};\n\t} else if (is.object(options.timeout)) {\n\t\toptions.gotTimeout = options.timeout;\n\t}\n\n\tdelete options.timeout;\n\n\tconst {retry} = options;\n\toptions.retry = {\n\t\tretries: 0,\n\t\tmethods: [],\n\t\tstatusCodes: [],\n\t\terrorCodes: []\n\t};\n\n\tif (is.nonEmptyObject(defaults) && retry !== false) {\n\t\toptions.retry = {...defaults.retry};\n\t}\n\n\tif (retry !== false) {\n\t\tif (is.number(retry)) {\n\t\t\toptions.retry.retries = retry;\n\t\t} else {\n\t\t\toptions.retry = {...options.retry, ...retry};\n\t\t}\n\t}\n\n\tif (options.gotTimeout) {\n\t\toptions.retry.maxRetryAfter = Math.min(...[options.gotTimeout.request, options.gotTimeout.connection].filter(n => !is.nullOrUndefined(n)));\n\t}\n\n\tif (is.array(options.retry.methods)) {\n\t\toptions.retry.methods = new Set(options.retry.methods.map(method => method.toUpperCase()));\n\t}\n\n\tif (is.array(options.retry.statusCodes)) {\n\t\toptions.retry.statusCodes = new Set(options.retry.statusCodes);\n\t}\n\n\tif (is.array(options.retry.errorCodes)) {\n\t\toptions.retry.errorCodes = new Set(options.retry.errorCodes);\n\t}\n\n\treturn options;\n};\n\nconst normalize = (url, options, defaults) => {\n\tif (is.plainObject(url)) {\n\t\toptions = {...url, ...options};\n\t\turl = options.url || {};\n\t\tdelete options.url;\n\t}\n\n\tif (defaults) {\n\t\toptions = merge({}, defaults.options, options ? preNormalize(options, defaults.options) : {});\n\t} else {\n\t\toptions = merge({}, preNormalize(options));\n\t}\n\n\tif (!is.string(url) && !is.object(url)) {\n\t\tthrow new TypeError(`Parameter \\`url\\` must be a string or object, not ${is(url)}`);\n\t}\n\n\tif (is.string(url)) {\n\t\tif (options.baseUrl) {\n\t\t\tif (url.toString().startsWith('/')) {\n\t\t\t\turl = url.toString().slice(1);\n\t\t\t}\n\n\t\t\turl = urlToOptions(new URL(url, options.baseUrl));\n\t\t} else {\n\t\t\turl = url.replace(/^unix:/, 'http://$&');\n\t\t\turl = urlParseLax(url);\n\t\t}\n\t} else if (is(url) === 'URL') {\n\t\turl = urlToOptions(url);\n\t}\n\n\t// Override both null/undefined with default protocol\n\toptions = merge({path: ''}, url, {protocol: url.protocol || 'https:'}, options);\n\n\tfor (const hook of options.hooks.init) {\n\t\tconst called = hook(options);\n\n\t\tif (is.promise(called)) {\n\t\t\tthrow new TypeError('The `init` hook must be a synchronous function');\n\t\t}\n\t}\n\n\tconst {baseUrl} = options;\n\tObject.defineProperty(options, 'baseUrl', {\n\t\tset: () => {\n\t\t\tthrow new Error('Failed to set baseUrl. Options are normalized already.');\n\t\t},\n\t\tget: () => baseUrl\n\t});\n\n\tconst {query} = options;\n\tif (is.nonEmptyString(query) || is.nonEmptyObject(query) || query instanceof URLSearchParams) {\n\t\tif (!is.string(query)) {\n\t\t\toptions.query = (new URLSearchParams(query)).toString();\n\t\t}\n\n\t\toptions.path = `${options.path.split('?')[0]}?${options.query}`;\n\t\tdelete options.query;\n\t}\n\n\tif (options.hostname === 'unix') {\n\t\tconst matches = /(.+?):(.+)/.exec(options.path);\n\n\t\tif (matches) {\n\t\t\tconst [, socketPath, path] = matches;\n\t\t\toptions = {\n\t\t\t\t...options,\n\t\t\t\tsocketPath,\n\t\t\t\tpath,\n\t\t\t\thost: null\n\t\t\t};\n\t\t}\n\t}\n\n\tconst {headers} = options;\n\tfor (const [key, value] of Object.entries(headers)) {\n\t\tif (is.nullOrUndefined(value)) {\n\t\t\tdelete headers[key];\n\t\t}\n\t}\n\n\tif (options.json && is.undefined(headers.accept)) {\n\t\theaders.accept = 'application/json';\n\t}\n\n\tif (options.decompress && is.undefined(headers['accept-encoding'])) {\n\t\theaders['accept-encoding'] = 'gzip, deflate';\n\t}\n\n\tconst {body} = options;\n\tif (is.nullOrUndefined(body)) {\n\t\toptions.method = options.method ? options.method.toUpperCase() : 'GET';\n\t} else {\n\t\tconst isObject = is.object(body) && !is.buffer(body) && !is.nodeStream(body);\n\t\tif (!is.nodeStream(body) && !is.string(body) && !is.buffer(body) && !(options.form || options.json)) {\n\t\t\tthrow new TypeError('The `body` option must be a stream.Readable, string or Buffer');\n\t\t}\n\n\t\tif (options.json && !(isObject || is.array(body))) {\n\t\t\tthrow new TypeError('The `body` option must be an Object or Array when the `json` option is used');\n\t\t}\n\n\t\tif (options.form && !isObject) {\n\t\t\tthrow new TypeError('The `body` option must be an Object when the `form` option is used');\n\t\t}\n\n\t\tif (isFormData(body)) {\n\t\t\t// Special case for https://github.com/form-data/form-data\n\t\t\theaders['content-type'] = headers['content-type'] || `multipart/form-data; boundary=${body.getBoundary()}`;\n\t\t} else if (options.form) {\n\t\t\theaders['content-type'] = headers['content-type'] || 'application/x-www-form-urlencoded';\n\t\t\toptions.body = (new URLSearchParams(body)).toString();\n\t\t} else if (options.json) {\n\t\t\theaders['content-type'] = headers['content-type'] || 'application/json';\n\t\t\toptions.body = JSON.stringify(body);\n\t\t}\n\n\t\toptions.method = options.method ? options.method.toUpperCase() : 'POST';\n\t}\n\n\tif (!is.function(options.retry.retries)) {\n\t\tconst {retries} = options.retry;\n\n\t\toptions.retry.retries = (iteration, error) => {\n\t\t\tif (iteration > retries) {\n\t\t\t\treturn 0;\n\t\t\t}\n\n\t\t\tif ((!error || !options.retry.errorCodes.has(error.code)) && (!options.retry.methods.has(error.method) || !options.retry.statusCodes.has(error.statusCode))) {\n\t\t\t\treturn 0;\n\t\t\t}\n\n\t\t\tif (Reflect.has(error, 'headers') && Reflect.has(error.headers, 'retry-after') && retryAfterStatusCodes.has(error.statusCode)) {\n\t\t\t\tlet after = Number(error.headers['retry-after']);\n\t\t\t\tif (is.nan(after)) {\n\t\t\t\t\tafter = Date.parse(error.headers['retry-after']) - Date.now();\n\t\t\t\t} else {\n\t\t\t\t\tafter *= 1000;\n\t\t\t\t}\n\n\t\t\t\tif (after > options.retry.maxRetryAfter) {\n\t\t\t\t\treturn 0;\n\t\t\t\t}\n\n\t\t\t\treturn after;\n\t\t\t}\n\n\t\t\tif (error.statusCode === 413) {\n\t\t\t\treturn 0;\n\t\t\t}\n\n\t\t\tconst noise = Math.random() * 100;\n\t\t\treturn ((2 ** (iteration - 1)) * 1000) + noise;\n\t\t};\n\t}\n\n\treturn options;\n};\n\nconst reNormalize = options => normalize(urlLib.format(options), options);\n\nmodule.exports = normalize;\nmodule.exports.preNormalize = preNormalize;\nmodule.exports.reNormalize = reNormalize;\n","'use strict';\nconst {Transform} = require('stream');\n\nmodule.exports = {\n\tdownload(response, emitter, downloadBodySize) {\n\t\tlet downloaded = 0;\n\n\t\treturn new Transform({\n\t\t\ttransform(chunk, encoding, callback) {\n\t\t\t\tdownloaded += chunk.length;\n\n\t\t\t\tconst percent = downloadBodySize ? downloaded / downloadBodySize : 0;\n\n\t\t\t\t// Let `flush()` be responsible for emitting the last event\n\t\t\t\tif (percent < 1) {\n\t\t\t\t\temitter.emit('downloadProgress', {\n\t\t\t\t\t\tpercent,\n\t\t\t\t\t\ttransferred: downloaded,\n\t\t\t\t\t\ttotal: downloadBodySize\n\t\t\t\t\t});\n\t\t\t\t}\n\n\t\t\t\tcallback(null, chunk);\n\t\t\t},\n\n\t\t\tflush(callback) {\n\t\t\t\temitter.emit('downloadProgress', {\n\t\t\t\t\tpercent: 1,\n\t\t\t\t\ttransferred: downloaded,\n\t\t\t\t\ttotal: downloadBodySize\n\t\t\t\t});\n\n\t\t\t\tcallback();\n\t\t\t}\n\t\t});\n\t},\n\n\tupload(request, emitter, uploadBodySize) {\n\t\tconst uploadEventFrequency = 150;\n\t\tlet uploaded = 0;\n\t\tlet progressInterval;\n\n\t\temitter.emit('uploadProgress', {\n\t\t\tpercent: 0,\n\t\t\ttransferred: 0,\n\t\t\ttotal: uploadBodySize\n\t\t});\n\n\t\trequest.once('error', () => {\n\t\t\tclearInterval(progressInterval);\n\t\t});\n\n\t\trequest.once('response', () => {\n\t\t\tclearInterval(progressInterval);\n\n\t\t\temitter.emit('uploadProgress', {\n\t\t\t\tpercent: 1,\n\t\t\t\ttransferred: uploaded,\n\t\t\t\ttotal: uploadBodySize\n\t\t\t});\n\t\t});\n\n\t\trequest.once('socket', socket => {\n\t\t\tconst onSocketConnect = () => {\n\t\t\t\tprogressInterval = setInterval(() => {\n\t\t\t\t\tconst lastUploaded = uploaded;\n\t\t\t\t\t/* istanbul ignore next: see #490 (occurs randomly!) */\n\t\t\t\t\tconst headersSize = request._header ? Buffer.byteLength(request._header) : 0;\n\t\t\t\t\tuploaded = socket.bytesWritten - headersSize;\n\n\t\t\t\t\t// Don't emit events with unchanged progress and\n\t\t\t\t\t// prevent last event from being emitted, because\n\t\t\t\t\t// it's emitted when `response` is emitted\n\t\t\t\t\tif (uploaded === lastUploaded || uploaded === uploadBodySize) {\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\n\t\t\t\t\temitter.emit('uploadProgress', {\n\t\t\t\t\t\tpercent: uploadBodySize ? uploaded / uploadBodySize : 0,\n\t\t\t\t\t\ttransferred: uploaded,\n\t\t\t\t\t\ttotal: uploadBodySize\n\t\t\t\t\t});\n\t\t\t\t}, uploadEventFrequency);\n\t\t\t};\n\n\t\t\t/* istanbul ignore next: hard to test */\n\t\t\tif (socket.connecting) {\n\t\t\t\tsocket.once('connect', onSocketConnect);\n\t\t\t} else if (socket.writable) {\n\t\t\t\t// The socket is being reused from pool,\n\t\t\t\t// so the connect event will not be emitted\n\t\t\t\tonSocketConnect();\n\t\t\t}\n\t\t});\n\t}\n};\n",null,"'use strict';\nconst is = require('@sindresorhus/is');\n\nmodule.exports = function deepFreeze(object) {\n\tfor (const [key, value] of Object.entries(object)) {\n\t\tif (is.plainObject(value) || is.array(value)) {\n\t\t\tdeepFreeze(object[key]);\n\t\t}\n\t}\n\n\treturn Object.freeze(object);\n};\n","'use strict';\nconst fs = require('fs');\nconst util = require('util');\nconst is = require('@sindresorhus/is');\nconst isFormData = require('./is-form-data');\n\nmodule.exports = async options => {\n\tconst {body} = options;\n\n\tif (options.headers['content-length']) {\n\t\treturn Number(options.headers['content-length']);\n\t}\n\n\tif (!body && !options.stream) {\n\t\treturn 0;\n\t}\n\n\tif (is.string(body)) {\n\t\treturn Buffer.byteLength(body);\n\t}\n\n\tif (isFormData(body)) {\n\t\treturn util.promisify(body.getLength.bind(body))();\n\t}\n\n\tif (body instanceof fs.ReadStream) {\n\t\tconst {size} = await util.promisify(fs.stat)(body.path);\n\t\treturn size;\n\t}\n\n\treturn null;\n};\n","'use strict';\nconst is = require('@sindresorhus/is');\n\nmodule.exports = body => is.nodeStream(body) && is.function(body.getBoundary);\n","'use strict';\nconst net = require('net');\n\nclass TimeoutError extends Error {\n\tconstructor(threshold, event) {\n\t\tsuper(`Timeout awaiting '${event}' for ${threshold}ms`);\n\t\tthis.name = 'TimeoutError';\n\t\tthis.code = 'ETIMEDOUT';\n\t\tthis.event = event;\n\t}\n}\n\nconst reentry = Symbol('reentry');\n\nconst noop = () => {};\n\nmodule.exports = (request, delays, options) => {\n\t/* istanbul ignore next: this makes sure timed-out isn't called twice */\n\tif (request[reentry]) {\n\t\treturn;\n\t}\n\n\trequest[reentry] = true;\n\n\tlet stopNewTimeouts = false;\n\n\tconst addTimeout = (delay, callback, ...args) => {\n\t\t// An error had been thrown before. Going further would result in uncaught errors.\n\t\t// See https://github.com/sindresorhus/got/issues/631#issuecomment-435675051\n\t\tif (stopNewTimeouts) {\n\t\t\treturn noop;\n\t\t}\n\n\t\t// Event loop order is timers, poll, immediates.\n\t\t// The timed event may emit during the current tick poll phase, so\n\t\t// defer calling the handler until the poll phase completes.\n\t\tlet immediate;\n\t\tconst timeout = setTimeout(() => {\n\t\t\timmediate = setImmediate(callback, delay, ...args);\n\t\t\t/* istanbul ignore next: added in node v9.7.0 */\n\t\t\tif (immediate.unref) {\n\t\t\t\timmediate.unref();\n\t\t\t}\n\t\t}, delay);\n\n\t\t/* istanbul ignore next: in order to support electron renderer */\n\t\tif (timeout.unref) {\n\t\t\ttimeout.unref();\n\t\t}\n\n\t\tconst cancel = () => {\n\t\t\tclearTimeout(timeout);\n\t\t\tclearImmediate(immediate);\n\t\t};\n\n\t\tcancelers.push(cancel);\n\n\t\treturn cancel;\n\t};\n\n\tconst {host, hostname} = options;\n\tconst timeoutHandler = (delay, event) => {\n\t\trequest.emit('error', new TimeoutError(delay, event));\n\t\trequest.once('error', () => {}); // Ignore the `socket hung up` error made by request.abort()\n\n\t\trequest.abort();\n\t};\n\n\tconst cancelers = [];\n\tconst cancelTimeouts = () => {\n\t\tstopNewTimeouts = true;\n\t\tcancelers.forEach(cancelTimeout => cancelTimeout());\n\t};\n\n\trequest.once('error', cancelTimeouts);\n\trequest.once('response', response => {\n\t\tresponse.once('end', cancelTimeouts);\n\t});\n\n\tif (delays.request !== undefined) {\n\t\taddTimeout(delays.request, timeoutHandler, 'request');\n\t}\n\n\tif (delays.socket !== undefined) {\n\t\tconst socketTimeoutHandler = () => {\n\t\t\ttimeoutHandler(delays.socket, 'socket');\n\t\t};\n\n\t\trequest.setTimeout(delays.socket, socketTimeoutHandler);\n\n\t\t// `request.setTimeout(0)` causes a memory leak.\n\t\t// We can just remove the listener and forget about the timer - it's unreffed.\n\t\t// See https://github.com/sindresorhus/got/issues/690\n\t\tcancelers.push(() => request.removeListener('timeout', socketTimeoutHandler));\n\t}\n\n\tif (delays.lookup !== undefined && !request.socketPath && !net.isIP(hostname || host)) {\n\t\trequest.once('socket', socket => {\n\t\t\t/* istanbul ignore next: hard to test */\n\t\t\tif (socket.connecting) {\n\t\t\t\tconst cancelTimeout = addTimeout(delays.lookup, timeoutHandler, 'lookup');\n\t\t\t\tsocket.once('lookup', cancelTimeout);\n\t\t\t}\n\t\t});\n\t}\n\n\tif (delays.connect !== undefined) {\n\t\trequest.once('socket', socket => {\n\t\t\t/* istanbul ignore next: hard to test */\n\t\t\tif (socket.connecting) {\n\t\t\t\tconst timeConnect = () => addTimeout(delays.connect, timeoutHandler, 'connect');\n\n\t\t\t\tif (request.socketPath || net.isIP(hostname || host)) {\n\t\t\t\t\tsocket.once('connect', timeConnect());\n\t\t\t\t} else {\n\t\t\t\t\tsocket.once('lookup', error => {\n\t\t\t\t\t\tif (error === null) {\n\t\t\t\t\t\t\tsocket.once('connect', timeConnect());\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t}\n\n\tif (delays.secureConnect !== undefined && options.protocol === 'https:') {\n\t\trequest.once('socket', socket => {\n\t\t\t/* istanbul ignore next: hard to test */\n\t\t\tif (socket.connecting) {\n\t\t\t\tsocket.once('connect', () => {\n\t\t\t\t\tconst cancelTimeout = addTimeout(delays.secureConnect, timeoutHandler, 'secureConnect');\n\t\t\t\t\tsocket.once('secureConnect', cancelTimeout);\n\t\t\t\t});\n\t\t\t}\n\t\t});\n\t}\n\n\tif (delays.send !== undefined) {\n\t\trequest.once('socket', socket => {\n\t\t\tconst timeRequest = () => addTimeout(delays.send, timeoutHandler, 'send');\n\t\t\t/* istanbul ignore next: hard to test */\n\t\t\tif (socket.connecting) {\n\t\t\t\tsocket.once('connect', () => {\n\t\t\t\t\trequest.once('upload-complete', timeRequest());\n\t\t\t\t});\n\t\t\t} else {\n\t\t\t\trequest.once('upload-complete', timeRequest());\n\t\t\t}\n\t\t});\n\t}\n\n\tif (delays.response !== undefined) {\n\t\trequest.once('upload-complete', () => {\n\t\t\tconst cancelTimeout = addTimeout(delays.response, timeoutHandler, 'response');\n\t\t\trequest.once('response', cancelTimeout);\n\t\t});\n\t}\n};\n\nmodule.exports.TimeoutError = TimeoutError;\n","'use strict';\nconst is = require('@sindresorhus/is');\n\nmodule.exports = url => {\n\tconst options = {\n\t\tprotocol: url.protocol,\n\t\thostname: url.hostname.startsWith('[') ? url.hostname.slice(1, -1) : url.hostname,\n\t\thash: url.hash,\n\t\tsearch: url.search,\n\t\tpathname: url.pathname,\n\t\thref: url.href\n\t};\n\n\tif (is.string(url.port) && url.port.length > 0) {\n\t\toptions.port = Number(url.port);\n\t}\n\n\tif (url.username || url.password) {\n\t\toptions.auth = `${url.username}:${url.password}`;\n\t}\n\n\toptions.path = is.null(url.search) ? url.pathname : `${url.pathname}${url.search}`;\n\n\treturn options;\n};\n","'use strict'\n\nmodule.exports = {\n afterRequest: require('./afterRequest.json'),\n beforeRequest: require('./beforeRequest.json'),\n browser: require('./browser.json'),\n cache: require('./cache.json'),\n content: require('./content.json'),\n cookie: require('./cookie.json'),\n creator: require('./creator.json'),\n entry: require('./entry.json'),\n har: require('./har.json'),\n header: require('./header.json'),\n log: require('./log.json'),\n page: require('./page.json'),\n pageTimings: require('./pageTimings.json'),\n postData: require('./postData.json'),\n query: require('./query.json'),\n request: require('./request.json'),\n response: require('./response.json'),\n timings: require('./timings.json')\n}\n","function HARError (errors) {\n var message = 'validation failed'\n\n this.name = 'HARError'\n this.message = message\n this.errors = errors\n\n if (typeof Error.captureStackTrace === 'function') {\n Error.captureStackTrace(this, this.constructor)\n } else {\n this.stack = (new Error(message)).stack\n }\n}\n\nHARError.prototype = Error.prototype\n\nmodule.exports = HARError\n","var Ajv = require('ajv')\nvar HARError = require('./error')\nvar schemas = require('har-schema')\n\nvar ajv\n\nfunction createAjvInstance () {\n var ajv = new Ajv({\n allErrors: true\n })\n ajv.addMetaSchema(require('ajv/lib/refs/json-schema-draft-06.json'))\n ajv.addSchema(schemas)\n\n return ajv\n}\n\nfunction validate (name, data) {\n data = data || {}\n\n // validator config\n ajv = ajv || createAjvInstance()\n\n var validate = ajv.getSchema(name + '.json')\n\n return new Promise(function (resolve, reject) {\n var valid = validate(data)\n\n !valid ? reject(new HARError(validate.errors)) : resolve(data)\n })\n}\n\nexports.afterRequest = function (data) {\n return validate('afterRequest', data)\n}\n\nexports.beforeRequest = function (data) {\n return validate('beforeRequest', data)\n}\n\nexports.browser = function (data) {\n return validate('browser', data)\n}\n\nexports.cache = function (data) {\n return validate('cache', data)\n}\n\nexports.content = function (data) {\n return validate('content', data)\n}\n\nexports.cookie = function (data) {\n return validate('cookie', data)\n}\n\nexports.creator = function (data) {\n return validate('creator', data)\n}\n\nexports.entry = function (data) {\n return validate('entry', data)\n}\n\nexports.har = function (data) {\n return validate('har', data)\n}\n\nexports.header = function (data) {\n return validate('header', data)\n}\n\nexports.log = function (data) {\n return validate('log', data)\n}\n\nexports.page = function (data) {\n return validate('page', data)\n}\n\nexports.pageTimings = function (data) {\n return validate('pageTimings', data)\n}\n\nexports.postData = function (data) {\n return validate('postData', data)\n}\n\nexports.query = function (data) {\n return validate('query', data)\n}\n\nexports.request = function (data) {\n return validate('request', data)\n}\n\nexports.response = function (data) {\n return validate('response', data)\n}\n\nexports.timings = function (data) {\n return validate('timings', data)\n}\n","'use strict';\n\nvar origSymbol = typeof Symbol !== 'undefined' && Symbol;\nvar hasSymbolSham = require('./shams');\n\nmodule.exports = function hasNativeSymbols() {\n\tif (typeof origSymbol !== 'function') { return false; }\n\tif (typeof Symbol !== 'function') { return false; }\n\tif (typeof origSymbol('foo') !== 'symbol') { return false; }\n\tif (typeof Symbol('bar') !== 'symbol') { return false; }\n\n\treturn hasSymbolSham();\n};\n","'use strict';\n\n/* eslint complexity: [2, 18], max-statements: [2, 33] */\nmodule.exports = function hasSymbols() {\n\tif (typeof Symbol !== 'function' || typeof Object.getOwnPropertySymbols !== 'function') { return false; }\n\tif (typeof Symbol.iterator === 'symbol') { return true; }\n\n\tvar obj = {};\n\tvar sym = Symbol('test');\n\tvar symObj = Object(sym);\n\tif (typeof sym === 'string') { return false; }\n\n\tif (Object.prototype.toString.call(sym) !== '[object Symbol]') { return false; }\n\tif (Object.prototype.toString.call(symObj) !== '[object Symbol]') { return false; }\n\n\t// temp disabled per https://github.com/ljharb/object.assign/issues/17\n\t// if (sym instanceof Symbol) { return false; }\n\t// temp disabled per https://github.com/WebReflection/get-own-property-symbols/issues/4\n\t// if (!(symObj instanceof Symbol)) { return false; }\n\n\t// if (typeof Symbol.prototype.toString !== 'function') { return false; }\n\t// if (String(sym) !== Symbol.prototype.toString.call(sym)) { return false; }\n\n\tvar symVal = 42;\n\tobj[sym] = symVal;\n\tfor (sym in obj) { return false; } // eslint-disable-line no-restricted-syntax, no-unreachable-loop\n\tif (typeof Object.keys === 'function' && Object.keys(obj).length !== 0) { return false; }\n\n\tif (typeof Object.getOwnPropertyNames === 'function' && Object.getOwnPropertyNames(obj).length !== 0) { return false; }\n\n\tvar syms = Object.getOwnPropertySymbols(obj);\n\tif (syms.length !== 1 || syms[0] !== sym) { return false; }\n\n\tif (!Object.prototype.propertyIsEnumerable.call(obj, sym)) { return false; }\n\n\tif (typeof Object.getOwnPropertyDescriptor === 'function') {\n\t\tvar descriptor = Object.getOwnPropertyDescriptor(obj, sym);\n\t\tif (descriptor.value !== symVal || descriptor.enumerable !== true) { return false; }\n\t}\n\n\treturn true;\n};\n","'use strict';\n\nvar bind = require('function-bind');\n\nmodule.exports = bind.call(Function.call, Object.prototype.hasOwnProperty);\n","'use strict';\n// rfc7231 6.1\nconst statusCodeCacheableByDefault = new Set([\n 200,\n 203,\n 204,\n 206,\n 300,\n 301,\n 404,\n 405,\n 410,\n 414,\n 501,\n]);\n\n// This implementation does not understand partial responses (206)\nconst understoodStatuses = new Set([\n 200,\n 203,\n 204,\n 300,\n 301,\n 302,\n 303,\n 307,\n 308,\n 404,\n 405,\n 410,\n 414,\n 501,\n]);\n\nconst errorStatusCodes = new Set([\n 500,\n 502,\n 503, \n 504,\n]);\n\nconst hopByHopHeaders = {\n date: true, // included, because we add Age update Date\n connection: true,\n 'keep-alive': true,\n 'proxy-authenticate': true,\n 'proxy-authorization': true,\n te: true,\n trailer: true,\n 'transfer-encoding': true,\n upgrade: true,\n};\n\nconst excludedFromRevalidationUpdate = {\n // Since the old body is reused, it doesn't make sense to change properties of the body\n 'content-length': true,\n 'content-encoding': true,\n 'transfer-encoding': true,\n 'content-range': true,\n};\n\nfunction toNumberOrZero(s) {\n const n = parseInt(s, 10);\n return isFinite(n) ? n : 0;\n}\n\n// RFC 5861\nfunction isErrorResponse(response) {\n // consider undefined response as faulty\n if(!response) {\n return true\n }\n return errorStatusCodes.has(response.status);\n}\n\nfunction parseCacheControl(header) {\n const cc = {};\n if (!header) return cc;\n\n // TODO: When there is more than one value present for a given directive (e.g., two Expires header fields, multiple Cache-Control: max-age directives),\n // the directive's value is considered invalid. Caches are encouraged to consider responses that have invalid freshness information to be stale\n const parts = header.trim().split(/\\s*,\\s*/); // TODO: lame parsing\n for (const part of parts) {\n const [k, v] = part.split(/\\s*=\\s*/, 2);\n cc[k] = v === undefined ? true : v.replace(/^\"|\"$/g, ''); // TODO: lame unquoting\n }\n\n return cc;\n}\n\nfunction formatCacheControl(cc) {\n let parts = [];\n for (const k in cc) {\n const v = cc[k];\n parts.push(v === true ? k : k + '=' + v);\n }\n if (!parts.length) {\n return undefined;\n }\n return parts.join(', ');\n}\n\nmodule.exports = class CachePolicy {\n constructor(\n req,\n res,\n {\n shared,\n cacheHeuristic,\n immutableMinTimeToLive,\n ignoreCargoCult,\n _fromObject,\n } = {}\n ) {\n if (_fromObject) {\n this._fromObject(_fromObject);\n return;\n }\n\n if (!res || !res.headers) {\n throw Error('Response headers missing');\n }\n this._assertRequestHasHeaders(req);\n\n this._responseTime = this.now();\n this._isShared = shared !== false;\n this._cacheHeuristic =\n undefined !== cacheHeuristic ? cacheHeuristic : 0.1; // 10% matches IE\n this._immutableMinTtl =\n undefined !== immutableMinTimeToLive\n ? immutableMinTimeToLive\n : 24 * 3600 * 1000;\n\n this._status = 'status' in res ? res.status : 200;\n this._resHeaders = res.headers;\n this._rescc = parseCacheControl(res.headers['cache-control']);\n this._method = 'method' in req ? req.method : 'GET';\n this._url = req.url;\n this._host = req.headers.host;\n this._noAuthorization = !req.headers.authorization;\n this._reqHeaders = res.headers.vary ? req.headers : null; // Don't keep all request headers if they won't be used\n this._reqcc = parseCacheControl(req.headers['cache-control']);\n\n // Assume that if someone uses legacy, non-standard uncecessary options they don't understand caching,\n // so there's no point stricly adhering to the blindly copy&pasted directives.\n if (\n ignoreCargoCult &&\n 'pre-check' in this._rescc &&\n 'post-check' in this._rescc\n ) {\n delete this._rescc['pre-check'];\n delete this._rescc['post-check'];\n delete this._rescc['no-cache'];\n delete this._rescc['no-store'];\n delete this._rescc['must-revalidate'];\n this._resHeaders = Object.assign({}, this._resHeaders, {\n 'cache-control': formatCacheControl(this._rescc),\n });\n delete this._resHeaders.expires;\n delete this._resHeaders.pragma;\n }\n\n // When the Cache-Control header field is not present in a request, caches MUST consider the no-cache request pragma-directive\n // as having the same effect as if \"Cache-Control: no-cache\" were present (see Section 5.2.1).\n if (\n res.headers['cache-control'] == null &&\n /no-cache/.test(res.headers.pragma)\n ) {\n this._rescc['no-cache'] = true;\n }\n }\n\n now() {\n return Date.now();\n }\n\n storable() {\n // The \"no-store\" request directive indicates that a cache MUST NOT store any part of either this request or any response to it.\n return !!(\n !this._reqcc['no-store'] &&\n // A cache MUST NOT store a response to any request, unless:\n // The request method is understood by the cache and defined as being cacheable, and\n ('GET' === this._method ||\n 'HEAD' === this._method ||\n ('POST' === this._method && this._hasExplicitExpiration())) &&\n // the response status code is understood by the cache, and\n understoodStatuses.has(this._status) &&\n // the \"no-store\" cache directive does not appear in request or response header fields, and\n !this._rescc['no-store'] &&\n // the \"private\" response directive does not appear in the response, if the cache is shared, and\n (!this._isShared || !this._rescc.private) &&\n // the Authorization header field does not appear in the request, if the cache is shared,\n (!this._isShared ||\n this._noAuthorization ||\n this._allowsStoringAuthenticated()) &&\n // the response either:\n // contains an Expires header field, or\n (this._resHeaders.expires ||\n // contains a max-age response directive, or\n // contains a s-maxage response directive and the cache is shared, or\n // contains a public response directive.\n this._rescc['max-age'] ||\n (this._isShared && this._rescc['s-maxage']) ||\n this._rescc.public ||\n // has a status code that is defined as cacheable by default\n statusCodeCacheableByDefault.has(this._status))\n );\n }\n\n _hasExplicitExpiration() {\n // 4.2.1 Calculating Freshness Lifetime\n return (\n (this._isShared && this._rescc['s-maxage']) ||\n this._rescc['max-age'] ||\n this._resHeaders.expires\n );\n }\n\n _assertRequestHasHeaders(req) {\n if (!req || !req.headers) {\n throw Error('Request headers missing');\n }\n }\n\n satisfiesWithoutRevalidation(req) {\n this._assertRequestHasHeaders(req);\n\n // When presented with a request, a cache MUST NOT reuse a stored response, unless:\n // the presented request does not contain the no-cache pragma (Section 5.4), nor the no-cache cache directive,\n // unless the stored response is successfully validated (Section 4.3), and\n const requestCC = parseCacheControl(req.headers['cache-control']);\n if (requestCC['no-cache'] || /no-cache/.test(req.headers.pragma)) {\n return false;\n }\n\n if (requestCC['max-age'] && this.age() > requestCC['max-age']) {\n return false;\n }\n\n if (\n requestCC['min-fresh'] &&\n this.timeToLive() < 1000 * requestCC['min-fresh']\n ) {\n return false;\n }\n\n // the stored response is either:\n // fresh, or allowed to be served stale\n if (this.stale()) {\n const allowsStale =\n requestCC['max-stale'] &&\n !this._rescc['must-revalidate'] &&\n (true === requestCC['max-stale'] ||\n requestCC['max-stale'] > this.age() - this.maxAge());\n if (!allowsStale) {\n return false;\n }\n }\n\n return this._requestMatches(req, false);\n }\n\n _requestMatches(req, allowHeadMethod) {\n // The presented effective request URI and that of the stored response match, and\n return (\n (!this._url || this._url === req.url) &&\n this._host === req.headers.host &&\n // the request method associated with the stored response allows it to be used for the presented request, and\n (!req.method ||\n this._method === req.method ||\n (allowHeadMethod && 'HEAD' === req.method)) &&\n // selecting header fields nominated by the stored response (if any) match those presented, and\n this._varyMatches(req)\n );\n }\n\n _allowsStoringAuthenticated() {\n // following Cache-Control response directives (Section 5.2.2) have such an effect: must-revalidate, public, and s-maxage.\n return (\n this._rescc['must-revalidate'] ||\n this._rescc.public ||\n this._rescc['s-maxage']\n );\n }\n\n _varyMatches(req) {\n if (!this._resHeaders.vary) {\n return true;\n }\n\n // A Vary header field-value of \"*\" always fails to match\n if (this._resHeaders.vary === '*') {\n return false;\n }\n\n const fields = this._resHeaders.vary\n .trim()\n .toLowerCase()\n .split(/\\s*,\\s*/);\n for (const name of fields) {\n if (req.headers[name] !== this._reqHeaders[name]) return false;\n }\n return true;\n }\n\n _copyWithoutHopByHopHeaders(inHeaders) {\n const headers = {};\n for (const name in inHeaders) {\n if (hopByHopHeaders[name]) continue;\n headers[name] = inHeaders[name];\n }\n // 9.1. Connection\n if (inHeaders.connection) {\n const tokens = inHeaders.connection.trim().split(/\\s*,\\s*/);\n for (const name of tokens) {\n delete headers[name];\n }\n }\n if (headers.warning) {\n const warnings = headers.warning.split(/,/).filter(warning => {\n return !/^\\s*1[0-9][0-9]/.test(warning);\n });\n if (!warnings.length) {\n delete headers.warning;\n } else {\n headers.warning = warnings.join(',').trim();\n }\n }\n return headers;\n }\n\n responseHeaders() {\n const headers = this._copyWithoutHopByHopHeaders(this._resHeaders);\n const age = this.age();\n\n // A cache SHOULD generate 113 warning if it heuristically chose a freshness\n // lifetime greater than 24 hours and the response's age is greater than 24 hours.\n if (\n age > 3600 * 24 &&\n !this._hasExplicitExpiration() &&\n this.maxAge() > 3600 * 24\n ) {\n headers.warning =\n (headers.warning ? `${headers.warning}, ` : '') +\n '113 - \"rfc7234 5.5.4\"';\n }\n headers.age = `${Math.round(age)}`;\n headers.date = new Date(this.now()).toUTCString();\n return headers;\n }\n\n /**\n * Value of the Date response header or current time if Date was invalid\n * @return timestamp\n */\n date() {\n const serverDate = Date.parse(this._resHeaders.date);\n if (isFinite(serverDate)) {\n return serverDate;\n }\n return this._responseTime;\n }\n\n /**\n * Value of the Age header, in seconds, updated for the current time.\n * May be fractional.\n *\n * @return Number\n */\n age() {\n let age = this._ageValue();\n\n const residentTime = (this.now() - this._responseTime) / 1000;\n return age + residentTime;\n }\n\n _ageValue() {\n return toNumberOrZero(this._resHeaders.age);\n }\n\n /**\n * Value of applicable max-age (or heuristic equivalent) in seconds. This counts since response's `Date`.\n *\n * For an up-to-date value, see `timeToLive()`.\n *\n * @return Number\n */\n maxAge() {\n if (!this.storable() || this._rescc['no-cache']) {\n return 0;\n }\n\n // Shared responses with cookies are cacheable according to the RFC, but IMHO it'd be unwise to do so by default\n // so this implementation requires explicit opt-in via public header\n if (\n this._isShared &&\n (this._resHeaders['set-cookie'] &&\n !this._rescc.public &&\n !this._rescc.immutable)\n ) {\n return 0;\n }\n\n if (this._resHeaders.vary === '*') {\n return 0;\n }\n\n if (this._isShared) {\n if (this._rescc['proxy-revalidate']) {\n return 0;\n }\n // if a response includes the s-maxage directive, a shared cache recipient MUST ignore the Expires field.\n if (this._rescc['s-maxage']) {\n return toNumberOrZero(this._rescc['s-maxage']);\n }\n }\n\n // If a response includes a Cache-Control field with the max-age directive, a recipient MUST ignore the Expires field.\n if (this._rescc['max-age']) {\n return toNumberOrZero(this._rescc['max-age']);\n }\n\n const defaultMinTtl = this._rescc.immutable ? this._immutableMinTtl : 0;\n\n const serverDate = this.date();\n if (this._resHeaders.expires) {\n const expires = Date.parse(this._resHeaders.expires);\n // A cache recipient MUST interpret invalid date formats, especially the value \"0\", as representing a time in the past (i.e., \"already expired\").\n if (Number.isNaN(expires) || expires < serverDate) {\n return 0;\n }\n return Math.max(defaultMinTtl, (expires - serverDate) / 1000);\n }\n\n if (this._resHeaders['last-modified']) {\n const lastModified = Date.parse(this._resHeaders['last-modified']);\n if (isFinite(lastModified) && serverDate > lastModified) {\n return Math.max(\n defaultMinTtl,\n ((serverDate - lastModified) / 1000) * this._cacheHeuristic\n );\n }\n }\n\n return defaultMinTtl;\n }\n\n timeToLive() {\n const age = this.maxAge() - this.age();\n const staleIfErrorAge = age + toNumberOrZero(this._rescc['stale-if-error']);\n const staleWhileRevalidateAge = age + toNumberOrZero(this._rescc['stale-while-revalidate']);\n return Math.max(0, age, staleIfErrorAge, staleWhileRevalidateAge) * 1000;\n }\n\n stale() {\n return this.maxAge() <= this.age();\n }\n\n _useStaleIfError() {\n return this.maxAge() + toNumberOrZero(this._rescc['stale-if-error']) > this.age();\n }\n\n useStaleWhileRevalidate() {\n return this.maxAge() + toNumberOrZero(this._rescc['stale-while-revalidate']) > this.age();\n }\n\n static fromObject(obj) {\n return new this(undefined, undefined, { _fromObject: obj });\n }\n\n _fromObject(obj) {\n if (this._responseTime) throw Error('Reinitialized');\n if (!obj || obj.v !== 1) throw Error('Invalid serialization');\n\n this._responseTime = obj.t;\n this._isShared = obj.sh;\n this._cacheHeuristic = obj.ch;\n this._immutableMinTtl =\n obj.imm !== undefined ? obj.imm : 24 * 3600 * 1000;\n this._status = obj.st;\n this._resHeaders = obj.resh;\n this._rescc = obj.rescc;\n this._method = obj.m;\n this._url = obj.u;\n this._host = obj.h;\n this._noAuthorization = obj.a;\n this._reqHeaders = obj.reqh;\n this._reqcc = obj.reqcc;\n }\n\n toObject() {\n return {\n v: 1,\n t: this._responseTime,\n sh: this._isShared,\n ch: this._cacheHeuristic,\n imm: this._immutableMinTtl,\n st: this._status,\n resh: this._resHeaders,\n rescc: this._rescc,\n m: this._method,\n u: this._url,\n h: this._host,\n a: this._noAuthorization,\n reqh: this._reqHeaders,\n reqcc: this._reqcc,\n };\n }\n\n /**\n * Headers for sending to the origin server to revalidate stale response.\n * Allows server to return 304 to allow reuse of the previous response.\n *\n * Hop by hop headers are always stripped.\n * Revalidation headers may be added or removed, depending on request.\n */\n revalidationHeaders(incomingReq) {\n this._assertRequestHasHeaders(incomingReq);\n const headers = this._copyWithoutHopByHopHeaders(incomingReq.headers);\n\n // This implementation does not understand range requests\n delete headers['if-range'];\n\n if (!this._requestMatches(incomingReq, true) || !this.storable()) {\n // revalidation allowed via HEAD\n // not for the same resource, or wasn't allowed to be cached anyway\n delete headers['if-none-match'];\n delete headers['if-modified-since'];\n return headers;\n }\n\n /* MUST send that entity-tag in any cache validation request (using If-Match or If-None-Match) if an entity-tag has been provided by the origin server. */\n if (this._resHeaders.etag) {\n headers['if-none-match'] = headers['if-none-match']\n ? `${headers['if-none-match']}, ${this._resHeaders.etag}`\n : this._resHeaders.etag;\n }\n\n // Clients MAY issue simple (non-subrange) GET requests with either weak validators or strong validators. Clients MUST NOT use weak validators in other forms of request.\n const forbidsWeakValidators =\n headers['accept-ranges'] ||\n headers['if-match'] ||\n headers['if-unmodified-since'] ||\n (this._method && this._method != 'GET');\n\n /* SHOULD send the Last-Modified value in non-subrange cache validation requests (using If-Modified-Since) if only a Last-Modified value has been provided by the origin server.\n Note: This implementation does not understand partial responses (206) */\n if (forbidsWeakValidators) {\n delete headers['if-modified-since'];\n\n if (headers['if-none-match']) {\n const etags = headers['if-none-match']\n .split(/,/)\n .filter(etag => {\n return !/^\\s*W\\//.test(etag);\n });\n if (!etags.length) {\n delete headers['if-none-match'];\n } else {\n headers['if-none-match'] = etags.join(',').trim();\n }\n }\n } else if (\n this._resHeaders['last-modified'] &&\n !headers['if-modified-since']\n ) {\n headers['if-modified-since'] = this._resHeaders['last-modified'];\n }\n\n return headers;\n }\n\n /**\n * Creates new CachePolicy with information combined from the previews response,\n * and the new revalidation response.\n *\n * Returns {policy, modified} where modified is a boolean indicating\n * whether the response body has been modified, and old cached body can't be used.\n *\n * @return {Object} {policy: CachePolicy, modified: Boolean}\n */\n revalidatedPolicy(request, response) {\n this._assertRequestHasHeaders(request);\n if(this._useStaleIfError() && isErrorResponse(response)) { // I consider the revalidation request unsuccessful\n return {\n modified: false,\n matches: false,\n policy: this,\n };\n }\n if (!response || !response.headers) {\n throw Error('Response headers missing');\n }\n\n // These aren't going to be supported exactly, since one CachePolicy object\n // doesn't know about all the other cached objects.\n let matches = false;\n if (response.status !== undefined && response.status != 304) {\n matches = false;\n } else if (\n response.headers.etag &&\n !/^\\s*W\\//.test(response.headers.etag)\n ) {\n // \"All of the stored responses with the same strong validator are selected.\n // If none of the stored responses contain the same strong validator,\n // then the cache MUST NOT use the new response to update any stored responses.\"\n matches =\n this._resHeaders.etag &&\n this._resHeaders.etag.replace(/^\\s*W\\//, '') ===\n response.headers.etag;\n } else if (this._resHeaders.etag && response.headers.etag) {\n // \"If the new response contains a weak validator and that validator corresponds\n // to one of the cache's stored responses,\n // then the most recent of those matching stored responses is selected for update.\"\n matches =\n this._resHeaders.etag.replace(/^\\s*W\\//, '') ===\n response.headers.etag.replace(/^\\s*W\\//, '');\n } else if (this._resHeaders['last-modified']) {\n matches =\n this._resHeaders['last-modified'] ===\n response.headers['last-modified'];\n } else {\n // If the new response does not include any form of validator (such as in the case where\n // a client generates an If-Modified-Since request from a source other than the Last-Modified\n // response header field), and there is only one stored response, and that stored response also\n // lacks a validator, then that stored response is selected for update.\n if (\n !this._resHeaders.etag &&\n !this._resHeaders['last-modified'] &&\n !response.headers.etag &&\n !response.headers['last-modified']\n ) {\n matches = true;\n }\n }\n\n if (!matches) {\n return {\n policy: new this.constructor(request, response),\n // Client receiving 304 without body, even if it's invalid/mismatched has no option\n // but to reuse a cached body. We don't have a good way to tell clients to do\n // error recovery in such case.\n modified: response.status != 304,\n matches: false,\n };\n }\n\n // use other header fields provided in the 304 (Not Modified) response to replace all instances\n // of the corresponding header fields in the stored response.\n const headers = {};\n for (const k in this._resHeaders) {\n headers[k] =\n k in response.headers && !excludedFromRevalidationUpdate[k]\n ? response.headers[k]\n : this._resHeaders[k];\n }\n\n const newResponse = Object.assign({}, response, {\n status: this._status,\n method: this._method,\n headers,\n });\n return {\n policy: new this.constructor(request, newResponse, {\n shared: this._isShared,\n cacheHeuristic: this._cacheHeuristic,\n immutableMinTimeToLive: this._immutableMinTtl,\n }),\n modified: false,\n matches: true,\n };\n }\n};\n","// Copyright 2015 Joyent, Inc.\n\nvar parser = require('./parser');\nvar signer = require('./signer');\nvar verify = require('./verify');\nvar utils = require('./utils');\n\n\n\n///--- API\n\nmodule.exports = {\n\n parse: parser.parseRequest,\n parseRequest: parser.parseRequest,\n\n sign: signer.signRequest,\n signRequest: signer.signRequest,\n createSigner: signer.createSigner,\n isSigner: signer.isSigner,\n\n sshKeyToPEM: utils.sshKeyToPEM,\n sshKeyFingerprint: utils.fingerprint,\n pemToRsaSSHKey: utils.pemToRsaSSHKey,\n\n verify: verify.verifySignature,\n verifySignature: verify.verifySignature,\n verifyHMAC: verify.verifyHMAC\n};\n","// Copyright 2012 Joyent, Inc. All rights reserved.\n\nvar assert = require('assert-plus');\nvar util = require('util');\nvar utils = require('./utils');\n\n\n\n///--- Globals\n\nvar HASH_ALGOS = utils.HASH_ALGOS;\nvar PK_ALGOS = utils.PK_ALGOS;\nvar HttpSignatureError = utils.HttpSignatureError;\nvar InvalidAlgorithmError = utils.InvalidAlgorithmError;\nvar validateAlgorithm = utils.validateAlgorithm;\n\nvar State = {\n New: 0,\n Params: 1\n};\n\nvar ParamsState = {\n Name: 0,\n Quote: 1,\n Value: 2,\n Comma: 3\n};\n\n\n///--- Specific Errors\n\n\nfunction ExpiredRequestError(message) {\n HttpSignatureError.call(this, message, ExpiredRequestError);\n}\nutil.inherits(ExpiredRequestError, HttpSignatureError);\n\n\nfunction InvalidHeaderError(message) {\n HttpSignatureError.call(this, message, InvalidHeaderError);\n}\nutil.inherits(InvalidHeaderError, HttpSignatureError);\n\n\nfunction InvalidParamsError(message) {\n HttpSignatureError.call(this, message, InvalidParamsError);\n}\nutil.inherits(InvalidParamsError, HttpSignatureError);\n\n\nfunction MissingHeaderError(message) {\n HttpSignatureError.call(this, message, MissingHeaderError);\n}\nutil.inherits(MissingHeaderError, HttpSignatureError);\n\nfunction StrictParsingError(message) {\n HttpSignatureError.call(this, message, StrictParsingError);\n}\nutil.inherits(StrictParsingError, HttpSignatureError);\n\n///--- Exported API\n\nmodule.exports = {\n\n /**\n * Parses the 'Authorization' header out of an http.ServerRequest object.\n *\n * Note that this API will fully validate the Authorization header, and throw\n * on any error. It will not however check the signature, or the keyId format\n * as those are specific to your environment. You can use the options object\n * to pass in extra constraints.\n *\n * As a response object you can expect this:\n *\n * {\n * \"scheme\": \"Signature\",\n * \"params\": {\n * \"keyId\": \"foo\",\n * \"algorithm\": \"rsa-sha256\",\n * \"headers\": [\n * \"date\" or \"x-date\",\n * \"digest\"\n * ],\n * \"signature\": \"base64\"\n * },\n * \"signingString\": \"ready to be passed to crypto.verify()\"\n * }\n *\n * @param {Object} request an http.ServerRequest.\n * @param {Object} options an optional options object with:\n * - clockSkew: allowed clock skew in seconds (default 300).\n * - headers: required header names (def: date or x-date)\n * - algorithms: algorithms to support (default: all).\n * - strict: should enforce latest spec parsing\n * (default: false).\n * @return {Object} parsed out object (see above).\n * @throws {TypeError} on invalid input.\n * @throws {InvalidHeaderError} on an invalid Authorization header error.\n * @throws {InvalidParamsError} if the params in the scheme are invalid.\n * @throws {MissingHeaderError} if the params indicate a header not present,\n * either in the request headers from the params,\n * or not in the params from a required header\n * in options.\n * @throws {StrictParsingError} if old attributes are used in strict parsing\n * mode.\n * @throws {ExpiredRequestError} if the value of date or x-date exceeds skew.\n */\n parseRequest: function parseRequest(request, options) {\n assert.object(request, 'request');\n assert.object(request.headers, 'request.headers');\n if (options === undefined) {\n options = {};\n }\n if (options.headers === undefined) {\n options.headers = [request.headers['x-date'] ? 'x-date' : 'date'];\n }\n assert.object(options, 'options');\n assert.arrayOfString(options.headers, 'options.headers');\n assert.optionalFinite(options.clockSkew, 'options.clockSkew');\n\n var authzHeaderName = options.authorizationHeaderName || 'authorization';\n\n if (!request.headers[authzHeaderName]) {\n throw new MissingHeaderError('no ' + authzHeaderName + ' header ' +\n 'present in the request');\n }\n\n options.clockSkew = options.clockSkew || 300;\n\n\n var i = 0;\n var state = State.New;\n var substate = ParamsState.Name;\n var tmpName = '';\n var tmpValue = '';\n\n var parsed = {\n scheme: '',\n params: {},\n signingString: ''\n };\n\n var authz = request.headers[authzHeaderName];\n for (i = 0; i < authz.length; i++) {\n var c = authz.charAt(i);\n\n switch (Number(state)) {\n\n case State.New:\n if (c !== ' ') parsed.scheme += c;\n else state = State.Params;\n break;\n\n case State.Params:\n switch (Number(substate)) {\n\n case ParamsState.Name:\n var code = c.charCodeAt(0);\n // restricted name of A-Z / a-z\n if ((code >= 0x41 && code <= 0x5a) || // A-Z\n (code >= 0x61 && code <= 0x7a)) { // a-z\n tmpName += c;\n } else if (c === '=') {\n if (tmpName.length === 0)\n throw new InvalidHeaderError('bad param format');\n substate = ParamsState.Quote;\n } else {\n throw new InvalidHeaderError('bad param format');\n }\n break;\n\n case ParamsState.Quote:\n if (c === '\"') {\n tmpValue = '';\n substate = ParamsState.Value;\n } else {\n throw new InvalidHeaderError('bad param format');\n }\n break;\n\n case ParamsState.Value:\n if (c === '\"') {\n parsed.params[tmpName] = tmpValue;\n substate = ParamsState.Comma;\n } else {\n tmpValue += c;\n }\n break;\n\n case ParamsState.Comma:\n if (c === ',') {\n tmpName = '';\n substate = ParamsState.Name;\n } else {\n throw new InvalidHeaderError('bad param format');\n }\n break;\n\n default:\n throw new Error('Invalid substate');\n }\n break;\n\n default:\n throw new Error('Invalid substate');\n }\n\n }\n\n if (!parsed.params.headers || parsed.params.headers === '') {\n if (request.headers['x-date']) {\n parsed.params.headers = ['x-date'];\n } else {\n parsed.params.headers = ['date'];\n }\n } else {\n parsed.params.headers = parsed.params.headers.split(' ');\n }\n\n // Minimally validate the parsed object\n if (!parsed.scheme || parsed.scheme !== 'Signature')\n throw new InvalidHeaderError('scheme was not \"Signature\"');\n\n if (!parsed.params.keyId)\n throw new InvalidHeaderError('keyId was not specified');\n\n if (!parsed.params.algorithm)\n throw new InvalidHeaderError('algorithm was not specified');\n\n if (!parsed.params.signature)\n throw new InvalidHeaderError('signature was not specified');\n\n // Check the algorithm against the official list\n parsed.params.algorithm = parsed.params.algorithm.toLowerCase();\n try {\n validateAlgorithm(parsed.params.algorithm);\n } catch (e) {\n if (e instanceof InvalidAlgorithmError)\n throw (new InvalidParamsError(parsed.params.algorithm + ' is not ' +\n 'supported'));\n else\n throw (e);\n }\n\n // Build the signingString\n for (i = 0; i < parsed.params.headers.length; i++) {\n var h = parsed.params.headers[i].toLowerCase();\n parsed.params.headers[i] = h;\n\n if (h === 'request-line') {\n if (!options.strict) {\n /*\n * We allow headers from the older spec drafts if strict parsing isn't\n * specified in options.\n */\n parsed.signingString +=\n request.method + ' ' + request.url + ' HTTP/' + request.httpVersion;\n } else {\n /* Strict parsing doesn't allow older draft headers. */\n throw (new StrictParsingError('request-line is not a valid header ' +\n 'with strict parsing enabled.'));\n }\n } else if (h === '(request-target)') {\n parsed.signingString +=\n '(request-target): ' + request.method.toLowerCase() + ' ' +\n request.url;\n } else {\n var value = request.headers[h];\n if (value === undefined)\n throw new MissingHeaderError(h + ' was not in the request');\n parsed.signingString += h + ': ' + value;\n }\n\n if ((i + 1) < parsed.params.headers.length)\n parsed.signingString += '\\n';\n }\n\n // Check against the constraints\n var date;\n if (request.headers.date || request.headers['x-date']) {\n if (request.headers['x-date']) {\n date = new Date(request.headers['x-date']);\n } else {\n date = new Date(request.headers.date);\n }\n var now = new Date();\n var skew = Math.abs(now.getTime() - date.getTime());\n\n if (skew > options.clockSkew * 1000) {\n throw new ExpiredRequestError('clock skew of ' +\n (skew / 1000) +\n 's was greater than ' +\n options.clockSkew + 's');\n }\n }\n\n options.headers.forEach(function (hdr) {\n // Remember that we already checked any headers in the params\n // were in the request, so if this passes we're good.\n if (parsed.params.headers.indexOf(hdr.toLowerCase()) < 0)\n throw new MissingHeaderError(hdr + ' was not a signed header');\n });\n\n if (options.algorithms) {\n if (options.algorithms.indexOf(parsed.params.algorithm) === -1)\n throw new InvalidParamsError(parsed.params.algorithm +\n ' is not a supported algorithm');\n }\n\n parsed.algorithm = parsed.params.algorithm.toUpperCase();\n parsed.keyId = parsed.params.keyId;\n return parsed;\n }\n\n};\n","// Copyright 2012 Joyent, Inc. All rights reserved.\n\nvar assert = require('assert-plus');\nvar crypto = require('crypto');\nvar http = require('http');\nvar util = require('util');\nvar sshpk = require('sshpk');\nvar jsprim = require('jsprim');\nvar utils = require('./utils');\n\nvar sprintf = require('util').format;\n\nvar HASH_ALGOS = utils.HASH_ALGOS;\nvar PK_ALGOS = utils.PK_ALGOS;\nvar InvalidAlgorithmError = utils.InvalidAlgorithmError;\nvar HttpSignatureError = utils.HttpSignatureError;\nvar validateAlgorithm = utils.validateAlgorithm;\n\n///--- Globals\n\nvar AUTHZ_FMT =\n 'Signature keyId=\"%s\",algorithm=\"%s\",headers=\"%s\",signature=\"%s\"';\n\n///--- Specific Errors\n\nfunction MissingHeaderError(message) {\n HttpSignatureError.call(this, message, MissingHeaderError);\n}\nutil.inherits(MissingHeaderError, HttpSignatureError);\n\nfunction StrictParsingError(message) {\n HttpSignatureError.call(this, message, StrictParsingError);\n}\nutil.inherits(StrictParsingError, HttpSignatureError);\n\n/* See createSigner() */\nfunction RequestSigner(options) {\n assert.object(options, 'options');\n\n var alg = [];\n if (options.algorithm !== undefined) {\n assert.string(options.algorithm, 'options.algorithm');\n alg = validateAlgorithm(options.algorithm);\n }\n this.rs_alg = alg;\n\n /*\n * RequestSigners come in two varieties: ones with an rs_signFunc, and ones\n * with an rs_signer.\n *\n * rs_signFunc-based RequestSigners have to build up their entire signing\n * string within the rs_lines array and give it to rs_signFunc as a single\n * concat'd blob. rs_signer-based RequestSigners can add a line at a time to\n * their signing state by using rs_signer.update(), thus only needing to\n * buffer the hash function state and one line at a time.\n */\n if (options.sign !== undefined) {\n assert.func(options.sign, 'options.sign');\n this.rs_signFunc = options.sign;\n\n } else if (alg[0] === 'hmac' && options.key !== undefined) {\n assert.string(options.keyId, 'options.keyId');\n this.rs_keyId = options.keyId;\n\n if (typeof (options.key) !== 'string' && !Buffer.isBuffer(options.key))\n throw (new TypeError('options.key for HMAC must be a string or Buffer'));\n\n /*\n * Make an rs_signer for HMACs, not a rs_signFunc -- HMACs digest their\n * data in chunks rather than requiring it all to be given in one go\n * at the end, so they are more similar to signers than signFuncs.\n */\n this.rs_signer = crypto.createHmac(alg[1].toUpperCase(), options.key);\n this.rs_signer.sign = function () {\n var digest = this.digest('base64');\n return ({\n hashAlgorithm: alg[1],\n toString: function () { return (digest); }\n });\n };\n\n } else if (options.key !== undefined) {\n var key = options.key;\n if (typeof (key) === 'string' || Buffer.isBuffer(key))\n key = sshpk.parsePrivateKey(key);\n\n assert.ok(sshpk.PrivateKey.isPrivateKey(key, [1, 2]),\n 'options.key must be a sshpk.PrivateKey');\n this.rs_key = key;\n\n assert.string(options.keyId, 'options.keyId');\n this.rs_keyId = options.keyId;\n\n if (!PK_ALGOS[key.type]) {\n throw (new InvalidAlgorithmError(key.type.toUpperCase() + ' type ' +\n 'keys are not supported'));\n }\n\n if (alg[0] !== undefined && key.type !== alg[0]) {\n throw (new InvalidAlgorithmError('options.key must be a ' +\n alg[0].toUpperCase() + ' key, was given a ' +\n key.type.toUpperCase() + ' key instead'));\n }\n\n this.rs_signer = key.createSign(alg[1]);\n\n } else {\n throw (new TypeError('options.sign (func) or options.key is required'));\n }\n\n this.rs_headers = [];\n this.rs_lines = [];\n}\n\n/**\n * Adds a header to be signed, with its value, into this signer.\n *\n * @param {String} header\n * @param {String} value\n * @return {String} value written\n */\nRequestSigner.prototype.writeHeader = function (header, value) {\n assert.string(header, 'header');\n header = header.toLowerCase();\n assert.string(value, 'value');\n\n this.rs_headers.push(header);\n\n if (this.rs_signFunc) {\n this.rs_lines.push(header + ': ' + value);\n\n } else {\n var line = header + ': ' + value;\n if (this.rs_headers.length > 0)\n line = '\\n' + line;\n this.rs_signer.update(line);\n }\n\n return (value);\n};\n\n/**\n * Adds a default Date header, returning its value.\n *\n * @return {String}\n */\nRequestSigner.prototype.writeDateHeader = function () {\n return (this.writeHeader('date', jsprim.rfc1123(new Date())));\n};\n\n/**\n * Adds the request target line to be signed.\n *\n * @param {String} method, HTTP method (e.g. 'get', 'post', 'put')\n * @param {String} path\n */\nRequestSigner.prototype.writeTarget = function (method, path) {\n assert.string(method, 'method');\n assert.string(path, 'path');\n method = method.toLowerCase();\n this.writeHeader('(request-target)', method + ' ' + path);\n};\n\n/**\n * Calculate the value for the Authorization header on this request\n * asynchronously.\n *\n * @param {Func} callback (err, authz)\n */\nRequestSigner.prototype.sign = function (cb) {\n assert.func(cb, 'callback');\n\n if (this.rs_headers.length < 1)\n throw (new Error('At least one header must be signed'));\n\n var alg, authz;\n if (this.rs_signFunc) {\n var data = this.rs_lines.join('\\n');\n var self = this;\n this.rs_signFunc(data, function (err, sig) {\n if (err) {\n cb(err);\n return;\n }\n try {\n assert.object(sig, 'signature');\n assert.string(sig.keyId, 'signature.keyId');\n assert.string(sig.algorithm, 'signature.algorithm');\n assert.string(sig.signature, 'signature.signature');\n alg = validateAlgorithm(sig.algorithm);\n\n authz = sprintf(AUTHZ_FMT,\n sig.keyId,\n sig.algorithm,\n self.rs_headers.join(' '),\n sig.signature);\n } catch (e) {\n cb(e);\n return;\n }\n cb(null, authz);\n });\n\n } else {\n try {\n var sigObj = this.rs_signer.sign();\n } catch (e) {\n cb(e);\n return;\n }\n alg = (this.rs_alg[0] || this.rs_key.type) + '-' + sigObj.hashAlgorithm;\n var signature = sigObj.toString();\n authz = sprintf(AUTHZ_FMT,\n this.rs_keyId,\n alg,\n this.rs_headers.join(' '),\n signature);\n cb(null, authz);\n }\n};\n\n///--- Exported API\n\nmodule.exports = {\n /**\n * Identifies whether a given object is a request signer or not.\n *\n * @param {Object} object, the object to identify\n * @returns {Boolean}\n */\n isSigner: function (obj) {\n if (typeof (obj) === 'object' && obj instanceof RequestSigner)\n return (true);\n return (false);\n },\n\n /**\n * Creates a request signer, used to asynchronously build a signature\n * for a request (does not have to be an http.ClientRequest).\n *\n * @param {Object} options, either:\n * - {String} keyId\n * - {String|Buffer} key\n * - {String} algorithm (optional, required for HMAC)\n * or:\n * - {Func} sign (data, cb)\n * @return {RequestSigner}\n */\n createSigner: function createSigner(options) {\n return (new RequestSigner(options));\n },\n\n /**\n * Adds an 'Authorization' header to an http.ClientRequest object.\n *\n * Note that this API will add a Date header if it's not already set. Any\n * other headers in the options.headers array MUST be present, or this\n * will throw.\n *\n * You shouldn't need to check the return type; it's just there if you want\n * to be pedantic.\n *\n * The optional flag indicates whether parsing should use strict enforcement\n * of the version draft-cavage-http-signatures-04 of the spec or beyond.\n * The default is to be loose and support\n * older versions for compatibility.\n *\n * @param {Object} request an instance of http.ClientRequest.\n * @param {Object} options signing parameters object:\n * - {String} keyId required.\n * - {String} key required (either a PEM or HMAC key).\n * - {Array} headers optional; defaults to ['date'].\n * - {String} algorithm optional (unless key is HMAC);\n * default is the same as the sshpk default\n * signing algorithm for the type of key given\n * - {String} httpVersion optional; defaults to '1.1'.\n * - {Boolean} strict optional; defaults to 'false'.\n * @return {Boolean} true if Authorization (and optionally Date) were added.\n * @throws {TypeError} on bad parameter types (input).\n * @throws {InvalidAlgorithmError} if algorithm was bad or incompatible with\n * the given key.\n * @throws {sshpk.KeyParseError} if key was bad.\n * @throws {MissingHeaderError} if a header to be signed was specified but\n * was not present.\n */\n signRequest: function signRequest(request, options) {\n assert.object(request, 'request');\n assert.object(options, 'options');\n assert.optionalString(options.algorithm, 'options.algorithm');\n assert.string(options.keyId, 'options.keyId');\n assert.optionalArrayOfString(options.headers, 'options.headers');\n assert.optionalString(options.httpVersion, 'options.httpVersion');\n\n if (!request.getHeader('Date'))\n request.setHeader('Date', jsprim.rfc1123(new Date()));\n if (!options.headers)\n options.headers = ['date'];\n if (!options.httpVersion)\n options.httpVersion = '1.1';\n\n var alg = [];\n if (options.algorithm) {\n options.algorithm = options.algorithm.toLowerCase();\n alg = validateAlgorithm(options.algorithm);\n }\n\n var i;\n var stringToSign = '';\n for (i = 0; i < options.headers.length; i++) {\n if (typeof (options.headers[i]) !== 'string')\n throw new TypeError('options.headers must be an array of Strings');\n\n var h = options.headers[i].toLowerCase();\n\n if (h === 'request-line') {\n if (!options.strict) {\n /**\n * We allow headers from the older spec drafts if strict parsing isn't\n * specified in options.\n */\n stringToSign +=\n request.method + ' ' + request.path + ' HTTP/' +\n options.httpVersion;\n } else {\n /* Strict parsing doesn't allow older draft headers. */\n throw (new StrictParsingError('request-line is not a valid header ' +\n 'with strict parsing enabled.'));\n }\n } else if (h === '(request-target)') {\n stringToSign +=\n '(request-target): ' + request.method.toLowerCase() + ' ' +\n request.path;\n } else {\n var value = request.getHeader(h);\n if (value === undefined || value === '') {\n throw new MissingHeaderError(h + ' was not in the request');\n }\n stringToSign += h + ': ' + value;\n }\n\n if ((i + 1) < options.headers.length)\n stringToSign += '\\n';\n }\n\n /* This is just for unit tests. */\n if (request.hasOwnProperty('_stringToSign')) {\n request._stringToSign = stringToSign;\n }\n\n var signature;\n if (alg[0] === 'hmac') {\n if (typeof (options.key) !== 'string' && !Buffer.isBuffer(options.key))\n throw (new TypeError('options.key must be a string or Buffer'));\n\n var hmac = crypto.createHmac(alg[1].toUpperCase(), options.key);\n hmac.update(stringToSign);\n signature = hmac.digest('base64');\n\n } else {\n var key = options.key;\n if (typeof (key) === 'string' || Buffer.isBuffer(key))\n key = sshpk.parsePrivateKey(options.key);\n\n assert.ok(sshpk.PrivateKey.isPrivateKey(key, [1, 2]),\n 'options.key must be a sshpk.PrivateKey');\n\n if (!PK_ALGOS[key.type]) {\n throw (new InvalidAlgorithmError(key.type.toUpperCase() + ' type ' +\n 'keys are not supported'));\n }\n\n if (alg[0] !== undefined && key.type !== alg[0]) {\n throw (new InvalidAlgorithmError('options.key must be a ' +\n alg[0].toUpperCase() + ' key, was given a ' +\n key.type.toUpperCase() + ' key instead'));\n }\n\n var signer = key.createSign(alg[1]);\n signer.update(stringToSign);\n var sigObj = signer.sign();\n if (!HASH_ALGOS[sigObj.hashAlgorithm]) {\n throw (new InvalidAlgorithmError(sigObj.hashAlgorithm.toUpperCase() +\n ' is not a supported hash algorithm'));\n }\n options.algorithm = key.type + '-' + sigObj.hashAlgorithm;\n signature = sigObj.toString();\n assert.notStrictEqual(signature, '', 'empty signature produced');\n }\n\n var authzHeaderName = options.authorizationHeaderName || 'Authorization';\n\n request.setHeader(authzHeaderName, sprintf(AUTHZ_FMT,\n options.keyId,\n options.algorithm,\n options.headers.join(' '),\n signature));\n\n return true;\n }\n\n};\n","// Copyright 2012 Joyent, Inc. All rights reserved.\n\nvar assert = require('assert-plus');\nvar sshpk = require('sshpk');\nvar util = require('util');\n\nvar HASH_ALGOS = {\n 'sha1': true,\n 'sha256': true,\n 'sha512': true\n};\n\nvar PK_ALGOS = {\n 'rsa': true,\n 'dsa': true,\n 'ecdsa': true\n};\n\nfunction HttpSignatureError(message, caller) {\n if (Error.captureStackTrace)\n Error.captureStackTrace(this, caller || HttpSignatureError);\n\n this.message = message;\n this.name = caller.name;\n}\nutil.inherits(HttpSignatureError, Error);\n\nfunction InvalidAlgorithmError(message) {\n HttpSignatureError.call(this, message, InvalidAlgorithmError);\n}\nutil.inherits(InvalidAlgorithmError, HttpSignatureError);\n\nfunction validateAlgorithm(algorithm) {\n var alg = algorithm.toLowerCase().split('-');\n\n if (alg.length !== 2) {\n throw (new InvalidAlgorithmError(alg[0].toUpperCase() + ' is not a ' +\n 'valid algorithm'));\n }\n\n if (alg[0] !== 'hmac' && !PK_ALGOS[alg[0]]) {\n throw (new InvalidAlgorithmError(alg[0].toUpperCase() + ' type keys ' +\n 'are not supported'));\n }\n\n if (!HASH_ALGOS[alg[1]]) {\n throw (new InvalidAlgorithmError(alg[1].toUpperCase() + ' is not a ' +\n 'supported hash algorithm'));\n }\n\n return (alg);\n}\n\n///--- API\n\nmodule.exports = {\n\n HASH_ALGOS: HASH_ALGOS,\n PK_ALGOS: PK_ALGOS,\n\n HttpSignatureError: HttpSignatureError,\n InvalidAlgorithmError: InvalidAlgorithmError,\n\n validateAlgorithm: validateAlgorithm,\n\n /**\n * Converts an OpenSSH public key (rsa only) to a PKCS#8 PEM file.\n *\n * The intent of this module is to interoperate with OpenSSL only,\n * specifically the node crypto module's `verify` method.\n *\n * @param {String} key an OpenSSH public key.\n * @return {String} PEM encoded form of the RSA public key.\n * @throws {TypeError} on bad input.\n * @throws {Error} on invalid ssh key formatted data.\n */\n sshKeyToPEM: function sshKeyToPEM(key) {\n assert.string(key, 'ssh_key');\n\n var k = sshpk.parseKey(key, 'ssh');\n return (k.toString('pem'));\n },\n\n\n /**\n * Generates an OpenSSH fingerprint from an ssh public key.\n *\n * @param {String} key an OpenSSH public key.\n * @return {String} key fingerprint.\n * @throws {TypeError} on bad input.\n * @throws {Error} if what you passed doesn't look like an ssh public key.\n */\n fingerprint: function fingerprint(key) {\n assert.string(key, 'ssh_key');\n\n var k = sshpk.parseKey(key, 'ssh');\n return (k.fingerprint('md5').toString('hex'));\n },\n\n /**\n * Converts a PKGCS#8 PEM file to an OpenSSH public key (rsa)\n *\n * The reverse of the above function.\n */\n pemToRsaSSHKey: function pemToRsaSSHKey(pem, comment) {\n assert.equal('string', typeof (pem), 'typeof pem');\n\n var k = sshpk.parseKey(pem, 'pem');\n k.comment = comment;\n return (k.toString('ssh'));\n }\n};\n","// Copyright 2015 Joyent, Inc.\n\nvar assert = require('assert-plus');\nvar crypto = require('crypto');\nvar sshpk = require('sshpk');\nvar utils = require('./utils');\n\nvar HASH_ALGOS = utils.HASH_ALGOS;\nvar PK_ALGOS = utils.PK_ALGOS;\nvar InvalidAlgorithmError = utils.InvalidAlgorithmError;\nvar HttpSignatureError = utils.HttpSignatureError;\nvar validateAlgorithm = utils.validateAlgorithm;\n\n///--- Exported API\n\nmodule.exports = {\n /**\n * Verify RSA/DSA signature against public key. You are expected to pass in\n * an object that was returned from `parse()`.\n *\n * @param {Object} parsedSignature the object you got from `parse`.\n * @param {String} pubkey RSA/DSA private key PEM.\n * @return {Boolean} true if valid, false otherwise.\n * @throws {TypeError} if you pass in bad arguments.\n * @throws {InvalidAlgorithmError}\n */\n verifySignature: function verifySignature(parsedSignature, pubkey) {\n assert.object(parsedSignature, 'parsedSignature');\n if (typeof (pubkey) === 'string' || Buffer.isBuffer(pubkey))\n pubkey = sshpk.parseKey(pubkey);\n assert.ok(sshpk.Key.isKey(pubkey, [1, 1]), 'pubkey must be a sshpk.Key');\n\n var alg = validateAlgorithm(parsedSignature.algorithm);\n if (alg[0] === 'hmac' || alg[0] !== pubkey.type)\n return (false);\n\n var v = pubkey.createVerify(alg[1]);\n v.update(parsedSignature.signingString);\n return (v.verify(parsedSignature.params.signature, 'base64'));\n },\n\n /**\n * Verify HMAC against shared secret. You are expected to pass in an object\n * that was returned from `parse()`.\n *\n * @param {Object} parsedSignature the object you got from `parse`.\n * @param {String} secret HMAC shared secret.\n * @return {Boolean} true if valid, false otherwise.\n * @throws {TypeError} if you pass in bad arguments.\n * @throws {InvalidAlgorithmError}\n */\n verifyHMAC: function verifyHMAC(parsedSignature, secret) {\n assert.object(parsedSignature, 'parsedHMAC');\n assert.string(secret, 'secret');\n\n var alg = validateAlgorithm(parsedSignature.algorithm);\n if (alg[0] !== 'hmac')\n return (false);\n\n var hashAlg = alg[1].toUpperCase();\n\n var hmac = crypto.createHmac(hashAlg, secret);\n hmac.update(parsedSignature.signingString);\n\n /*\n * Now double-hash to avoid leaking timing information - there's\n * no easy constant-time compare in JS, so we use this approach\n * instead. See for more info:\n * https://www.isecpartners.com/blog/2011/february/double-hmac-\n * verification.aspx\n */\n var h1 = crypto.createHmac(hashAlg, secret);\n h1.update(hmac.digest());\n h1 = h1.digest();\n var h2 = crypto.createHmac(hashAlg, secret);\n h2.update(new Buffer(parsedSignature.params.signature, 'base64'));\n h2 = h2.digest();\n\n /* Node 0.8 returns strings from .digest(). */\n if (typeof (h1) === 'string')\n return (h1 === h2);\n /* And node 0.10 lacks the .equals() method on Buffers. */\n if (Buffer.isBuffer(h1) && !h1.equals)\n return (h1.toString('binary') === h2.toString('binary'));\n\n return (h1.equals(h2));\n }\n};\n","'use strict';\n\nmodule.exports = (string, count = 1, options) => {\n\toptions = {\n\t\tindent: ' ',\n\t\tincludeEmptyLines: false,\n\t\t...options\n\t};\n\n\tif (typeof string !== 'string') {\n\t\tthrow new TypeError(\n\t\t\t`Expected \\`input\\` to be a \\`string\\`, got \\`${typeof string}\\``\n\t\t);\n\t}\n\n\tif (typeof count !== 'number') {\n\t\tthrow new TypeError(\n\t\t\t`Expected \\`count\\` to be a \\`number\\`, got \\`${typeof count}\\``\n\t\t);\n\t}\n\n\tif (typeof options.indent !== 'string') {\n\t\tthrow new TypeError(\n\t\t\t`Expected \\`options.indent\\` to be a \\`string\\`, got \\`${typeof options.indent}\\``\n\t\t);\n\t}\n\n\tif (count === 0) {\n\t\treturn string;\n\t}\n\n\tconst regex = options.includeEmptyLines ? /^/gm : /^(?!\\s*$)/gm;\n\n\treturn string.replace(regex, options.indent.repeat(count));\n};\n","var wrappy = require('wrappy')\nvar reqs = Object.create(null)\nvar once = require('once')\n\nmodule.exports = wrappy(inflight)\n\nfunction inflight (key, cb) {\n if (reqs[key]) {\n reqs[key].push(cb)\n return null\n } else {\n reqs[key] = [cb]\n return makeres(key)\n }\n}\n\nfunction makeres (key) {\n return once(function RES () {\n var cbs = reqs[key]\n var len = cbs.length\n var args = slice(arguments)\n\n // XXX It's somewhat ambiguous whether a new callback added in this\n // pass should be queued for later execution if something in the\n // list of callbacks throws, or if it should just be discarded.\n // However, it's such an edge case that it hardly matters, and either\n // choice is likely as surprising as the other.\n // As it happens, we do go ahead and schedule it for later execution.\n try {\n for (var i = 0; i < len; i++) {\n cbs[i].apply(null, args)\n }\n } finally {\n if (cbs.length > len) {\n // added more in the interim.\n // de-zalgo, just in case, but don't call again.\n cbs.splice(0, len)\n process.nextTick(function () {\n RES.apply(null, args)\n })\n } else {\n delete reqs[key]\n }\n }\n })\n}\n\nfunction slice (args) {\n var length = args.length\n var array = []\n\n for (var i = 0; i < length; i++) array[i] = args[i]\n return array\n}\n","try {\n var util = require('util');\n /* istanbul ignore next */\n if (typeof util.inherits !== 'function') throw '';\n module.exports = util.inherits;\n} catch (e) {\n /* istanbul ignore next */\n module.exports = require('./inherits_browser.js');\n}\n","if (typeof Object.create === 'function') {\n // implementation from standard node.js 'util' module\n module.exports = function inherits(ctor, superCtor) {\n if (superCtor) {\n ctor.super_ = superCtor\n ctor.prototype = Object.create(superCtor.prototype, {\n constructor: {\n value: ctor,\n enumerable: false,\n writable: true,\n configurable: true\n }\n })\n }\n };\n} else {\n // old school shim for old browsers\n module.exports = function inherits(ctor, superCtor) {\n if (superCtor) {\n ctor.super_ = superCtor\n var TempCtor = function () {}\n TempCtor.prototype = superCtor.prototype\n ctor.prototype = new TempCtor()\n ctor.prototype.constructor = ctor\n }\n }\n}\n","module.exports = isTypedArray\nisTypedArray.strict = isStrictTypedArray\nisTypedArray.loose = isLooseTypedArray\n\nvar toString = Object.prototype.toString\nvar names = {\n '[object Int8Array]': true\n , '[object Int16Array]': true\n , '[object Int32Array]': true\n , '[object Uint8Array]': true\n , '[object Uint8ClampedArray]': true\n , '[object Uint16Array]': true\n , '[object Uint32Array]': true\n , '[object Float32Array]': true\n , '[object Float64Array]': true\n}\n\nfunction isTypedArray(arr) {\n return (\n isStrictTypedArray(arr)\n || isLooseTypedArray(arr)\n )\n}\n\nfunction isStrictTypedArray(arr) {\n return (\n arr instanceof Int8Array\n || arr instanceof Int16Array\n || arr instanceof Int32Array\n || arr instanceof Uint8Array\n || arr instanceof Uint8ClampedArray\n || arr instanceof Uint16Array\n || arr instanceof Uint32Array\n || arr instanceof Float32Array\n || arr instanceof Float64Array\n )\n}\n\nfunction isLooseTypedArray(arr) {\n return names[toString.call(arr)]\n}\n","\"use strict\";\n\nmodule.exports = require('ws');","var stream = require('stream')\n\n\nfunction isStream (obj) {\n return obj instanceof stream.Stream\n}\n\n\nfunction isReadable (obj) {\n return isStream(obj) && typeof obj._read == 'function' && typeof obj._readableState == 'object'\n}\n\n\nfunction isWritable (obj) {\n return isStream(obj) && typeof obj._write == 'function' && typeof obj._writableState == 'object'\n}\n\n\nfunction isDuplex (obj) {\n return isReadable(obj) && isWritable(obj)\n}\n\n\nmodule.exports = isStream\nmodule.exports.isReadable = isReadable\nmodule.exports.isWritable = isWritable\nmodule.exports.isDuplex = isDuplex\n","(function(exports) {\n \"use strict\";\n\n function isArray(obj) {\n if (obj !== null) {\n return Object.prototype.toString.call(obj) === \"[object Array]\";\n } else {\n return false;\n }\n }\n\n function isObject(obj) {\n if (obj !== null) {\n return Object.prototype.toString.call(obj) === \"[object Object]\";\n } else {\n return false;\n }\n }\n\n function strictDeepEqual(first, second) {\n // Check the scalar case first.\n if (first === second) {\n return true;\n }\n\n // Check if they are the same type.\n var firstType = Object.prototype.toString.call(first);\n if (firstType !== Object.prototype.toString.call(second)) {\n return false;\n }\n // We know that first and second have the same type so we can just check the\n // first type from now on.\n if (isArray(first) === true) {\n // Short circuit if they're not the same length;\n if (first.length !== second.length) {\n return false;\n }\n for (var i = 0; i < first.length; i++) {\n if (strictDeepEqual(first[i], second[i]) === false) {\n return false;\n }\n }\n return true;\n }\n if (isObject(first) === true) {\n // An object is equal if it has the same key/value pairs.\n var keysSeen = {};\n for (var key in first) {\n if (hasOwnProperty.call(first, key)) {\n if (strictDeepEqual(first[key], second[key]) === false) {\n return false;\n }\n keysSeen[key] = true;\n }\n }\n // Now check that there aren't any keys in second that weren't\n // in first.\n for (var key2 in second) {\n if (hasOwnProperty.call(second, key2)) {\n if (keysSeen[key2] !== true) {\n return false;\n }\n }\n }\n return true;\n }\n return false;\n }\n\n function isFalse(obj) {\n // From the spec:\n // A false value corresponds to the following values:\n // Empty list\n // Empty object\n // Empty string\n // False boolean\n // null value\n\n // First check the scalar values.\n if (obj === \"\" || obj === false || obj === null) {\n return true;\n } else if (isArray(obj) && obj.length === 0) {\n // Check for an empty array.\n return true;\n } else if (isObject(obj)) {\n // Check for an empty object.\n for (var key in obj) {\n // If there are any keys, then\n // the object is not empty so the object\n // is not false.\n if (obj.hasOwnProperty(key)) {\n return false;\n }\n }\n return true;\n } else {\n return false;\n }\n }\n\n function objValues(obj) {\n var keys = Object.keys(obj);\n var values = [];\n for (var i = 0; i < keys.length; i++) {\n values.push(obj[keys[i]]);\n }\n return values;\n }\n\n function merge(a, b) {\n var merged = {};\n for (var key in a) {\n merged[key] = a[key];\n }\n for (var key2 in b) {\n merged[key2] = b[key2];\n }\n return merged;\n }\n\n var trimLeft;\n if (typeof String.prototype.trimLeft === \"function\") {\n trimLeft = function(str) {\n return str.trimLeft();\n };\n } else {\n trimLeft = function(str) {\n return str.match(/^\\s*(.*)/)[1];\n };\n }\n\n // Type constants used to define functions.\n var TYPE_NUMBER = 0;\n var TYPE_ANY = 1;\n var TYPE_STRING = 2;\n var TYPE_ARRAY = 3;\n var TYPE_OBJECT = 4;\n var TYPE_BOOLEAN = 5;\n var TYPE_EXPREF = 6;\n var TYPE_NULL = 7;\n var TYPE_ARRAY_NUMBER = 8;\n var TYPE_ARRAY_STRING = 9;\n\n var TOK_EOF = \"EOF\";\n var TOK_UNQUOTEDIDENTIFIER = \"UnquotedIdentifier\";\n var TOK_QUOTEDIDENTIFIER = \"QuotedIdentifier\";\n var TOK_RBRACKET = \"Rbracket\";\n var TOK_RPAREN = \"Rparen\";\n var TOK_COMMA = \"Comma\";\n var TOK_COLON = \"Colon\";\n var TOK_RBRACE = \"Rbrace\";\n var TOK_NUMBER = \"Number\";\n var TOK_CURRENT = \"Current\";\n var TOK_EXPREF = \"Expref\";\n var TOK_PIPE = \"Pipe\";\n var TOK_OR = \"Or\";\n var TOK_AND = \"And\";\n var TOK_EQ = \"EQ\";\n var TOK_GT = \"GT\";\n var TOK_LT = \"LT\";\n var TOK_GTE = \"GTE\";\n var TOK_LTE = \"LTE\";\n var TOK_NE = \"NE\";\n var TOK_FLATTEN = \"Flatten\";\n var TOK_STAR = \"Star\";\n var TOK_FILTER = \"Filter\";\n var TOK_DOT = \"Dot\";\n var TOK_NOT = \"Not\";\n var TOK_LBRACE = \"Lbrace\";\n var TOK_LBRACKET = \"Lbracket\";\n var TOK_LPAREN= \"Lparen\";\n var TOK_LITERAL= \"Literal\";\n\n // The \"&\", \"[\", \"<\", \">\" tokens\n // are not in basicToken because\n // there are two token variants\n // (\"&&\", \"[?\", \"<=\", \">=\"). This is specially handled\n // below.\n\n var basicTokens = {\n \".\": TOK_DOT,\n \"*\": TOK_STAR,\n \",\": TOK_COMMA,\n \":\": TOK_COLON,\n \"{\": TOK_LBRACE,\n \"}\": TOK_RBRACE,\n \"]\": TOK_RBRACKET,\n \"(\": TOK_LPAREN,\n \")\": TOK_RPAREN,\n \"@\": TOK_CURRENT\n };\n\n var operatorStartToken = {\n \"<\": true,\n \">\": true,\n \"=\": true,\n \"!\": true\n };\n\n var skipChars = {\n \" \": true,\n \"\\t\": true,\n \"\\n\": true\n };\n\n\n function isAlpha(ch) {\n return (ch >= \"a\" && ch <= \"z\") ||\n (ch >= \"A\" && ch <= \"Z\") ||\n ch === \"_\";\n }\n\n function isNum(ch) {\n return (ch >= \"0\" && ch <= \"9\") ||\n ch === \"-\";\n }\n function isAlphaNum(ch) {\n return (ch >= \"a\" && ch <= \"z\") ||\n (ch >= \"A\" && ch <= \"Z\") ||\n (ch >= \"0\" && ch <= \"9\") ||\n ch === \"_\";\n }\n\n function Lexer() {\n }\n Lexer.prototype = {\n tokenize: function(stream) {\n var tokens = [];\n this._current = 0;\n var start;\n var identifier;\n var token;\n while (this._current < stream.length) {\n if (isAlpha(stream[this._current])) {\n start = this._current;\n identifier = this._consumeUnquotedIdentifier(stream);\n tokens.push({type: TOK_UNQUOTEDIDENTIFIER,\n value: identifier,\n start: start});\n } else if (basicTokens[stream[this._current]] !== undefined) {\n tokens.push({type: basicTokens[stream[this._current]],\n value: stream[this._current],\n start: this._current});\n this._current++;\n } else if (isNum(stream[this._current])) {\n token = this._consumeNumber(stream);\n tokens.push(token);\n } else if (stream[this._current] === \"[\") {\n // No need to increment this._current. This happens\n // in _consumeLBracket\n token = this._consumeLBracket(stream);\n tokens.push(token);\n } else if (stream[this._current] === \"\\\"\") {\n start = this._current;\n identifier = this._consumeQuotedIdentifier(stream);\n tokens.push({type: TOK_QUOTEDIDENTIFIER,\n value: identifier,\n start: start});\n } else if (stream[this._current] === \"'\") {\n start = this._current;\n identifier = this._consumeRawStringLiteral(stream);\n tokens.push({type: TOK_LITERAL,\n value: identifier,\n start: start});\n } else if (stream[this._current] === \"`\") {\n start = this._current;\n var literal = this._consumeLiteral(stream);\n tokens.push({type: TOK_LITERAL,\n value: literal,\n start: start});\n } else if (operatorStartToken[stream[this._current]] !== undefined) {\n tokens.push(this._consumeOperator(stream));\n } else if (skipChars[stream[this._current]] !== undefined) {\n // Ignore whitespace.\n this._current++;\n } else if (stream[this._current] === \"&\") {\n start = this._current;\n this._current++;\n if (stream[this._current] === \"&\") {\n this._current++;\n tokens.push({type: TOK_AND, value: \"&&\", start: start});\n } else {\n tokens.push({type: TOK_EXPREF, value: \"&\", start: start});\n }\n } else if (stream[this._current] === \"|\") {\n start = this._current;\n this._current++;\n if (stream[this._current] === \"|\") {\n this._current++;\n tokens.push({type: TOK_OR, value: \"||\", start: start});\n } else {\n tokens.push({type: TOK_PIPE, value: \"|\", start: start});\n }\n } else {\n var error = new Error(\"Unknown character:\" + stream[this._current]);\n error.name = \"LexerError\";\n throw error;\n }\n }\n return tokens;\n },\n\n _consumeUnquotedIdentifier: function(stream) {\n var start = this._current;\n this._current++;\n while (this._current < stream.length && isAlphaNum(stream[this._current])) {\n this._current++;\n }\n return stream.slice(start, this._current);\n },\n\n _consumeQuotedIdentifier: function(stream) {\n var start = this._current;\n this._current++;\n var maxLength = stream.length;\n while (stream[this._current] !== \"\\\"\" && this._current < maxLength) {\n // You can escape a double quote and you can escape an escape.\n var current = this._current;\n if (stream[current] === \"\\\\\" && (stream[current + 1] === \"\\\\\" ||\n stream[current + 1] === \"\\\"\")) {\n current += 2;\n } else {\n current++;\n }\n this._current = current;\n }\n this._current++;\n return JSON.parse(stream.slice(start, this._current));\n },\n\n _consumeRawStringLiteral: function(stream) {\n var start = this._current;\n this._current++;\n var maxLength = stream.length;\n while (stream[this._current] !== \"'\" && this._current < maxLength) {\n // You can escape a single quote and you can escape an escape.\n var current = this._current;\n if (stream[current] === \"\\\\\" && (stream[current + 1] === \"\\\\\" ||\n stream[current + 1] === \"'\")) {\n current += 2;\n } else {\n current++;\n }\n this._current = current;\n }\n this._current++;\n var literal = stream.slice(start + 1, this._current - 1);\n return literal.replace(\"\\\\'\", \"'\");\n },\n\n _consumeNumber: function(stream) {\n var start = this._current;\n this._current++;\n var maxLength = stream.length;\n while (isNum(stream[this._current]) && this._current < maxLength) {\n this._current++;\n }\n var value = parseInt(stream.slice(start, this._current));\n return {type: TOK_NUMBER, value: value, start: start};\n },\n\n _consumeLBracket: function(stream) {\n var start = this._current;\n this._current++;\n if (stream[this._current] === \"?\") {\n this._current++;\n return {type: TOK_FILTER, value: \"[?\", start: start};\n } else if (stream[this._current] === \"]\") {\n this._current++;\n return {type: TOK_FLATTEN, value: \"[]\", start: start};\n } else {\n return {type: TOK_LBRACKET, value: \"[\", start: start};\n }\n },\n\n _consumeOperator: function(stream) {\n var start = this._current;\n var startingChar = stream[start];\n this._current++;\n if (startingChar === \"!\") {\n if (stream[this._current] === \"=\") {\n this._current++;\n return {type: TOK_NE, value: \"!=\", start: start};\n } else {\n return {type: TOK_NOT, value: \"!\", start: start};\n }\n } else if (startingChar === \"<\") {\n if (stream[this._current] === \"=\") {\n this._current++;\n return {type: TOK_LTE, value: \"<=\", start: start};\n } else {\n return {type: TOK_LT, value: \"<\", start: start};\n }\n } else if (startingChar === \">\") {\n if (stream[this._current] === \"=\") {\n this._current++;\n return {type: TOK_GTE, value: \">=\", start: start};\n } else {\n return {type: TOK_GT, value: \">\", start: start};\n }\n } else if (startingChar === \"=\") {\n if (stream[this._current] === \"=\") {\n this._current++;\n return {type: TOK_EQ, value: \"==\", start: start};\n }\n }\n },\n\n _consumeLiteral: function(stream) {\n this._current++;\n var start = this._current;\n var maxLength = stream.length;\n var literal;\n while(stream[this._current] !== \"`\" && this._current < maxLength) {\n // You can escape a literal char or you can escape the escape.\n var current = this._current;\n if (stream[current] === \"\\\\\" && (stream[current + 1] === \"\\\\\" ||\n stream[current + 1] === \"`\")) {\n current += 2;\n } else {\n current++;\n }\n this._current = current;\n }\n var literalString = trimLeft(stream.slice(start, this._current));\n literalString = literalString.replace(\"\\\\`\", \"`\");\n if (this._looksLikeJSON(literalString)) {\n literal = JSON.parse(literalString);\n } else {\n // Try to JSON parse it as \"\"\n literal = JSON.parse(\"\\\"\" + literalString + \"\\\"\");\n }\n // +1 gets us to the ending \"`\", +1 to move on to the next char.\n this._current++;\n return literal;\n },\n\n _looksLikeJSON: function(literalString) {\n var startingChars = \"[{\\\"\";\n var jsonLiterals = [\"true\", \"false\", \"null\"];\n var numberLooking = \"-0123456789\";\n\n if (literalString === \"\") {\n return false;\n } else if (startingChars.indexOf(literalString[0]) >= 0) {\n return true;\n } else if (jsonLiterals.indexOf(literalString) >= 0) {\n return true;\n } else if (numberLooking.indexOf(literalString[0]) >= 0) {\n try {\n JSON.parse(literalString);\n return true;\n } catch (ex) {\n return false;\n }\n } else {\n return false;\n }\n }\n };\n\n var bindingPower = {};\n bindingPower[TOK_EOF] = 0;\n bindingPower[TOK_UNQUOTEDIDENTIFIER] = 0;\n bindingPower[TOK_QUOTEDIDENTIFIER] = 0;\n bindingPower[TOK_RBRACKET] = 0;\n bindingPower[TOK_RPAREN] = 0;\n bindingPower[TOK_COMMA] = 0;\n bindingPower[TOK_RBRACE] = 0;\n bindingPower[TOK_NUMBER] = 0;\n bindingPower[TOK_CURRENT] = 0;\n bindingPower[TOK_EXPREF] = 0;\n bindingPower[TOK_PIPE] = 1;\n bindingPower[TOK_OR] = 2;\n bindingPower[TOK_AND] = 3;\n bindingPower[TOK_EQ] = 5;\n bindingPower[TOK_GT] = 5;\n bindingPower[TOK_LT] = 5;\n bindingPower[TOK_GTE] = 5;\n bindingPower[TOK_LTE] = 5;\n bindingPower[TOK_NE] = 5;\n bindingPower[TOK_FLATTEN] = 9;\n bindingPower[TOK_STAR] = 20;\n bindingPower[TOK_FILTER] = 21;\n bindingPower[TOK_DOT] = 40;\n bindingPower[TOK_NOT] = 45;\n bindingPower[TOK_LBRACE] = 50;\n bindingPower[TOK_LBRACKET] = 55;\n bindingPower[TOK_LPAREN] = 60;\n\n function Parser() {\n }\n\n Parser.prototype = {\n parse: function(expression) {\n this._loadTokens(expression);\n this.index = 0;\n var ast = this.expression(0);\n if (this._lookahead(0) !== TOK_EOF) {\n var t = this._lookaheadToken(0);\n var error = new Error(\n \"Unexpected token type: \" + t.type + \", value: \" + t.value);\n error.name = \"ParserError\";\n throw error;\n }\n return ast;\n },\n\n _loadTokens: function(expression) {\n var lexer = new Lexer();\n var tokens = lexer.tokenize(expression);\n tokens.push({type: TOK_EOF, value: \"\", start: expression.length});\n this.tokens = tokens;\n },\n\n expression: function(rbp) {\n var leftToken = this._lookaheadToken(0);\n this._advance();\n var left = this.nud(leftToken);\n var currentToken = this._lookahead(0);\n while (rbp < bindingPower[currentToken]) {\n this._advance();\n left = this.led(currentToken, left);\n currentToken = this._lookahead(0);\n }\n return left;\n },\n\n _lookahead: function(number) {\n return this.tokens[this.index + number].type;\n },\n\n _lookaheadToken: function(number) {\n return this.tokens[this.index + number];\n },\n\n _advance: function() {\n this.index++;\n },\n\n nud: function(token) {\n var left;\n var right;\n var expression;\n switch (token.type) {\n case TOK_LITERAL:\n return {type: \"Literal\", value: token.value};\n case TOK_UNQUOTEDIDENTIFIER:\n return {type: \"Field\", name: token.value};\n case TOK_QUOTEDIDENTIFIER:\n var node = {type: \"Field\", name: token.value};\n if (this._lookahead(0) === TOK_LPAREN) {\n throw new Error(\"Quoted identifier not allowed for function names.\");\n } else {\n return node;\n }\n break;\n case TOK_NOT:\n right = this.expression(bindingPower.Not);\n return {type: \"NotExpression\", children: [right]};\n case TOK_STAR:\n left = {type: \"Identity\"};\n right = null;\n if (this._lookahead(0) === TOK_RBRACKET) {\n // This can happen in a multiselect,\n // [a, b, *]\n right = {type: \"Identity\"};\n } else {\n right = this._parseProjectionRHS(bindingPower.Star);\n }\n return {type: \"ValueProjection\", children: [left, right]};\n case TOK_FILTER:\n return this.led(token.type, {type: \"Identity\"});\n case TOK_LBRACE:\n return this._parseMultiselectHash();\n case TOK_FLATTEN:\n left = {type: TOK_FLATTEN, children: [{type: \"Identity\"}]};\n right = this._parseProjectionRHS(bindingPower.Flatten);\n return {type: \"Projection\", children: [left, right]};\n case TOK_LBRACKET:\n if (this._lookahead(0) === TOK_NUMBER || this._lookahead(0) === TOK_COLON) {\n right = this._parseIndexExpression();\n return this._projectIfSlice({type: \"Identity\"}, right);\n } else if (this._lookahead(0) === TOK_STAR &&\n this._lookahead(1) === TOK_RBRACKET) {\n this._advance();\n this._advance();\n right = this._parseProjectionRHS(bindingPower.Star);\n return {type: \"Projection\",\n children: [{type: \"Identity\"}, right]};\n } else {\n return this._parseMultiselectList();\n }\n break;\n case TOK_CURRENT:\n return {type: TOK_CURRENT};\n case TOK_EXPREF:\n expression = this.expression(bindingPower.Expref);\n return {type: \"ExpressionReference\", children: [expression]};\n case TOK_LPAREN:\n var args = [];\n while (this._lookahead(0) !== TOK_RPAREN) {\n if (this._lookahead(0) === TOK_CURRENT) {\n expression = {type: TOK_CURRENT};\n this._advance();\n } else {\n expression = this.expression(0);\n }\n args.push(expression);\n }\n this._match(TOK_RPAREN);\n return args[0];\n default:\n this._errorToken(token);\n }\n },\n\n led: function(tokenName, left) {\n var right;\n switch(tokenName) {\n case TOK_DOT:\n var rbp = bindingPower.Dot;\n if (this._lookahead(0) !== TOK_STAR) {\n right = this._parseDotRHS(rbp);\n return {type: \"Subexpression\", children: [left, right]};\n } else {\n // Creating a projection.\n this._advance();\n right = this._parseProjectionRHS(rbp);\n return {type: \"ValueProjection\", children: [left, right]};\n }\n break;\n case TOK_PIPE:\n right = this.expression(bindingPower.Pipe);\n return {type: TOK_PIPE, children: [left, right]};\n case TOK_OR:\n right = this.expression(bindingPower.Or);\n return {type: \"OrExpression\", children: [left, right]};\n case TOK_AND:\n right = this.expression(bindingPower.And);\n return {type: \"AndExpression\", children: [left, right]};\n case TOK_LPAREN:\n var name = left.name;\n var args = [];\n var expression, node;\n while (this._lookahead(0) !== TOK_RPAREN) {\n if (this._lookahead(0) === TOK_CURRENT) {\n expression = {type: TOK_CURRENT};\n this._advance();\n } else {\n expression = this.expression(0);\n }\n if (this._lookahead(0) === TOK_COMMA) {\n this._match(TOK_COMMA);\n }\n args.push(expression);\n }\n this._match(TOK_RPAREN);\n node = {type: \"Function\", name: name, children: args};\n return node;\n case TOK_FILTER:\n var condition = this.expression(0);\n this._match(TOK_RBRACKET);\n if (this._lookahead(0) === TOK_FLATTEN) {\n right = {type: \"Identity\"};\n } else {\n right = this._parseProjectionRHS(bindingPower.Filter);\n }\n return {type: \"FilterProjection\", children: [left, right, condition]};\n case TOK_FLATTEN:\n var leftNode = {type: TOK_FLATTEN, children: [left]};\n var rightNode = this._parseProjectionRHS(bindingPower.Flatten);\n return {type: \"Projection\", children: [leftNode, rightNode]};\n case TOK_EQ:\n case TOK_NE:\n case TOK_GT:\n case TOK_GTE:\n case TOK_LT:\n case TOK_LTE:\n return this._parseComparator(left, tokenName);\n case TOK_LBRACKET:\n var token = this._lookaheadToken(0);\n if (token.type === TOK_NUMBER || token.type === TOK_COLON) {\n right = this._parseIndexExpression();\n return this._projectIfSlice(left, right);\n } else {\n this._match(TOK_STAR);\n this._match(TOK_RBRACKET);\n right = this._parseProjectionRHS(bindingPower.Star);\n return {type: \"Projection\", children: [left, right]};\n }\n break;\n default:\n this._errorToken(this._lookaheadToken(0));\n }\n },\n\n _match: function(tokenType) {\n if (this._lookahead(0) === tokenType) {\n this._advance();\n } else {\n var t = this._lookaheadToken(0);\n var error = new Error(\"Expected \" + tokenType + \", got: \" + t.type);\n error.name = \"ParserError\";\n throw error;\n }\n },\n\n _errorToken: function(token) {\n var error = new Error(\"Invalid token (\" +\n token.type + \"): \\\"\" +\n token.value + \"\\\"\");\n error.name = \"ParserError\";\n throw error;\n },\n\n\n _parseIndexExpression: function() {\n if (this._lookahead(0) === TOK_COLON || this._lookahead(1) === TOK_COLON) {\n return this._parseSliceExpression();\n } else {\n var node = {\n type: \"Index\",\n value: this._lookaheadToken(0).value};\n this._advance();\n this._match(TOK_RBRACKET);\n return node;\n }\n },\n\n _projectIfSlice: function(left, right) {\n var indexExpr = {type: \"IndexExpression\", children: [left, right]};\n if (right.type === \"Slice\") {\n return {\n type: \"Projection\",\n children: [indexExpr, this._parseProjectionRHS(bindingPower.Star)]\n };\n } else {\n return indexExpr;\n }\n },\n\n _parseSliceExpression: function() {\n // [start:end:step] where each part is optional, as well as the last\n // colon.\n var parts = [null, null, null];\n var index = 0;\n var currentToken = this._lookahead(0);\n while (currentToken !== TOK_RBRACKET && index < 3) {\n if (currentToken === TOK_COLON) {\n index++;\n this._advance();\n } else if (currentToken === TOK_NUMBER) {\n parts[index] = this._lookaheadToken(0).value;\n this._advance();\n } else {\n var t = this._lookahead(0);\n var error = new Error(\"Syntax error, unexpected token: \" +\n t.value + \"(\" + t.type + \")\");\n error.name = \"Parsererror\";\n throw error;\n }\n currentToken = this._lookahead(0);\n }\n this._match(TOK_RBRACKET);\n return {\n type: \"Slice\",\n children: parts\n };\n },\n\n _parseComparator: function(left, comparator) {\n var right = this.expression(bindingPower[comparator]);\n return {type: \"Comparator\", name: comparator, children: [left, right]};\n },\n\n _parseDotRHS: function(rbp) {\n var lookahead = this._lookahead(0);\n var exprTokens = [TOK_UNQUOTEDIDENTIFIER, TOK_QUOTEDIDENTIFIER, TOK_STAR];\n if (exprTokens.indexOf(lookahead) >= 0) {\n return this.expression(rbp);\n } else if (lookahead === TOK_LBRACKET) {\n this._match(TOK_LBRACKET);\n return this._parseMultiselectList();\n } else if (lookahead === TOK_LBRACE) {\n this._match(TOK_LBRACE);\n return this._parseMultiselectHash();\n }\n },\n\n _parseProjectionRHS: function(rbp) {\n var right;\n if (bindingPower[this._lookahead(0)] < 10) {\n right = {type: \"Identity\"};\n } else if (this._lookahead(0) === TOK_LBRACKET) {\n right = this.expression(rbp);\n } else if (this._lookahead(0) === TOK_FILTER) {\n right = this.expression(rbp);\n } else if (this._lookahead(0) === TOK_DOT) {\n this._match(TOK_DOT);\n right = this._parseDotRHS(rbp);\n } else {\n var t = this._lookaheadToken(0);\n var error = new Error(\"Sytanx error, unexpected token: \" +\n t.value + \"(\" + t.type + \")\");\n error.name = \"ParserError\";\n throw error;\n }\n return right;\n },\n\n _parseMultiselectList: function() {\n var expressions = [];\n while (this._lookahead(0) !== TOK_RBRACKET) {\n var expression = this.expression(0);\n expressions.push(expression);\n if (this._lookahead(0) === TOK_COMMA) {\n this._match(TOK_COMMA);\n if (this._lookahead(0) === TOK_RBRACKET) {\n throw new Error(\"Unexpected token Rbracket\");\n }\n }\n }\n this._match(TOK_RBRACKET);\n return {type: \"MultiSelectList\", children: expressions};\n },\n\n _parseMultiselectHash: function() {\n var pairs = [];\n var identifierTypes = [TOK_UNQUOTEDIDENTIFIER, TOK_QUOTEDIDENTIFIER];\n var keyToken, keyName, value, node;\n for (;;) {\n keyToken = this._lookaheadToken(0);\n if (identifierTypes.indexOf(keyToken.type) < 0) {\n throw new Error(\"Expecting an identifier token, got: \" +\n keyToken.type);\n }\n keyName = keyToken.value;\n this._advance();\n this._match(TOK_COLON);\n value = this.expression(0);\n node = {type: \"KeyValuePair\", name: keyName, value: value};\n pairs.push(node);\n if (this._lookahead(0) === TOK_COMMA) {\n this._match(TOK_COMMA);\n } else if (this._lookahead(0) === TOK_RBRACE) {\n this._match(TOK_RBRACE);\n break;\n }\n }\n return {type: \"MultiSelectHash\", children: pairs};\n }\n };\n\n\n function TreeInterpreter(runtime) {\n this.runtime = runtime;\n }\n\n TreeInterpreter.prototype = {\n search: function(node, value) {\n return this.visit(node, value);\n },\n\n visit: function(node, value) {\n var matched, current, result, first, second, field, left, right, collected, i;\n switch (node.type) {\n case \"Field\":\n if (value === null ) {\n return null;\n } else if (isObject(value)) {\n field = value[node.name];\n if (field === undefined) {\n return null;\n } else {\n return field;\n }\n } else {\n return null;\n }\n break;\n case \"Subexpression\":\n result = this.visit(node.children[0], value);\n for (i = 1; i < node.children.length; i++) {\n result = this.visit(node.children[1], result);\n if (result === null) {\n return null;\n }\n }\n return result;\n case \"IndexExpression\":\n left = this.visit(node.children[0], value);\n right = this.visit(node.children[1], left);\n return right;\n case \"Index\":\n if (!isArray(value)) {\n return null;\n }\n var index = node.value;\n if (index < 0) {\n index = value.length + index;\n }\n result = value[index];\n if (result === undefined) {\n result = null;\n }\n return result;\n case \"Slice\":\n if (!isArray(value)) {\n return null;\n }\n var sliceParams = node.children.slice(0);\n var computed = this.computeSliceParams(value.length, sliceParams);\n var start = computed[0];\n var stop = computed[1];\n var step = computed[2];\n result = [];\n if (step > 0) {\n for (i = start; i < stop; i += step) {\n result.push(value[i]);\n }\n } else {\n for (i = start; i > stop; i += step) {\n result.push(value[i]);\n }\n }\n return result;\n case \"Projection\":\n // Evaluate left child.\n var base = this.visit(node.children[0], value);\n if (!isArray(base)) {\n return null;\n }\n collected = [];\n for (i = 0; i < base.length; i++) {\n current = this.visit(node.children[1], base[i]);\n if (current !== null) {\n collected.push(current);\n }\n }\n return collected;\n case \"ValueProjection\":\n // Evaluate left child.\n base = this.visit(node.children[0], value);\n if (!isObject(base)) {\n return null;\n }\n collected = [];\n var values = objValues(base);\n for (i = 0; i < values.length; i++) {\n current = this.visit(node.children[1], values[i]);\n if (current !== null) {\n collected.push(current);\n }\n }\n return collected;\n case \"FilterProjection\":\n base = this.visit(node.children[0], value);\n if (!isArray(base)) {\n return null;\n }\n var filtered = [];\n var finalResults = [];\n for (i = 0; i < base.length; i++) {\n matched = this.visit(node.children[2], base[i]);\n if (!isFalse(matched)) {\n filtered.push(base[i]);\n }\n }\n for (var j = 0; j < filtered.length; j++) {\n current = this.visit(node.children[1], filtered[j]);\n if (current !== null) {\n finalResults.push(current);\n }\n }\n return finalResults;\n case \"Comparator\":\n first = this.visit(node.children[0], value);\n second = this.visit(node.children[1], value);\n switch(node.name) {\n case TOK_EQ:\n result = strictDeepEqual(first, second);\n break;\n case TOK_NE:\n result = !strictDeepEqual(first, second);\n break;\n case TOK_GT:\n result = first > second;\n break;\n case TOK_GTE:\n result = first >= second;\n break;\n case TOK_LT:\n result = first < second;\n break;\n case TOK_LTE:\n result = first <= second;\n break;\n default:\n throw new Error(\"Unknown comparator: \" + node.name);\n }\n return result;\n case TOK_FLATTEN:\n var original = this.visit(node.children[0], value);\n if (!isArray(original)) {\n return null;\n }\n var merged = [];\n for (i = 0; i < original.length; i++) {\n current = original[i];\n if (isArray(current)) {\n merged.push.apply(merged, current);\n } else {\n merged.push(current);\n }\n }\n return merged;\n case \"Identity\":\n return value;\n case \"MultiSelectList\":\n if (value === null) {\n return null;\n }\n collected = [];\n for (i = 0; i < node.children.length; i++) {\n collected.push(this.visit(node.children[i], value));\n }\n return collected;\n case \"MultiSelectHash\":\n if (value === null) {\n return null;\n }\n collected = {};\n var child;\n for (i = 0; i < node.children.length; i++) {\n child = node.children[i];\n collected[child.name] = this.visit(child.value, value);\n }\n return collected;\n case \"OrExpression\":\n matched = this.visit(node.children[0], value);\n if (isFalse(matched)) {\n matched = this.visit(node.children[1], value);\n }\n return matched;\n case \"AndExpression\":\n first = this.visit(node.children[0], value);\n\n if (isFalse(first) === true) {\n return first;\n }\n return this.visit(node.children[1], value);\n case \"NotExpression\":\n first = this.visit(node.children[0], value);\n return isFalse(first);\n case \"Literal\":\n return node.value;\n case TOK_PIPE:\n left = this.visit(node.children[0], value);\n return this.visit(node.children[1], left);\n case TOK_CURRENT:\n return value;\n case \"Function\":\n var resolvedArgs = [];\n for (i = 0; i < node.children.length; i++) {\n resolvedArgs.push(this.visit(node.children[i], value));\n }\n return this.runtime.callFunction(node.name, resolvedArgs);\n case \"ExpressionReference\":\n var refNode = node.children[0];\n // Tag the node with a specific attribute so the type\n // checker verify the type.\n refNode.jmespathType = TOK_EXPREF;\n return refNode;\n default:\n throw new Error(\"Unknown node type: \" + node.type);\n }\n },\n\n computeSliceParams: function(arrayLength, sliceParams) {\n var start = sliceParams[0];\n var stop = sliceParams[1];\n var step = sliceParams[2];\n var computed = [null, null, null];\n if (step === null) {\n step = 1;\n } else if (step === 0) {\n var error = new Error(\"Invalid slice, step cannot be 0\");\n error.name = \"RuntimeError\";\n throw error;\n }\n var stepValueNegative = step < 0 ? true : false;\n\n if (start === null) {\n start = stepValueNegative ? arrayLength - 1 : 0;\n } else {\n start = this.capSliceRange(arrayLength, start, step);\n }\n\n if (stop === null) {\n stop = stepValueNegative ? -1 : arrayLength;\n } else {\n stop = this.capSliceRange(arrayLength, stop, step);\n }\n computed[0] = start;\n computed[1] = stop;\n computed[2] = step;\n return computed;\n },\n\n capSliceRange: function(arrayLength, actualValue, step) {\n if (actualValue < 0) {\n actualValue += arrayLength;\n if (actualValue < 0) {\n actualValue = step < 0 ? -1 : 0;\n }\n } else if (actualValue >= arrayLength) {\n actualValue = step < 0 ? arrayLength - 1 : arrayLength;\n }\n return actualValue;\n }\n\n };\n\n function Runtime(interpreter) {\n this._interpreter = interpreter;\n this.functionTable = {\n // name: [function, ]\n // The can be:\n //\n // {\n // args: [[type1, type2], [type1, type2]],\n // variadic: true|false\n // }\n //\n // Each arg in the arg list is a list of valid types\n // (if the function is overloaded and supports multiple\n // types. If the type is \"any\" then no type checking\n // occurs on the argument. Variadic is optional\n // and if not provided is assumed to be false.\n abs: {_func: this._functionAbs, _signature: [{types: [TYPE_NUMBER]}]},\n avg: {_func: this._functionAvg, _signature: [{types: [TYPE_ARRAY_NUMBER]}]},\n ceil: {_func: this._functionCeil, _signature: [{types: [TYPE_NUMBER]}]},\n contains: {\n _func: this._functionContains,\n _signature: [{types: [TYPE_STRING, TYPE_ARRAY]},\n {types: [TYPE_ANY]}]},\n \"ends_with\": {\n _func: this._functionEndsWith,\n _signature: [{types: [TYPE_STRING]}, {types: [TYPE_STRING]}]},\n floor: {_func: this._functionFloor, _signature: [{types: [TYPE_NUMBER]}]},\n length: {\n _func: this._functionLength,\n _signature: [{types: [TYPE_STRING, TYPE_ARRAY, TYPE_OBJECT]}]},\n map: {\n _func: this._functionMap,\n _signature: [{types: [TYPE_EXPREF]}, {types: [TYPE_ARRAY]}]},\n max: {\n _func: this._functionMax,\n _signature: [{types: [TYPE_ARRAY_NUMBER, TYPE_ARRAY_STRING]}]},\n \"merge\": {\n _func: this._functionMerge,\n _signature: [{types: [TYPE_OBJECT], variadic: true}]\n },\n \"max_by\": {\n _func: this._functionMaxBy,\n _signature: [{types: [TYPE_ARRAY]}, {types: [TYPE_EXPREF]}]\n },\n sum: {_func: this._functionSum, _signature: [{types: [TYPE_ARRAY_NUMBER]}]},\n \"starts_with\": {\n _func: this._functionStartsWith,\n _signature: [{types: [TYPE_STRING]}, {types: [TYPE_STRING]}]},\n min: {\n _func: this._functionMin,\n _signature: [{types: [TYPE_ARRAY_NUMBER, TYPE_ARRAY_STRING]}]},\n \"min_by\": {\n _func: this._functionMinBy,\n _signature: [{types: [TYPE_ARRAY]}, {types: [TYPE_EXPREF]}]\n },\n type: {_func: this._functionType, _signature: [{types: [TYPE_ANY]}]},\n keys: {_func: this._functionKeys, _signature: [{types: [TYPE_OBJECT]}]},\n values: {_func: this._functionValues, _signature: [{types: [TYPE_OBJECT]}]},\n sort: {_func: this._functionSort, _signature: [{types: [TYPE_ARRAY_STRING, TYPE_ARRAY_NUMBER]}]},\n \"sort_by\": {\n _func: this._functionSortBy,\n _signature: [{types: [TYPE_ARRAY]}, {types: [TYPE_EXPREF]}]\n },\n join: {\n _func: this._functionJoin,\n _signature: [\n {types: [TYPE_STRING]},\n {types: [TYPE_ARRAY_STRING]}\n ]\n },\n reverse: {\n _func: this._functionReverse,\n _signature: [{types: [TYPE_STRING, TYPE_ARRAY]}]},\n \"to_array\": {_func: this._functionToArray, _signature: [{types: [TYPE_ANY]}]},\n \"to_string\": {_func: this._functionToString, _signature: [{types: [TYPE_ANY]}]},\n \"to_number\": {_func: this._functionToNumber, _signature: [{types: [TYPE_ANY]}]},\n \"not_null\": {\n _func: this._functionNotNull,\n _signature: [{types: [TYPE_ANY], variadic: true}]\n }\n };\n }\n\n Runtime.prototype = {\n callFunction: function(name, resolvedArgs) {\n var functionEntry = this.functionTable[name];\n if (functionEntry === undefined) {\n throw new Error(\"Unknown function: \" + name + \"()\");\n }\n this._validateArgs(name, resolvedArgs, functionEntry._signature);\n return functionEntry._func.call(this, resolvedArgs);\n },\n\n _validateArgs: function(name, args, signature) {\n // Validating the args requires validating\n // the correct arity and the correct type of each arg.\n // If the last argument is declared as variadic, then we need\n // a minimum number of args to be required. Otherwise it has to\n // be an exact amount.\n var pluralized;\n if (signature[signature.length - 1].variadic) {\n if (args.length < signature.length) {\n pluralized = signature.length === 1 ? \" argument\" : \" arguments\";\n throw new Error(\"ArgumentError: \" + name + \"() \" +\n \"takes at least\" + signature.length + pluralized +\n \" but received \" + args.length);\n }\n } else if (args.length !== signature.length) {\n pluralized = signature.length === 1 ? \" argument\" : \" arguments\";\n throw new Error(\"ArgumentError: \" + name + \"() \" +\n \"takes \" + signature.length + pluralized +\n \" but received \" + args.length);\n }\n var currentSpec;\n var actualType;\n var typeMatched;\n for (var i = 0; i < signature.length; i++) {\n typeMatched = false;\n currentSpec = signature[i].types;\n actualType = this._getTypeName(args[i]);\n for (var j = 0; j < currentSpec.length; j++) {\n if (this._typeMatches(actualType, currentSpec[j], args[i])) {\n typeMatched = true;\n break;\n }\n }\n if (!typeMatched) {\n throw new Error(\"TypeError: \" + name + \"() \" +\n \"expected argument \" + (i + 1) +\n \" to be type \" + currentSpec +\n \" but received type \" + actualType +\n \" instead.\");\n }\n }\n },\n\n _typeMatches: function(actual, expected, argValue) {\n if (expected === TYPE_ANY) {\n return true;\n }\n if (expected === TYPE_ARRAY_STRING ||\n expected === TYPE_ARRAY_NUMBER ||\n expected === TYPE_ARRAY) {\n // The expected type can either just be array,\n // or it can require a specific subtype (array of numbers).\n //\n // The simplest case is if \"array\" with no subtype is specified.\n if (expected === TYPE_ARRAY) {\n return actual === TYPE_ARRAY;\n } else if (actual === TYPE_ARRAY) {\n // Otherwise we need to check subtypes.\n // I think this has potential to be improved.\n var subtype;\n if (expected === TYPE_ARRAY_NUMBER) {\n subtype = TYPE_NUMBER;\n } else if (expected === TYPE_ARRAY_STRING) {\n subtype = TYPE_STRING;\n }\n for (var i = 0; i < argValue.length; i++) {\n if (!this._typeMatches(\n this._getTypeName(argValue[i]), subtype,\n argValue[i])) {\n return false;\n }\n }\n return true;\n }\n } else {\n return actual === expected;\n }\n },\n _getTypeName: function(obj) {\n switch (Object.prototype.toString.call(obj)) {\n case \"[object String]\":\n return TYPE_STRING;\n case \"[object Number]\":\n return TYPE_NUMBER;\n case \"[object Array]\":\n return TYPE_ARRAY;\n case \"[object Boolean]\":\n return TYPE_BOOLEAN;\n case \"[object Null]\":\n return TYPE_NULL;\n case \"[object Object]\":\n // Check if it's an expref. If it has, it's been\n // tagged with a jmespathType attr of 'Expref';\n if (obj.jmespathType === TOK_EXPREF) {\n return TYPE_EXPREF;\n } else {\n return TYPE_OBJECT;\n }\n }\n },\n\n _functionStartsWith: function(resolvedArgs) {\n return resolvedArgs[0].lastIndexOf(resolvedArgs[1]) === 0;\n },\n\n _functionEndsWith: function(resolvedArgs) {\n var searchStr = resolvedArgs[0];\n var suffix = resolvedArgs[1];\n return searchStr.indexOf(suffix, searchStr.length - suffix.length) !== -1;\n },\n\n _functionReverse: function(resolvedArgs) {\n var typeName = this._getTypeName(resolvedArgs[0]);\n if (typeName === TYPE_STRING) {\n var originalStr = resolvedArgs[0];\n var reversedStr = \"\";\n for (var i = originalStr.length - 1; i >= 0; i--) {\n reversedStr += originalStr[i];\n }\n return reversedStr;\n } else {\n var reversedArray = resolvedArgs[0].slice(0);\n reversedArray.reverse();\n return reversedArray;\n }\n },\n\n _functionAbs: function(resolvedArgs) {\n return Math.abs(resolvedArgs[0]);\n },\n\n _functionCeil: function(resolvedArgs) {\n return Math.ceil(resolvedArgs[0]);\n },\n\n _functionAvg: function(resolvedArgs) {\n var sum = 0;\n var inputArray = resolvedArgs[0];\n for (var i = 0; i < inputArray.length; i++) {\n sum += inputArray[i];\n }\n return sum / inputArray.length;\n },\n\n _functionContains: function(resolvedArgs) {\n return resolvedArgs[0].indexOf(resolvedArgs[1]) >= 0;\n },\n\n _functionFloor: function(resolvedArgs) {\n return Math.floor(resolvedArgs[0]);\n },\n\n _functionLength: function(resolvedArgs) {\n if (!isObject(resolvedArgs[0])) {\n return resolvedArgs[0].length;\n } else {\n // As far as I can tell, there's no way to get the length\n // of an object without O(n) iteration through the object.\n return Object.keys(resolvedArgs[0]).length;\n }\n },\n\n _functionMap: function(resolvedArgs) {\n var mapped = [];\n var interpreter = this._interpreter;\n var exprefNode = resolvedArgs[0];\n var elements = resolvedArgs[1];\n for (var i = 0; i < elements.length; i++) {\n mapped.push(interpreter.visit(exprefNode, elements[i]));\n }\n return mapped;\n },\n\n _functionMerge: function(resolvedArgs) {\n var merged = {};\n for (var i = 0; i < resolvedArgs.length; i++) {\n var current = resolvedArgs[i];\n for (var key in current) {\n merged[key] = current[key];\n }\n }\n return merged;\n },\n\n _functionMax: function(resolvedArgs) {\n if (resolvedArgs[0].length > 0) {\n var typeName = this._getTypeName(resolvedArgs[0][0]);\n if (typeName === TYPE_NUMBER) {\n return Math.max.apply(Math, resolvedArgs[0]);\n } else {\n var elements = resolvedArgs[0];\n var maxElement = elements[0];\n for (var i = 1; i < elements.length; i++) {\n if (maxElement.localeCompare(elements[i]) < 0) {\n maxElement = elements[i];\n }\n }\n return maxElement;\n }\n } else {\n return null;\n }\n },\n\n _functionMin: function(resolvedArgs) {\n if (resolvedArgs[0].length > 0) {\n var typeName = this._getTypeName(resolvedArgs[0][0]);\n if (typeName === TYPE_NUMBER) {\n return Math.min.apply(Math, resolvedArgs[0]);\n } else {\n var elements = resolvedArgs[0];\n var minElement = elements[0];\n for (var i = 1; i < elements.length; i++) {\n if (elements[i].localeCompare(minElement) < 0) {\n minElement = elements[i];\n }\n }\n return minElement;\n }\n } else {\n return null;\n }\n },\n\n _functionSum: function(resolvedArgs) {\n var sum = 0;\n var listToSum = resolvedArgs[0];\n for (var i = 0; i < listToSum.length; i++) {\n sum += listToSum[i];\n }\n return sum;\n },\n\n _functionType: function(resolvedArgs) {\n switch (this._getTypeName(resolvedArgs[0])) {\n case TYPE_NUMBER:\n return \"number\";\n case TYPE_STRING:\n return \"string\";\n case TYPE_ARRAY:\n return \"array\";\n case TYPE_OBJECT:\n return \"object\";\n case TYPE_BOOLEAN:\n return \"boolean\";\n case TYPE_EXPREF:\n return \"expref\";\n case TYPE_NULL:\n return \"null\";\n }\n },\n\n _functionKeys: function(resolvedArgs) {\n return Object.keys(resolvedArgs[0]);\n },\n\n _functionValues: function(resolvedArgs) {\n var obj = resolvedArgs[0];\n var keys = Object.keys(obj);\n var values = [];\n for (var i = 0; i < keys.length; i++) {\n values.push(obj[keys[i]]);\n }\n return values;\n },\n\n _functionJoin: function(resolvedArgs) {\n var joinChar = resolvedArgs[0];\n var listJoin = resolvedArgs[1];\n return listJoin.join(joinChar);\n },\n\n _functionToArray: function(resolvedArgs) {\n if (this._getTypeName(resolvedArgs[0]) === TYPE_ARRAY) {\n return resolvedArgs[0];\n } else {\n return [resolvedArgs[0]];\n }\n },\n\n _functionToString: function(resolvedArgs) {\n if (this._getTypeName(resolvedArgs[0]) === TYPE_STRING) {\n return resolvedArgs[0];\n } else {\n return JSON.stringify(resolvedArgs[0]);\n }\n },\n\n _functionToNumber: function(resolvedArgs) {\n var typeName = this._getTypeName(resolvedArgs[0]);\n var convertedValue;\n if (typeName === TYPE_NUMBER) {\n return resolvedArgs[0];\n } else if (typeName === TYPE_STRING) {\n convertedValue = +resolvedArgs[0];\n if (!isNaN(convertedValue)) {\n return convertedValue;\n }\n }\n return null;\n },\n\n _functionNotNull: function(resolvedArgs) {\n for (var i = 0; i < resolvedArgs.length; i++) {\n if (this._getTypeName(resolvedArgs[i]) !== TYPE_NULL) {\n return resolvedArgs[i];\n }\n }\n return null;\n },\n\n _functionSort: function(resolvedArgs) {\n var sortedArray = resolvedArgs[0].slice(0);\n sortedArray.sort();\n return sortedArray;\n },\n\n _functionSortBy: function(resolvedArgs) {\n var sortedArray = resolvedArgs[0].slice(0);\n if (sortedArray.length === 0) {\n return sortedArray;\n }\n var interpreter = this._interpreter;\n var exprefNode = resolvedArgs[1];\n var requiredType = this._getTypeName(\n interpreter.visit(exprefNode, sortedArray[0]));\n if ([TYPE_NUMBER, TYPE_STRING].indexOf(requiredType) < 0) {\n throw new Error(\"TypeError\");\n }\n var that = this;\n // In order to get a stable sort out of an unstable\n // sort algorithm, we decorate/sort/undecorate (DSU)\n // by creating a new list of [index, element] pairs.\n // In the cmp function, if the evaluated elements are\n // equal, then the index will be used as the tiebreaker.\n // After the decorated list has been sorted, it will be\n // undecorated to extract the original elements.\n var decorated = [];\n for (var i = 0; i < sortedArray.length; i++) {\n decorated.push([i, sortedArray[i]]);\n }\n decorated.sort(function(a, b) {\n var exprA = interpreter.visit(exprefNode, a[1]);\n var exprB = interpreter.visit(exprefNode, b[1]);\n if (that._getTypeName(exprA) !== requiredType) {\n throw new Error(\n \"TypeError: expected \" + requiredType + \", received \" +\n that._getTypeName(exprA));\n } else if (that._getTypeName(exprB) !== requiredType) {\n throw new Error(\n \"TypeError: expected \" + requiredType + \", received \" +\n that._getTypeName(exprB));\n }\n if (exprA > exprB) {\n return 1;\n } else if (exprA < exprB) {\n return -1;\n } else {\n // If they're equal compare the items by their\n // order to maintain relative order of equal keys\n // (i.e. to get a stable sort).\n return a[0] - b[0];\n }\n });\n // Undecorate: extract out the original list elements.\n for (var j = 0; j < decorated.length; j++) {\n sortedArray[j] = decorated[j][1];\n }\n return sortedArray;\n },\n\n _functionMaxBy: function(resolvedArgs) {\n var exprefNode = resolvedArgs[1];\n var resolvedArray = resolvedArgs[0];\n var keyFunction = this.createKeyFunction(exprefNode, [TYPE_NUMBER, TYPE_STRING]);\n var maxNumber = -Infinity;\n var maxRecord;\n var current;\n for (var i = 0; i < resolvedArray.length; i++) {\n current = keyFunction(resolvedArray[i]);\n if (current > maxNumber) {\n maxNumber = current;\n maxRecord = resolvedArray[i];\n }\n }\n return maxRecord;\n },\n\n _functionMinBy: function(resolvedArgs) {\n var exprefNode = resolvedArgs[1];\n var resolvedArray = resolvedArgs[0];\n var keyFunction = this.createKeyFunction(exprefNode, [TYPE_NUMBER, TYPE_STRING]);\n var minNumber = Infinity;\n var minRecord;\n var current;\n for (var i = 0; i < resolvedArray.length; i++) {\n current = keyFunction(resolvedArray[i]);\n if (current < minNumber) {\n minNumber = current;\n minRecord = resolvedArray[i];\n }\n }\n return minRecord;\n },\n\n createKeyFunction: function(exprefNode, allowedTypes) {\n var that = this;\n var interpreter = this._interpreter;\n var keyFunc = function(x) {\n var current = interpreter.visit(exprefNode, x);\n if (allowedTypes.indexOf(that._getTypeName(current)) < 0) {\n var msg = \"TypeError: expected one of \" + allowedTypes +\n \", received \" + that._getTypeName(current);\n throw new Error(msg);\n }\n return current;\n };\n return keyFunc;\n }\n\n };\n\n function compile(stream) {\n var parser = new Parser();\n var ast = parser.parse(stream);\n return ast;\n }\n\n function tokenize(stream) {\n var lexer = new Lexer();\n return lexer.tokenize(stream);\n }\n\n function search(data, expression) {\n var parser = new Parser();\n // This needs to be improved. Both the interpreter and runtime depend on\n // each other. The runtime needs the interpreter to support exprefs.\n // There's likely a clean way to avoid the cyclic dependency.\n var runtime = new Runtime();\n var interpreter = new TreeInterpreter(runtime);\n runtime._interpreter = interpreter;\n var node = parser.parse(expression);\n return interpreter.search(node, data);\n }\n\n exports.tokenize = tokenize;\n exports.compile = compile;\n exports.search = search;\n exports.strictDeepEqual = strictDeepEqual;\n})(typeof exports === \"undefined\" ? this.jmespath = {} : exports);\n","const CODES = {\n JOSEAlgNotWhitelisted: 'ERR_JOSE_ALG_NOT_WHITELISTED',\n JOSECritNotUnderstood: 'ERR_JOSE_CRIT_NOT_UNDERSTOOD',\n JOSEInvalidEncoding: 'ERR_JOSE_INVALID_ENCODING',\n JOSEMultiError: 'ERR_JOSE_MULTIPLE_ERRORS',\n JOSENotSupported: 'ERR_JOSE_NOT_SUPPORTED',\n JWEDecryptionFailed: 'ERR_JWE_DECRYPTION_FAILED',\n JWEInvalid: 'ERR_JWE_INVALID',\n JWKImportFailed: 'ERR_JWK_IMPORT_FAILED',\n JWKInvalid: 'ERR_JWK_INVALID',\n JWKKeySupport: 'ERR_JWK_KEY_SUPPORT',\n JWKSNoMatchingKey: 'ERR_JWKS_NO_MATCHING_KEY',\n JWSInvalid: 'ERR_JWS_INVALID',\n JWSVerificationFailed: 'ERR_JWS_VERIFICATION_FAILED',\n JWTClaimInvalid: 'ERR_JWT_CLAIM_INVALID',\n JWTExpired: 'ERR_JWT_EXPIRED',\n JWTMalformed: 'ERR_JWT_MALFORMED'\n}\n\nconst DEFAULT_MESSAGES = {\n JWEDecryptionFailed: 'decryption operation failed',\n JWEInvalid: 'JWE invalid',\n JWKSNoMatchingKey: 'no matching key found in the KeyStore',\n JWSInvalid: 'JWS invalid',\n JWSVerificationFailed: 'signature verification failed'\n}\n\nclass JOSEError extends Error {\n constructor (message) {\n super(message)\n if (message === undefined) {\n this.message = DEFAULT_MESSAGES[this.constructor.name]\n }\n this.name = this.constructor.name\n this.code = CODES[this.constructor.name]\n Error.captureStackTrace(this, this.constructor)\n }\n}\n\nconst isMulti = e => e instanceof JOSEMultiError\nclass JOSEMultiError extends JOSEError {\n constructor (errors) {\n super()\n let i\n while ((i = errors.findIndex(isMulti)) && i !== -1) {\n errors.splice(i, 1, ...errors[i])\n }\n Object.defineProperty(this, 'errors', { value: errors })\n }\n\n * [Symbol.iterator] () {\n for (const error of this.errors) {\n yield error\n }\n }\n}\nmodule.exports.JOSEError = JOSEError\n\nmodule.exports.JOSEAlgNotWhitelisted = class JOSEAlgNotWhitelisted extends JOSEError {}\nmodule.exports.JOSECritNotUnderstood = class JOSECritNotUnderstood extends JOSEError {}\nmodule.exports.JOSEInvalidEncoding = class JOSEInvalidEncoding extends JOSEError {}\nmodule.exports.JOSEMultiError = JOSEMultiError\nmodule.exports.JOSENotSupported = class JOSENotSupported extends JOSEError {}\n\nmodule.exports.JWEDecryptionFailed = class JWEDecryptionFailed extends JOSEError {}\nmodule.exports.JWEInvalid = class JWEInvalid extends JOSEError {}\n\nmodule.exports.JWKImportFailed = class JWKImportFailed extends JOSEError {}\nmodule.exports.JWKInvalid = class JWKInvalid extends JOSEError {}\nmodule.exports.JWKKeySupport = class JWKKeySupport extends JOSEError {}\n\nmodule.exports.JWKSNoMatchingKey = class JWKSNoMatchingKey extends JOSEError {}\n\nmodule.exports.JWSInvalid = class JWSInvalid extends JOSEError {}\nmodule.exports.JWSVerificationFailed = class JWSVerificationFailed extends JOSEError {}\n\nclass JWTClaimInvalid extends JOSEError {\n constructor (message, claim = 'unspecified', reason = 'unspecified') {\n super(message)\n this.claim = claim\n this.reason = reason\n }\n}\nmodule.exports.JWTClaimInvalid = JWTClaimInvalid\nmodule.exports.JWTExpired = class JWTExpired extends JWTClaimInvalid {}\nmodule.exports.JWTMalformed = class JWTMalformed extends JOSEError {}\n","const oids = require('./oids')\n\nmodule.exports = function () {\n this.seq().obj(\n this.key('algorithm').objid(oids),\n this.key('parameters').optional().choice({ namedCurve: this.objid(oids), null: this.null_() })\n )\n}\n","const oids = require('./oids')\n\nmodule.exports = function () {\n this.seq().obj(\n this.key('version').int(),\n this.key('privateKey').octstr(),\n this.key('parameters').explicit(0).optional().choice({ namedCurve: this.objid(oids) }),\n this.key('publicKey').explicit(1).optional().bitstr()\n )\n}\n","const asn1 = require('@panva/asn1.js')\n\nconst types = new Map()\n\nconst AlgorithmIdentifier = asn1.define('AlgorithmIdentifier', require('./algorithm_identifier'))\ntypes.set('AlgorithmIdentifier', AlgorithmIdentifier)\n\nconst ECPrivateKey = asn1.define('ECPrivateKey', require('./ec_private_key'))\ntypes.set('ECPrivateKey', ECPrivateKey)\n\nconst PrivateKeyInfo = asn1.define('PrivateKeyInfo', require('./private_key_info')(AlgorithmIdentifier))\ntypes.set('PrivateKeyInfo', PrivateKeyInfo)\n\nconst PublicKeyInfo = asn1.define('PublicKeyInfo', require('./public_key_info')(AlgorithmIdentifier))\ntypes.set('PublicKeyInfo', PublicKeyInfo)\n\nconst PrivateKey = asn1.define('PrivateKey', require('./private_key'))\ntypes.set('PrivateKey', PrivateKey)\n\nconst OneAsymmetricKey = asn1.define('OneAsymmetricKey', require('./one_asymmetric_key')(AlgorithmIdentifier, PrivateKey))\ntypes.set('OneAsymmetricKey', OneAsymmetricKey)\n\nconst RSAPrivateKey = asn1.define('RSAPrivateKey', require('./rsa_private_key'))\ntypes.set('RSAPrivateKey', RSAPrivateKey)\n\nconst RSAPublicKey = asn1.define('RSAPublicKey', require('./rsa_public_key'))\ntypes.set('RSAPublicKey', RSAPublicKey)\n\nmodule.exports = types\n","const { name: secp256k1 } = require('../../jwk/key/secp256k1_crv')\n\nconst oids = {\n '1 2 840 10045 3 1 7': 'P-256',\n '1 3 132 0 10': secp256k1,\n '1 3 132 0 34': 'P-384',\n '1 3 132 0 35': 'P-521',\n '1 2 840 10045 2 1': 'ecPublicKey',\n '1 2 840 113549 1 1 1': 'rsaEncryption',\n '1 3 101 110': 'X25519',\n '1 3 101 111': 'X448',\n '1 3 101 112': 'Ed25519',\n '1 3 101 113': 'Ed448'\n}\n\nmodule.exports = oids\n","module.exports = (AlgorithmIdentifier, PrivateKey) => function () {\n this.seq().obj(\n this.key('version').int(),\n this.key('algorithm').use(AlgorithmIdentifier),\n this.key('privateKey').use(PrivateKey)\n )\n}\n","module.exports = function () {\n this.octstr().contains().obj(\n this.key('privateKey').octstr()\n )\n}\n","module.exports = (AlgorithmIdentifier) => function () {\n this.seq().obj(\n this.key('version').int(),\n this.key('algorithm').use(AlgorithmIdentifier),\n this.key('privateKey').octstr()\n )\n}\n","module.exports = AlgorithmIdentifier => function () {\n this.seq().obj(\n this.key('algorithm').use(AlgorithmIdentifier),\n this.key('publicKey').bitstr()\n )\n}\n","module.exports = function () {\n this.seq().obj(\n this.key('version').int({ 0: 'two-prime', 1: 'multi' }),\n this.key('n').int(),\n this.key('e').int(),\n this.key('d').int(),\n this.key('p').int(),\n this.key('q').int(),\n this.key('dp').int(),\n this.key('dq').int(),\n this.key('qi').int()\n )\n}\n","module.exports = function () {\n this.seq().obj(\n this.key('n').int(),\n this.key('e').int()\n )\n}\n","/* global BigInt */\n\nconst fromBase64 = (base64) => {\n return base64.replace(/=/g, '').replace(/\\+/g, '-').replace(/\\//g, '_')\n}\n\nconst encode = (input, encoding = 'utf8') => {\n return fromBase64(Buffer.from(input, encoding).toString('base64'))\n}\n\nconst encodeBuffer = (buf) => {\n return fromBase64(buf.toString('base64'))\n}\n\nconst decodeToBuffer = (input) => {\n return Buffer.from(input, 'base64')\n}\n\nconst decode = (input, encoding = 'utf8') => {\n return decodeToBuffer(input).toString(encoding)\n}\n\nconst b64uJSON = {\n encode: (input) => {\n return encode(JSON.stringify(input))\n },\n decode: (input, encoding = 'utf8') => {\n return JSON.parse(decode(input, encoding))\n }\n}\n\nb64uJSON.decode.try = (input, encoding = 'utf8') => {\n try {\n return b64uJSON.decode(input, encoding)\n } catch (err) {\n return decode(input, encoding)\n }\n}\n\nconst bnToBuf = (bn) => {\n let hex = BigInt(bn).toString(16)\n if (hex.length % 2) {\n hex = `0${hex}`\n }\n\n const len = hex.length / 2\n const u8 = new Uint8Array(len)\n\n let i = 0\n let j = 0\n while (i < len) {\n u8[i] = parseInt(hex.slice(j, j + 2), 16)\n i += 1\n j += 2\n }\n\n return u8\n}\n\nconst encodeBigInt = (bn) => encodeBuffer(Buffer.from(bnToBuf(bn)))\n\nmodule.exports.decode = decode\nmodule.exports.decodeToBuffer = decodeToBuffer\nmodule.exports.encode = encode\nmodule.exports.encodeBuffer = encodeBuffer\nmodule.exports.JSON = b64uJSON\nmodule.exports.encodeBigInt = encodeBigInt\n","module.exports.KEYOBJECT = Symbol('KEYOBJECT')\nmodule.exports.PRIVATE_MEMBERS = Symbol('PRIVATE_MEMBERS')\nmodule.exports.PUBLIC_MEMBERS = Symbol('PUBLIC_MEMBERS')\nmodule.exports.THUMBPRINT_MATERIAL = Symbol('THUMBPRINT_MATERIAL')\nmodule.exports.JWK_MEMBERS = Symbol('JWK_MEMBERS')\nmodule.exports.KEY_MANAGEMENT_ENCRYPT = Symbol('KEY_MANAGEMENT_ENCRYPT')\nmodule.exports.KEY_MANAGEMENT_DECRYPT = Symbol('KEY_MANAGEMENT_DECRYPT')\n\nconst USES_MAPPING = {\n sig: new Set(['sign', 'verify']),\n enc: new Set(['encrypt', 'decrypt', 'wrapKey', 'unwrapKey', 'deriveKey'])\n}\nconst OPS = new Set([...USES_MAPPING.sig, ...USES_MAPPING.enc])\nconst USES = new Set(Object.keys(USES_MAPPING))\n\nmodule.exports.USES_MAPPING = USES_MAPPING\nmodule.exports.OPS = OPS\nmodule.exports.USES = USES\n","module.exports = obj => JSON.parse(JSON.stringify(obj))\n","const MAX_OCTET = 0x80\nconst CLASS_UNIVERSAL = 0\nconst PRIMITIVE_BIT = 0x20\nconst TAG_SEQ = 0x10\nconst TAG_INT = 0x02\nconst ENCODED_TAG_SEQ = (TAG_SEQ | PRIMITIVE_BIT) | (CLASS_UNIVERSAL << 6)\nconst ENCODED_TAG_INT = TAG_INT | (CLASS_UNIVERSAL << 6)\n\nconst getParamSize = keySize => ((keySize / 8) | 0) + (keySize % 8 === 0 ? 0 : 1)\n\nconst paramBytesForAlg = {\n ES256: getParamSize(256),\n ES256K: getParamSize(256),\n ES384: getParamSize(384),\n ES512: getParamSize(521)\n}\n\nconst countPadding = (buf, start, stop) => {\n let padding = 0\n while (start + padding < stop && buf[start + padding] === 0) {\n ++padding\n }\n\n const needsSign = buf[start + padding] >= MAX_OCTET\n if (needsSign) {\n --padding\n }\n\n return padding\n}\n\nmodule.exports.derToJose = (signature, alg) => {\n if (!Buffer.isBuffer(signature)) {\n throw new TypeError('ECDSA signature must be a Buffer')\n }\n\n if (!paramBytesForAlg[alg]) {\n throw new Error(`Unknown algorithm \"${alg}\"`)\n }\n\n const paramBytes = paramBytesForAlg[alg]\n\n // the DER encoded param should at most be the param size, plus a padding\n // zero, since due to being a signed integer\n const maxEncodedParamLength = paramBytes + 1\n\n const inputLength = signature.length\n\n let offset = 0\n if (signature[offset++] !== ENCODED_TAG_SEQ) {\n throw new Error('Could not find expected \"seq\"')\n }\n\n let seqLength = signature[offset++]\n if (seqLength === (MAX_OCTET | 1)) {\n seqLength = signature[offset++]\n }\n\n if (inputLength - offset < seqLength) {\n throw new Error(`\"seq\" specified length of ${seqLength}\", only ${inputLength - offset}\" remaining`)\n }\n\n if (signature[offset++] !== ENCODED_TAG_INT) {\n throw new Error('Could not find expected \"int\" for \"r\"')\n }\n\n const rLength = signature[offset++]\n\n if (inputLength - offset - 2 < rLength) {\n throw new Error(`\"r\" specified length of \"${rLength}\", only \"${inputLength - offset - 2}\" available`)\n }\n\n if (maxEncodedParamLength < rLength) {\n throw new Error(`\"r\" specified length of \"${rLength}\", max of \"${maxEncodedParamLength}\" is acceptable`)\n }\n\n const rOffset = offset\n offset += rLength\n\n if (signature[offset++] !== ENCODED_TAG_INT) {\n throw new Error('Could not find expected \"int\" for \"s\"')\n }\n\n const sLength = signature[offset++]\n\n if (inputLength - offset !== sLength) {\n throw new Error(`\"s\" specified length of \"${sLength}\", expected \"${inputLength - offset}\"`)\n }\n\n if (maxEncodedParamLength < sLength) {\n throw new Error(`\"s\" specified length of \"${sLength}\", max of \"${maxEncodedParamLength}\" is acceptable`)\n }\n\n const sOffset = offset\n offset += sLength\n\n if (offset !== inputLength) {\n throw new Error(`Expected to consume entire buffer, but \"${inputLength - offset}\" bytes remain`)\n }\n\n const rPadding = paramBytes - rLength\n\n const sPadding = paramBytes - sLength\n\n const dst = Buffer.allocUnsafe(rPadding + rLength + sPadding + sLength)\n\n for (offset = 0; offset < rPadding; ++offset) {\n dst[offset] = 0\n }\n signature.copy(dst, offset, rOffset + Math.max(-rPadding, 0), rOffset + rLength)\n\n offset = paramBytes\n\n for (const o = offset; offset < o + sPadding; ++offset) {\n dst[offset] = 0\n }\n signature.copy(dst, offset, sOffset + Math.max(-sPadding, 0), sOffset + sLength)\n\n return dst\n}\n\nmodule.exports.joseToDer = (signature, alg) => {\n if (!Buffer.isBuffer(signature)) {\n throw new TypeError('ECDSA signature must be a Buffer')\n }\n\n if (!paramBytesForAlg[alg]) {\n throw new TypeError(`Unknown algorithm \"${alg}\"`)\n }\n\n const paramBytes = paramBytesForAlg[alg]\n\n const signatureBytes = signature.length\n if (signatureBytes !== paramBytes * 2) {\n throw new Error(`\"${alg}\" signatures must be \"${paramBytes * 2}\" bytes, saw \"${signatureBytes}\"`)\n }\n\n const rPadding = countPadding(signature, 0, paramBytes)\n const sPadding = countPadding(signature, paramBytes, signature.length)\n const rLength = paramBytes - rPadding\n const sLength = paramBytes - sPadding\n\n const rsBytes = 1 + 1 + rLength + 1 + 1 + sLength\n\n const shortLength = rsBytes < MAX_OCTET\n\n const dst = Buffer.allocUnsafe((shortLength ? 2 : 3) + rsBytes)\n\n let offset = 0\n dst[offset++] = ENCODED_TAG_SEQ\n if (shortLength) {\n // Bit 8 has value \"0\"\n // bits 7-1 give the length.\n dst[offset++] = rsBytes\n } else {\n // Bit 8 of first octet has value \"1\"\n // bits 7-1 give the number of additional length octets.\n dst[offset++] = MAX_OCTET\t| 1 // eslint-disable-line no-tabs\n // length, base 256\n dst[offset++] = rsBytes & 0xff\n }\n dst[offset++] = ENCODED_TAG_INT\n dst[offset++] = rLength\n if (rPadding < 0) {\n dst[offset++] = 0\n offset += signature.copy(dst, offset, 0, paramBytes)\n } else {\n offset += signature.copy(dst, offset, rPadding, paramBytes)\n }\n dst[offset++] = ENCODED_TAG_INT\n dst[offset++] = sLength\n if (sPadding < 0) {\n dst[offset++] = 0\n signature.copy(dst, offset, paramBytes)\n } else {\n signature.copy(dst, offset, paramBytes + sPadding)\n }\n\n return dst\n}\n","module.exports = (date) => Math.floor(date.getTime() / 1000)\n","const { randomBytes } = require('crypto')\n\nconst { IVLENGTHS } = require('../registry')\n\nmodule.exports = alg => randomBytes(IVLENGTHS.get(alg) / 8)\n","const errors = require('../errors')\nconst Key = require('../jwk/key/base')\nconst importKey = require('../jwk/import')\nconst { KeyStore } = require('../jwks/keystore')\n\nmodule.exports = (input, keyStoreAllowed = false) => {\n if (input instanceof Key) {\n return input\n }\n\n if (input instanceof KeyStore) {\n if (!keyStoreAllowed) {\n throw new TypeError('key argument for this operation must not be a JWKS.KeyStore instance')\n }\n\n return input\n }\n\n try {\n return importKey(input)\n } catch (err) {\n if (err instanceof errors.JOSEError && !(err instanceof errors.JWKImportFailed)) {\n throw err\n }\n\n let msg\n if (keyStoreAllowed) {\n msg = 'key must be an instance of a key instantiated by JWK.asKey, a valid JWK.asKey input, or a JWKS.KeyStore instance'\n } else {\n msg = 'key must be an instance of a key instantiated by JWK.asKey, or a valid JWK.asKey input'\n }\n\n throw new TypeError(msg)\n }\n}\n","module.exports = (a = {}, b = {}) => {\n const keysA = Object.keys(a)\n const keysB = new Set(Object.keys(b))\n return !keysA.some((ka) => keysB.has(ka))\n}\n","module.exports = a => !!a && a.constructor === Object\n","/* global BigInt */\n\nconst { keyObjectSupported } = require('./runtime_support')\n\nlet createPublicKey\nlet createPrivateKey\nlet createSecretKey\nlet KeyObject\nlet asInput\n\nif (keyObjectSupported) {\n ({ createPublicKey, createPrivateKey, createSecretKey, KeyObject } = require('crypto'))\n asInput = (input) => input\n} else {\n const { EOL } = require('os')\n\n const errors = require('../errors')\n const isObject = require('./is_object')\n const asn1 = require('./asn1')\n const toInput = Symbol('toInput')\n\n const namedCurve = Symbol('namedCurve')\n\n asInput = (keyObject, needsPublic) => {\n if (keyObject instanceof KeyObject) {\n return keyObject[toInput](needsPublic)\n }\n\n return createSecretKey(keyObject)[toInput](needsPublic)\n }\n\n const pemToDer = pem => Buffer.from(pem.replace(/(?:-----(?:BEGIN|END)(?: (?:RSA|EC))? (?:PRIVATE|PUBLIC) KEY-----|\\s)/g, ''), 'base64')\n const derToPem = (der, label) => `-----BEGIN ${label}-----${EOL}${(der.toString('base64').match(/.{1,64}/g) || []).join(EOL)}${EOL}-----END ${label}-----`\n const unsupported = (input) => {\n const label = typeof input === 'string' ? input : `OID ${input.join('.')}`\n throw new errors.JOSENotSupported(`${label} is not supported in your Node.js runtime version`)\n }\n\n KeyObject = class KeyObject {\n export ({ cipher, passphrase, type, format } = {}) {\n if (this._type === 'secret') {\n return this._buffer\n }\n\n if (this._type === 'public') {\n if (this.asymmetricKeyType === 'rsa') {\n switch (type) {\n case 'pkcs1':\n if (format === 'pem') {\n return this._pem\n }\n\n return pemToDer(this._pem)\n case 'spki': {\n const PublicKeyInfo = asn1.get('PublicKeyInfo')\n const pem = PublicKeyInfo.encode({\n algorithm: {\n algorithm: 'rsaEncryption',\n parameters: { type: 'null' }\n },\n publicKey: {\n unused: 0,\n data: pemToDer(this._pem)\n }\n }, 'pem', { label: 'PUBLIC KEY' })\n\n return format === 'pem' ? pem : pemToDer(pem)\n }\n default:\n throw new TypeError(`The value ${type} is invalid for option \"type\"`)\n }\n }\n\n if (this.asymmetricKeyType === 'ec') {\n if (type !== 'spki') {\n throw new TypeError(`The value ${type} is invalid for option \"type\"`)\n }\n\n if (format === 'pem') {\n return this._pem\n }\n\n return pemToDer(this._pem)\n }\n }\n\n if (this._type === 'private') {\n if (passphrase !== undefined || cipher !== undefined) {\n throw new errors.JOSENotSupported('encrypted private keys are not supported in your Node.js runtime version')\n }\n\n if (type === 'pkcs8') {\n if (this._pkcs8) {\n if (format === 'der' && typeof this._pkcs8 === 'string') {\n return pemToDer(this._pkcs8)\n }\n\n if (format === 'pem' && Buffer.isBuffer(this._pkcs8)) {\n return derToPem(this._pkcs8, 'PRIVATE KEY')\n }\n\n return this._pkcs8\n }\n\n if (this.asymmetricKeyType === 'rsa') {\n const parsed = this._asn1\n const RSAPrivateKey = asn1.get('RSAPrivateKey')\n const privateKey = RSAPrivateKey.encode(parsed)\n const PrivateKeyInfo = asn1.get('PrivateKeyInfo')\n const pkcs8 = PrivateKeyInfo.encode({\n version: 0,\n privateKey,\n algorithm: {\n algorithm: 'rsaEncryption',\n parameters: { type: 'null' }\n }\n })\n\n this._pkcs8 = pkcs8\n\n return this.export({ type, format })\n }\n\n if (this.asymmetricKeyType === 'ec') {\n const parsed = this._asn1\n const ECPrivateKey = asn1.get('ECPrivateKey')\n const privateKey = ECPrivateKey.encode({\n version: parsed.version,\n privateKey: parsed.privateKey,\n publicKey: parsed.publicKey\n })\n const PrivateKeyInfo = asn1.get('PrivateKeyInfo')\n const pkcs8 = PrivateKeyInfo.encode({\n version: 0,\n privateKey,\n algorithm: {\n algorithm: 'ecPublicKey',\n parameters: this._asn1.parameters\n }\n })\n\n this._pkcs8 = pkcs8\n\n return this.export({ type, format })\n }\n }\n\n if (this.asymmetricKeyType === 'rsa' && type === 'pkcs1') {\n if (format === 'pem') {\n return this._pem\n }\n\n return pemToDer(this._pem)\n } else if (this.asymmetricKeyType === 'ec' && type === 'sec1') {\n if (format === 'pem') {\n return this._pem\n }\n\n return pemToDer(this._pem)\n } else {\n throw new TypeError(`The value ${type} is invalid for option \"type\"`)\n }\n }\n }\n\n get type () {\n return this._type\n }\n\n get asymmetricKeyType () {\n return this._asymmetricKeyType\n }\n\n get symmetricKeySize () {\n return this._symmetricKeySize\n }\n\n [toInput] (needsPublic) {\n switch (this._type) {\n case 'secret':\n return this._buffer\n case 'public':\n return this._pem\n default:\n if (needsPublic) {\n if (!('_pub' in this)) {\n this._pub = createPublicKey(this)\n }\n\n return this._pub[toInput](false)\n }\n\n return this._pem\n }\n }\n }\n\n createSecretKey = (buffer) => {\n if (!Buffer.isBuffer(buffer) || !buffer.length) {\n throw new TypeError('input must be a non-empty Buffer instance')\n }\n\n const keyObject = new KeyObject()\n keyObject._buffer = Buffer.from(buffer)\n keyObject._symmetricKeySize = buffer.length\n keyObject._type = 'secret'\n\n return keyObject\n }\n\n createPublicKey = (input) => {\n if (input instanceof KeyObject) {\n if (input.type !== 'private') {\n throw new TypeError(`Invalid key object type ${input.type}, expected private.`)\n }\n\n switch (input.asymmetricKeyType) {\n case 'ec': {\n const PublicKeyInfo = asn1.get('PublicKeyInfo')\n const key = PublicKeyInfo.encode({\n algorithm: {\n algorithm: 'ecPublicKey',\n parameters: input._asn1.parameters\n },\n publicKey: input._asn1.publicKey\n })\n\n return createPublicKey({ key, format: 'der', type: 'spki' })\n }\n case 'rsa': {\n const RSAPublicKey = asn1.get('RSAPublicKey')\n const key = RSAPublicKey.encode(input._asn1)\n return createPublicKey({ key, format: 'der', type: 'pkcs1' })\n }\n }\n }\n\n if (typeof input === 'string' || Buffer.isBuffer(input)) {\n input = { key: input, format: 'pem' }\n }\n\n if (!isObject(input)) {\n throw new TypeError('input must be a string, Buffer or an object')\n }\n\n const { format, passphrase } = input\n let { key, type } = input\n\n if (typeof key !== 'string' && !Buffer.isBuffer(key)) {\n throw new TypeError('key must be a string or Buffer')\n }\n\n if (format !== 'pem' && format !== 'der') {\n throw new TypeError('format must be one of \"pem\" or \"der\"')\n }\n\n let label\n if (format === 'pem') {\n key = key.toString()\n switch (key.split(/\\r?\\n/g)[0].toString()) {\n case '-----BEGIN PUBLIC KEY-----':\n type = 'spki'\n label = 'PUBLIC KEY'\n break\n case '-----BEGIN RSA PUBLIC KEY-----':\n type = 'pkcs1'\n label = 'RSA PUBLIC KEY'\n break\n case '-----BEGIN CERTIFICATE-----':\n throw new errors.JOSENotSupported('X.509 certificates are not supported in your Node.js runtime version')\n case '-----BEGIN PRIVATE KEY-----':\n case '-----BEGIN EC PRIVATE KEY-----':\n case '-----BEGIN RSA PRIVATE KEY-----':\n return createPublicKey(createPrivateKey(key))\n default:\n throw new TypeError('unknown/unsupported PEM type')\n }\n }\n\n switch (type) {\n case 'spki': {\n const PublicKeyInfo = asn1.get('PublicKeyInfo')\n const parsed = PublicKeyInfo.decode(key, format, { label })\n\n let type, keyObject\n switch (parsed.algorithm.algorithm) {\n case 'ecPublicKey': {\n keyObject = new KeyObject()\n keyObject._asn1 = parsed\n keyObject._asymmetricKeyType = 'ec'\n keyObject._type = 'public'\n keyObject._pem = PublicKeyInfo.encode(parsed, 'pem', { label: 'PUBLIC KEY' })\n\n break\n }\n case 'rsaEncryption': {\n type = 'pkcs1'\n keyObject = createPublicKey({ type, key: parsed.publicKey.data, format: 'der' })\n break\n }\n default:\n unsupported(parsed.algorithm.algorithm)\n }\n\n return keyObject\n }\n case 'pkcs1': {\n const RSAPublicKey = asn1.get('RSAPublicKey')\n const parsed = RSAPublicKey.decode(key, format, { label })\n\n // special case when private pkcs1 PEM / DER is used with createPublicKey\n if (parsed.n === BigInt(0)) {\n return createPublicKey(createPrivateKey({ key, format, type, passphrase }))\n }\n\n const keyObject = new KeyObject()\n keyObject._asn1 = parsed\n keyObject._asymmetricKeyType = 'rsa'\n keyObject._type = 'public'\n keyObject._pem = RSAPublicKey.encode(parsed, 'pem', { label: 'RSA PUBLIC KEY' })\n\n return keyObject\n }\n case 'pkcs8':\n case 'sec1':\n return createPublicKey(createPrivateKey({ format, key, type, passphrase }))\n default:\n throw new TypeError(`The value ${type} is invalid for option \"type\"`)\n }\n }\n\n createPrivateKey = (input, hints) => {\n if (typeof input === 'string' || Buffer.isBuffer(input)) {\n input = { key: input, format: 'pem' }\n }\n\n if (!isObject(input)) {\n throw new TypeError('input must be a string, Buffer or an object')\n }\n\n const { format, passphrase } = input\n let { key, type } = input\n\n if (typeof key !== 'string' && !Buffer.isBuffer(key)) {\n throw new TypeError('key must be a string or Buffer')\n }\n\n if (passphrase !== undefined) {\n throw new errors.JOSENotSupported('encrypted private keys are not supported in your Node.js runtime version')\n }\n\n if (format !== 'pem' && format !== 'der') {\n throw new TypeError('format must be one of \"pem\" or \"der\"')\n }\n\n let label\n if (format === 'pem') {\n key = key.toString()\n switch (key.split(/\\r?\\n/g)[0].toString()) {\n case '-----BEGIN PRIVATE KEY-----':\n type = 'pkcs8'\n label = 'PRIVATE KEY'\n break\n case '-----BEGIN EC PRIVATE KEY-----':\n type = 'sec1'\n label = 'EC PRIVATE KEY'\n break\n case '-----BEGIN RSA PRIVATE KEY-----':\n type = 'pkcs1'\n label = 'RSA PRIVATE KEY'\n break\n default:\n throw new TypeError('unknown/unsupported PEM type')\n }\n }\n\n switch (type) {\n case 'pkcs8': {\n const PrivateKeyInfo = asn1.get('PrivateKeyInfo')\n const parsed = PrivateKeyInfo.decode(key, format, { label })\n\n let type, keyObject\n switch (parsed.algorithm.algorithm) {\n case 'ecPublicKey': {\n type = 'sec1'\n keyObject = createPrivateKey({ type, key: parsed.privateKey, format: 'der' }, { [namedCurve]: parsed.algorithm.parameters.value })\n break\n }\n case 'rsaEncryption': {\n type = 'pkcs1'\n keyObject = createPrivateKey({ type, key: parsed.privateKey, format: 'der' })\n break\n }\n default:\n unsupported(parsed.algorithm.algorithm)\n }\n\n keyObject._pkcs8 = key\n return keyObject\n }\n case 'pkcs1': {\n const RSAPrivateKey = asn1.get('RSAPrivateKey')\n const parsed = RSAPrivateKey.decode(key, format, { label })\n\n const keyObject = new KeyObject()\n keyObject._asn1 = parsed\n keyObject._asymmetricKeyType = 'rsa'\n keyObject._type = 'private'\n keyObject._pem = RSAPrivateKey.encode(parsed, 'pem', { label: 'RSA PRIVATE KEY' })\n\n return keyObject\n }\n case 'sec1': {\n const ECPrivateKey = asn1.get('ECPrivateKey')\n let parsed = ECPrivateKey.decode(key, format, { label })\n\n if (!('parameters' in parsed) && !hints[namedCurve]) {\n throw new Error('invalid sec1')\n } else if (!('parameters' in parsed)) {\n parsed = { ...parsed, parameters: { type: 'namedCurve', value: hints[namedCurve] } }\n }\n\n const keyObject = new KeyObject()\n keyObject._asn1 = parsed\n keyObject._asymmetricKeyType = 'ec'\n keyObject._type = 'private'\n keyObject._pem = ECPrivateKey.encode(parsed, 'pem', { label: 'EC PRIVATE KEY' })\n\n return keyObject\n }\n default:\n throw new TypeError(`The value ${type} is invalid for option \"type\"`)\n }\n }\n}\n\nmodule.exports = { createPublicKey, createPrivateKey, createSecretKey, KeyObject, asInput }\n","/* global BigInt */\n\nconst { EOL } = require('os')\n\nconst errors = require('../errors')\n\nconst { keyObjectSupported } = require('./runtime_support')\nconst { createPublicKey } = require('./key_object')\nconst base64url = require('./base64url')\nconst asn1 = require('./asn1')\nconst computePrimes = require('./rsa_primes')\nconst { OKP_CURVES, EC_CURVES } = require('../registry')\n\nconst formatPem = (base64pem, descriptor) => `-----BEGIN ${descriptor} KEY-----${EOL}${(base64pem.match(/.{1,64}/g) || []).join(EOL)}${EOL}-----END ${descriptor} KEY-----`\n\nconst okpToJWK = {\n private (crv, keyObject) {\n const der = keyObject.export({ type: 'pkcs8', format: 'der' })\n const OneAsymmetricKey = asn1.get('OneAsymmetricKey')\n const { privateKey: { privateKey: d } } = OneAsymmetricKey.decode(der)\n\n return {\n ...okpToJWK.public(crv, createPublicKey(keyObject)),\n d: base64url.encodeBuffer(d)\n }\n },\n public (crv, keyObject) {\n const der = keyObject.export({ type: 'spki', format: 'der' })\n\n const PublicKeyInfo = asn1.get('PublicKeyInfo')\n\n const { publicKey: { data: x } } = PublicKeyInfo.decode(der)\n\n return {\n kty: 'OKP',\n crv,\n x: base64url.encodeBuffer(x)\n }\n }\n}\n\nconst keyObjectToJWK = {\n rsa: {\n private (keyObject) {\n const der = keyObject.export({ type: 'pkcs8', format: 'der' })\n\n const PrivateKeyInfo = asn1.get('PrivateKeyInfo')\n const RSAPrivateKey = asn1.get('RSAPrivateKey')\n\n const { privateKey } = PrivateKeyInfo.decode(der)\n const { version, n, e, d, p, q, dp, dq, qi } = RSAPrivateKey.decode(privateKey)\n\n if (version !== 'two-prime') {\n throw new errors.JOSENotSupported('Private RSA keys with more than two primes are not supported')\n }\n\n return {\n kty: 'RSA',\n n: base64url.encodeBigInt(n),\n e: base64url.encodeBigInt(e),\n d: base64url.encodeBigInt(d),\n p: base64url.encodeBigInt(p),\n q: base64url.encodeBigInt(q),\n dp: base64url.encodeBigInt(dp),\n dq: base64url.encodeBigInt(dq),\n qi: base64url.encodeBigInt(qi)\n }\n },\n public (keyObject) {\n const der = keyObject.export({ type: 'spki', format: 'der' })\n\n const PublicKeyInfo = asn1.get('PublicKeyInfo')\n const RSAPublicKey = asn1.get('RSAPublicKey')\n\n const { publicKey: { data: publicKey } } = PublicKeyInfo.decode(der)\n const { n, e } = RSAPublicKey.decode(publicKey)\n\n return {\n kty: 'RSA',\n n: base64url.encodeBigInt(n),\n e: base64url.encodeBigInt(e)\n }\n }\n },\n ec: {\n private (keyObject) {\n const der = keyObject.export({ type: 'pkcs8', format: 'der' })\n\n const PrivateKeyInfo = asn1.get('PrivateKeyInfo')\n const ECPrivateKey = asn1.get('ECPrivateKey')\n\n const { privateKey, algorithm: { parameters: { value: crv } } } = PrivateKeyInfo.decode(der)\n const { privateKey: d, publicKey } = ECPrivateKey.decode(privateKey)\n\n if (typeof publicKey === 'undefined') {\n if (keyObjectSupported) {\n return {\n ...keyObjectToJWK.ec.public(createPublicKey(keyObject)),\n d: base64url.encodeBuffer(d)\n }\n }\n\n throw new errors.JOSENotSupported('Private EC keys without the public key embedded are not supported in your Node.js runtime version')\n }\n\n const x = publicKey.data.slice(1, ((publicKey.data.length - 1) / 2) + 1)\n const y = publicKey.data.slice(((publicKey.data.length - 1) / 2) + 1)\n\n return {\n kty: 'EC',\n crv,\n d: base64url.encodeBuffer(d),\n x: base64url.encodeBuffer(x),\n y: base64url.encodeBuffer(y)\n }\n },\n public (keyObject) {\n const der = keyObject.export({ type: 'spki', format: 'der' })\n\n const PublicKeyInfo = asn1.get('PublicKeyInfo')\n\n const { publicKey: { data: publicKey }, algorithm: { parameters: { value: crv } } } = PublicKeyInfo.decode(der)\n\n const x = publicKey.slice(1, ((publicKey.length - 1) / 2) + 1)\n const y = publicKey.slice(((publicKey.length - 1) / 2) + 1)\n\n return {\n kty: 'EC',\n crv,\n x: base64url.encodeBuffer(x),\n y: base64url.encodeBuffer(y)\n }\n }\n },\n ed25519: {\n private (keyObject) {\n return okpToJWK.private('Ed25519', keyObject)\n },\n public (keyObject) {\n return okpToJWK.public('Ed25519', keyObject)\n }\n },\n ed448: {\n private (keyObject) {\n return okpToJWK.private('Ed448', keyObject)\n },\n public (keyObject) {\n return okpToJWK.public('Ed448', keyObject)\n }\n },\n x25519: {\n private (keyObject) {\n return okpToJWK.private('X25519', keyObject)\n },\n public (keyObject) {\n return okpToJWK.public('X25519', keyObject)\n }\n },\n x448: {\n private (keyObject) {\n return okpToJWK.private('X448', keyObject)\n },\n public (keyObject) {\n return okpToJWK.public('X448', keyObject)\n }\n }\n}\n\nmodule.exports.keyObjectToJWK = (keyObject) => {\n if (keyObject.type === 'private') {\n return keyObjectToJWK[keyObject.asymmetricKeyType].private(keyObject)\n }\n\n return keyObjectToJWK[keyObject.asymmetricKeyType].public(keyObject)\n}\n\nconst concatEcPublicKey = (x, y) => ({\n unused: 0,\n data: Buffer.concat([\n Buffer.alloc(1, 4),\n base64url.decodeToBuffer(x),\n base64url.decodeToBuffer(y)\n ])\n})\n\nconst jwkToPem = {\n RSA: {\n private (jwk, { calculateMissingRSAPrimes }) {\n const RSAPrivateKey = asn1.get('RSAPrivateKey')\n\n if ('oth' in jwk) {\n throw new errors.JOSENotSupported('Private RSA keys with more than two primes are not supported')\n }\n\n if (jwk.p || jwk.q || jwk.dp || jwk.dq || jwk.qi) {\n if (!(jwk.p && jwk.q && jwk.dp && jwk.dq && jwk.qi)) {\n throw new errors.JWKInvalid('all other private key parameters must be present when any one of them is present')\n }\n } else if (calculateMissingRSAPrimes) {\n jwk = computePrimes(jwk)\n } else if (!calculateMissingRSAPrimes) {\n throw new errors.JOSENotSupported('importing private RSA keys without all other private key parameters is not enabled, see documentation and its advisory on how and when its ok to enable it')\n }\n\n return RSAPrivateKey.encode({\n version: 0,\n n: BigInt(`0x${base64url.decodeToBuffer(jwk.n).toString('hex')}`),\n e: BigInt(`0x${base64url.decodeToBuffer(jwk.e).toString('hex')}`),\n d: BigInt(`0x${base64url.decodeToBuffer(jwk.d).toString('hex')}`),\n p: BigInt(`0x${base64url.decodeToBuffer(jwk.p).toString('hex')}`),\n q: BigInt(`0x${base64url.decodeToBuffer(jwk.q).toString('hex')}`),\n dp: BigInt(`0x${base64url.decodeToBuffer(jwk.dp).toString('hex')}`),\n dq: BigInt(`0x${base64url.decodeToBuffer(jwk.dq).toString('hex')}`),\n qi: BigInt(`0x${base64url.decodeToBuffer(jwk.qi).toString('hex')}`)\n }, 'pem', { label: 'RSA PRIVATE KEY' })\n },\n public (jwk) {\n const RSAPublicKey = asn1.get('RSAPublicKey')\n\n return RSAPublicKey.encode({\n version: 0,\n n: BigInt(`0x${base64url.decodeToBuffer(jwk.n).toString('hex')}`),\n e: BigInt(`0x${base64url.decodeToBuffer(jwk.e).toString('hex')}`)\n }, 'pem', { label: 'RSA PUBLIC KEY' })\n }\n },\n EC: {\n private (jwk) {\n const ECPrivateKey = asn1.get('ECPrivateKey')\n\n return ECPrivateKey.encode({\n version: 1,\n privateKey: base64url.decodeToBuffer(jwk.d),\n parameters: { type: 'namedCurve', value: jwk.crv },\n publicKey: concatEcPublicKey(jwk.x, jwk.y)\n }, 'pem', { label: 'EC PRIVATE KEY' })\n },\n public (jwk) {\n const PublicKeyInfo = asn1.get('PublicKeyInfo')\n\n return PublicKeyInfo.encode({\n algorithm: {\n algorithm: 'ecPublicKey',\n parameters: { type: 'namedCurve', value: jwk.crv }\n },\n publicKey: concatEcPublicKey(jwk.x, jwk.y)\n }, 'pem', { label: 'PUBLIC KEY' })\n }\n },\n OKP: {\n private (jwk) {\n const OneAsymmetricKey = asn1.get('OneAsymmetricKey')\n\n const b64 = OneAsymmetricKey.encode({\n version: 0,\n privateKey: { privateKey: base64url.decodeToBuffer(jwk.d) },\n algorithm: { algorithm: jwk.crv }\n }, 'der')\n\n // TODO: WHYYY? https://github.com/indutny/asn1.js/issues/110\n b64.write('04', 12, 1, 'hex')\n\n return formatPem(b64.toString('base64'), 'PRIVATE')\n },\n public (jwk) {\n const PublicKeyInfo = asn1.get('PublicKeyInfo')\n\n return PublicKeyInfo.encode({\n algorithm: { algorithm: jwk.crv },\n publicKey: {\n unused: 0,\n data: base64url.decodeToBuffer(jwk.x)\n }\n }, 'pem', { label: 'PUBLIC KEY' })\n }\n }\n}\n\nmodule.exports.jwkToPem = (jwk, { calculateMissingRSAPrimes = false } = {}) => {\n switch (jwk.kty) {\n case 'EC':\n if (!EC_CURVES.has(jwk.crv)) {\n throw new errors.JOSENotSupported(`unsupported EC key curve: ${jwk.crv}`)\n }\n break\n case 'OKP':\n if (!OKP_CURVES.has(jwk.crv)) {\n throw new errors.JOSENotSupported(`unsupported OKP key curve: ${jwk.crv}`)\n }\n break\n case 'RSA':\n break\n default:\n throw new errors.JOSENotSupported(`unsupported key type: ${jwk.kty}`)\n }\n\n if (jwk.d) {\n return jwkToPem[jwk.kty].private(jwk, { calculateMissingRSAPrimes })\n }\n\n return jwkToPem[jwk.kty].public(jwk)\n}\n","module.exports = alg => `sha${alg.substr(2, 3)}`\n","/* global BigInt */\n\nconst { randomBytes } = require('crypto')\n\nconst base64url = require('./base64url')\nconst errors = require('../errors')\n\nconst ZERO = BigInt(0)\nconst ONE = BigInt(1)\nconst TWO = BigInt(2)\n\nconst toJWKParameter = (n) => {\n const hex = n.toString(16)\n return base64url.encodeBuffer(Buffer.from(hex.length % 2 ? `0${hex}` : hex, 'hex'))\n}\nconst fromBuffer = buf => BigInt(`0x${buf.toString('hex')}`)\nconst bitLength = n => n.toString(2).length\n\nconst eGcdX = (a, b) => {\n let x = ZERO\n let y = ONE\n let u = ONE\n let v = ZERO\n\n while (a !== ZERO) {\n const q = b / a\n const r = b % a\n const m = x - (u * q)\n const n = y - (v * q)\n b = a\n a = r\n x = u\n y = v\n u = m\n v = n\n }\n return x\n}\n\nconst gcd = (a, b) => {\n let shift = ZERO\n while (!((a | b) & ONE)) {\n a >>= ONE\n b >>= ONE\n shift++\n }\n while (!(a & ONE)) {\n a >>= ONE\n }\n do {\n while (!(b & ONE)) {\n b >>= ONE\n }\n if (a > b) {\n const x = a\n a = b\n b = x\n }\n b -= a\n } while (b)\n\n return a << shift\n}\n\nconst modPow = (a, b, n) => {\n a = toZn(a, n)\n let result = ONE\n let x = a\n while (b > 0) {\n var leastSignificantBit = b % TWO\n b = b / TWO\n if (leastSignificantBit === ONE) {\n result = result * x\n result = result % n\n }\n x = x * x\n x = x % n\n }\n return result\n}\n\nconst randBetween = (min, max) => {\n const interval = max - min\n const bitLen = bitLength(interval)\n let rnd\n do {\n rnd = fromBuffer(randBits(bitLen))\n } while (rnd > interval)\n return rnd + min\n}\n\nconst randBits = (bitLength) => {\n const byteLength = Math.ceil(bitLength / 8)\n const rndBytes = randomBytes(byteLength)\n // Fill with 0's the extra bits\n rndBytes[0] = rndBytes[0] & (2 ** (bitLength % 8) - 1)\n return rndBytes\n}\n\nconst toZn = (a, n) => {\n a = a % n\n return (a < 0) ? a + n : a\n}\n\nconst odd = (n) => {\n let r = n\n while (r % TWO === ZERO) {\n r = r / TWO\n }\n return r\n}\n\n// not sold on these values\nconst maxCountWhileNoY = 30\nconst maxCountWhileInot0 = 22\n\nconst getPrimeFactors = (e, d, n) => {\n const r = odd(e * d - ONE)\n\n let countWhileNoY = 0\n let y\n do {\n countWhileNoY++\n if (countWhileNoY === maxCountWhileNoY) {\n throw new errors.JWKImportFailed('failed to calculate missing primes')\n }\n\n let countWhileInot0 = 0\n let i = modPow(randBetween(TWO, n), r, n)\n let o = ZERO\n while (i !== ONE) {\n countWhileInot0++\n if (countWhileInot0 === maxCountWhileInot0) {\n throw new errors.JWKImportFailed('failed to calculate missing primes')\n }\n o = i\n i = (i * i) % n\n }\n if (o !== (n - ONE)) {\n y = o\n }\n } while (!y)\n\n const p = gcd(y - ONE, n)\n const q = n / p\n\n return p > q ? { p, q } : { p: q, q: p }\n}\n\nmodule.exports = (jwk) => {\n const e = fromBuffer(base64url.decodeToBuffer(jwk.e))\n const d = fromBuffer(base64url.decodeToBuffer(jwk.d))\n const n = fromBuffer(base64url.decodeToBuffer(jwk.n))\n\n if (d >= n) {\n throw new errors.JWKInvalid('invalid RSA private exponent')\n }\n\n const { p, q } = getPrimeFactors(e, d, n)\n const dp = d % (p - ONE)\n const dq = d % (q - ONE)\n const qi = toZn(eGcdX(toZn(q, p), p), p)\n\n return {\n ...jwk,\n p: toJWKParameter(p),\n q: toJWKParameter(q),\n dp: toJWKParameter(dp),\n dq: toJWKParameter(dq),\n qi: toJWKParameter(qi)\n }\n}\n","const { diffieHellman, KeyObject, sign, verify } = require('crypto')\n\nconst [major, minor] = process.version.substr(1).split('.').map(x => parseInt(x, 10))\n\nmodule.exports = {\n oaepHashSupported: major > 12 || (major === 12 && minor >= 9),\n keyObjectSupported: !!KeyObject && major >= 12,\n edDSASupported: !!sign && !!verify,\n dsaEncodingSupported: major > 13 || (major === 13 && minor >= 2) || (major === 12 && minor >= 16),\n improvedDH: !!diffieHellman\n}\n","const minute = 60\nconst hour = minute * 60\nconst day = hour * 24\nconst week = day * 7\nconst year = day * 365.25\n\nconst REGEX = /^(\\d+|\\d+\\.\\d+) ?(seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)$/i\n\nmodule.exports = (str) => {\n const matched = REGEX.exec(str)\n\n if (!matched) {\n throw new TypeError(`invalid time period format (\"${str}\")`)\n }\n\n const value = parseFloat(matched[1])\n const unit = matched[2].toLowerCase()\n\n switch (unit) {\n case 'sec':\n case 'secs':\n case 'second':\n case 'seconds':\n case 's':\n return Math.round(value)\n case 'minute':\n case 'minutes':\n case 'min':\n case 'mins':\n case 'm':\n return Math.round(value * minute)\n case 'hour':\n case 'hours':\n case 'hr':\n case 'hrs':\n case 'h':\n return Math.round(value * hour)\n case 'day':\n case 'days':\n case 'd':\n return Math.round(value * day)\n case 'week':\n case 'weeks':\n case 'w':\n return Math.round(value * week)\n case 'year':\n case 'years':\n case 'yr':\n case 'yrs':\n case 'y':\n return Math.round(value * year)\n }\n}\n","const { timingSafeEqual: TSE } = require('crypto')\n\nconst paddedBuffer = (input, length) => {\n if (input.length === length) {\n return input\n }\n\n const buffer = Buffer.alloc(length)\n input.copy(buffer)\n return buffer\n}\n\nconst timingSafeEqual = (a, b) => {\n const length = Math.max(a.length, b.length)\n return TSE(paddedBuffer(a, length), paddedBuffer(b, length))\n}\n\nmodule.exports = timingSafeEqual\n","const MAX_INT32 = Math.pow(2, 32)\n\nmodule.exports = (value, buf = Buffer.allocUnsafe(8)) => {\n const high = Math.floor(value / MAX_INT32)\n const low = value % MAX_INT32\n\n buf.writeUInt32BE(high, 0)\n buf.writeUInt32BE(low, 4)\n return buf\n}\n","const { JOSECritNotUnderstood, JWSInvalid } = require('../errors')\n\nconst DEFINED = new Set([\n 'alg', 'jku', 'jwk', 'kid', 'x5u', 'x5c', 'x5t', 'x5t#S256', 'typ', 'cty',\n 'crit', 'enc', 'zip', 'epk', 'apu', 'apv', 'iv', 'tag', 'p2s', 'p2c'\n])\n\nmodule.exports = function validateCrit (Err, protectedHeader, unprotectedHeader, understood) {\n if (protectedHeader && 'crit' in protectedHeader) {\n if (\n !Array.isArray(protectedHeader.crit) ||\n protectedHeader.crit.length === 0 ||\n protectedHeader.crit.some(s => typeof s !== 'string' || !s)\n ) {\n throw new Err('\"crit\" Header Parameter MUST be an array of non-empty strings when present')\n }\n const whitelisted = new Set(understood)\n const combined = { ...protectedHeader, ...unprotectedHeader }\n protectedHeader.crit.forEach((parameter) => {\n if (DEFINED.has(parameter)) {\n throw new Err(`The critical list contains a non-extension Header Parameter ${parameter}`)\n }\n if (!whitelisted.has(parameter)) {\n throw new JOSECritNotUnderstood(`critical \"${parameter}\" is not understood`)\n }\n if (parameter === 'b64') {\n if (!('b64' in protectedHeader)) {\n throw new JWSInvalid('\"b64\" critical parameter must be integrity protected')\n }\n if (typeof protectedHeader.b64 !== 'boolean') {\n throw new JWSInvalid('\"b64\" critical parameter must be a boolean')\n }\n } else if (!(parameter in combined)) {\n throw new Err(`critical parameter \"${parameter}\" is missing`)\n }\n })\n }\n if (unprotectedHeader && 'crit' in unprotectedHeader) {\n throw new Err('\"crit\" Header Parameter MUST be integrity protected when present')\n }\n}\n","module.exports = {\n JWE: require('./jwe'),\n JWK: require('./jwk'),\n JWKS: require('./jwks'),\n JWS: require('./jws'),\n JWT: require('./jwt'),\n errors: require('./errors')\n}\n","const { createCipheriv, createDecipheriv, getCiphers } = require('crypto')\n\nconst uint64be = require('../help/uint64be')\nconst timingSafeEqual = require('../help/timing_safe_equal')\nconst { KEYOBJECT } = require('../help/consts')\nconst { JWEInvalid, JWEDecryptionFailed } = require('../errors')\n\nconst checkInput = function (size, iv, tag) {\n if (iv.length !== 16) {\n throw new JWEInvalid('invalid iv')\n }\n if (arguments.length === 3) {\n if (tag.length !== size / 8) {\n throw new JWEInvalid('invalid tag')\n }\n }\n}\n\nconst encrypt = (size, sign, { [KEYOBJECT]: keyObject }, cleartext, { iv, aad = Buffer.alloc(0) }) => {\n const key = keyObject.export()\n checkInput(size, iv)\n\n const keySize = size / 8\n const encKey = key.slice(keySize)\n const cipher = createCipheriv(`aes-${size}-cbc`, encKey, iv)\n const ciphertext = Buffer.concat([cipher.update(cleartext), cipher.final()])\n const macData = Buffer.concat([aad, iv, ciphertext, uint64be(aad.length * 8)])\n\n const macKey = key.slice(0, keySize)\n const tag = sign({ [KEYOBJECT]: macKey }, macData).slice(0, keySize)\n\n return { ciphertext, tag }\n}\n\nconst decrypt = (size, sign, { [KEYOBJECT]: keyObject }, ciphertext, { iv, tag = Buffer.alloc(0), aad = Buffer.alloc(0) }) => {\n checkInput(size, iv, tag)\n\n const keySize = size / 8\n const key = keyObject.export()\n const encKey = key.slice(keySize)\n const macKey = key.slice(0, keySize)\n\n const macData = Buffer.concat([aad, iv, ciphertext, uint64be(aad.length * 8)])\n const expectedTag = sign({ [KEYOBJECT]: macKey }, macData, tag).slice(0, keySize)\n const macCheckPassed = timingSafeEqual(tag, expectedTag)\n\n if (!macCheckPassed) {\n throw new JWEDecryptionFailed()\n }\n\n let cleartext\n try {\n const cipher = createDecipheriv(`aes-${size}-cbc`, encKey, iv)\n cleartext = Buffer.concat([cipher.update(ciphertext), cipher.final()])\n } catch (err) {}\n\n if (!cleartext) {\n throw new JWEDecryptionFailed()\n }\n\n return cleartext\n}\n\nmodule.exports = (JWA, JWK) => {\n ['A128CBC-HS256', 'A192CBC-HS384', 'A256CBC-HS512'].forEach((jwaAlg) => {\n const size = parseInt(jwaAlg.substr(1, 3), 10)\n const sign = JWA.sign.get(`HS${size * 2}`)\n if (getCiphers().includes(`aes-${size}-cbc`)) {\n JWA.encrypt.set(jwaAlg, encrypt.bind(undefined, size, sign))\n JWA.decrypt.set(jwaAlg, decrypt.bind(undefined, size, sign))\n JWK.oct.encrypt[jwaAlg] = JWK.oct.decrypt[jwaAlg] = key => (key.use === 'enc' || key.use === undefined) && key.length / 2 === size\n }\n })\n}\n","const { createCipheriv, createDecipheriv, getCiphers } = require('crypto')\n\nconst { KEYOBJECT } = require('../help/consts')\nconst { JWEInvalid, JWEDecryptionFailed } = require('../errors')\nconst { asInput } = require('../help/key_object')\n\nconst checkInput = function (size, iv, tag) {\n if (iv.length !== 12) {\n throw new JWEInvalid('invalid iv')\n }\n if (arguments.length === 3) {\n if (tag.length !== 16) {\n throw new JWEInvalid('invalid tag')\n }\n }\n}\n\nconst encrypt = (size, { [KEYOBJECT]: keyObject }, cleartext, { iv, aad = Buffer.alloc(0) }) => {\n const key = asInput(keyObject, false)\n checkInput(size, iv)\n\n const cipher = createCipheriv(`aes-${size}-gcm`, key, iv, { authTagLength: 16 })\n cipher.setAAD(aad)\n\n const ciphertext = Buffer.concat([cipher.update(cleartext), cipher.final()])\n const tag = cipher.getAuthTag()\n\n return { ciphertext, tag }\n}\n\nconst decrypt = (size, { [KEYOBJECT]: keyObject }, ciphertext, { iv, tag = Buffer.alloc(0), aad = Buffer.alloc(0) }) => {\n const key = asInput(keyObject, false)\n checkInput(size, iv, tag)\n\n try {\n const cipher = createDecipheriv(`aes-${size}-gcm`, key, iv, { authTagLength: 16 })\n cipher.setAuthTag(tag)\n cipher.setAAD(aad)\n\n return Buffer.concat([cipher.update(ciphertext), cipher.final()])\n } catch (err) {\n throw new JWEDecryptionFailed()\n }\n}\n\nmodule.exports = (JWA, JWK) => {\n ['A128GCM', 'A192GCM', 'A256GCM'].forEach((jwaAlg) => {\n const size = parseInt(jwaAlg.substr(1, 3), 10)\n if (getCiphers().includes(`aes-${size}-gcm`)) {\n JWA.encrypt.set(jwaAlg, encrypt.bind(undefined, size))\n JWA.decrypt.set(jwaAlg, decrypt.bind(undefined, size))\n JWK.oct.encrypt[jwaAlg] = JWK.oct.decrypt[jwaAlg] = key => (key.use === 'enc' || key.use === undefined) && key.length === size\n }\n })\n}\n","const generateIV = require('../help/generate_iv')\nconst base64url = require('../help/base64url')\n\nmodule.exports = (JWA, JWK) => {\n ['A128GCMKW', 'A192GCMKW', 'A256GCMKW'].forEach((jwaAlg) => {\n const encAlg = jwaAlg.substr(0, 7)\n const size = parseInt(jwaAlg.substr(1, 3), 10)\n const encrypt = JWA.encrypt.get(encAlg)\n const decrypt = JWA.decrypt.get(encAlg)\n\n if (encrypt && decrypt) {\n JWA.keyManagementEncrypt.set(jwaAlg, (key, payload) => {\n const iv = generateIV(jwaAlg)\n const { ciphertext, tag } = encrypt(key, payload, { iv })\n return {\n wrapped: ciphertext,\n header: { tag: base64url.encodeBuffer(tag), iv: base64url.encodeBuffer(iv) }\n }\n })\n JWA.keyManagementDecrypt.set(jwaAlg, decrypt)\n JWK.oct.wrapKey[jwaAlg] = JWK.oct.unwrapKey[jwaAlg] = key => (key.use === 'enc' || key.use === undefined) && key.length === size\n }\n })\n}\n","const { createCipheriv, createDecipheriv, getCiphers } = require('crypto')\n\nconst { KEYOBJECT } = require('../help/consts')\nconst { asInput } = require('../help/key_object')\n\nconst checkInput = (data) => {\n if (data !== undefined && data.length % 8 !== 0) {\n throw new Error('invalid data length')\n }\n}\n\nconst wrapKey = (alg, { [KEYOBJECT]: keyObject }, payload) => {\n const key = asInput(keyObject, false)\n const cipher = createCipheriv(alg, key, Buffer.alloc(8, 'a6', 'hex'))\n\n return { wrapped: Buffer.concat([cipher.update(payload), cipher.final()]) }\n}\n\nconst unwrapKey = (alg, { [KEYOBJECT]: keyObject }, payload) => {\n const key = asInput(keyObject, false)\n checkInput(payload)\n const cipher = createDecipheriv(alg, key, Buffer.alloc(8, 'a6', 'hex'))\n\n return Buffer.concat([cipher.update(payload), cipher.final()])\n}\n\nmodule.exports = (JWA, JWK) => {\n ['A128KW', 'A192KW', 'A256KW'].forEach((jwaAlg) => {\n const size = parseInt(jwaAlg.substr(1, 3), 10)\n const alg = `aes${size}-wrap`\n if (getCiphers().includes(alg)) {\n JWA.keyManagementEncrypt.set(jwaAlg, wrapKey.bind(undefined, alg))\n JWA.keyManagementDecrypt.set(jwaAlg, unwrapKey.bind(undefined, alg))\n JWK.oct.wrapKey[jwaAlg] = JWK.oct.unwrapKey[jwaAlg] = key => (key.use === 'enc' || key.use === undefined) && key.length === size\n }\n })\n}\n","const { improvedDH } = require('../../help/runtime_support')\n\nif (improvedDH) {\n const { diffieHellman } = require('crypto')\n\n const { KeyObject } = require('../../help/key_object')\n const importKey = require('../../jwk/import')\n\n module.exports = ({ keyObject: privateKey }, publicKey) => {\n if (!(publicKey instanceof KeyObject)) {\n ({ keyObject: publicKey } = importKey(publicKey))\n }\n\n return diffieHellman({ privateKey, publicKey })\n }\n} else {\n const { createECDH, constants: { POINT_CONVERSION_UNCOMPRESSED } } = require('crypto')\n\n const base64url = require('../../help/base64url')\n\n const crvToCurve = (crv) => {\n switch (crv) {\n case 'P-256':\n return 'prime256v1'\n case 'P-384':\n return 'secp384r1'\n case 'P-521':\n return 'secp521r1'\n }\n }\n\n const UNCOMPRESSED = Buffer.alloc(1, POINT_CONVERSION_UNCOMPRESSED)\n const pubToBuffer = (x, y) => Buffer.concat([UNCOMPRESSED, base64url.decodeToBuffer(x), base64url.decodeToBuffer(y)])\n\n module.exports = ({ crv, d }, { x, y }) => {\n const curve = crvToCurve(crv)\n const exchange = createECDH(curve)\n\n exchange.setPrivateKey(base64url.decodeToBuffer(d))\n\n return exchange.computeSecret(pubToBuffer(x, y))\n }\n}\n","const { createHash } = require('crypto')\nconst ecdhComputeSecret = require('./compute_secret')\n\nconst concat = (key, length, value) => {\n const iterations = Math.ceil(length / 32)\n let res\n\n for (let iter = 1; iter <= iterations; iter++) {\n const buf = Buffer.allocUnsafe(4 + key.length + value.length)\n buf.writeUInt32BE(iter, 0)\n key.copy(buf, 4)\n value.copy(buf, 4 + key.length)\n if (!res) {\n res = createHash('sha256').update(buf).digest()\n } else {\n res = Buffer.concat([res, createHash('sha256').update(buf).digest()])\n }\n }\n\n return res.slice(0, length)\n}\n\nconst uint32be = (value, buf = Buffer.allocUnsafe(4)) => {\n buf.writeUInt32BE(value)\n return buf\n}\n\nconst lengthAndInput = input => Buffer.concat([uint32be(input.length), input])\n\nmodule.exports = (alg, keyLen, privKey, pubKey, { apu = Buffer.alloc(0), apv = Buffer.alloc(0) } = {}, computeSecret = ecdhComputeSecret) => {\n const value = Buffer.concat([\n lengthAndInput(Buffer.from(alg)),\n lengthAndInput(apu),\n lengthAndInput(apv),\n uint32be(keyLen)\n ])\n\n const sharedSecret = computeSecret(privKey, pubKey)\n return concat(sharedSecret, keyLen / 8, value)\n}\n","const { improvedDH } = require('../../help/runtime_support')\nconst { KEYLENGTHS } = require('../../registry')\nconst { generateSync } = require('../../jwk/generate')\nconst { name: secp256k1 } = require('../../jwk/key/secp256k1_crv')\n\nconst derive = require('./derive')\n\nconst wrapKey = (key, payload, { enc }) => {\n const epk = generateSync(key.kty, key.crv)\n\n const derivedKey = derive(enc, KEYLENGTHS.get(enc), epk, key)\n\n return {\n wrapped: derivedKey,\n header: { epk: { kty: key.kty, crv: key.crv, x: epk.x, y: epk.y } }\n }\n}\n\nconst unwrapKey = (key, payload, header) => {\n const { enc, epk } = header\n return derive(enc, KEYLENGTHS.get(enc), key, epk, header)\n}\n\nmodule.exports = (JWA, JWK) => {\n JWA.keyManagementEncrypt.set('ECDH-ES', wrapKey)\n JWA.keyManagementDecrypt.set('ECDH-ES', unwrapKey)\n JWK.EC.deriveKey['ECDH-ES'] = key => (key.use === 'enc' || key.use === undefined) && key.crv !== secp256k1\n\n if (improvedDH) {\n JWK.OKP.deriveKey['ECDH-ES'] = key => (key.use === 'enc' || key.use === undefined) && key.keyObject.asymmetricKeyType.startsWith('x')\n }\n}\n","const { improvedDH } = require('../../help/runtime_support')\nconst { KEYOBJECT } = require('../../help/consts')\nconst { generateSync } = require('../../jwk/generate')\nconst { name: secp256k1 } = require('../../jwk/key/secp256k1_crv')\nconst { ECDH_DERIVE_LENGTHS } = require('../../registry')\n\nconst derive = require('./derive')\n\nconst wrapKey = (wrap, derive, key, payload) => {\n const epk = generateSync(key.kty, key.crv)\n\n const derivedKey = derive(epk, key, payload)\n\n const result = wrap({ [KEYOBJECT]: derivedKey }, payload)\n result.header = result.header || {}\n Object.assign(result.header, { epk: { kty: key.kty, crv: key.crv, x: epk.x, y: epk.y } })\n\n return result\n}\n\nconst unwrapKey = (unwrap, derive, key, payload, header) => {\n const { epk } = header\n const derivedKey = derive(key, epk, header)\n\n return unwrap({ [KEYOBJECT]: derivedKey }, payload, header)\n}\n\nmodule.exports = (JWA, JWK) => {\n ['ECDH-ES+A128KW', 'ECDH-ES+A192KW', 'ECDH-ES+A256KW'].forEach((jwaAlg) => {\n const kw = jwaAlg.substr(-6)\n const kwWrap = JWA.keyManagementEncrypt.get(kw)\n const kwUnwrap = JWA.keyManagementDecrypt.get(kw)\n const keylen = parseInt(jwaAlg.substr(9, 3), 10)\n ECDH_DERIVE_LENGTHS.set(jwaAlg, keylen)\n\n if (kwWrap && kwUnwrap) {\n JWA.keyManagementEncrypt.set(jwaAlg, wrapKey.bind(undefined, kwWrap, derive.bind(undefined, jwaAlg, keylen)))\n JWA.keyManagementDecrypt.set(jwaAlg, unwrapKey.bind(undefined, kwUnwrap, derive.bind(undefined, jwaAlg, keylen)))\n JWK.EC.deriveKey[jwaAlg] = key => (key.use === 'enc' || key.use === undefined) && key.crv !== secp256k1\n\n if (improvedDH) {\n JWK.OKP.deriveKey[jwaAlg] = key => (key.use === 'enc' || key.use === undefined) && key.keyObject.asymmetricKeyType.startsWith('x')\n }\n }\n })\n}\nmodule.exports.wrapKey = wrapKey\nmodule.exports.unwrapKey = unwrapKey\n","const { sign: signOneShot, verify: verifyOneShot, createSign, createVerify, getCurves } = require('crypto')\n\nconst { derToJose, joseToDer } = require('../help/ecdsa_signatures')\nconst { KEYOBJECT } = require('../help/consts')\nconst resolveNodeAlg = require('../help/node_alg')\nconst { asInput } = require('../help/key_object')\nconst { dsaEncodingSupported } = require('../help/runtime_support')\nconst { name: secp256k1 } = require('../jwk/key/secp256k1_crv')\n\nlet sign, verify\n\nif (dsaEncodingSupported) {\n sign = (jwaAlg, nodeAlg, { [KEYOBJECT]: keyObject }, payload) => {\n if (typeof payload === 'string') {\n payload = Buffer.from(payload)\n }\n return signOneShot(nodeAlg, payload, { key: asInput(keyObject, false), dsaEncoding: 'ieee-p1363' })\n }\n verify = (jwaAlg, nodeAlg, { [KEYOBJECT]: keyObject }, payload, signature) => {\n try {\n return verifyOneShot(nodeAlg, payload, { key: asInput(keyObject, true), dsaEncoding: 'ieee-p1363' }, signature)\n } catch (err) {\n return false\n }\n }\n} else {\n sign = (jwaAlg, nodeAlg, { [KEYOBJECT]: keyObject }, payload) => {\n return derToJose(createSign(nodeAlg).update(payload).sign(asInput(keyObject, false)), jwaAlg)\n }\n verify = (jwaAlg, nodeAlg, { [KEYOBJECT]: keyObject }, payload, signature) => {\n try {\n return createVerify(nodeAlg).update(payload).verify(asInput(keyObject, true), joseToDer(signature, jwaAlg))\n } catch (err) {\n return false\n }\n }\n}\n\nconst crvToAlg = (crv) => {\n switch (crv) {\n case 'P-256':\n return 'ES256'\n case secp256k1:\n return 'ES256K'\n case 'P-384':\n return 'ES384'\n case 'P-521':\n return 'ES512'\n }\n}\n\nmodule.exports = (JWA, JWK) => {\n const algs = []\n\n if (getCurves().includes('prime256v1')) {\n algs.push('ES256')\n }\n\n if (getCurves().includes('secp256k1')) {\n algs.push('ES256K')\n }\n\n if (getCurves().includes('secp384r1')) {\n algs.push('ES384')\n }\n\n if (getCurves().includes('secp521r1')) {\n algs.push('ES512')\n }\n\n algs.forEach((jwaAlg) => {\n const nodeAlg = resolveNodeAlg(jwaAlg)\n JWA.sign.set(jwaAlg, sign.bind(undefined, jwaAlg, nodeAlg))\n JWA.verify.set(jwaAlg, verify.bind(undefined, jwaAlg, nodeAlg))\n JWK.EC.sign[jwaAlg] = key => key.private && JWK.EC.verify[jwaAlg](key)\n JWK.EC.verify[jwaAlg] = key => (key.use === 'sig' || key.use === undefined) && crvToAlg(key.crv) === jwaAlg\n })\n}\n","const { sign: signOneShot, verify: verifyOneShot } = require('crypto')\n\nconst { KEYOBJECT } = require('../help/consts')\nconst { edDSASupported } = require('../help/runtime_support')\n\nconst sign = ({ [KEYOBJECT]: keyObject }, payload) => {\n if (typeof payload === 'string') {\n payload = Buffer.from(payload)\n }\n return signOneShot(undefined, payload, keyObject)\n}\n\nconst verify = ({ [KEYOBJECT]: keyObject }, payload, signature) => {\n return verifyOneShot(undefined, payload, keyObject, signature)\n}\n\nmodule.exports = (JWA, JWK) => {\n if (edDSASupported) {\n JWA.sign.set('EdDSA', sign)\n JWA.verify.set('EdDSA', verify)\n JWK.OKP.sign.EdDSA = key => key.private && JWK.OKP.verify.EdDSA(key)\n JWK.OKP.verify.EdDSA = key => (key.use === 'sig' || key.use === undefined) && key.keyObject.asymmetricKeyType.startsWith('ed')\n }\n}\n","const { createHmac } = require('crypto')\n\nconst { KEYOBJECT } = require('../help/consts')\nconst timingSafeEqual = require('../help/timing_safe_equal')\nconst resolveNodeAlg = require('../help/node_alg')\nconst { asInput } = require('../help/key_object')\n\nconst sign = (jwaAlg, hmacAlg, { [KEYOBJECT]: keyObject }, payload) => {\n const hmac = createHmac(hmacAlg, asInput(keyObject, false))\n hmac.update(payload)\n return hmac.digest()\n}\n\nconst verify = (jwaAlg, hmacAlg, key, payload, signature) => {\n const expected = sign(jwaAlg, hmacAlg, key, payload)\n const actual = signature\n\n return timingSafeEqual(actual, expected)\n}\n\nmodule.exports = (JWA, JWK) => {\n ['HS256', 'HS384', 'HS512'].forEach((jwaAlg) => {\n const hmacAlg = resolveNodeAlg(jwaAlg)\n JWA.sign.set(jwaAlg, sign.bind(undefined, jwaAlg, hmacAlg))\n JWA.verify.set(jwaAlg, verify.bind(undefined, jwaAlg, hmacAlg))\n JWK.oct.sign[jwaAlg] = JWK.oct.verify[jwaAlg] = key => key.use === 'sig' || key.use === undefined\n })\n}\n","const { JWKKeySupport, JOSENotSupported } = require('../errors')\nconst { KEY_MANAGEMENT_ENCRYPT, KEY_MANAGEMENT_DECRYPT } = require('../help/consts')\n\nconst { JWA, JWK } = require('../registry')\n\n// sign, verify\nrequire('./hmac')(JWA, JWK)\nrequire('./ecdsa')(JWA, JWK)\nrequire('./eddsa')(JWA, JWK)\nrequire('./rsassa_pss')(JWA, JWK)\nrequire('./rsassa')(JWA, JWK)\nrequire('./none')(JWA)\n\n// encrypt, decrypt\nrequire('./aes_cbc_hmac_sha2')(JWA, JWK)\nrequire('./aes_gcm')(JWA, JWK)\n\n// wrapKey, unwrapKey\nrequire('./rsaes')(JWA, JWK)\nrequire('./aes_kw')(JWA, JWK)\nrequire('./aes_gcm_kw')(JWA, JWK)\n\n// deriveKey\nrequire('./pbes2')(JWA, JWK)\nrequire('./ecdh/dir')(JWA, JWK)\nrequire('./ecdh/kw')(JWA, JWK)\n\nconst check = (key, op, alg) => {\n const cache = `_${op}_${alg}`\n\n let label\n let keyOp\n if (op === 'keyManagementEncrypt') {\n label = 'key management (encryption)'\n keyOp = KEY_MANAGEMENT_ENCRYPT\n } else if (op === 'keyManagementDecrypt') {\n label = 'key management (decryption)'\n keyOp = KEY_MANAGEMENT_DECRYPT\n }\n\n if (cache in key) {\n if (key[cache]) {\n return\n }\n throw new JWKKeySupport(`the key does not support ${alg} ${label || op} algorithm`)\n }\n\n let value = true\n if (!JWA[op].has(alg)) {\n throw new JOSENotSupported(`unsupported ${label || op} alg: ${alg}`)\n } else if (!key.algorithms(keyOp).has(alg)) {\n value = false\n }\n\n Object.defineProperty(key, cache, { value, enumerable: false })\n\n if (!value) {\n return check(key, op, alg)\n }\n}\n\nmodule.exports = {\n check,\n sign: (alg, key, payload) => {\n check(key, 'sign', alg)\n return JWA.sign.get(alg)(key, payload)\n },\n verify: (alg, key, payload, signature) => {\n check(key, 'verify', alg)\n return JWA.verify.get(alg)(key, payload, signature)\n },\n keyManagementEncrypt: (alg, key, payload, opts) => {\n check(key, 'keyManagementEncrypt', alg)\n return JWA.keyManagementEncrypt.get(alg)(key, payload, opts)\n },\n keyManagementDecrypt: (alg, key, payload, opts) => {\n check(key, 'keyManagementDecrypt', alg)\n return JWA.keyManagementDecrypt.get(alg)(key, payload, opts)\n },\n encrypt: (alg, key, cleartext, opts) => {\n check(key, 'encrypt', alg)\n return JWA.encrypt.get(alg)(key, cleartext, opts)\n },\n decrypt: (alg, key, ciphertext, opts) => {\n check(key, 'decrypt', alg)\n return JWA.decrypt.get(alg)(key, ciphertext, opts)\n }\n}\n","const sign = () => Buffer.from('')\nconst verify = (key, payload, signature) => !signature.length\n\nmodule.exports = (JWA, JWK) => {\n JWA.sign.set('none', sign)\n JWA.verify.set('none', verify)\n}\n","const { pbkdf2Sync: pbkdf2, randomBytes } = require('crypto')\n\nconst { KEYOBJECT } = require('../help/consts')\nconst base64url = require('../help/base64url')\n\nconst SALT_LENGTH = 16\nconst NULL_BUFFER = Buffer.alloc(1, 0)\n\nconst concatSalt = (alg, p2s) => {\n return Buffer.concat([\n Buffer.from(alg, 'utf8'),\n NULL_BUFFER,\n p2s\n ])\n}\n\nconst wrapKey = (keylen, sha, concat, wrap, { [KEYOBJECT]: keyObject }, payload) => {\n // Note that if password-based encryption is used for multiple\n // recipients, it is expected that each recipient use different values\n // for the PBES2 parameters \"p2s\" and \"p2c\".\n // here we generate p2c between 2048 and 4096 and random p2s\n const p2c = Math.floor((Math.random() * 2049) + 2048)\n const p2s = randomBytes(SALT_LENGTH)\n const salt = concat(p2s)\n\n const derivedKey = pbkdf2(keyObject.export(), salt, p2c, keylen, sha)\n\n const result = wrap({ [KEYOBJECT]: derivedKey }, payload)\n result.header = result.header || {}\n Object.assign(result.header, { p2c, p2s: base64url.encodeBuffer(p2s) })\n\n return result\n}\n\nconst unwrapKey = (keylen, sha, concat, unwrap, { [KEYOBJECT]: keyObject }, payload, header) => {\n const { p2s, p2c } = header\n const salt = concat(p2s)\n const derivedKey = pbkdf2(keyObject.export(), salt, p2c, keylen, sha)\n return unwrap({ [KEYOBJECT]: derivedKey }, payload, header)\n}\n\nmodule.exports = (JWA, JWK) => {\n ['PBES2-HS256+A128KW', 'PBES2-HS384+A192KW', 'PBES2-HS512+A256KW'].forEach((jwaAlg) => {\n const kw = jwaAlg.substr(-6)\n const kwWrap = JWA.keyManagementEncrypt.get(kw)\n const kwUnwrap = JWA.keyManagementDecrypt.get(kw)\n const keylen = parseInt(jwaAlg.substr(13, 3), 10) / 8\n const sha = `sha${jwaAlg.substr(8, 3)}`\n\n if (kwWrap && kwUnwrap) {\n JWA.keyManagementEncrypt.set(jwaAlg, wrapKey.bind(undefined, keylen, sha, concatSalt.bind(undefined, jwaAlg), kwWrap))\n JWA.keyManagementDecrypt.set(jwaAlg, unwrapKey.bind(undefined, keylen, sha, concatSalt.bind(undefined, jwaAlg), kwUnwrap))\n JWK.oct.deriveKey[jwaAlg] = key => key.use === 'enc' || key.use === undefined\n }\n })\n}\n","const { publicEncrypt, privateDecrypt, constants } = require('crypto')\n\nconst { oaepHashSupported } = require('../help/runtime_support')\nconst { KEYOBJECT } = require('../help/consts')\nconst { asInput } = require('../help/key_object')\n\nconst resolvePadding = (alg) => {\n switch (alg) {\n case 'RSA-OAEP':\n case 'RSA-OAEP-256':\n case 'RSA-OAEP-384':\n case 'RSA-OAEP-512':\n return constants.RSA_PKCS1_OAEP_PADDING\n case 'RSA1_5':\n return constants.RSA_PKCS1_PADDING\n }\n}\n\nconst resolveOaepHash = (alg) => {\n switch (alg) {\n case 'RSA-OAEP':\n return 'sha1'\n case 'RSA-OAEP-256':\n return 'sha256'\n case 'RSA-OAEP-384':\n return 'sha384'\n case 'RSA-OAEP-512':\n return 'sha512'\n default:\n return undefined\n }\n}\n\nconst wrapKey = (padding, oaepHash, { [KEYOBJECT]: keyObject }, payload) => {\n const key = asInput(keyObject, true)\n return { wrapped: publicEncrypt({ key, oaepHash, padding }, payload) }\n}\n\nconst unwrapKey = (padding, oaepHash, { [KEYOBJECT]: keyObject }, payload) => {\n const key = asInput(keyObject, false)\n return privateDecrypt({ key, oaepHash, padding }, payload)\n}\n\nconst LENGTHS = {\n RSA1_5: 0,\n 'RSA-OAEP': 592,\n 'RSA-OAEP-256': 784,\n 'RSA-OAEP-384': 1040,\n 'RSA-OAEP-512': 1296\n}\n\nmodule.exports = (JWA, JWK) => {\n const algs = ['RSA-OAEP', 'RSA1_5']\n\n if (oaepHashSupported) {\n algs.splice(1, 0, 'RSA-OAEP-256', 'RSA-OAEP-384', 'RSA-OAEP-512')\n }\n\n algs.forEach((jwaAlg) => {\n const padding = resolvePadding(jwaAlg)\n const oaepHash = resolveOaepHash(jwaAlg)\n JWA.keyManagementEncrypt.set(jwaAlg, wrapKey.bind(undefined, padding, oaepHash))\n JWA.keyManagementDecrypt.set(jwaAlg, unwrapKey.bind(undefined, padding, oaepHash))\n JWK.RSA.wrapKey[jwaAlg] = key => (key.use === 'enc' || key.use === undefined) && key.length >= LENGTHS[jwaAlg]\n JWK.RSA.unwrapKey[jwaAlg] = key => key.private && (key.use === 'enc' || key.use === undefined) && key.length >= LENGTHS[jwaAlg]\n })\n}\n","const { createSign, createVerify } = require('crypto')\n\nconst { KEYOBJECT } = require('../help/consts')\nconst resolveNodeAlg = require('../help/node_alg')\nconst { asInput } = require('../help/key_object')\n\nconst sign = (nodeAlg, { [KEYOBJECT]: keyObject }, payload) => {\n return createSign(nodeAlg).update(payload).sign(asInput(keyObject, false))\n}\n\nconst verify = (nodeAlg, { [KEYOBJECT]: keyObject }, payload, signature) => {\n return createVerify(nodeAlg).update(payload).verify(asInput(keyObject, true), signature)\n}\n\nconst LENGTHS = {\n RS256: 0,\n RS384: 624,\n RS512: 752\n}\n\nmodule.exports = (JWA, JWK) => {\n ['RS256', 'RS384', 'RS512'].forEach((jwaAlg) => {\n const nodeAlg = resolveNodeAlg(jwaAlg)\n JWA.sign.set(jwaAlg, sign.bind(undefined, nodeAlg))\n JWA.verify.set(jwaAlg, verify.bind(undefined, nodeAlg))\n JWK.RSA.sign[jwaAlg] = key => key.private && JWK.RSA.verify[jwaAlg](key)\n JWK.RSA.verify[jwaAlg] = key => (key.use === 'sig' || key.use === undefined) && key.length >= LENGTHS[jwaAlg]\n })\n}\n","const {\n createSign,\n createVerify,\n constants\n} = require('crypto')\n\nconst { KEYOBJECT } = require('../help/consts')\nconst resolveNodeAlg = require('../help/node_alg')\nconst { asInput } = require('../help/key_object')\n\nconst sign = (nodeAlg, { [KEYOBJECT]: keyObject }, payload) => {\n const key = asInput(keyObject, false)\n return createSign(nodeAlg).update(payload).sign({\n key,\n padding: constants.RSA_PKCS1_PSS_PADDING,\n saltLength: constants.RSA_PSS_SALTLEN_DIGEST\n })\n}\n\nconst verify = (nodeAlg, { [KEYOBJECT]: keyObject }, payload, signature) => {\n const key = asInput(keyObject, true)\n return createVerify(nodeAlg).update(payload).verify({\n key,\n padding: constants.RSA_PKCS1_PSS_PADDING,\n saltLength: constants.RSA_PSS_SALTLEN_DIGEST\n }, signature)\n}\n\nconst LENGTHS = {\n PS256: 528,\n PS384: 784,\n PS512: 1040\n}\n\nmodule.exports = (JWA, JWK) => {\n ['PS256', 'PS384', 'PS512'].forEach((jwaAlg) => {\n const nodeAlg = resolveNodeAlg(jwaAlg)\n JWA.sign.set(jwaAlg, sign.bind(undefined, nodeAlg))\n JWA.verify.set(jwaAlg, verify.bind(undefined, nodeAlg))\n JWK.RSA.sign[jwaAlg] = key => key.private && JWK.RSA.verify[jwaAlg](key)\n JWK.RSA.verify[jwaAlg] = key => (key.use === 'sig' || key.use === undefined) && key.length >= LENGTHS[jwaAlg]\n })\n}\n","const { inflateRawSync } = require('zlib')\n\nconst base64url = require('../help/base64url')\nconst getKey = require('../help/get_key')\nconst { KeyStore } = require('../jwks')\nconst errors = require('../errors')\nconst { check, decrypt, keyManagementDecrypt } = require('../jwa')\nconst JWK = require('../jwk')\n\nconst { createSecretKey } = require('../help/key_object')\nconst generateCEK = require('./generate_cek')\nconst validateHeaders = require('./validate_headers')\nconst { detect: resolveSerialization } = require('./serializers')\n\nconst SINGLE_RECIPIENT = new Set(['compact', 'flattened'])\n\nconst combineHeader = (prot = {}, unprotected = {}, header = {}) => {\n if (typeof prot === 'string') {\n prot = base64url.JSON.decode(prot)\n }\n\n const p2s = prot.p2s || unprotected.p2s || header.p2s\n const apu = prot.apu || unprotected.apu || header.apu\n const apv = prot.apv || unprotected.apv || header.apv\n const iv = prot.iv || unprotected.iv || header.iv\n const tag = prot.tag || unprotected.tag || header.tag\n\n return {\n ...prot,\n ...unprotected,\n ...header,\n ...(typeof p2s === 'string' ? { p2s: base64url.decodeToBuffer(p2s) } : undefined),\n ...(typeof apu === 'string' ? { apu: base64url.decodeToBuffer(apu) } : undefined),\n ...(typeof apv === 'string' ? { apv: base64url.decodeToBuffer(apv) } : undefined),\n ...(typeof iv === 'string' ? { iv: base64url.decodeToBuffer(iv) } : undefined),\n ...(typeof tag === 'string' ? { tag: base64url.decodeToBuffer(tag) } : undefined)\n }\n}\n\n/*\n * @public\n */\nconst jweDecrypt = (skipValidateHeaders, serialization, jwe, key, { crit = [], complete = false, algorithms } = {}) => {\n key = getKey(key, true)\n\n if (algorithms !== undefined && (!Array.isArray(algorithms) || algorithms.some(s => typeof s !== 'string' || !s))) {\n throw new TypeError('\"algorithms\" option must be an array of non-empty strings')\n } else if (algorithms) {\n algorithms = new Set(algorithms)\n }\n\n if (!Array.isArray(crit) || crit.some(s => typeof s !== 'string' || !s)) {\n throw new TypeError('\"crit\" option must be an array of non-empty strings')\n }\n\n if (!serialization) {\n serialization = resolveSerialization(jwe)\n }\n\n let alg, ciphertext, enc, encryptedKey, iv, opts, prot, tag, unprotected, cek, aad, header\n\n // treat general format with one recipient as flattened\n // skips iteration and avoids multi errors in this case\n if (serialization === 'general' && jwe.recipients.length === 1) {\n serialization = 'flattened'\n const { recipients, ...root } = jwe\n jwe = { ...root, ...recipients[0] }\n }\n\n if (SINGLE_RECIPIENT.has(serialization)) {\n if (serialization === 'compact') { // compact serialization format\n ([prot, encryptedKey, iv, ciphertext, tag] = jwe.split('.'))\n } else { // flattened serialization format\n ({ protected: prot, encrypted_key: encryptedKey, iv, ciphertext, tag, unprotected, aad, header } = jwe)\n }\n\n if (!skipValidateHeaders) {\n validateHeaders(prot, unprotected, [{ header }], true, crit)\n }\n\n opts = combineHeader(prot, unprotected, header)\n\n ;({ alg, enc } = opts)\n\n if (algorithms && !algorithms.has(alg === 'dir' ? enc : alg)) {\n throw new errors.JOSEAlgNotWhitelisted('alg not whitelisted')\n }\n\n if (key instanceof KeyStore) {\n const keystore = key\n let keys\n if (opts.alg === 'dir') {\n keys = keystore.all({ kid: opts.kid, alg: opts.enc, key_ops: ['decrypt'] })\n } else {\n keys = keystore.all({ kid: opts.kid, alg: opts.alg, key_ops: ['unwrapKey'] })\n }\n switch (keys.length) {\n case 0:\n throw new errors.JWKSNoMatchingKey()\n case 1:\n // treat the call as if a Key instance was passed in\n // skips iteration and avoids multi errors in this case\n key = keys[0]\n break\n default: {\n const errs = []\n for (const key of keys) {\n try {\n return jweDecrypt(true, serialization, jwe, key, { crit, complete, algorithms: algorithms ? [...algorithms] : undefined })\n } catch (err) {\n errs.push(err)\n continue\n }\n }\n\n const multi = new errors.JOSEMultiError(errs)\n if ([...multi].some(e => e instanceof errors.JWEDecryptionFailed)) {\n throw new errors.JWEDecryptionFailed()\n }\n throw multi\n }\n }\n }\n\n check(key, ...(alg === 'dir' ? ['decrypt', enc] : ['keyManagementDecrypt', alg]))\n\n try {\n if (alg === 'dir') {\n cek = JWK.asKey(key, { alg: enc, use: 'enc' })\n } else if (alg === 'ECDH-ES') {\n const unwrapped = keyManagementDecrypt(alg, key, undefined, opts)\n cek = JWK.asKey(createSecretKey(unwrapped), { alg: enc, use: 'enc' })\n } else {\n const unwrapped = keyManagementDecrypt(alg, key, base64url.decodeToBuffer(encryptedKey), opts)\n cek = JWK.asKey(createSecretKey(unwrapped), { alg: enc, use: 'enc' })\n }\n } catch (err) {\n // To mitigate the attacks described in RFC 3218, the\n // recipient MUST NOT distinguish between format, padding, and length\n // errors of encrypted keys. It is strongly recommended, in the event\n // of receiving an improperly formatted key, that the recipient\n // substitute a randomly generated CEK and proceed to the next step, to\n // mitigate timing attacks.\n cek = generateCEK(enc)\n }\n\n let adata\n if (aad) {\n adata = Buffer.concat([\n Buffer.from(prot || ''),\n Buffer.from('.'),\n Buffer.from(aad)\n ])\n } else {\n adata = Buffer.from(prot || '')\n }\n\n try {\n iv = base64url.decodeToBuffer(iv)\n } catch (err) {}\n try {\n tag = base64url.decodeToBuffer(tag)\n } catch (err) {}\n\n let cleartext = decrypt(enc, cek, base64url.decodeToBuffer(ciphertext), { iv, tag, aad: adata })\n\n if (opts.zip) {\n cleartext = inflateRawSync(cleartext)\n }\n\n if (complete) {\n const result = { cleartext, key, cek }\n if (aad) result.aad = aad\n if (header) result.header = header\n if (unprotected) result.unprotected = unprotected\n if (prot) result.protected = base64url.JSON.decode(prot)\n return result\n }\n\n return cleartext\n }\n\n validateHeaders(jwe.protected, jwe.unprotected, jwe.recipients.map(({ header }) => ({ header })), true, crit)\n\n // general serialization format\n const { recipients, ...root } = jwe\n const errs = []\n for (const recipient of recipients) {\n try {\n return jweDecrypt(true, 'flattened', { ...root, ...recipient }, key, { crit, complete, algorithms: algorithms ? [...algorithms] : undefined })\n } catch (err) {\n errs.push(err)\n continue\n }\n }\n\n const multi = new errors.JOSEMultiError(errs)\n if ([...multi].some(e => e instanceof errors.JWEDecryptionFailed)) {\n throw new errors.JWEDecryptionFailed()\n } else if ([...multi].every(e => e instanceof errors.JWKSNoMatchingKey)) {\n throw new errors.JWKSNoMatchingKey()\n }\n throw multi\n}\n\nmodule.exports = jweDecrypt.bind(undefined, false, undefined)\n","const { deflateRawSync } = require('zlib')\n\nconst { KEYOBJECT } = require('../help/consts')\nconst generateIV = require('../help/generate_iv')\nconst base64url = require('../help/base64url')\nconst getKey = require('../help/get_key')\nconst isObject = require('../help/is_object')\nconst { createSecretKey } = require('../help/key_object')\nconst deepClone = require('../help/deep_clone')\nconst importKey = require('../jwk/import')\nconst { JWEInvalid } = require('../errors')\nconst { check, keyManagementEncrypt, encrypt } = require('../jwa')\n\nconst serializers = require('./serializers')\nconst generateCEK = require('./generate_cek')\nconst validateHeaders = require('./validate_headers')\n\nconst PROCESS_RECIPIENT = Symbol('PROCESS_RECIPIENT')\n\nclass Encrypt {\n // TODO: in v2.x swap unprotectedHeader and aad\n constructor (cleartext, protectedHeader, unprotectedHeader, aad) {\n if (!Buffer.isBuffer(cleartext) && typeof cleartext !== 'string') {\n throw new TypeError('cleartext argument must be a Buffer or a string')\n }\n cleartext = Buffer.from(cleartext)\n\n if (aad !== undefined && !Buffer.isBuffer(aad) && typeof aad !== 'string') {\n throw new TypeError('aad argument must be a Buffer or a string when provided')\n }\n aad = aad ? Buffer.from(aad) : undefined\n\n if (protectedHeader !== undefined && !isObject(protectedHeader)) {\n throw new TypeError('protectedHeader argument must be a plain object when provided')\n }\n\n if (unprotectedHeader !== undefined && !isObject(unprotectedHeader)) {\n throw new TypeError('unprotectedHeader argument must be a plain object when provided')\n }\n\n this._recipients = []\n this._cleartext = cleartext\n this._aad = aad\n this._unprotected = unprotectedHeader ? deepClone(unprotectedHeader) : undefined\n this._protected = protectedHeader ? deepClone(protectedHeader) : undefined\n }\n\n /*\n * @public\n */\n recipient (key, header) {\n key = getKey(key)\n\n if (header !== undefined && !isObject(header)) {\n throw new TypeError('header argument must be a plain object when provided')\n }\n\n this._recipients.push({\n key,\n header: header ? deepClone(header) : undefined\n })\n\n return this\n }\n\n /*\n * @private\n */\n [PROCESS_RECIPIENT] (recipient) {\n const unprotectedHeader = this._unprotected\n const protectedHeader = this._protected\n const { length: recipientCount } = this._recipients\n\n const jweHeader = {\n ...protectedHeader,\n ...unprotectedHeader,\n ...recipient.header\n }\n const { key } = recipient\n\n const enc = jweHeader.enc\n let alg = jweHeader.alg\n\n if (key.use === 'sig') {\n throw new TypeError('a key with \"use\":\"sig\" is not usable for encryption')\n }\n\n if (alg === 'dir') {\n check(key, 'encrypt', enc)\n } else if (alg) {\n check(key, 'keyManagementEncrypt', alg)\n } else {\n alg = key.alg || [...key.algorithms('wrapKey')][0] || [...key.algorithms('deriveKey')][0]\n\n if (alg === 'ECDH-ES' && recipientCount !== 1) {\n alg = [...key.algorithms('deriveKey')][1]\n }\n\n if (!alg) {\n throw new JWEInvalid('could not resolve a usable \"alg\" for a recipient')\n }\n\n if (recipientCount === 1) {\n if (protectedHeader) {\n protectedHeader.alg = alg\n } else {\n this._protected = { alg }\n }\n } else {\n if (recipient.header) {\n recipient.header.alg = alg\n } else {\n recipient.header = { alg }\n }\n }\n }\n\n let wrapped\n let generatedHeader\n\n if (key.kty === 'oct' && alg === 'dir') {\n this._cek = importKey(key[KEYOBJECT], { use: 'enc', alg: enc })\n } else {\n check(this._cek, 'encrypt', enc)\n ;({ wrapped, header: generatedHeader } = keyManagementEncrypt(alg, key, this._cek[KEYOBJECT].export(), { enc, alg }))\n if (alg === 'ECDH-ES') {\n this._cek = importKey(createSecretKey(wrapped), { use: 'enc', alg: enc })\n }\n }\n\n if (alg === 'dir' || alg === 'ECDH-ES') {\n recipient.encrypted_key = ''\n } else {\n recipient.encrypted_key = base64url.encodeBuffer(wrapped)\n }\n\n if (generatedHeader) {\n recipient.generatedHeader = generatedHeader\n }\n }\n\n /*\n * @public\n */\n encrypt (serialization) {\n const serializer = serializers[serialization]\n if (!serializer) {\n throw new TypeError('serialization must be one of \"compact\", \"flattened\", \"general\"')\n }\n\n if (!this._recipients.length) {\n throw new JWEInvalid('missing recipients')\n }\n\n serializer.validate(this._protected, this._unprotected, this._aad, this._recipients)\n\n let enc = validateHeaders(this._protected, this._unprotected, this._recipients, false, this._protected ? this._protected.crit : undefined)\n if (!enc) {\n enc = 'A128CBC-HS256'\n if (this._protected) {\n this._protected.enc = enc\n } else {\n this._protected = { enc }\n }\n }\n const final = {}\n this._cek = generateCEK(enc)\n\n for (const recipient of this._recipients) {\n this[PROCESS_RECIPIENT](recipient)\n }\n\n const iv = generateIV(enc)\n final.iv = base64url.encodeBuffer(iv)\n\n if (this._recipients.length === 1 && this._recipients[0].generatedHeader) {\n const [{ generatedHeader }] = this._recipients\n delete this._recipients[0].generatedHeader\n this._protected = {\n ...this._protected,\n ...generatedHeader\n }\n }\n\n if (this._protected) {\n final.protected = base64url.JSON.encode(this._protected)\n }\n final.unprotected = this._unprotected\n\n let aad\n if (this._aad) {\n final.aad = base64url.encode(this._aad)\n aad = Buffer.concat([\n Buffer.from(final.protected || ''),\n Buffer.from('.'),\n Buffer.from(final.aad)\n ])\n } else {\n aad = Buffer.from(final.protected || '')\n }\n\n let cleartext = this._cleartext\n if (this._protected && 'zip' in this._protected) {\n cleartext = deflateRawSync(cleartext)\n }\n\n const { ciphertext, tag } = encrypt(enc, this._cek, cleartext, { iv, aad })\n final.tag = base64url.encodeBuffer(tag)\n final.ciphertext = base64url.encodeBuffer(ciphertext)\n\n return serializer(final, this._recipients)\n }\n}\n\nmodule.exports = Encrypt\n","const { randomBytes } = require('crypto')\n\nconst { createSecretKey } = require('../help/key_object')\nconst { KEYLENGTHS } = require('../registry')\nconst Key = require('../jwk/key/oct')\n\nmodule.exports = (alg) => {\n const keyLength = KEYLENGTHS.get(alg)\n\n if (!keyLength) {\n return new Key({ type: 'secret' })\n }\n\n return new Key(createSecretKey(randomBytes(keyLength / 8)), { use: 'enc', alg })\n}\n","const Encrypt = require('./encrypt')\nconst decrypt = require('./decrypt')\n\n// TODO: in v2.x swap unprotectedHeader and aad\nconst single = (serialization, cleartext, key, protectedHeader, unprotectedHeader, aad) => {\n return new Encrypt(cleartext, protectedHeader, unprotectedHeader, aad)\n .recipient(key)\n .encrypt(serialization)\n}\n\nmodule.exports.Encrypt = Encrypt\nmodule.exports.encrypt = single.bind(undefined, 'compact')\nmodule.exports.encrypt.flattened = single.bind(undefined, 'flattened')\nmodule.exports.encrypt.general = single.bind(undefined, 'general')\n\nmodule.exports.decrypt = decrypt\n","const isObject = require('../help/is_object')\nlet validateCrit = require('../help/validate_crit')\n\nconst { JWEInvalid } = require('../errors')\n\nvalidateCrit = validateCrit.bind(undefined, JWEInvalid)\n\nconst compactSerializer = (final, [recipient]) => {\n return `${final.protected}.${recipient.encrypted_key}.${final.iv}.${final.ciphertext}.${final.tag}`\n}\ncompactSerializer.validate = (protectedHeader, unprotectedHeader, aad, { 0: { header }, length }) => {\n if (length !== 1 || aad || unprotectedHeader || header) {\n throw new JWEInvalid('JWE Compact Serialization doesn\\'t support multiple recipients, JWE unprotected headers or AAD')\n }\n validateCrit(protectedHeader, unprotectedHeader, protectedHeader ? protectedHeader.crit : undefined)\n}\n\nconst flattenedSerializer = (final, [recipient]) => {\n const { header, encrypted_key: encryptedKey } = recipient\n\n return {\n ...(final.protected ? { protected: final.protected } : undefined),\n ...(final.unprotected ? { unprotected: final.unprotected } : undefined),\n ...(header ? { header } : undefined),\n ...(encryptedKey ? { encrypted_key: encryptedKey } : undefined),\n ...(final.aad ? { aad: final.aad } : undefined),\n iv: final.iv,\n ciphertext: final.ciphertext,\n tag: final.tag\n }\n}\nflattenedSerializer.validate = (protectedHeader, unprotectedHeader, aad, { 0: { header }, length }) => {\n if (length !== 1) {\n throw new JWEInvalid('Flattened JWE JSON Serialization doesn\\'t support multiple recipients')\n }\n validateCrit(protectedHeader, { ...unprotectedHeader, ...header }, protectedHeader ? protectedHeader.crit : undefined)\n}\n\nconst generalSerializer = (final, recipients) => {\n const result = {\n ...(final.protected ? { protected: final.protected } : undefined),\n ...(final.unprotected ? { unprotected: final.unprotected } : undefined),\n recipients: recipients.map(({ header, encrypted_key: encryptedKey, generatedHeader }) => {\n if (!header && !encryptedKey && !generatedHeader) {\n return false\n }\n\n return {\n ...(header || generatedHeader ? { header: { ...header, ...generatedHeader } } : undefined),\n ...(encryptedKey ? { encrypted_key: encryptedKey } : undefined)\n }\n }).filter(Boolean),\n ...(final.aad ? { aad: final.aad } : undefined),\n iv: final.iv,\n ciphertext: final.ciphertext,\n tag: final.tag\n }\n\n if (!result.recipients.length) {\n delete result.recipients\n }\n\n return result\n}\ngeneralSerializer.validate = (protectedHeader, unprotectedHeader, aad, recipients) => {\n recipients.forEach(({ header }) => {\n validateCrit(protectedHeader, { ...header, ...unprotectedHeader }, protectedHeader ? protectedHeader.crit : undefined)\n })\n}\n\nconst isJSON = (input) => {\n return isObject(input) &&\n typeof input.ciphertext === 'string' &&\n typeof input.iv === 'string' &&\n typeof input.tag === 'string' &&\n (input.unprotected === undefined || isObject(input.unprotected)) &&\n (input.protected === undefined || typeof input.protected === 'string') &&\n (input.aad === undefined || typeof input.aad === 'string')\n}\n\nconst isSingleRecipient = (input) => {\n return (input.encrypted_key === undefined || typeof input.encrypted_key === 'string') &&\n (input.header === undefined || isObject(input.header))\n}\n\nconst isValidRecipient = (recipient) => {\n return isObject(recipient) && typeof recipient.encrypted_key === 'string' && (recipient.header === undefined || isObject(recipient.header))\n}\n\nconst isMultiRecipient = (input) => {\n if (Array.isArray(input.recipients) && input.recipients.every(isValidRecipient)) {\n return true\n }\n\n return false\n}\n\nconst detect = (input) => {\n if (typeof input === 'string' && input.split('.').length === 5) {\n return 'compact'\n }\n\n if (isJSON(input)) {\n if (isMultiRecipient(input)) {\n return 'general'\n }\n\n if (isSingleRecipient(input)) {\n return 'flattened'\n }\n }\n\n throw new JWEInvalid('JWE malformed or invalid serialization')\n}\n\nmodule.exports = {\n compact: compactSerializer,\n flattened: flattenedSerializer,\n general: generalSerializer,\n detect\n}\n","const isDisjoint = require('../help/is_disjoint')\nconst base64url = require('../help/base64url')\nlet validateCrit = require('../help/validate_crit')\nconst { JWEInvalid, JOSENotSupported } = require('../errors')\n\nvalidateCrit = validateCrit.bind(undefined, JWEInvalid)\n\nmodule.exports = (prot, unprotected, recipients, checkAlgorithms, crit) => {\n if (typeof prot === 'string') {\n try {\n prot = base64url.JSON.decode(prot)\n } catch (err) {\n throw new JWEInvalid('could not parse JWE protected header')\n }\n }\n\n let alg = []\n const enc = new Set()\n if (!isDisjoint(prot, unprotected) || !recipients.every(({ header }) => {\n if (typeof header === 'object') {\n alg.push(header.alg)\n enc.add(header.enc)\n }\n const combined = { ...unprotected, ...header }\n validateCrit(prot, combined, crit)\n if ('zip' in combined) {\n throw new JWEInvalid('\"zip\" Header Parameter MUST be integrity protected')\n } else if (prot && 'zip' in prot && prot.zip !== 'DEF') {\n throw new JOSENotSupported('only \"DEF\" compression algorithm is supported')\n }\n return isDisjoint(header, prot) && isDisjoint(header, unprotected)\n })) {\n throw new JWEInvalid('JWE Shared Protected, JWE Shared Unprotected and JWE Per-Recipient Header Parameter names must be disjoint')\n }\n\n if (typeof prot === 'object') {\n alg.push(prot.alg)\n enc.add(prot.enc)\n }\n if (typeof unprotected === 'object') {\n alg.push(unprotected.alg)\n enc.add(unprotected.enc)\n }\n\n alg = alg.filter(Boolean)\n enc.delete(undefined)\n\n if (recipients.length !== 1) {\n if (alg.includes('dir') || alg.includes('ECDH-ES')) {\n throw new JWEInvalid('dir and ECDH-ES alg may only be used with a single recipient')\n }\n }\n\n if (checkAlgorithms) {\n if (alg.length !== recipients.length) {\n throw new JWEInvalid('missing Key Management algorithm')\n }\n if (enc.size === 0) {\n throw new JWEInvalid('missing Content Encryption algorithm')\n } else if (enc.size !== 1) {\n throw new JWEInvalid('there must only be one Content Encryption algorithm')\n }\n } else {\n if (enc.size > 1) {\n throw new JWEInvalid('there must only be one Content Encryption algorithm')\n }\n }\n\n return [...enc][0]\n}\n","const errors = require('../errors')\n\nconst importKey = require('./import')\n\nconst RSAKey = require('./key/rsa')\nconst ECKey = require('./key/ec')\nconst OKPKey = require('./key/okp')\nconst OctKey = require('./key/oct')\n\nconst generate = async (kty, crvOrSize, params, generatePrivate = true) => {\n switch (kty) {\n case 'RSA':\n return importKey(\n await RSAKey.generate(crvOrSize, generatePrivate),\n params\n )\n case 'EC':\n return importKey(\n await ECKey.generate(crvOrSize, generatePrivate),\n params\n )\n case 'OKP':\n return importKey(\n await OKPKey.generate(crvOrSize, generatePrivate),\n params\n )\n case 'oct':\n return importKey(\n await OctKey.generate(crvOrSize, generatePrivate),\n params\n )\n default:\n throw new errors.JOSENotSupported(`unsupported key type: ${kty}`)\n }\n}\n\nconst generateSync = (kty, crvOrSize, params, generatePrivate = true) => {\n switch (kty) {\n case 'RSA':\n return importKey(RSAKey.generateSync(crvOrSize, generatePrivate), params)\n case 'EC':\n return importKey(ECKey.generateSync(crvOrSize, generatePrivate), params)\n case 'OKP':\n return importKey(OKPKey.generateSync(crvOrSize, generatePrivate), params)\n case 'oct':\n return importKey(OctKey.generateSync(crvOrSize, generatePrivate), params)\n default:\n throw new errors.JOSENotSupported(`unsupported key type: ${kty}`)\n }\n}\n\nmodule.exports.generate = generate\nmodule.exports.generateSync = generateSync\n","const { deprecate } = require('util')\n\nconst { createPublicKey, createPrivateKey, createSecretKey, KeyObject } = require('../help/key_object')\nconst base64url = require('../help/base64url')\nconst isObject = require('../help/is_object')\nconst { jwkToPem } = require('../help/key_utils')\nconst errors = require('../errors')\n\nconst RSAKey = require('./key/rsa')\nconst ECKey = require('./key/ec')\nconst OKPKey = require('./key/okp')\nconst OctKey = require('./key/oct')\n\nconst importable = new Set(['string', 'buffer', 'object'])\n\nconst mergedParameters = (target = {}, source = {}) => {\n return {\n alg: source.alg,\n key_ops: source.key_ops,\n kid: source.kid,\n use: source.use,\n x5c: source.x5c,\n x5t: source.x5t,\n 'x5t#S256': source['x5t#S256'],\n ...target\n }\n}\n\nconst openSSHpublicKey = /^[a-zA-Z0-9-]+ AAAA(?:[0-9A-Za-z+/])+(?:==|=)?(?: .*)?$/\n\nconst asKey = (key, parameters, { calculateMissingRSAPrimes = false } = {}) => {\n let privateKey, publicKey, secret\n\n if (!importable.has(typeof key)) {\n throw new TypeError('key argument must be a string, buffer or an object')\n }\n\n if (parameters !== undefined && !isObject(parameters)) {\n throw new TypeError('parameters argument must be a plain object when provided')\n }\n\n if (key instanceof KeyObject) {\n switch (key.type) {\n case 'private':\n privateKey = key\n break\n case 'public':\n publicKey = key\n break\n case 'secret':\n secret = key\n break\n }\n } else if (typeof key === 'object' && key && 'kty' in key && key.kty === 'oct') { // symmetric key \n try {\n secret = createSecretKey(base64url.decodeToBuffer(key.k))\n } catch (err) {\n if (!('k' in key)) {\n secret = { type: 'secret' }\n }\n }\n parameters = mergedParameters(parameters, key)\n } else if (typeof key === 'object' && key && 'kty' in key) { // assume JWK formatted asymmetric key \n ({ calculateMissingRSAPrimes = false } = parameters || { calculateMissingRSAPrimes })\n let pem\n\n try {\n pem = jwkToPem(key, { calculateMissingRSAPrimes })\n } catch (err) {\n if (err instanceof errors.JOSEError) {\n throw err\n }\n }\n\n if (pem && key.d) {\n privateKey = createPrivateKey(pem)\n } else if (pem) {\n publicKey = createPublicKey(pem)\n }\n\n parameters = mergedParameters({}, key)\n } else if (key && (typeof key === 'object' || typeof key === 'string')) { // | | passed to crypto.createPrivateKey or crypto.createPublicKey or passed to crypto.createSecretKey\n try {\n privateKey = createPrivateKey(key)\n } catch (err) {\n if (err instanceof errors.JOSEError) {\n throw err\n }\n }\n\n try {\n publicKey = createPublicKey(key)\n if (key.startsWith('-----BEGIN CERTIFICATE-----') && (!parameters || !('x5c' in parameters))) {\n parameters = mergedParameters(parameters, {\n x5c: [key.replace(/(?:-----(?:BEGIN|END) CERTIFICATE-----|\\s)/g, '')]\n })\n }\n } catch (err) {\n if (err instanceof errors.JOSEError) {\n throw err\n }\n }\n\n try {\n // this is to filter out invalid PEM keys and certs, i'll rather have them fail import then\n // have them imported as symmetric \"oct\" keys\n if (!key.includes('-----BEGIN') && !openSSHpublicKey.test(key.toString('ascii').replace(/[\\r\\n]/g, ''))) {\n secret = createSecretKey(Buffer.isBuffer(key) ? key : Buffer.from(key))\n }\n } catch (err) {}\n }\n\n const keyObject = privateKey || publicKey || secret\n\n if (privateKey || publicKey) {\n switch (keyObject.asymmetricKeyType) {\n case 'rsa':\n return new RSAKey(keyObject, parameters)\n case 'ec':\n return new ECKey(keyObject, parameters)\n case 'ed25519':\n case 'ed448':\n case 'x25519':\n case 'x448':\n return new OKPKey(keyObject, parameters)\n default:\n throw new errors.JOSENotSupported('only RSA, EC and OKP asymmetric keys are supported')\n }\n } else if (secret) {\n return new OctKey(keyObject, parameters)\n }\n\n throw new errors.JWKImportFailed('key import failed')\n}\n\nmodule.exports = asKey\nObject.defineProperty(asKey, 'deprecated', {\n value: deprecate((key, parameters) => { return asKey(key, parameters, { calculateMissingRSAPrimes: true }) }, 'JWK.importKey() is deprecated, use JWK.asKey() instead'),\n enumerable: false\n})\n","const Key = require('./key/base')\nconst None = require('./key/none')\nconst EmbeddedJWK = require('./key/embedded.jwk')\nconst EmbeddedX5C = require('./key/embedded.x5c')\nconst importKey = require('./import')\nconst generate = require('./generate')\n\nmodule.exports = {\n ...generate,\n asKey: importKey,\n isKey: input => input instanceof Key,\n None,\n EmbeddedJWK,\n EmbeddedX5C\n}\n\n/* deprecated */\nObject.defineProperty(module.exports, 'importKey', {\n value: importKey.deprecated,\n enumerable: false\n})\n","const { strict: assert } = require('assert')\nconst { inspect } = require('util')\nconst { EOL } = require('os')\n\nconst { keyObjectSupported } = require('../../help/runtime_support')\nconst { createPublicKey } = require('../../help/key_object')\nconst { keyObjectToJWK } = require('../../help/key_utils')\nconst {\n THUMBPRINT_MATERIAL, PUBLIC_MEMBERS, PRIVATE_MEMBERS, JWK_MEMBERS, KEYOBJECT,\n USES_MAPPING, OPS, USES\n} = require('../../help/consts')\nconst isObject = require('../../help/is_object')\nconst thumbprint = require('../thumbprint')\nconst errors = require('../../errors')\n\nconst privateApi = Symbol('privateApi')\nconst { JWK } = require('../../registry')\n\nclass Key {\n constructor (keyObject, { alg, use, kid, key_ops: ops, x5c, x5t, 'x5t#S256': x5t256 } = {}) {\n if (use !== undefined) {\n if (typeof use !== 'string' || !USES.has(use)) {\n throw new TypeError('`use` must be either \"sig\" or \"enc\" string when provided')\n }\n }\n\n if (alg !== undefined) {\n if (typeof alg !== 'string' || !alg) {\n throw new TypeError('`alg` must be a non-empty string when provided')\n }\n }\n\n if (kid !== undefined) {\n if (typeof kid !== 'string' || !kid) {\n throw new TypeError('`kid` must be a non-empty string when provided')\n }\n }\n\n if (ops !== undefined) {\n if (!Array.isArray(ops) || !ops.length || ops.some(o => typeof o !== 'string')) {\n throw new TypeError('`key_ops` must be a non-empty array of strings when provided')\n }\n ops = Array.from(new Set(ops)).filter(x => OPS.has(x))\n }\n\n if (ops && use) {\n if (\n (use === 'enc' && ops.some(x => USES_MAPPING.sig.has(x))) ||\n (use === 'sig' && ops.some(x => USES_MAPPING.enc.has(x)))\n ) {\n throw new errors.JWKInvalid('inconsistent JWK \"use\" and \"key_ops\"')\n }\n }\n\n if (keyObjectSupported && x5c !== undefined) {\n if (!Array.isArray(x5c) || !x5c.length || x5c.some(c => typeof c !== 'string')) {\n throw new TypeError('`x5c` must be an array of one or more PKIX certificates when provided')\n }\n\n x5c.forEach((cert, i) => {\n let publicKey\n try {\n publicKey = createPublicKey({\n key: `-----BEGIN CERTIFICATE-----${EOL}${(cert.match(/.{1,64}/g) || []).join(EOL)}${EOL}-----END CERTIFICATE-----`, format: 'pem'\n })\n } catch (err) {\n throw new errors.JWKInvalid(`\\`x5c\\` member at index ${i} is not a valid base64-encoded DER PKIX certificate`)\n }\n if (i === 0) {\n try {\n assert.deepEqual(\n publicKey.export({ type: 'spki', format: 'der' }),\n (keyObject.type === 'public' ? keyObject : createPublicKey(keyObject)).export({ type: 'spki', format: 'der' })\n )\n } catch (err) {\n throw new errors.JWKInvalid('The key in the first `x5c` certificate MUST match the public key represented by the JWK')\n }\n }\n })\n }\n\n Object.defineProperties(this, {\n [KEYOBJECT]: { value: isObject(keyObject) ? undefined : keyObject },\n keyObject: {\n get () {\n if (!keyObjectSupported) {\n throw new errors.JOSENotSupported('KeyObject class is not supported in your Node.js runtime version')\n }\n\n return this[KEYOBJECT]\n }\n },\n type: { value: keyObject.type },\n private: { value: keyObject.type === 'private' },\n public: { value: keyObject.type === 'public' },\n secret: { value: keyObject.type === 'secret' },\n alg: { value: alg, enumerable: alg !== undefined },\n use: { value: use, enumerable: use !== undefined },\n x5c: {\n enumerable: x5c !== undefined,\n ...(x5c ? { get () { return [...x5c] } } : { value: undefined })\n },\n key_ops: {\n enumerable: ops !== undefined,\n ...(ops ? { get () { return [...ops] } } : { value: undefined })\n },\n kid: {\n enumerable: true,\n ...(kid ? { value: kid } : {\n get () {\n Object.defineProperty(this, 'kid', { value: this.thumbprint, configurable: false })\n return this.kid\n },\n configurable: true\n })\n },\n ...(x5c ? {\n x5t: {\n enumerable: true,\n ...(x5t ? { value: x5t } : {\n get () {\n Object.defineProperty(this, 'x5t', { value: thumbprint.x5t(this.x5c[0]), configurable: false })\n return this.x5t\n },\n configurable: true\n })\n }\n } : undefined),\n ...(x5c ? {\n 'x5t#S256': {\n enumerable: true,\n ...(x5t256 ? { value: x5t256 } : {\n get () {\n Object.defineProperty(this, 'x5t#S256', { value: thumbprint['x5t#S256'](this.x5c[0]), configurable: false })\n return this['x5t#S256']\n },\n configurable: true\n })\n }\n } : undefined),\n thumbprint: {\n get () {\n Object.defineProperty(this, 'thumbprint', { value: thumbprint.kid(this[THUMBPRINT_MATERIAL]()), configurable: false })\n return this.thumbprint\n },\n configurable: true\n }\n })\n }\n\n toPEM (priv = false, encoding = {}) {\n if (this.secret) {\n throw new TypeError('symmetric keys cannot be exported as PEM')\n }\n\n if (priv && this.public === true) {\n throw new TypeError('public key cannot be exported as private')\n }\n\n const { type = priv ? 'pkcs8' : 'spki', cipher, passphrase } = encoding\n\n let keyObject = this[KEYOBJECT]\n\n if (!priv) {\n if (this.private) {\n keyObject = createPublicKey(keyObject)\n }\n if (cipher || passphrase) {\n throw new TypeError('cipher and passphrase can only be applied when exporting private keys')\n }\n }\n\n if (priv) {\n return keyObject.export({ format: 'pem', type, cipher, passphrase })\n }\n\n return keyObject.export({ format: 'pem', type })\n }\n\n toJWK (priv = false) {\n if (priv && this.public === true) {\n throw new TypeError('public key cannot be exported as private')\n }\n\n const components = [...this.constructor[priv ? PRIVATE_MEMBERS : PUBLIC_MEMBERS]]\n .map(k => [k, this[k]])\n\n const result = {}\n\n Object.keys(components).forEach((key) => {\n const [k, v] = components[key]\n\n result[k] = v\n })\n\n result.kty = this.kty\n result.kid = this.kid\n\n if (this.alg) {\n result.alg = this.alg\n }\n\n if (this.key_ops && this.key_ops.length) {\n result.key_ops = this.key_ops\n }\n\n if (this.use) {\n result.use = this.use\n }\n\n if (this.x5c) {\n result.x5c = this.x5c\n }\n\n if (this.x5t) {\n result.x5t = this.x5t\n }\n\n if (this['x5t#S256']) {\n result['x5t#S256'] = this['x5t#S256']\n }\n\n return result\n }\n\n [JWK_MEMBERS] () {\n const props = this[KEYOBJECT].type === 'private' ? this.constructor[PRIVATE_MEMBERS] : this.constructor[PUBLIC_MEMBERS]\n Object.defineProperties(this, [...props].reduce((acc, component) => {\n acc[component] = {\n get () {\n const jwk = keyObjectToJWK(this[KEYOBJECT])\n Object.defineProperties(\n this,\n Object.entries(jwk)\n .filter(([key]) => props.has(key))\n .reduce((acc, [key, value]) => {\n acc[key] = { value, enumerable: this.constructor[PUBLIC_MEMBERS].has(key), configurable: false }\n return acc\n }, {})\n )\n\n return this[component]\n },\n enumerable: this.constructor[PUBLIC_MEMBERS].has(component),\n configurable: true\n }\n return acc\n }, {}))\n }\n\n /* c8 ignore next 8 */\n [inspect.custom] () {\n return `${this.constructor.name} ${inspect(this.toJWK(false), {\n depth: Infinity,\n colors: process.stdout.isTTY,\n compact: false,\n sorted: true\n })}`\n }\n\n /* c8 ignore next 3 */\n [THUMBPRINT_MATERIAL] () {\n throw new Error(`\"[THUMBPRINT_MATERIAL]()\" is not implemented on ${this.constructor.name}`)\n }\n\n algorithms (operation, /* the rest is private API */ int, opts) {\n const { use = this.use, alg = this.alg, key_ops: ops = this.key_ops } = int === privateApi ? opts : {}\n if (alg) {\n return new Set(this.algorithms(operation, privateApi, { alg: null, use, key_ops: ops }).has(alg) ? [alg] : undefined)\n }\n\n if (typeof operation === 'symbol') {\n try {\n return this[operation]()\n } catch (err) {\n return new Set()\n }\n }\n\n if (operation && ops && !ops.includes(operation)) {\n return new Set()\n }\n\n switch (operation) {\n case 'decrypt':\n case 'deriveKey':\n case 'encrypt':\n case 'sign':\n case 'unwrapKey':\n case 'verify':\n case 'wrapKey':\n return new Set(Object.entries(JWK[this.kty][operation]).map(([alg, fn]) => fn(this) ? alg : undefined).filter(Boolean))\n case undefined:\n return new Set([\n ...this.algorithms('sign'),\n ...this.algorithms('verify'),\n ...this.algorithms('decrypt'),\n ...this.algorithms('encrypt'),\n ...this.algorithms('unwrapKey'),\n ...this.algorithms('wrapKey'),\n ...this.algorithms('deriveKey')\n ])\n default:\n throw new TypeError('invalid key operation')\n }\n }\n\n /* c8 ignore next 3 */\n static async generate () {\n throw new Error(`\"static async generate()\" is not implemented on ${this.name}`)\n }\n\n /* c8 ignore next 3 */\n static generateSync () {\n throw new Error(`\"static generateSync()\" is not implemented on ${this.name}`)\n }\n\n /* c8 ignore next 3 */\n static get [PUBLIC_MEMBERS] () {\n throw new Error(`\"static get [PUBLIC_MEMBERS]()\" is not implemented on ${this.name}`)\n }\n\n /* c8 ignore next 3 */\n static get [PRIVATE_MEMBERS] () {\n throw new Error(`\"static get [PRIVATE_MEMBERS]()\" is not implemented on ${this.name}`)\n }\n}\n\nmodule.exports = Key\n","const { generateKeyPairSync, generateKeyPair: async } = require('crypto')\nconst { promisify } = require('util')\n\nconst {\n THUMBPRINT_MATERIAL, JWK_MEMBERS, PUBLIC_MEMBERS,\n PRIVATE_MEMBERS, KEY_MANAGEMENT_DECRYPT, KEY_MANAGEMENT_ENCRYPT\n} = require('../../help/consts')\nconst { EC_CURVES } = require('../../registry')\nconst { keyObjectSupported } = require('../../help/runtime_support')\nconst { createPublicKey, createPrivateKey } = require('../../help/key_object')\n\nconst errors = require('../../errors')\nconst { name: secp256k1 } = require('./secp256k1_crv')\n\nconst Key = require('./base')\n\nconst generateKeyPair = promisify(async)\n\nconst EC_PUBLIC = new Set(['crv', 'x', 'y'])\nObject.freeze(EC_PUBLIC)\nconst EC_PRIVATE = new Set([...EC_PUBLIC, 'd'])\nObject.freeze(EC_PRIVATE)\n\n// Elliptic Curve Key Type\nclass ECKey extends Key {\n constructor (...args) {\n super(...args)\n this[JWK_MEMBERS]()\n Object.defineProperty(this, 'kty', { value: 'EC', enumerable: true })\n if (!EC_CURVES.has(this.crv)) {\n throw new errors.JOSENotSupported('unsupported EC key curve')\n }\n }\n\n static get [PUBLIC_MEMBERS] () {\n return EC_PUBLIC\n }\n\n static get [PRIVATE_MEMBERS] () {\n return EC_PRIVATE\n }\n\n // https://tc39.github.io/ecma262/#sec-ordinaryownpropertykeys no need for any special\n // JSON.stringify handling in V8\n [THUMBPRINT_MATERIAL] () {\n return { crv: this.crv, kty: 'EC', x: this.x, y: this.y }\n }\n\n [KEY_MANAGEMENT_ENCRYPT] () {\n return this.algorithms('deriveKey')\n }\n\n [KEY_MANAGEMENT_DECRYPT] () {\n if (this.public) {\n return new Set()\n }\n return this.algorithms('deriveKey')\n }\n\n static async generate (crv = 'P-256', privat = true) {\n if (!EC_CURVES.has(crv)) {\n throw new errors.JOSENotSupported(`unsupported EC key curve: ${crv}`)\n }\n\n if (crv === secp256k1 && crv !== 'secp256k1') {\n crv = 'secp256k1'\n }\n\n let privateKey, publicKey\n\n if (keyObjectSupported) {\n ({ privateKey, publicKey } = await generateKeyPair('ec', { namedCurve: crv }))\n return privat ? privateKey : publicKey\n }\n\n ({ privateKey, publicKey } = await generateKeyPair('ec', {\n namedCurve: crv,\n publicKeyEncoding: { type: 'spki', format: 'pem' },\n privateKeyEncoding: { type: 'pkcs8', format: 'pem' }\n }))\n\n if (privat) {\n return createPrivateKey(privateKey)\n } else {\n return createPublicKey(publicKey)\n }\n }\n\n static generateSync (crv = 'P-256', privat = true) {\n if (!EC_CURVES.has(crv)) {\n throw new errors.JOSENotSupported(`unsupported EC key curve: ${crv}`)\n }\n\n if (crv === secp256k1 && crv !== 'secp256k1') {\n crv = 'secp256k1'\n }\n\n let privateKey, publicKey\n\n if (keyObjectSupported) {\n ({ privateKey, publicKey } = generateKeyPairSync('ec', { namedCurve: crv }))\n return privat ? privateKey : publicKey\n }\n\n ({ privateKey, publicKey } = generateKeyPairSync('ec', {\n namedCurve: crv,\n publicKeyEncoding: { type: 'spki', format: 'pem' },\n privateKeyEncoding: { type: 'pkcs8', format: 'pem' }\n }))\n\n if (privat) {\n return createPrivateKey(privateKey)\n } else {\n return createPublicKey(publicKey)\n }\n }\n}\n\nmodule.exports = ECKey\n","const { inspect } = require('util')\n\nconst Key = require('./base')\n\nclass EmbeddedJWK extends Key {\n constructor () {\n super({ type: 'embedded' })\n Object.defineProperties(this, {\n kid: { value: undefined },\n kty: { value: undefined },\n thumbprint: { value: undefined },\n toJWK: { value: undefined },\n toPEM: { value: undefined }\n })\n }\n\n /* c8 ignore next 3 */\n [inspect.custom] () {\n return 'Embedded.JWK {}'\n }\n\n algorithms () {\n return new Set()\n }\n}\n\nmodule.exports = new EmbeddedJWK()\n","const { inspect } = require('util')\n\nconst Key = require('./base')\n\nclass EmbeddedX5C extends Key {\n constructor () {\n super({ type: 'embedded' })\n Object.defineProperties(this, {\n kid: { value: undefined },\n kty: { value: undefined },\n thumbprint: { value: undefined },\n toJWK: { value: undefined },\n toPEM: { value: undefined }\n })\n }\n\n /* c8 ignore next 3 */\n [inspect.custom] () {\n return 'Embedded.X5C {}'\n }\n\n algorithms () {\n return new Set()\n }\n}\n\nmodule.exports = new EmbeddedX5C()\n","const { inspect } = require('util')\n\nconst Key = require('./base')\n\nclass NoneKey extends Key {\n constructor () {\n super({ type: 'unsecured' }, { alg: 'none' })\n Object.defineProperties(this, {\n kid: { value: undefined },\n kty: { value: undefined },\n thumbprint: { value: undefined },\n toJWK: { value: undefined },\n toPEM: { value: undefined }\n })\n }\n\n /* c8 ignore next 3 */\n [inspect.custom] () {\n return 'None {}'\n }\n\n algorithms (operation) {\n switch (operation) {\n case 'sign':\n case 'verify':\n case undefined:\n return new Set(['none'])\n default:\n return new Set()\n }\n }\n}\n\nmodule.exports = new NoneKey()\n","const { randomBytes } = require('crypto')\n\nconst { createSecretKey } = require('../../help/key_object')\nconst base64url = require('../../help/base64url')\nconst {\n THUMBPRINT_MATERIAL, PUBLIC_MEMBERS, PRIVATE_MEMBERS,\n KEY_MANAGEMENT_DECRYPT, KEY_MANAGEMENT_ENCRYPT, KEYOBJECT\n} = require('../../help/consts')\n\nconst Key = require('./base')\n\nconst OCT_PUBLIC = new Set()\nObject.freeze(OCT_PUBLIC)\nconst OCT_PRIVATE = new Set(['k'])\nObject.freeze(OCT_PRIVATE)\n\n// Octet sequence Key Type\nclass OctKey extends Key {\n constructor (...args) {\n super(...args)\n Object.defineProperties(this, {\n kty: {\n value: 'oct',\n enumerable: true\n },\n length: {\n value: this[KEYOBJECT] ? this[KEYOBJECT].symmetricKeySize * 8 : undefined\n },\n k: {\n enumerable: false,\n get () {\n if (this[KEYOBJECT]) {\n Object.defineProperty(this, 'k', {\n value: base64url.encodeBuffer(this[KEYOBJECT].export()),\n configurable: false\n })\n } else {\n Object.defineProperty(this, 'k', {\n value: undefined,\n configurable: false\n })\n }\n\n return this.k\n },\n configurable: true\n }\n })\n }\n\n static get [PUBLIC_MEMBERS] () {\n return OCT_PUBLIC\n }\n\n static get [PRIVATE_MEMBERS] () {\n return OCT_PRIVATE\n }\n\n // https://tc39.github.io/ecma262/#sec-ordinaryownpropertykeys no need for any special\n // JSON.stringify handling in V8\n [THUMBPRINT_MATERIAL] () {\n if (!this[KEYOBJECT]) {\n throw new TypeError('reference \"oct\" keys without \"k\" cannot have their thumbprint calculated')\n }\n return { k: this.k, kty: 'oct' }\n }\n\n [KEY_MANAGEMENT_ENCRYPT] () {\n return new Set([\n ...this.algorithms('wrapKey'),\n ...this.algorithms('deriveKey')\n ])\n }\n\n [KEY_MANAGEMENT_DECRYPT] () {\n return this[KEY_MANAGEMENT_ENCRYPT]()\n }\n\n algorithms (...args) {\n if (!this[KEYOBJECT]) {\n return new Set()\n }\n\n return Key.prototype.algorithms.call(this, ...args)\n }\n\n static async generate (...args) {\n return this.generateSync(...args)\n }\n\n static generateSync (len = 256, privat = true) {\n if (!privat) {\n throw new TypeError('\"oct\" keys cannot be generated as public')\n }\n if (!Number.isSafeInteger(len) || !len || len % 8 !== 0) {\n throw new TypeError('invalid bit length')\n }\n\n return createSecretKey(randomBytes(len / 8))\n }\n}\n\nmodule.exports = OctKey\n","const { generateKeyPairSync, generateKeyPair: async } = require('crypto')\nconst { promisify } = require('util')\n\nconst {\n THUMBPRINT_MATERIAL, JWK_MEMBERS, PUBLIC_MEMBERS,\n PRIVATE_MEMBERS, KEY_MANAGEMENT_DECRYPT, KEY_MANAGEMENT_ENCRYPT\n} = require('../../help/consts')\nconst { OKP_CURVES } = require('../../registry')\nconst { edDSASupported } = require('../../help/runtime_support')\nconst errors = require('../../errors')\n\nconst Key = require('./base')\n\nconst generateKeyPair = promisify(async)\n\nconst OKP_PUBLIC = new Set(['crv', 'x'])\nObject.freeze(OKP_PUBLIC)\nconst OKP_PRIVATE = new Set([...OKP_PUBLIC, 'd'])\nObject.freeze(OKP_PRIVATE)\n\n// Octet string key pairs Key Type\nclass OKPKey extends Key {\n constructor (...args) {\n super(...args)\n this[JWK_MEMBERS]()\n Object.defineProperty(this, 'kty', { value: 'OKP', enumerable: true })\n if (!OKP_CURVES.has(this.crv)) {\n throw new errors.JOSENotSupported('unsupported OKP key curve')\n }\n }\n\n static get [PUBLIC_MEMBERS] () {\n return OKP_PUBLIC\n }\n\n static get [PRIVATE_MEMBERS] () {\n return OKP_PRIVATE\n }\n\n // https://tc39.github.io/ecma262/#sec-ordinaryownpropertykeys no need for any special\n // JSON.stringify handling in V8\n [THUMBPRINT_MATERIAL] () {\n return { crv: this.crv, kty: 'OKP', x: this.x }\n }\n\n [KEY_MANAGEMENT_ENCRYPT] () {\n return this.algorithms('deriveKey')\n }\n\n [KEY_MANAGEMENT_DECRYPT] () {\n if (this.public) {\n return new Set()\n }\n return this.algorithms('deriveKey')\n }\n\n static async generate (crv = 'Ed25519', privat = true) {\n if (!edDSASupported) {\n throw new errors.JOSENotSupported('OKP keys are not supported in your Node.js runtime version')\n }\n\n if (!OKP_CURVES.has(crv)) {\n throw new errors.JOSENotSupported(`unsupported OKP key curve: ${crv}`)\n }\n\n const { privateKey, publicKey } = await generateKeyPair(crv.toLowerCase())\n\n return privat ? privateKey : publicKey\n }\n\n static generateSync (crv = 'Ed25519', privat = true) {\n if (!edDSASupported) {\n throw new errors.JOSENotSupported('OKP keys are not supported in your Node.js runtime version')\n }\n\n if (!OKP_CURVES.has(crv)) {\n throw new errors.JOSENotSupported(`unsupported OKP key curve: ${crv}`)\n }\n\n const { privateKey, publicKey } = generateKeyPairSync(crv.toLowerCase())\n\n return privat ? privateKey : publicKey\n }\n}\n\nmodule.exports = OKPKey\n","const { generateKeyPairSync, generateKeyPair: async } = require('crypto')\nconst { promisify } = require('util')\n\nconst {\n THUMBPRINT_MATERIAL, JWK_MEMBERS, PUBLIC_MEMBERS,\n PRIVATE_MEMBERS, KEY_MANAGEMENT_DECRYPT, KEY_MANAGEMENT_ENCRYPT\n} = require('../../help/consts')\nconst { keyObjectSupported } = require('../../help/runtime_support')\nconst { createPublicKey, createPrivateKey } = require('../../help/key_object')\n\nconst Key = require('./base')\n\nconst generateKeyPair = promisify(async)\n\nconst RSA_PUBLIC = new Set(['e', 'n'])\nObject.freeze(RSA_PUBLIC)\nconst RSA_PRIVATE = new Set([...RSA_PUBLIC, 'd', 'p', 'q', 'dp', 'dq', 'qi'])\nObject.freeze(RSA_PRIVATE)\n\n// RSA Key Type\nclass RSAKey extends Key {\n constructor (...args) {\n super(...args)\n this[JWK_MEMBERS]()\n Object.defineProperties(this, {\n kty: {\n value: 'RSA',\n enumerable: true\n },\n length: {\n get () {\n Object.defineProperty(this, 'length', {\n value: Buffer.byteLength(this.n, 'base64') * 8,\n configurable: false\n })\n\n return this.length\n },\n configurable: true\n }\n })\n }\n\n static get [PUBLIC_MEMBERS] () {\n return RSA_PUBLIC\n }\n\n static get [PRIVATE_MEMBERS] () {\n return RSA_PRIVATE\n }\n\n // https://tc39.github.io/ecma262/#sec-ordinaryownpropertykeys no need for any special\n // JSON.stringify handling in V8\n [THUMBPRINT_MATERIAL] () {\n return { e: this.e, kty: 'RSA', n: this.n }\n }\n\n [KEY_MANAGEMENT_ENCRYPT] () {\n return this.algorithms('wrapKey')\n }\n\n [KEY_MANAGEMENT_DECRYPT] () {\n return this.algorithms('unwrapKey')\n }\n\n static async generate (len = 2048, privat = true) {\n if (!Number.isSafeInteger(len) || len < 512 || len % 8 !== 0 || (('electron' in process.versions) && len % 128 !== 0)) {\n throw new TypeError('invalid bit length')\n }\n\n let privateKey, publicKey\n\n if (keyObjectSupported) {\n ({ privateKey, publicKey } = await generateKeyPair('rsa', { modulusLength: len }))\n return privat ? privateKey : publicKey\n }\n\n ({ privateKey, publicKey } = await generateKeyPair('rsa', {\n modulusLength: len,\n publicKeyEncoding: { type: 'spki', format: 'pem' },\n privateKeyEncoding: { type: 'pkcs8', format: 'pem' }\n }))\n\n if (privat) {\n return createPrivateKey(privateKey)\n } else {\n return createPublicKey(publicKey)\n }\n }\n\n static generateSync (len = 2048, privat = true) {\n if (!Number.isSafeInteger(len) || len < 512 || len % 8 !== 0 || (('electron' in process.versions) && len % 128 !== 0)) {\n throw new TypeError('invalid bit length')\n }\n\n let privateKey, publicKey\n\n if (keyObjectSupported) {\n ({ privateKey, publicKey } = generateKeyPairSync('rsa', { modulusLength: len }))\n return privat ? privateKey : publicKey\n }\n\n ({ privateKey, publicKey } = generateKeyPairSync('rsa', {\n modulusLength: len,\n publicKeyEncoding: { type: 'spki', format: 'pem' },\n privateKeyEncoding: { type: 'pkcs8', format: 'pem' }\n }))\n\n if (privat) {\n return createPrivateKey(privateKey)\n } else {\n return createPublicKey(publicKey)\n }\n }\n}\n\nmodule.exports = RSAKey\n","const { deprecate } = require('util')\n\nconst deprecation = deprecate(() => {}, '\"P-256K\" EC curve name is deprecated')\n\nmodule.exports = {\n name: 'secp256k1',\n rename (value) {\n if (value !== 'secp256k1') {\n deprecation()\n }\n module.exports.name = value\n }\n}\n","const { createHash } = require('crypto')\n\nconst base64url = require('../help/base64url')\n\nconst x5t = (hash, cert) => base64url.encodeBuffer(createHash(hash).update(Buffer.from(cert, 'base64')).digest())\n\nmodule.exports.kid = components => base64url.encodeBuffer(createHash('sha256').update(JSON.stringify(components)).digest())\nmodule.exports.x5t = x5t.bind(undefined, 'sha1')\nmodule.exports['x5t#S256'] = x5t.bind(undefined, 'sha256')\n","const KeyStore = require('./keystore')\n\nmodule.exports = KeyStore\n","const { deprecate, inspect } = require('util')\n\nconst isObject = require('../help/is_object')\nconst { generate, generateSync } = require('../jwk/generate')\nconst { USES_MAPPING } = require('../help/consts')\nconst { isKey, asKey: importKey } = require('../jwk')\n\nconst keyscore = (key, { alg, use, ops }) => {\n let score = 0\n\n if (alg && key.alg) {\n score++\n }\n\n if (use && key.use) {\n score++\n }\n\n if (ops && key.key_ops) {\n score++\n }\n\n return score\n}\n\nclass KeyStore {\n constructor (...keys) {\n while (keys.some(Array.isArray)) {\n keys = keys.flat ? keys.flat() : keys.reduce((acc, val) => {\n if (Array.isArray(val)) {\n return [...acc, ...val]\n }\n\n acc.push(val)\n return acc\n }, [])\n }\n if (keys.some(k => !isKey(k) || !k.kty)) {\n throw new TypeError('all keys must be instances of a key instantiated by JWK.asKey')\n }\n\n this._keys = new Set(keys)\n }\n\n all ({ alg, kid, thumbprint, use, kty, key_ops: ops, x5t, 'x5t#S256': x5t256, crv } = {}) {\n if (ops !== undefined && (!Array.isArray(ops) || !ops.length || ops.some(x => typeof x !== 'string'))) {\n throw new TypeError('`key_ops` must be a non-empty array of strings')\n }\n\n const search = { alg, use, ops }\n return [...this._keys]\n .filter((key) => {\n let candidate = true\n\n if (candidate && kid !== undefined && key.kid !== kid) {\n candidate = false\n }\n\n if (candidate && thumbprint !== undefined && key.thumbprint !== thumbprint) {\n candidate = false\n }\n\n if (candidate && x5t !== undefined && key.x5t !== x5t) {\n candidate = false\n }\n\n if (candidate && x5t256 !== undefined && key['x5t#S256'] !== x5t256) {\n candidate = false\n }\n\n if (candidate && kty !== undefined && key.kty !== kty) {\n candidate = false\n }\n\n if (candidate && crv !== undefined && (key.crv !== crv)) {\n candidate = false\n }\n\n if (alg !== undefined && !key.algorithms().has(alg)) {\n candidate = false\n }\n\n if (candidate && use !== undefined && (key.use !== undefined && key.use !== use)) {\n candidate = false\n }\n\n // TODO:\n if (candidate && ops !== undefined && (key.key_ops !== undefined || key.use !== undefined)) {\n let keyOps\n if (key.key_ops) {\n keyOps = new Set(key.key_ops)\n } else {\n keyOps = USES_MAPPING[key.use]\n }\n if (ops.some(x => !keyOps.has(x))) {\n candidate = false\n }\n }\n\n return candidate\n })\n .sort((first, second) => keyscore(second, search) - keyscore(first, search))\n }\n\n get (...args) {\n return this.all(...args)[0]\n }\n\n add (key) {\n if (!isKey(key) || !key.kty) {\n throw new TypeError('key must be an instance of a key instantiated by JWK.asKey')\n }\n\n this._keys.add(key)\n }\n\n remove (key) {\n if (!isKey(key)) {\n throw new TypeError('key must be an instance of a key instantiated by JWK.asKey')\n }\n\n this._keys.delete(key)\n }\n\n toJWKS (priv = false) {\n return {\n keys: [...this._keys.values()].map(\n key => key.toJWK(priv && (key.private || (key.secret && key.k)))\n )\n }\n }\n\n async generate (...args) {\n this._keys.add(await generate(...args))\n }\n\n generateSync (...args) {\n this._keys.add(generateSync(...args))\n }\n\n get size () {\n return this._keys.size\n }\n\n /* c8 ignore next 8 */\n [inspect.custom] () {\n return `${this.constructor.name} ${inspect(this.toJWKS(false), {\n depth: Infinity,\n colors: process.stdout.isTTY,\n compact: false,\n sorted: true\n })}`\n }\n\n * [Symbol.iterator] () {\n for (const key of this._keys) {\n yield key\n }\n }\n}\n\nfunction asKeyStore (jwks, { ignoreErrors = false, calculateMissingRSAPrimes = false } = {}) {\n if (!isObject(jwks) || !Array.isArray(jwks.keys) || jwks.keys.some(k => !isObject(k) || !('kty' in k))) {\n throw new TypeError('jwks must be a JSON Web Key Set formatted object')\n }\n\n const keys = jwks.keys.map((jwk) => {\n try {\n return importKey(jwk, { calculateMissingRSAPrimes })\n } catch (err) {\n if (!ignoreErrors) {\n throw err\n }\n }\n }).filter(Boolean)\n\n return new KeyStore(...keys)\n}\n\nObject.defineProperty(KeyStore, 'fromJWKS', {\n value: deprecate(jwks => asKeyStore(jwks, { calculateMissingRSAPrimes: true }), 'JWKS.KeyStore.fromJWKS() is deprecated, use JWKS.asKeyStore() instead'),\n enumerable: false\n})\n\nmodule.exports = { KeyStore, asKeyStore }\n","const Sign = require('./sign')\nconst { verify } = require('./verify')\n\nconst single = (serialization, payload, key, protectedHeader, unprotectedHeader) => {\n return new Sign(payload)\n .recipient(key, protectedHeader, unprotectedHeader)\n .sign(serialization)\n}\n\nmodule.exports.Sign = Sign\nmodule.exports.sign = single.bind(undefined, 'compact')\nmodule.exports.sign.flattened = single.bind(undefined, 'flattened')\nmodule.exports.sign.general = single.bind(undefined, 'general')\n\nmodule.exports.verify = verify\n","const isObject = require('../help/is_object')\nlet validateCrit = require('../help/validate_crit')\nconst { JWSInvalid } = require('../errors')\n\nvalidateCrit = validateCrit.bind(undefined, JWSInvalid)\n\nconst compactSerializer = (payload, [recipient]) => {\n return `${recipient.protected}.${payload}.${recipient.signature}`\n}\ncompactSerializer.validate = (jws, { 0: { unprotectedHeader, protectedHeader }, length }) => {\n if (length !== 1 || unprotectedHeader) {\n throw new JWSInvalid('JWS Compact Serialization doesn\\'t support multiple recipients or JWS unprotected headers')\n }\n validateCrit(protectedHeader, unprotectedHeader, protectedHeader ? protectedHeader.crit : undefined)\n}\n\nconst flattenedSerializer = (payload, [recipient]) => {\n const { header, signature, protected: prot } = recipient\n\n return {\n payload,\n ...prot ? { protected: prot } : undefined,\n ...header ? { header } : undefined,\n signature\n }\n}\nflattenedSerializer.validate = (jws, { 0: { unprotectedHeader, protectedHeader }, length }) => {\n if (length !== 1) {\n throw new JWSInvalid('Flattened JWS JSON Serialization doesn\\'t support multiple recipients')\n }\n validateCrit(protectedHeader, unprotectedHeader, protectedHeader ? protectedHeader.crit : undefined)\n}\n\nconst generalSerializer = (payload, recipients) => {\n return {\n payload,\n signatures: recipients.map(({ header, signature, protected: prot }) => {\n return {\n ...prot ? { protected: prot } : undefined,\n ...header ? { header } : undefined,\n signature\n }\n })\n }\n}\ngeneralSerializer.validate = (jws, recipients) => {\n let validateB64 = false\n recipients.forEach(({ protectedHeader, unprotectedHeader }) => {\n if (protectedHeader && !validateB64 && 'b64' in protectedHeader) {\n validateB64 = true\n }\n validateCrit(protectedHeader, unprotectedHeader, protectedHeader ? protectedHeader.crit : undefined)\n })\n\n if (validateB64) {\n const values = recipients.map(({ protectedHeader }) => protectedHeader && protectedHeader.b64)\n if (!values.every((actual, i, [expected]) => actual === expected)) {\n throw new JWSInvalid('the \"b64\" Header Parameter value MUST be the same for all recipients')\n }\n }\n}\n\nconst isJSON = (input) => {\n return isObject(input) && (typeof input.payload === 'string' || Buffer.isBuffer(input.payload))\n}\n\nconst isValidRecipient = (recipient) => {\n return isObject(recipient) && typeof recipient.signature === 'string' &&\n (recipient.header === undefined || isObject(recipient.header)) &&\n (recipient.protected === undefined || typeof recipient.protected === 'string')\n}\n\nconst isMultiRecipient = (input) => {\n if (Array.isArray(input.signatures) && input.signatures.every(isValidRecipient)) {\n return true\n }\n\n return false\n}\n\nconst detect = (input) => {\n if (typeof input === 'string' && input.split('.').length === 3) {\n return 'compact'\n }\n\n if (isJSON(input)) {\n if (isMultiRecipient(input)) {\n return 'general'\n }\n\n if (isValidRecipient(input)) {\n return 'flattened'\n }\n }\n\n throw new JWSInvalid('JWS malformed or invalid serialization')\n}\n\nmodule.exports = {\n compact: compactSerializer,\n flattened: flattenedSerializer,\n general: generalSerializer,\n detect\n}\n","const base64url = require('../help/base64url')\nconst isDisjoint = require('../help/is_disjoint')\nconst isObject = require('../help/is_object')\nconst deepClone = require('../help/deep_clone')\nconst { JWSInvalid } = require('../errors')\nconst { sign } = require('../jwa')\nconst getKey = require('../help/get_key')\n\nconst serializers = require('./serializers')\n\nconst PROCESS_RECIPIENT = Symbol('PROCESS_RECIPIENT')\n\nclass Sign {\n constructor (payload) {\n if (typeof payload === 'string') {\n payload = base64url.encode(payload)\n } else if (Buffer.isBuffer(payload)) {\n payload = base64url.encodeBuffer(payload)\n this._binary = true\n } else if (isObject(payload)) {\n payload = base64url.JSON.encode(payload)\n } else {\n throw new TypeError('payload argument must be a Buffer, string or an object')\n }\n\n this._payload = payload\n this._recipients = []\n }\n\n /*\n * @public\n */\n recipient (key, protectedHeader, unprotectedHeader) {\n key = getKey(key)\n\n if (protectedHeader !== undefined && !isObject(protectedHeader)) {\n throw new TypeError('protectedHeader argument must be a plain object when provided')\n }\n\n if (unprotectedHeader !== undefined && !isObject(unprotectedHeader)) {\n throw new TypeError('unprotectedHeader argument must be a plain object when provided')\n }\n\n if (!isDisjoint(protectedHeader, unprotectedHeader)) {\n throw new JWSInvalid('JWS Protected and JWS Unprotected Header Parameter names must be disjoint')\n }\n\n this._recipients.push({\n key,\n protectedHeader: protectedHeader ? deepClone(protectedHeader) : undefined,\n unprotectedHeader: unprotectedHeader ? deepClone(unprotectedHeader) : undefined\n })\n\n return this\n }\n\n /*\n * @private\n */\n [PROCESS_RECIPIENT] (recipient, first) {\n const { key, protectedHeader, unprotectedHeader } = recipient\n\n if (key.use === 'enc') {\n throw new TypeError('a key with \"use\":\"enc\" is not usable for signing')\n }\n\n const joseHeader = {\n protected: protectedHeader || {},\n unprotected: unprotectedHeader || {}\n }\n\n let alg = joseHeader.protected.alg || joseHeader.unprotected.alg\n\n if (!alg) {\n alg = key.alg || [...key.algorithms('sign')][0]\n if (recipient.protectedHeader) {\n joseHeader.protected.alg = recipient.protectedHeader.alg = alg\n } else {\n joseHeader.protected = recipient.protectedHeader = { alg }\n }\n }\n\n if (!alg) {\n throw new JWSInvalid('could not resolve a usable \"alg\" for a recipient')\n }\n\n recipient.header = unprotectedHeader\n recipient.protected = Object.keys(joseHeader.protected).length ? base64url.JSON.encode(joseHeader.protected) : ''\n\n if (first && joseHeader.protected.crit && joseHeader.protected.crit.includes('b64') && joseHeader.protected.b64 === false) {\n if (this._binary) {\n this._payload = base64url.decodeToBuffer(this._payload)\n } else {\n this._payload = base64url.decode(this._payload)\n }\n }\n\n const data = Buffer.concat([\n Buffer.from(recipient.protected || ''),\n Buffer.from('.'),\n Buffer.from(this._payload)\n ])\n\n recipient.signature = base64url.encodeBuffer(sign(alg, key, data))\n }\n\n /*\n * @public\n */\n sign (serialization) {\n const serializer = serializers[serialization]\n if (!serializer) {\n throw new TypeError('serialization must be one of \"compact\", \"flattened\", \"general\"')\n }\n\n if (!this._recipients.length) {\n throw new JWSInvalid('missing recipients')\n }\n\n serializer.validate(this, this._recipients)\n\n this._recipients.forEach((recipient, i) => {\n this[PROCESS_RECIPIENT](recipient, i === 0)\n })\n\n return serializer(this._payload, this._recipients)\n }\n}\n\nmodule.exports = Sign\n","const { EOL } = require('os')\n\nconst base64url = require('../help/base64url')\nconst isDisjoint = require('../help/is_disjoint')\nconst isObject = require('../help/is_object')\nlet validateCrit = require('../help/validate_crit')\nconst getKey = require('../help/get_key')\nconst { KeyStore } = require('../jwks')\nconst errors = require('../errors')\nconst { check, verify } = require('../jwa')\nconst JWK = require('../jwk')\n\nconst { detect: resolveSerialization } = require('./serializers')\n\nvalidateCrit = validateCrit.bind(undefined, errors.JWSInvalid)\nconst SINGLE_RECIPIENT = new Set(['compact', 'flattened', 'preparsed'])\n\n/*\n * @public\n */\nconst jwsVerify = (skipDisjointCheck, serialization, jws, key, { crit = [], complete = false, algorithms, parse = true, encoding = 'utf8' } = {}) => {\n key = getKey(key, true)\n\n if (algorithms !== undefined && (!Array.isArray(algorithms) || algorithms.some(s => typeof s !== 'string' || !s))) {\n throw new TypeError('\"algorithms\" option must be an array of non-empty strings')\n } else if (algorithms) {\n algorithms = new Set(algorithms)\n }\n\n if (!Array.isArray(crit) || crit.some(s => typeof s !== 'string' || !s)) {\n throw new TypeError('\"crit\" option must be an array of non-empty strings')\n }\n\n if (!serialization) {\n serialization = resolveSerialization(jws)\n }\n\n let prot // protected header\n let header // unprotected header\n let payload\n let signature\n let alg\n\n // treat general format with one recipient as flattened\n // skips iteration and avoids multi errors in this case\n if (serialization === 'general' && jws.signatures.length === 1) {\n serialization = 'flattened'\n const { signatures, ...root } = jws\n jws = { ...root, ...signatures[0] }\n }\n\n let decoded\n\n if (SINGLE_RECIPIENT.has(serialization)) {\n let parsedProt = {}\n\n switch (serialization) {\n case 'compact': // compact serialization format\n ([prot, payload, signature] = jws.split('.'))\n break\n case 'flattened': // flattened serialization format\n ({ protected: prot, payload, signature, header } = jws)\n break\n case 'preparsed': { // from the JWT module\n ({ decoded } = jws);\n ([prot, payload, signature] = jws.token.split('.'))\n break\n }\n }\n\n if (!header) {\n skipDisjointCheck = true\n }\n\n if (decoded) {\n parsedProt = decoded.header\n } else if (prot) {\n try {\n parsedProt = base64url.JSON.decode(prot)\n } catch (err) {\n throw new errors.JWSInvalid('could not parse JWS protected header')\n }\n } else {\n skipDisjointCheck = skipDisjointCheck || true\n }\n\n if (!skipDisjointCheck && !isDisjoint(parsedProt, header)) {\n throw new errors.JWSInvalid('JWS Protected and JWS Unprotected Header Parameter names must be disjoint')\n }\n\n const combinedHeader = { ...parsedProt, ...header }\n validateCrit(parsedProt, header, crit)\n\n alg = parsedProt.alg || (header && header.alg)\n if (!alg) {\n throw new errors.JWSInvalid('missing JWS signature algorithm')\n } else if (algorithms && !algorithms.has(alg)) {\n throw new errors.JOSEAlgNotWhitelisted('alg not whitelisted')\n }\n\n if (key instanceof KeyStore) {\n const keystore = key\n const keys = keystore.all({ kid: combinedHeader.kid, alg: combinedHeader.alg, key_ops: ['verify'] })\n switch (keys.length) {\n case 0:\n throw new errors.JWKSNoMatchingKey()\n case 1:\n // treat the call as if a Key instance was passed in\n // skips iteration and avoids multi errors in this case\n key = keys[0]\n break\n default: {\n const errs = []\n for (const key of keys) {\n try {\n return jwsVerify(true, serialization, jws, key, { crit, complete, encoding, parse, algorithms: algorithms ? [...algorithms] : undefined })\n } catch (err) {\n errs.push(err)\n continue\n }\n }\n\n const multi = new errors.JOSEMultiError(errs)\n if ([...multi].some(e => e instanceof errors.JWSVerificationFailed)) {\n throw new errors.JWSVerificationFailed()\n }\n throw multi\n }\n }\n }\n\n if (key === JWK.EmbeddedJWK) {\n if (!isObject(combinedHeader.jwk)) {\n throw new errors.JWSInvalid('JWS Header Parameter \"jwk\" must be a JSON object')\n }\n key = JWK.asKey(combinedHeader.jwk)\n if (key.type !== 'public') {\n throw new errors.JWSInvalid('JWS Header Parameter \"jwk\" must be a public key')\n }\n } else if (key === JWK.EmbeddedX5C) {\n if (!Array.isArray(combinedHeader.x5c) || !combinedHeader.x5c.length || combinedHeader.x5c.some(c => typeof c !== 'string' || !c)) {\n throw new errors.JWSInvalid('JWS Header Parameter \"x5c\" must be a JSON array of certificate value strings')\n }\n key = JWK.asKey(\n `-----BEGIN CERTIFICATE-----${EOL}${(combinedHeader.x5c[0].match(/.{1,64}/g) || []).join(EOL)}${EOL}-----END CERTIFICATE-----`,\n { x5c: combinedHeader.x5c }\n )\n }\n\n check(key, 'verify', alg)\n\n const toBeVerified = Buffer.concat([\n Buffer.from(prot || ''),\n Buffer.from('.'),\n Buffer.isBuffer(payload) ? payload : Buffer.from(payload)\n ])\n\n if (!verify(alg, key, toBeVerified, base64url.decodeToBuffer(signature))) {\n throw new errors.JWSVerificationFailed()\n }\n\n if (!combinedHeader.crit || !combinedHeader.crit.includes('b64') || combinedHeader.b64) {\n if (parse) {\n payload = decoded ? decoded.payload : base64url.JSON.decode.try(payload, encoding)\n } else {\n payload = base64url.decodeToBuffer(payload)\n }\n }\n\n if (complete) {\n const result = { payload, key }\n if (prot) result.protected = parsedProt\n if (header) result.header = header\n return result\n }\n\n return payload\n }\n\n // general serialization format\n const { signatures, ...root } = jws\n const errs = []\n for (const recipient of signatures) {\n try {\n return jwsVerify(false, 'flattened', { ...root, ...recipient }, key, { crit, complete, encoding, parse, algorithms: algorithms ? [...algorithms] : undefined })\n } catch (err) {\n errs.push(err)\n continue\n }\n }\n\n const multi = new errors.JOSEMultiError(errs)\n if ([...multi].some(e => e instanceof errors.JWSVerificationFailed)) {\n throw new errors.JWSVerificationFailed()\n } else if ([...multi].every(e => e instanceof errors.JWKSNoMatchingKey)) {\n throw new errors.JWKSNoMatchingKey()\n }\n throw multi\n}\n\nmodule.exports = {\n bare: jwsVerify,\n verify: jwsVerify.bind(undefined, false, undefined)\n}\n","const base64url = require('../help/base64url')\nconst errors = require('../errors')\n\nmodule.exports = (token, { complete = false } = {}) => {\n if (typeof token !== 'string' || !token) {\n throw new TypeError('JWT must be a string')\n }\n\n const { 0: header, 1: payload, 2: signature, length } = token.split('.')\n\n if (length === 5) {\n throw new TypeError('JWTs must be decrypted first')\n }\n\n if (length !== 3) {\n throw new errors.JWTMalformed('JWTs must have three components')\n }\n\n try {\n const result = {\n header: base64url.JSON.decode(header),\n payload: base64url.JSON.decode(payload),\n signature\n }\n\n return complete ? result : result.payload\n } catch (err) {\n throw new errors.JWTMalformed('JWT is malformed')\n }\n}\n","const decode = require('./decode')\nconst sign = require('./sign')\nconst verify = require('./verify')\nconst profiles = require('./profiles')\n\nmodule.exports = {\n decode,\n sign,\n verify,\n ...profiles\n}\n","const verify = require('./verify')\n\nmodule.exports = {\n IdToken: { verify: (token, key, options) => verify(token, key, { ...options, profile: 'id_token' }) },\n LogoutToken: { verify: (token, key, options) => verify(token, key, { ...options, profile: 'logout_token' }) },\n AccessToken: { verify: (token, key, options) => verify(token, key, { ...options, profile: 'at+JWT' }) }\n}\n","const isNotString = val => typeof val !== 'string' || val.length === 0\n\nmodule.exports.isNotString = isNotString\nmodule.exports.isString = function isString (Err, value, label, claim, required = false) {\n if (required && value === undefined) {\n throw new Err(`${label} is missing`, claim, 'missing')\n }\n\n if (value !== undefined && isNotString(value)) {\n throw new Err(`${label} must be a string`, claim, 'invalid')\n }\n}\n","const isObject = require('../help/is_object')\nconst secs = require('../help/secs')\nconst epoch = require('../help/epoch')\nconst getKey = require('../help/get_key')\nconst JWS = require('../jws')\n\nconst isString = require('./shared_validations').isString.bind(undefined, TypeError)\n\nconst validateOptions = (options) => {\n if (typeof options.iat !== 'boolean') {\n throw new TypeError('options.iat must be a boolean')\n }\n\n if (typeof options.kid !== 'boolean') {\n throw new TypeError('options.kid must be a boolean')\n }\n\n isString(options.subject, 'options.subject')\n isString(options.issuer, 'options.issuer')\n\n if (\n options.audience !== undefined &&\n (\n (typeof options.audience !== 'string' || !options.audience) &&\n (!Array.isArray(options.audience) || options.audience.length === 0 || options.audience.some(a => !a || typeof a !== 'string'))\n )\n ) {\n throw new TypeError('options.audience must be a string or an array of strings')\n }\n\n if (!isObject(options.header)) {\n throw new TypeError('options.header must be an object')\n }\n\n isString(options.algorithm, 'options.algorithm')\n isString(options.expiresIn, 'options.expiresIn')\n isString(options.notBefore, 'options.notBefore')\n isString(options.jti, 'options.jti')\n isString(options.nonce, 'options.nonce')\n\n if (options.now !== undefined && (!(options.now instanceof Date) || !options.now.getTime())) {\n throw new TypeError('options.now must be a valid Date object')\n }\n}\n\nmodule.exports = (payload, key, options = {}) => {\n if (!isObject(options)) {\n throw new TypeError('options must be an object')\n }\n\n const {\n algorithm, audience, expiresIn, header = {}, iat = true,\n issuer, jti, kid = true, nonce, notBefore, subject, now\n } = options\n\n validateOptions({\n algorithm, audience, expiresIn, header, iat, issuer, jti, kid, nonce, notBefore, now, subject\n })\n\n if (!isObject(payload)) {\n throw new TypeError('payload must be an object')\n }\n\n let unix\n if (expiresIn || notBefore || iat) {\n unix = epoch(now || new Date())\n }\n\n payload = {\n ...payload,\n sub: subject || payload.sub,\n aud: audience || payload.aud,\n iss: issuer || payload.iss,\n jti: jti || payload.jti,\n iat: iat ? unix : payload.iat,\n nonce: nonce || payload.nonce,\n exp: expiresIn ? unix + secs(expiresIn) : payload.exp,\n nbf: notBefore ? unix + secs(notBefore) : payload.nbf\n }\n\n key = getKey(key)\n\n let includeKid\n\n if (typeof options.kid === 'boolean') {\n includeKid = kid\n } else {\n includeKid = !key.secret\n }\n\n return JWS.sign(JSON.stringify(payload), key, {\n ...header,\n alg: algorithm || header.alg,\n kid: includeKid ? key.kid : header.kid\n })\n}\n","const isObject = require('../help/is_object')\nconst epoch = require('../help/epoch')\nconst secs = require('../help/secs')\nconst getKey = require('../help/get_key')\nconst { bare: verify } = require('../jws/verify')\nconst { JWTClaimInvalid, JWTExpired } = require('../errors')\n\nconst { isString, isNotString } = require('./shared_validations')\nconst decode = require('./decode')\n\nconst isPayloadString = isString.bind(undefined, JWTClaimInvalid)\nconst isOptionString = isString.bind(undefined, TypeError)\n\nconst IDTOKEN = 'id_token'\nconst LOGOUTTOKEN = 'logout_token'\nconst ATJWT = 'at+JWT'\n\nconst isTimestamp = (value, label, required = false) => {\n if (required && value === undefined) {\n throw new JWTClaimInvalid(`\"${label}\" claim is missing`, label, 'missing')\n }\n\n if (value !== undefined && (typeof value !== 'number')) {\n throw new JWTClaimInvalid(`\"${label}\" claim must be a JSON numeric value`, label, 'invalid')\n }\n}\n\nconst isStringOrArrayOfStrings = (value, label, required = false) => {\n if (required && value === undefined) {\n throw new JWTClaimInvalid(`\"${label}\" claim is missing`, label, 'missing')\n }\n\n if (value !== undefined && (isNotString(value) && isNotArrayOfStrings(value))) {\n throw new JWTClaimInvalid(`\"${label}\" claim must be a string or array of strings`, label, 'invalid')\n }\n}\n\nconst isNotArrayOfStrings = val => !Array.isArray(val) || val.length === 0 || val.some(isNotString)\nconst normalizeTyp = (value) => value.toLowerCase().replace(/^application\\//, '')\n\nconst validateOptions = ({\n algorithms, audience, clockTolerance, complete = false, crit, ignoreExp = false,\n ignoreIat = false, ignoreNbf = false, issuer, jti, maxAuthAge, maxTokenAge, nonce, now = new Date(),\n profile, subject, typ\n}) => {\n isOptionString(profile, 'options.profile')\n\n if (typeof complete !== 'boolean') {\n throw new TypeError('options.complete must be a boolean')\n }\n\n if (typeof ignoreExp !== 'boolean') {\n throw new TypeError('options.ignoreExp must be a boolean')\n }\n\n if (typeof ignoreNbf !== 'boolean') {\n throw new TypeError('options.ignoreNbf must be a boolean')\n }\n\n if (typeof ignoreIat !== 'boolean') {\n throw new TypeError('options.ignoreIat must be a boolean')\n }\n\n isOptionString(maxTokenAge, 'options.maxTokenAge')\n isOptionString(subject, 'options.subject')\n isOptionString(maxAuthAge, 'options.maxAuthAge')\n isOptionString(jti, 'options.jti')\n isOptionString(clockTolerance, 'options.clockTolerance')\n isOptionString(typ, 'options.typ')\n\n if (issuer !== undefined && (isNotString(issuer) && isNotArrayOfStrings(issuer))) {\n throw new TypeError('options.issuer must be a string or an array of strings')\n }\n\n if (audience !== undefined && (isNotString(audience) && isNotArrayOfStrings(audience))) {\n throw new TypeError('options.audience must be a string or an array of strings')\n }\n\n if (algorithms !== undefined && isNotArrayOfStrings(algorithms)) {\n throw new TypeError('options.algorithms must be an array of strings')\n }\n\n isOptionString(nonce, 'options.nonce')\n\n if (!(now instanceof Date) || !now.getTime()) {\n throw new TypeError('options.now must be a valid Date object')\n }\n\n if (ignoreIat && maxTokenAge !== undefined) {\n throw new TypeError('options.ignoreIat and options.maxTokenAge cannot used together')\n }\n\n if (crit !== undefined && isNotArrayOfStrings(crit)) {\n throw new TypeError('options.crit must be an array of strings')\n }\n\n switch (profile) {\n case IDTOKEN:\n if (!issuer) {\n throw new TypeError('\"issuer\" option is required to validate an ID Token')\n }\n\n if (!audience) {\n throw new TypeError('\"audience\" option is required to validate an ID Token')\n }\n\n break\n case ATJWT:\n if (!issuer) {\n throw new TypeError('\"issuer\" option is required to validate a JWT Access Token')\n }\n\n if (!audience) {\n throw new TypeError('\"audience\" option is required to validate a JWT Access Token')\n }\n\n typ = ATJWT\n\n break\n case LOGOUTTOKEN:\n if (!issuer) {\n throw new TypeError('\"issuer\" option is required to validate a Logout Token')\n }\n\n if (!audience) {\n throw new TypeError('\"audience\" option is required to validate a Logout Token')\n }\n\n break\n case undefined:\n break\n default:\n throw new TypeError(`unsupported options.profile value \"${profile}\"`)\n }\n\n return {\n algorithms,\n audience,\n clockTolerance,\n complete,\n crit,\n ignoreExp,\n ignoreIat,\n ignoreNbf,\n issuer,\n jti,\n maxAuthAge,\n maxTokenAge,\n nonce,\n now,\n profile,\n subject,\n typ\n }\n}\n\nconst validateTypes = ({ header, payload }, profile, options) => {\n isPayloadString(header.alg, '\"alg\" header parameter', 'alg', true)\n\n isTimestamp(payload.iat, 'iat', profile === IDTOKEN || profile === LOGOUTTOKEN || profile === ATJWT || !!options.maxTokenAge)\n isTimestamp(payload.exp, 'exp', profile === IDTOKEN || profile === ATJWT)\n isTimestamp(payload.auth_time, 'auth_time', !!options.maxAuthAge)\n isTimestamp(payload.nbf, 'nbf')\n isPayloadString(payload.jti, '\"jti\" claim', 'jti', profile === LOGOUTTOKEN || profile === ATJWT || !!options.jti)\n isPayloadString(payload.acr, '\"acr\" claim', 'acr')\n isPayloadString(payload.nonce, '\"nonce\" claim', 'nonce', !!options.nonce)\n isStringOrArrayOfStrings(payload.iss, 'iss', !!options.issuer)\n isPayloadString(payload.sub, '\"sub\" claim', 'sub', profile === IDTOKEN || profile === ATJWT || !!options.subject)\n isStringOrArrayOfStrings(payload.aud, 'aud', !!options.audience)\n isPayloadString(payload.azp, '\"azp\" claim', 'azp', profile === IDTOKEN && Array.isArray(payload.aud) && payload.aud.length > 1)\n isStringOrArrayOfStrings(payload.amr, 'amr')\n isPayloadString(header.typ, '\"typ\" header parameter', 'typ', !!options.typ)\n\n if (profile === ATJWT) {\n isPayloadString(payload.client_id, '\"client_id\" claim', 'client_id', true)\n }\n\n if (profile === LOGOUTTOKEN) {\n isPayloadString(payload.sid, '\"sid\" claim', 'sid')\n\n if (!('sid' in payload) && !('sub' in payload)) {\n throw new JWTClaimInvalid('either \"sid\" or \"sub\" (or both) claims must be present')\n }\n\n if ('nonce' in payload) {\n throw new JWTClaimInvalid('\"nonce\" claim is prohibited', 'nonce', 'prohibited')\n }\n\n if (!('events' in payload)) {\n throw new JWTClaimInvalid('\"events\" claim is missing', 'events', 'missing')\n }\n\n if (!isObject(payload.events)) {\n throw new JWTClaimInvalid('\"events\" claim must be an object', 'events', 'invalid')\n }\n\n if (!('http://schemas.openid.net/event/backchannel-logout' in payload.events)) {\n throw new JWTClaimInvalid('\"http://schemas.openid.net/event/backchannel-logout\" member is missing in the \"events\" claim', 'events', 'invalid')\n }\n\n if (!isObject(payload.events['http://schemas.openid.net/event/backchannel-logout'])) {\n throw new JWTClaimInvalid('\"http://schemas.openid.net/event/backchannel-logout\" member in the \"events\" claim must be an object', 'events', 'invalid')\n }\n }\n}\n\nconst checkAudiencePresence = (audPayload, audOption, profile) => {\n if (typeof audPayload === 'string') {\n return audOption.includes(audPayload)\n }\n\n // Each principal intended to process the JWT MUST\n // identify itself with a value in the audience claim\n audPayload = new Set(audPayload)\n return audOption.some(Set.prototype.has.bind(audPayload))\n}\n\nmodule.exports = (token, key, options = {}) => {\n if (!isObject(options)) {\n throw new TypeError('options must be an object')\n }\n\n const {\n algorithms, audience, clockTolerance, complete, crit, ignoreExp, ignoreIat, ignoreNbf, issuer,\n jti, maxAuthAge, maxTokenAge, nonce, now, profile, subject, typ\n } = options = validateOptions(options)\n\n const decoded = decode(token, { complete: true })\n key = getKey(key, true)\n\n if (complete) {\n ({ key } = verify(true, 'preparsed', { decoded, token }, key, { crit, algorithms, complete: true }))\n decoded.key = key\n } else {\n verify(true, 'preparsed', { decoded, token }, key, { crit, algorithms })\n }\n\n const unix = epoch(now)\n validateTypes(decoded, profile, options)\n\n if (issuer && (typeof decoded.payload.iss !== 'string' || !(typeof issuer === 'string' ? [issuer] : issuer).includes(decoded.payload.iss))) {\n throw new JWTClaimInvalid('unexpected \"iss\" claim value', 'iss', 'check_failed')\n }\n\n if (nonce && decoded.payload.nonce !== nonce) {\n throw new JWTClaimInvalid('unexpected \"nonce\" claim value', 'nonce', 'check_failed')\n }\n\n if (subject && decoded.payload.sub !== subject) {\n throw new JWTClaimInvalid('unexpected \"sub\" claim value', 'sub', 'check_failed')\n }\n\n if (jti && decoded.payload.jti !== jti) {\n throw new JWTClaimInvalid('unexpected \"jti\" claim value', 'jti', 'check_failed')\n }\n\n if (audience && !checkAudiencePresence(decoded.payload.aud, typeof audience === 'string' ? [audience] : audience, profile)) {\n throw new JWTClaimInvalid('unexpected \"aud\" claim value', 'aud', 'check_failed')\n }\n\n if (typ && normalizeTyp(decoded.header.typ) !== normalizeTyp(typ)) {\n throw new JWTClaimInvalid('unexpected \"typ\" JWT header value', 'typ', 'check_failed')\n }\n\n const tolerance = clockTolerance ? secs(clockTolerance) : 0\n\n if (maxAuthAge) {\n const maxAuthAgeSeconds = secs(maxAuthAge)\n if (decoded.payload.auth_time + maxAuthAgeSeconds < unix - tolerance) {\n throw new JWTClaimInvalid('\"auth_time\" claim timestamp check failed (too much time has elapsed since the last End-User authentication)', 'auth_time', 'check_failed')\n }\n }\n\n if (!ignoreIat && !('exp' in decoded.payload) && 'iat' in decoded.payload && decoded.payload.iat > unix + tolerance) {\n throw new JWTClaimInvalid('\"iat\" claim timestamp check failed (it should be in the past)', 'iat', 'check_failed')\n }\n\n if (!ignoreNbf && 'nbf' in decoded.payload && decoded.payload.nbf > unix + tolerance) {\n throw new JWTClaimInvalid('\"nbf\" claim timestamp check failed', 'nbf', 'check_failed')\n }\n\n if (!ignoreExp && 'exp' in decoded.payload && decoded.payload.exp <= unix - tolerance) {\n throw new JWTExpired('\"exp\" claim timestamp check failed', 'exp', 'check_failed')\n }\n\n if (maxTokenAge) {\n const age = unix - decoded.payload.iat\n const max = secs(maxTokenAge)\n\n if (age - tolerance > max) {\n throw new JWTExpired('\"iat\" claim timestamp check failed (too far in the past)', 'iat', 'check_failed')\n }\n\n if (age < 0 - tolerance) {\n throw new JWTClaimInvalid('\"iat\" claim timestamp check failed (it should be in the past)', 'iat', 'check_failed')\n }\n }\n\n if (profile === IDTOKEN && Array.isArray(decoded.payload.aud) && decoded.payload.aud.length > 1 && decoded.payload.azp !== audience) {\n throw new JWTClaimInvalid('unexpected \"azp\" claim value', 'azp', 'check_failed')\n }\n\n return complete ? decoded : decoded.payload\n}\n","const { getCurves } = require('crypto')\n\nconst { name: secp256k1 } = require('../jwk/key/secp256k1_crv')\n\nconst curves = new Set()\n\nif (getCurves().includes('prime256v1')) {\n curves.add('P-256')\n}\n\nif (getCurves().includes('secp256k1')) {\n curves.add(secp256k1)\n}\n\nif (getCurves().includes('secp384r1')) {\n curves.add('P-384')\n}\n\nif (getCurves().includes('secp521r1')) {\n curves.add('P-521')\n}\n\nmodule.exports = curves\n","module.exports = new Map()\n","const EC_CURVES = require('./ec_curves')\nconst IVLENGTHS = require('./iv_lengths')\nconst JWA = require('./jwa')\nconst JWK = require('./jwk')\nconst KEYLENGTHS = require('./key_lengths')\nconst OKP_CURVES = require('./okp_curves')\nconst ECDH_DERIVE_LENGTHS = require('./ecdh_derive_lengths')\n\nmodule.exports = {\n EC_CURVES,\n ECDH_DERIVE_LENGTHS,\n IVLENGTHS,\n JWA,\n JWK,\n KEYLENGTHS,\n OKP_CURVES\n}\n","module.exports = new Map([\n ['A128CBC-HS256', 128],\n ['A128GCM', 96],\n ['A128GCMKW', 96],\n ['A192CBC-HS384', 128],\n ['A192GCM', 96],\n ['A192GCMKW', 96],\n ['A256CBC-HS512', 128],\n ['A256GCM', 96],\n ['A256GCMKW', 96]\n])\n","module.exports = {\n sign: new Map(),\n verify: new Map(),\n keyManagementEncrypt: new Map(),\n keyManagementDecrypt: new Map(),\n encrypt: new Map(),\n decrypt: new Map()\n}\n","module.exports = {\n oct: {\n decrypt: {},\n deriveKey: {},\n encrypt: {},\n sign: {},\n unwrapKey: {},\n verify: {},\n wrapKey: {}\n },\n EC: {\n decrypt: {},\n deriveKey: {},\n encrypt: {},\n sign: {},\n unwrapKey: {},\n verify: {},\n wrapKey: {}\n },\n RSA: {\n decrypt: {},\n deriveKey: {},\n encrypt: {},\n sign: {},\n unwrapKey: {},\n verify: {},\n wrapKey: {}\n },\n OKP: {\n decrypt: {},\n deriveKey: {},\n encrypt: {},\n sign: {},\n unwrapKey: {},\n verify: {},\n wrapKey: {}\n }\n}\n","module.exports = new Map([\n ['A128CBC-HS256', 256],\n ['A128GCM', 128],\n ['A192CBC-HS384', 384],\n ['A192GCM', 192],\n ['A256CBC-HS512', 512],\n ['A256GCM', 256]\n])\n","const curves = new Set(['Ed25519'])\n\nif (!('electron' in process.versions)) {\n curves.add('Ed448')\n curves.add('X25519')\n curves.add('X448')\n}\n\nmodule.exports = curves\n","'use strict';\n\n\nvar yaml = require('./lib/js-yaml.js');\n\n\nmodule.exports = yaml;\n","'use strict';\n\n\nvar loader = require('./js-yaml/loader');\nvar dumper = require('./js-yaml/dumper');\n\n\nfunction deprecated(name) {\n return function () {\n throw new Error('Function ' + name + ' is deprecated and cannot be used.');\n };\n}\n\n\nmodule.exports.Type = require('./js-yaml/type');\nmodule.exports.Schema = require('./js-yaml/schema');\nmodule.exports.FAILSAFE_SCHEMA = require('./js-yaml/schema/failsafe');\nmodule.exports.JSON_SCHEMA = require('./js-yaml/schema/json');\nmodule.exports.CORE_SCHEMA = require('./js-yaml/schema/core');\nmodule.exports.DEFAULT_SAFE_SCHEMA = require('./js-yaml/schema/default_safe');\nmodule.exports.DEFAULT_FULL_SCHEMA = require('./js-yaml/schema/default_full');\nmodule.exports.load = loader.load;\nmodule.exports.loadAll = loader.loadAll;\nmodule.exports.safeLoad = loader.safeLoad;\nmodule.exports.safeLoadAll = loader.safeLoadAll;\nmodule.exports.dump = dumper.dump;\nmodule.exports.safeDump = dumper.safeDump;\nmodule.exports.YAMLException = require('./js-yaml/exception');\n\n// Deprecated schema names from JS-YAML 2.0.x\nmodule.exports.MINIMAL_SCHEMA = require('./js-yaml/schema/failsafe');\nmodule.exports.SAFE_SCHEMA = require('./js-yaml/schema/default_safe');\nmodule.exports.DEFAULT_SCHEMA = require('./js-yaml/schema/default_full');\n\n// Deprecated functions from JS-YAML 1.x.x\nmodule.exports.scan = deprecated('scan');\nmodule.exports.parse = deprecated('parse');\nmodule.exports.compose = deprecated('compose');\nmodule.exports.addConstructor = deprecated('addConstructor');\n","'use strict';\n\n\nfunction isNothing(subject) {\n return (typeof subject === 'undefined') || (subject === null);\n}\n\n\nfunction isObject(subject) {\n return (typeof subject === 'object') && (subject !== null);\n}\n\n\nfunction toArray(sequence) {\n if (Array.isArray(sequence)) return sequence;\n else if (isNothing(sequence)) return [];\n\n return [ sequence ];\n}\n\n\nfunction extend(target, source) {\n var index, length, key, sourceKeys;\n\n if (source) {\n sourceKeys = Object.keys(source);\n\n for (index = 0, length = sourceKeys.length; index < length; index += 1) {\n key = sourceKeys[index];\n target[key] = source[key];\n }\n }\n\n return target;\n}\n\n\nfunction repeat(string, count) {\n var result = '', cycle;\n\n for (cycle = 0; cycle < count; cycle += 1) {\n result += string;\n }\n\n return result;\n}\n\n\nfunction isNegativeZero(number) {\n return (number === 0) && (Number.NEGATIVE_INFINITY === 1 / number);\n}\n\n\nmodule.exports.isNothing = isNothing;\nmodule.exports.isObject = isObject;\nmodule.exports.toArray = toArray;\nmodule.exports.repeat = repeat;\nmodule.exports.isNegativeZero = isNegativeZero;\nmodule.exports.extend = extend;\n","'use strict';\n\n/*eslint-disable no-use-before-define*/\n\nvar common = require('./common');\nvar YAMLException = require('./exception');\nvar DEFAULT_FULL_SCHEMA = require('./schema/default_full');\nvar DEFAULT_SAFE_SCHEMA = require('./schema/default_safe');\n\nvar _toString = Object.prototype.toString;\nvar _hasOwnProperty = Object.prototype.hasOwnProperty;\n\nvar CHAR_TAB = 0x09; /* Tab */\nvar CHAR_LINE_FEED = 0x0A; /* LF */\nvar CHAR_CARRIAGE_RETURN = 0x0D; /* CR */\nvar CHAR_SPACE = 0x20; /* Space */\nvar CHAR_EXCLAMATION = 0x21; /* ! */\nvar CHAR_DOUBLE_QUOTE = 0x22; /* \" */\nvar CHAR_SHARP = 0x23; /* # */\nvar CHAR_PERCENT = 0x25; /* % */\nvar CHAR_AMPERSAND = 0x26; /* & */\nvar CHAR_SINGLE_QUOTE = 0x27; /* ' */\nvar CHAR_ASTERISK = 0x2A; /* * */\nvar CHAR_COMMA = 0x2C; /* , */\nvar CHAR_MINUS = 0x2D; /* - */\nvar CHAR_COLON = 0x3A; /* : */\nvar CHAR_EQUALS = 0x3D; /* = */\nvar CHAR_GREATER_THAN = 0x3E; /* > */\nvar CHAR_QUESTION = 0x3F; /* ? */\nvar CHAR_COMMERCIAL_AT = 0x40; /* @ */\nvar CHAR_LEFT_SQUARE_BRACKET = 0x5B; /* [ */\nvar CHAR_RIGHT_SQUARE_BRACKET = 0x5D; /* ] */\nvar CHAR_GRAVE_ACCENT = 0x60; /* ` */\nvar CHAR_LEFT_CURLY_BRACKET = 0x7B; /* { */\nvar CHAR_VERTICAL_LINE = 0x7C; /* | */\nvar CHAR_RIGHT_CURLY_BRACKET = 0x7D; /* } */\n\nvar ESCAPE_SEQUENCES = {};\n\nESCAPE_SEQUENCES[0x00] = '\\\\0';\nESCAPE_SEQUENCES[0x07] = '\\\\a';\nESCAPE_SEQUENCES[0x08] = '\\\\b';\nESCAPE_SEQUENCES[0x09] = '\\\\t';\nESCAPE_SEQUENCES[0x0A] = '\\\\n';\nESCAPE_SEQUENCES[0x0B] = '\\\\v';\nESCAPE_SEQUENCES[0x0C] = '\\\\f';\nESCAPE_SEQUENCES[0x0D] = '\\\\r';\nESCAPE_SEQUENCES[0x1B] = '\\\\e';\nESCAPE_SEQUENCES[0x22] = '\\\\\"';\nESCAPE_SEQUENCES[0x5C] = '\\\\\\\\';\nESCAPE_SEQUENCES[0x85] = '\\\\N';\nESCAPE_SEQUENCES[0xA0] = '\\\\_';\nESCAPE_SEQUENCES[0x2028] = '\\\\L';\nESCAPE_SEQUENCES[0x2029] = '\\\\P';\n\nvar DEPRECATED_BOOLEANS_SYNTAX = [\n 'y', 'Y', 'yes', 'Yes', 'YES', 'on', 'On', 'ON',\n 'n', 'N', 'no', 'No', 'NO', 'off', 'Off', 'OFF'\n];\n\nfunction compileStyleMap(schema, map) {\n var result, keys, index, length, tag, style, type;\n\n if (map === null) return {};\n\n result = {};\n keys = Object.keys(map);\n\n for (index = 0, length = keys.length; index < length; index += 1) {\n tag = keys[index];\n style = String(map[tag]);\n\n if (tag.slice(0, 2) === '!!') {\n tag = 'tag:yaml.org,2002:' + tag.slice(2);\n }\n type = schema.compiledTypeMap['fallback'][tag];\n\n if (type && _hasOwnProperty.call(type.styleAliases, style)) {\n style = type.styleAliases[style];\n }\n\n result[tag] = style;\n }\n\n return result;\n}\n\nfunction encodeHex(character) {\n var string, handle, length;\n\n string = character.toString(16).toUpperCase();\n\n if (character <= 0xFF) {\n handle = 'x';\n length = 2;\n } else if (character <= 0xFFFF) {\n handle = 'u';\n length = 4;\n } else if (character <= 0xFFFFFFFF) {\n handle = 'U';\n length = 8;\n } else {\n throw new YAMLException('code point within a string may not be greater than 0xFFFFFFFF');\n }\n\n return '\\\\' + handle + common.repeat('0', length - string.length) + string;\n}\n\nfunction State(options) {\n this.schema = options['schema'] || DEFAULT_FULL_SCHEMA;\n this.indent = Math.max(1, (options['indent'] || 2));\n this.noArrayIndent = options['noArrayIndent'] || false;\n this.skipInvalid = options['skipInvalid'] || false;\n this.flowLevel = (common.isNothing(options['flowLevel']) ? -1 : options['flowLevel']);\n this.styleMap = compileStyleMap(this.schema, options['styles'] || null);\n this.sortKeys = options['sortKeys'] || false;\n this.lineWidth = options['lineWidth'] || 80;\n this.noRefs = options['noRefs'] || false;\n this.noCompatMode = options['noCompatMode'] || false;\n this.condenseFlow = options['condenseFlow'] || false;\n\n this.implicitTypes = this.schema.compiledImplicit;\n this.explicitTypes = this.schema.compiledExplicit;\n\n this.tag = null;\n this.result = '';\n\n this.duplicates = [];\n this.usedDuplicates = null;\n}\n\n// Indents every line in a string. Empty lines (\\n only) are not indented.\nfunction indentString(string, spaces) {\n var ind = common.repeat(' ', spaces),\n position = 0,\n next = -1,\n result = '',\n line,\n length = string.length;\n\n while (position < length) {\n next = string.indexOf('\\n', position);\n if (next === -1) {\n line = string.slice(position);\n position = length;\n } else {\n line = string.slice(position, next + 1);\n position = next + 1;\n }\n\n if (line.length && line !== '\\n') result += ind;\n\n result += line;\n }\n\n return result;\n}\n\nfunction generateNextLine(state, level) {\n return '\\n' + common.repeat(' ', state.indent * level);\n}\n\nfunction testImplicitResolving(state, str) {\n var index, length, type;\n\n for (index = 0, length = state.implicitTypes.length; index < length; index += 1) {\n type = state.implicitTypes[index];\n\n if (type.resolve(str)) {\n return true;\n }\n }\n\n return false;\n}\n\n// [33] s-white ::= s-space | s-tab\nfunction isWhitespace(c) {\n return c === CHAR_SPACE || c === CHAR_TAB;\n}\n\n// Returns true if the character can be printed without escaping.\n// From YAML 1.2: \"any allowed characters known to be non-printable\n// should also be escaped. [However,] This isn’t mandatory\"\n// Derived from nb-char - \\t - #x85 - #xA0 - #x2028 - #x2029.\nfunction isPrintable(c) {\n return (0x00020 <= c && c <= 0x00007E)\n || ((0x000A1 <= c && c <= 0x00D7FF) && c !== 0x2028 && c !== 0x2029)\n || ((0x0E000 <= c && c <= 0x00FFFD) && c !== 0xFEFF /* BOM */)\n || (0x10000 <= c && c <= 0x10FFFF);\n}\n\n// [34] ns-char ::= nb-char - s-white\n// [27] nb-char ::= c-printable - b-char - c-byte-order-mark\n// [26] b-char ::= b-line-feed | b-carriage-return\n// [24] b-line-feed ::= #xA /* LF */\n// [25] b-carriage-return ::= #xD /* CR */\n// [3] c-byte-order-mark ::= #xFEFF\nfunction isNsChar(c) {\n return isPrintable(c) && !isWhitespace(c)\n // byte-order-mark\n && c !== 0xFEFF\n // b-char\n && c !== CHAR_CARRIAGE_RETURN\n && c !== CHAR_LINE_FEED;\n}\n\n// Simplified test for values allowed after the first character in plain style.\nfunction isPlainSafe(c, prev) {\n // Uses a subset of nb-char - c-flow-indicator - \":\" - \"#\"\n // where nb-char ::= c-printable - b-char - c-byte-order-mark.\n return isPrintable(c) && c !== 0xFEFF\n // - c-flow-indicator\n && c !== CHAR_COMMA\n && c !== CHAR_LEFT_SQUARE_BRACKET\n && c !== CHAR_RIGHT_SQUARE_BRACKET\n && c !== CHAR_LEFT_CURLY_BRACKET\n && c !== CHAR_RIGHT_CURLY_BRACKET\n // - \":\" - \"#\"\n // /* An ns-char preceding */ \"#\"\n && c !== CHAR_COLON\n && ((c !== CHAR_SHARP) || (prev && isNsChar(prev)));\n}\n\n// Simplified test for values allowed as the first character in plain style.\nfunction isPlainSafeFirst(c) {\n // Uses a subset of ns-char - c-indicator\n // where ns-char = nb-char - s-white.\n return isPrintable(c) && c !== 0xFEFF\n && !isWhitespace(c) // - s-white\n // - (c-indicator ::=\n // “-” | “?” | “:” | “,” | “[” | “]” | “{” | “}”\n && c !== CHAR_MINUS\n && c !== CHAR_QUESTION\n && c !== CHAR_COLON\n && c !== CHAR_COMMA\n && c !== CHAR_LEFT_SQUARE_BRACKET\n && c !== CHAR_RIGHT_SQUARE_BRACKET\n && c !== CHAR_LEFT_CURLY_BRACKET\n && c !== CHAR_RIGHT_CURLY_BRACKET\n // | “#” | “&” | “*” | “!” | “|” | “=” | “>” | “'” | “\"”\n && c !== CHAR_SHARP\n && c !== CHAR_AMPERSAND\n && c !== CHAR_ASTERISK\n && c !== CHAR_EXCLAMATION\n && c !== CHAR_VERTICAL_LINE\n && c !== CHAR_EQUALS\n && c !== CHAR_GREATER_THAN\n && c !== CHAR_SINGLE_QUOTE\n && c !== CHAR_DOUBLE_QUOTE\n // | “%” | “@” | “`”)\n && c !== CHAR_PERCENT\n && c !== CHAR_COMMERCIAL_AT\n && c !== CHAR_GRAVE_ACCENT;\n}\n\n// Determines whether block indentation indicator is required.\nfunction needIndentIndicator(string) {\n var leadingSpaceRe = /^\\n* /;\n return leadingSpaceRe.test(string);\n}\n\nvar STYLE_PLAIN = 1,\n STYLE_SINGLE = 2,\n STYLE_LITERAL = 3,\n STYLE_FOLDED = 4,\n STYLE_DOUBLE = 5;\n\n// Determines which scalar styles are possible and returns the preferred style.\n// lineWidth = -1 => no limit.\n// Pre-conditions: str.length > 0.\n// Post-conditions:\n// STYLE_PLAIN or STYLE_SINGLE => no \\n are in the string.\n// STYLE_LITERAL => no lines are suitable for folding (or lineWidth is -1).\n// STYLE_FOLDED => a line > lineWidth and can be folded (and lineWidth != -1).\nfunction chooseScalarStyle(string, singleLineOnly, indentPerLevel, lineWidth, testAmbiguousType) {\n var i;\n var char, prev_char;\n var hasLineBreak = false;\n var hasFoldableLine = false; // only checked if shouldTrackWidth\n var shouldTrackWidth = lineWidth !== -1;\n var previousLineBreak = -1; // count the first line correctly\n var plain = isPlainSafeFirst(string.charCodeAt(0))\n && !isWhitespace(string.charCodeAt(string.length - 1));\n\n if (singleLineOnly) {\n // Case: no block styles.\n // Check for disallowed characters to rule out plain and single.\n for (i = 0; i < string.length; i++) {\n char = string.charCodeAt(i);\n if (!isPrintable(char)) {\n return STYLE_DOUBLE;\n }\n prev_char = i > 0 ? string.charCodeAt(i - 1) : null;\n plain = plain && isPlainSafe(char, prev_char);\n }\n } else {\n // Case: block styles permitted.\n for (i = 0; i < string.length; i++) {\n char = string.charCodeAt(i);\n if (char === CHAR_LINE_FEED) {\n hasLineBreak = true;\n // Check if any line can be folded.\n if (shouldTrackWidth) {\n hasFoldableLine = hasFoldableLine ||\n // Foldable line = too long, and not more-indented.\n (i - previousLineBreak - 1 > lineWidth &&\n string[previousLineBreak + 1] !== ' ');\n previousLineBreak = i;\n }\n } else if (!isPrintable(char)) {\n return STYLE_DOUBLE;\n }\n prev_char = i > 0 ? string.charCodeAt(i - 1) : null;\n plain = plain && isPlainSafe(char, prev_char);\n }\n // in case the end is missing a \\n\n hasFoldableLine = hasFoldableLine || (shouldTrackWidth &&\n (i - previousLineBreak - 1 > lineWidth &&\n string[previousLineBreak + 1] !== ' '));\n }\n // Although every style can represent \\n without escaping, prefer block styles\n // for multiline, since they're more readable and they don't add empty lines.\n // Also prefer folding a super-long line.\n if (!hasLineBreak && !hasFoldableLine) {\n // Strings interpretable as another type have to be quoted;\n // e.g. the string 'true' vs. the boolean true.\n return plain && !testAmbiguousType(string)\n ? STYLE_PLAIN : STYLE_SINGLE;\n }\n // Edge case: block indentation indicator can only have one digit.\n if (indentPerLevel > 9 && needIndentIndicator(string)) {\n return STYLE_DOUBLE;\n }\n // At this point we know block styles are valid.\n // Prefer literal style unless we want to fold.\n return hasFoldableLine ? STYLE_FOLDED : STYLE_LITERAL;\n}\n\n// Note: line breaking/folding is implemented for only the folded style.\n// NB. We drop the last trailing newline (if any) of a returned block scalar\n// since the dumper adds its own newline. This always works:\n// • No ending newline => unaffected; already using strip \"-\" chomping.\n// • Ending newline => removed then restored.\n// Importantly, this keeps the \"+\" chomp indicator from gaining an extra line.\nfunction writeScalar(state, string, level, iskey) {\n state.dump = (function () {\n if (string.length === 0) {\n return \"''\";\n }\n if (!state.noCompatMode &&\n DEPRECATED_BOOLEANS_SYNTAX.indexOf(string) !== -1) {\n return \"'\" + string + \"'\";\n }\n\n var indent = state.indent * Math.max(1, level); // no 0-indent scalars\n // As indentation gets deeper, let the width decrease monotonically\n // to the lower bound min(state.lineWidth, 40).\n // Note that this implies\n // state.lineWidth ≤ 40 + state.indent: width is fixed at the lower bound.\n // state.lineWidth > 40 + state.indent: width decreases until the lower bound.\n // This behaves better than a constant minimum width which disallows narrower options,\n // or an indent threshold which causes the width to suddenly increase.\n var lineWidth = state.lineWidth === -1\n ? -1 : Math.max(Math.min(state.lineWidth, 40), state.lineWidth - indent);\n\n // Without knowing if keys are implicit/explicit, assume implicit for safety.\n var singleLineOnly = iskey\n // No block styles in flow mode.\n || (state.flowLevel > -1 && level >= state.flowLevel);\n function testAmbiguity(string) {\n return testImplicitResolving(state, string);\n }\n\n switch (chooseScalarStyle(string, singleLineOnly, state.indent, lineWidth, testAmbiguity)) {\n case STYLE_PLAIN:\n return string;\n case STYLE_SINGLE:\n return \"'\" + string.replace(/'/g, \"''\") + \"'\";\n case STYLE_LITERAL:\n return '|' + blockHeader(string, state.indent)\n + dropEndingNewline(indentString(string, indent));\n case STYLE_FOLDED:\n return '>' + blockHeader(string, state.indent)\n + dropEndingNewline(indentString(foldString(string, lineWidth), indent));\n case STYLE_DOUBLE:\n return '\"' + escapeString(string, lineWidth) + '\"';\n default:\n throw new YAMLException('impossible error: invalid scalar style');\n }\n }());\n}\n\n// Pre-conditions: string is valid for a block scalar, 1 <= indentPerLevel <= 9.\nfunction blockHeader(string, indentPerLevel) {\n var indentIndicator = needIndentIndicator(string) ? String(indentPerLevel) : '';\n\n // note the special case: the string '\\n' counts as a \"trailing\" empty line.\n var clip = string[string.length - 1] === '\\n';\n var keep = clip && (string[string.length - 2] === '\\n' || string === '\\n');\n var chomp = keep ? '+' : (clip ? '' : '-');\n\n return indentIndicator + chomp + '\\n';\n}\n\n// (See the note for writeScalar.)\nfunction dropEndingNewline(string) {\n return string[string.length - 1] === '\\n' ? string.slice(0, -1) : string;\n}\n\n// Note: a long line without a suitable break point will exceed the width limit.\n// Pre-conditions: every char in str isPrintable, str.length > 0, width > 0.\nfunction foldString(string, width) {\n // In folded style, $k$ consecutive newlines output as $k+1$ newlines—\n // unless they're before or after a more-indented line, or at the very\n // beginning or end, in which case $k$ maps to $k$.\n // Therefore, parse each chunk as newline(s) followed by a content line.\n var lineRe = /(\\n+)([^\\n]*)/g;\n\n // first line (possibly an empty line)\n var result = (function () {\n var nextLF = string.indexOf('\\n');\n nextLF = nextLF !== -1 ? nextLF : string.length;\n lineRe.lastIndex = nextLF;\n return foldLine(string.slice(0, nextLF), width);\n }());\n // If we haven't reached the first content line yet, don't add an extra \\n.\n var prevMoreIndented = string[0] === '\\n' || string[0] === ' ';\n var moreIndented;\n\n // rest of the lines\n var match;\n while ((match = lineRe.exec(string))) {\n var prefix = match[1], line = match[2];\n moreIndented = (line[0] === ' ');\n result += prefix\n + (!prevMoreIndented && !moreIndented && line !== ''\n ? '\\n' : '')\n + foldLine(line, width);\n prevMoreIndented = moreIndented;\n }\n\n return result;\n}\n\n// Greedy line breaking.\n// Picks the longest line under the limit each time,\n// otherwise settles for the shortest line over the limit.\n// NB. More-indented lines *cannot* be folded, as that would add an extra \\n.\nfunction foldLine(line, width) {\n if (line === '' || line[0] === ' ') return line;\n\n // Since a more-indented line adds a \\n, breaks can't be followed by a space.\n var breakRe = / [^ ]/g; // note: the match index will always be <= length-2.\n var match;\n // start is an inclusive index. end, curr, and next are exclusive.\n var start = 0, end, curr = 0, next = 0;\n var result = '';\n\n // Invariants: 0 <= start <= length-1.\n // 0 <= curr <= next <= max(0, length-2). curr - start <= width.\n // Inside the loop:\n // A match implies length >= 2, so curr and next are <= length-2.\n while ((match = breakRe.exec(line))) {\n next = match.index;\n // maintain invariant: curr - start <= width\n if (next - start > width) {\n end = (curr > start) ? curr : next; // derive end <= length-2\n result += '\\n' + line.slice(start, end);\n // skip the space that was output as \\n\n start = end + 1; // derive start <= length-1\n }\n curr = next;\n }\n\n // By the invariants, start <= length-1, so there is something left over.\n // It is either the whole string or a part starting from non-whitespace.\n result += '\\n';\n // Insert a break if the remainder is too long and there is a break available.\n if (line.length - start > width && curr > start) {\n result += line.slice(start, curr) + '\\n' + line.slice(curr + 1);\n } else {\n result += line.slice(start);\n }\n\n return result.slice(1); // drop extra \\n joiner\n}\n\n// Escapes a double-quoted string.\nfunction escapeString(string) {\n var result = '';\n var char, nextChar;\n var escapeSeq;\n\n for (var i = 0; i < string.length; i++) {\n char = string.charCodeAt(i);\n // Check for surrogate pairs (reference Unicode 3.0 section \"3.7 Surrogates\").\n if (char >= 0xD800 && char <= 0xDBFF/* high surrogate */) {\n nextChar = string.charCodeAt(i + 1);\n if (nextChar >= 0xDC00 && nextChar <= 0xDFFF/* low surrogate */) {\n // Combine the surrogate pair and store it escaped.\n result += encodeHex((char - 0xD800) * 0x400 + nextChar - 0xDC00 + 0x10000);\n // Advance index one extra since we already used that char here.\n i++; continue;\n }\n }\n escapeSeq = ESCAPE_SEQUENCES[char];\n result += !escapeSeq && isPrintable(char)\n ? string[i]\n : escapeSeq || encodeHex(char);\n }\n\n return result;\n}\n\nfunction writeFlowSequence(state, level, object) {\n var _result = '',\n _tag = state.tag,\n index,\n length;\n\n for (index = 0, length = object.length; index < length; index += 1) {\n // Write only valid elements.\n if (writeNode(state, level, object[index], false, false)) {\n if (index !== 0) _result += ',' + (!state.condenseFlow ? ' ' : '');\n _result += state.dump;\n }\n }\n\n state.tag = _tag;\n state.dump = '[' + _result + ']';\n}\n\nfunction writeBlockSequence(state, level, object, compact) {\n var _result = '',\n _tag = state.tag,\n index,\n length;\n\n for (index = 0, length = object.length; index < length; index += 1) {\n // Write only valid elements.\n if (writeNode(state, level + 1, object[index], true, true)) {\n if (!compact || index !== 0) {\n _result += generateNextLine(state, level);\n }\n\n if (state.dump && CHAR_LINE_FEED === state.dump.charCodeAt(0)) {\n _result += '-';\n } else {\n _result += '- ';\n }\n\n _result += state.dump;\n }\n }\n\n state.tag = _tag;\n state.dump = _result || '[]'; // Empty sequence if no valid values.\n}\n\nfunction writeFlowMapping(state, level, object) {\n var _result = '',\n _tag = state.tag,\n objectKeyList = Object.keys(object),\n index,\n length,\n objectKey,\n objectValue,\n pairBuffer;\n\n for (index = 0, length = objectKeyList.length; index < length; index += 1) {\n\n pairBuffer = '';\n if (index !== 0) pairBuffer += ', ';\n\n if (state.condenseFlow) pairBuffer += '\"';\n\n objectKey = objectKeyList[index];\n objectValue = object[objectKey];\n\n if (!writeNode(state, level, objectKey, false, false)) {\n continue; // Skip this pair because of invalid key;\n }\n\n if (state.dump.length > 1024) pairBuffer += '? ';\n\n pairBuffer += state.dump + (state.condenseFlow ? '\"' : '') + ':' + (state.condenseFlow ? '' : ' ');\n\n if (!writeNode(state, level, objectValue, false, false)) {\n continue; // Skip this pair because of invalid value.\n }\n\n pairBuffer += state.dump;\n\n // Both key and value are valid.\n _result += pairBuffer;\n }\n\n state.tag = _tag;\n state.dump = '{' + _result + '}';\n}\n\nfunction writeBlockMapping(state, level, object, compact) {\n var _result = '',\n _tag = state.tag,\n objectKeyList = Object.keys(object),\n index,\n length,\n objectKey,\n objectValue,\n explicitPair,\n pairBuffer;\n\n // Allow sorting keys so that the output file is deterministic\n if (state.sortKeys === true) {\n // Default sorting\n objectKeyList.sort();\n } else if (typeof state.sortKeys === 'function') {\n // Custom sort function\n objectKeyList.sort(state.sortKeys);\n } else if (state.sortKeys) {\n // Something is wrong\n throw new YAMLException('sortKeys must be a boolean or a function');\n }\n\n for (index = 0, length = objectKeyList.length; index < length; index += 1) {\n pairBuffer = '';\n\n if (!compact || index !== 0) {\n pairBuffer += generateNextLine(state, level);\n }\n\n objectKey = objectKeyList[index];\n objectValue = object[objectKey];\n\n if (!writeNode(state, level + 1, objectKey, true, true, true)) {\n continue; // Skip this pair because of invalid key.\n }\n\n explicitPair = (state.tag !== null && state.tag !== '?') ||\n (state.dump && state.dump.length > 1024);\n\n if (explicitPair) {\n if (state.dump && CHAR_LINE_FEED === state.dump.charCodeAt(0)) {\n pairBuffer += '?';\n } else {\n pairBuffer += '? ';\n }\n }\n\n pairBuffer += state.dump;\n\n if (explicitPair) {\n pairBuffer += generateNextLine(state, level);\n }\n\n if (!writeNode(state, level + 1, objectValue, true, explicitPair)) {\n continue; // Skip this pair because of invalid value.\n }\n\n if (state.dump && CHAR_LINE_FEED === state.dump.charCodeAt(0)) {\n pairBuffer += ':';\n } else {\n pairBuffer += ': ';\n }\n\n pairBuffer += state.dump;\n\n // Both key and value are valid.\n _result += pairBuffer;\n }\n\n state.tag = _tag;\n state.dump = _result || '{}'; // Empty mapping if no valid pairs.\n}\n\nfunction detectType(state, object, explicit) {\n var _result, typeList, index, length, type, style;\n\n typeList = explicit ? state.explicitTypes : state.implicitTypes;\n\n for (index = 0, length = typeList.length; index < length; index += 1) {\n type = typeList[index];\n\n if ((type.instanceOf || type.predicate) &&\n (!type.instanceOf || ((typeof object === 'object') && (object instanceof type.instanceOf))) &&\n (!type.predicate || type.predicate(object))) {\n\n state.tag = explicit ? type.tag : '?';\n\n if (type.represent) {\n style = state.styleMap[type.tag] || type.defaultStyle;\n\n if (_toString.call(type.represent) === '[object Function]') {\n _result = type.represent(object, style);\n } else if (_hasOwnProperty.call(type.represent, style)) {\n _result = type.represent[style](object, style);\n } else {\n throw new YAMLException('!<' + type.tag + '> tag resolver accepts not \"' + style + '\" style');\n }\n\n state.dump = _result;\n }\n\n return true;\n }\n }\n\n return false;\n}\n\n// Serializes `object` and writes it to global `result`.\n// Returns true on success, or false on invalid object.\n//\nfunction writeNode(state, level, object, block, compact, iskey) {\n state.tag = null;\n state.dump = object;\n\n if (!detectType(state, object, false)) {\n detectType(state, object, true);\n }\n\n var type = _toString.call(state.dump);\n\n if (block) {\n block = (state.flowLevel < 0 || state.flowLevel > level);\n }\n\n var objectOrArray = type === '[object Object]' || type === '[object Array]',\n duplicateIndex,\n duplicate;\n\n if (objectOrArray) {\n duplicateIndex = state.duplicates.indexOf(object);\n duplicate = duplicateIndex !== -1;\n }\n\n if ((state.tag !== null && state.tag !== '?') || duplicate || (state.indent !== 2 && level > 0)) {\n compact = false;\n }\n\n if (duplicate && state.usedDuplicates[duplicateIndex]) {\n state.dump = '*ref_' + duplicateIndex;\n } else {\n if (objectOrArray && duplicate && !state.usedDuplicates[duplicateIndex]) {\n state.usedDuplicates[duplicateIndex] = true;\n }\n if (type === '[object Object]') {\n if (block && (Object.keys(state.dump).length !== 0)) {\n writeBlockMapping(state, level, state.dump, compact);\n if (duplicate) {\n state.dump = '&ref_' + duplicateIndex + state.dump;\n }\n } else {\n writeFlowMapping(state, level, state.dump);\n if (duplicate) {\n state.dump = '&ref_' + duplicateIndex + ' ' + state.dump;\n }\n }\n } else if (type === '[object Array]') {\n var arrayLevel = (state.noArrayIndent && (level > 0)) ? level - 1 : level;\n if (block && (state.dump.length !== 0)) {\n writeBlockSequence(state, arrayLevel, state.dump, compact);\n if (duplicate) {\n state.dump = '&ref_' + duplicateIndex + state.dump;\n }\n } else {\n writeFlowSequence(state, arrayLevel, state.dump);\n if (duplicate) {\n state.dump = '&ref_' + duplicateIndex + ' ' + state.dump;\n }\n }\n } else if (type === '[object String]') {\n if (state.tag !== '?') {\n writeScalar(state, state.dump, level, iskey);\n }\n } else {\n if (state.skipInvalid) return false;\n throw new YAMLException('unacceptable kind of an object to dump ' + type);\n }\n\n if (state.tag !== null && state.tag !== '?') {\n state.dump = '!<' + state.tag + '> ' + state.dump;\n }\n }\n\n return true;\n}\n\nfunction getDuplicateReferences(object, state) {\n var objects = [],\n duplicatesIndexes = [],\n index,\n length;\n\n inspectNode(object, objects, duplicatesIndexes);\n\n for (index = 0, length = duplicatesIndexes.length; index < length; index += 1) {\n state.duplicates.push(objects[duplicatesIndexes[index]]);\n }\n state.usedDuplicates = new Array(length);\n}\n\nfunction inspectNode(object, objects, duplicatesIndexes) {\n var objectKeyList,\n index,\n length;\n\n if (object !== null && typeof object === 'object') {\n index = objects.indexOf(object);\n if (index !== -1) {\n if (duplicatesIndexes.indexOf(index) === -1) {\n duplicatesIndexes.push(index);\n }\n } else {\n objects.push(object);\n\n if (Array.isArray(object)) {\n for (index = 0, length = object.length; index < length; index += 1) {\n inspectNode(object[index], objects, duplicatesIndexes);\n }\n } else {\n objectKeyList = Object.keys(object);\n\n for (index = 0, length = objectKeyList.length; index < length; index += 1) {\n inspectNode(object[objectKeyList[index]], objects, duplicatesIndexes);\n }\n }\n }\n }\n}\n\nfunction dump(input, options) {\n options = options || {};\n\n var state = new State(options);\n\n if (!state.noRefs) getDuplicateReferences(input, state);\n\n if (writeNode(state, 0, input, true, true)) return state.dump + '\\n';\n\n return '';\n}\n\nfunction safeDump(input, options) {\n return dump(input, common.extend({ schema: DEFAULT_SAFE_SCHEMA }, options));\n}\n\nmodule.exports.dump = dump;\nmodule.exports.safeDump = safeDump;\n","// YAML error class. http://stackoverflow.com/questions/8458984\n//\n'use strict';\n\nfunction YAMLException(reason, mark) {\n // Super constructor\n Error.call(this);\n\n this.name = 'YAMLException';\n this.reason = reason;\n this.mark = mark;\n this.message = (this.reason || '(unknown reason)') + (this.mark ? ' ' + this.mark.toString() : '');\n\n // Include stack trace in error object\n if (Error.captureStackTrace) {\n // Chrome and NodeJS\n Error.captureStackTrace(this, this.constructor);\n } else {\n // FF, IE 10+ and Safari 6+. Fallback for others\n this.stack = (new Error()).stack || '';\n }\n}\n\n\n// Inherit from Error\nYAMLException.prototype = Object.create(Error.prototype);\nYAMLException.prototype.constructor = YAMLException;\n\n\nYAMLException.prototype.toString = function toString(compact) {\n var result = this.name + ': ';\n\n result += this.reason || '(unknown reason)';\n\n if (!compact && this.mark) {\n result += ' ' + this.mark.toString();\n }\n\n return result;\n};\n\n\nmodule.exports = YAMLException;\n","'use strict';\n\n/*eslint-disable max-len,no-use-before-define*/\n\nvar common = require('./common');\nvar YAMLException = require('./exception');\nvar Mark = require('./mark');\nvar DEFAULT_SAFE_SCHEMA = require('./schema/default_safe');\nvar DEFAULT_FULL_SCHEMA = require('./schema/default_full');\n\n\nvar _hasOwnProperty = Object.prototype.hasOwnProperty;\n\n\nvar CONTEXT_FLOW_IN = 1;\nvar CONTEXT_FLOW_OUT = 2;\nvar CONTEXT_BLOCK_IN = 3;\nvar CONTEXT_BLOCK_OUT = 4;\n\n\nvar CHOMPING_CLIP = 1;\nvar CHOMPING_STRIP = 2;\nvar CHOMPING_KEEP = 3;\n\n\nvar PATTERN_NON_PRINTABLE = /[\\x00-\\x08\\x0B\\x0C\\x0E-\\x1F\\x7F-\\x84\\x86-\\x9F\\uFFFE\\uFFFF]|[\\uD800-\\uDBFF](?![\\uDC00-\\uDFFF])|(?:[^\\uD800-\\uDBFF]|^)[\\uDC00-\\uDFFF]/;\nvar PATTERN_NON_ASCII_LINE_BREAKS = /[\\x85\\u2028\\u2029]/;\nvar PATTERN_FLOW_INDICATORS = /[,\\[\\]\\{\\}]/;\nvar PATTERN_TAG_HANDLE = /^(?:!|!!|![a-z\\-]+!)$/i;\nvar PATTERN_TAG_URI = /^(?:!|[^,\\[\\]\\{\\}])(?:%[0-9a-f]{2}|[0-9a-z\\-#;\\/\\?:@&=\\+\\$,_\\.!~\\*'\\(\\)\\[\\]])*$/i;\n\n\nfunction _class(obj) { return Object.prototype.toString.call(obj); }\n\nfunction is_EOL(c) {\n return (c === 0x0A/* LF */) || (c === 0x0D/* CR */);\n}\n\nfunction is_WHITE_SPACE(c) {\n return (c === 0x09/* Tab */) || (c === 0x20/* Space */);\n}\n\nfunction is_WS_OR_EOL(c) {\n return (c === 0x09/* Tab */) ||\n (c === 0x20/* Space */) ||\n (c === 0x0A/* LF */) ||\n (c === 0x0D/* CR */);\n}\n\nfunction is_FLOW_INDICATOR(c) {\n return c === 0x2C/* , */ ||\n c === 0x5B/* [ */ ||\n c === 0x5D/* ] */ ||\n c === 0x7B/* { */ ||\n c === 0x7D/* } */;\n}\n\nfunction fromHexCode(c) {\n var lc;\n\n if ((0x30/* 0 */ <= c) && (c <= 0x39/* 9 */)) {\n return c - 0x30;\n }\n\n /*eslint-disable no-bitwise*/\n lc = c | 0x20;\n\n if ((0x61/* a */ <= lc) && (lc <= 0x66/* f */)) {\n return lc - 0x61 + 10;\n }\n\n return -1;\n}\n\nfunction escapedHexLen(c) {\n if (c === 0x78/* x */) { return 2; }\n if (c === 0x75/* u */) { return 4; }\n if (c === 0x55/* U */) { return 8; }\n return 0;\n}\n\nfunction fromDecimalCode(c) {\n if ((0x30/* 0 */ <= c) && (c <= 0x39/* 9 */)) {\n return c - 0x30;\n }\n\n return -1;\n}\n\nfunction simpleEscapeSequence(c) {\n /* eslint-disable indent */\n return (c === 0x30/* 0 */) ? '\\x00' :\n (c === 0x61/* a */) ? '\\x07' :\n (c === 0x62/* b */) ? '\\x08' :\n (c === 0x74/* t */) ? '\\x09' :\n (c === 0x09/* Tab */) ? '\\x09' :\n (c === 0x6E/* n */) ? '\\x0A' :\n (c === 0x76/* v */) ? '\\x0B' :\n (c === 0x66/* f */) ? '\\x0C' :\n (c === 0x72/* r */) ? '\\x0D' :\n (c === 0x65/* e */) ? '\\x1B' :\n (c === 0x20/* Space */) ? ' ' :\n (c === 0x22/* \" */) ? '\\x22' :\n (c === 0x2F/* / */) ? '/' :\n (c === 0x5C/* \\ */) ? '\\x5C' :\n (c === 0x4E/* N */) ? '\\x85' :\n (c === 0x5F/* _ */) ? '\\xA0' :\n (c === 0x4C/* L */) ? '\\u2028' :\n (c === 0x50/* P */) ? '\\u2029' : '';\n}\n\nfunction charFromCodepoint(c) {\n if (c <= 0xFFFF) {\n return String.fromCharCode(c);\n }\n // Encode UTF-16 surrogate pair\n // https://en.wikipedia.org/wiki/UTF-16#Code_points_U.2B010000_to_U.2B10FFFF\n return String.fromCharCode(\n ((c - 0x010000) >> 10) + 0xD800,\n ((c - 0x010000) & 0x03FF) + 0xDC00\n );\n}\n\nvar simpleEscapeCheck = new Array(256); // integer, for fast access\nvar simpleEscapeMap = new Array(256);\nfor (var i = 0; i < 256; i++) {\n simpleEscapeCheck[i] = simpleEscapeSequence(i) ? 1 : 0;\n simpleEscapeMap[i] = simpleEscapeSequence(i);\n}\n\n\nfunction State(input, options) {\n this.input = input;\n\n this.filename = options['filename'] || null;\n this.schema = options['schema'] || DEFAULT_FULL_SCHEMA;\n this.onWarning = options['onWarning'] || null;\n this.legacy = options['legacy'] || false;\n this.json = options['json'] || false;\n this.listener = options['listener'] || null;\n\n this.implicitTypes = this.schema.compiledImplicit;\n this.typeMap = this.schema.compiledTypeMap;\n\n this.length = input.length;\n this.position = 0;\n this.line = 0;\n this.lineStart = 0;\n this.lineIndent = 0;\n\n this.documents = [];\n\n /*\n this.version;\n this.checkLineBreaks;\n this.tagMap;\n this.anchorMap;\n this.tag;\n this.anchor;\n this.kind;\n this.result;*/\n\n}\n\n\nfunction generateError(state, message) {\n return new YAMLException(\n message,\n new Mark(state.filename, state.input, state.position, state.line, (state.position - state.lineStart)));\n}\n\nfunction throwError(state, message) {\n throw generateError(state, message);\n}\n\nfunction throwWarning(state, message) {\n if (state.onWarning) {\n state.onWarning.call(null, generateError(state, message));\n }\n}\n\n\nvar directiveHandlers = {\n\n YAML: function handleYamlDirective(state, name, args) {\n\n var match, major, minor;\n\n if (state.version !== null) {\n throwError(state, 'duplication of %YAML directive');\n }\n\n if (args.length !== 1) {\n throwError(state, 'YAML directive accepts exactly one argument');\n }\n\n match = /^([0-9]+)\\.([0-9]+)$/.exec(args[0]);\n\n if (match === null) {\n throwError(state, 'ill-formed argument of the YAML directive');\n }\n\n major = parseInt(match[1], 10);\n minor = parseInt(match[2], 10);\n\n if (major !== 1) {\n throwError(state, 'unacceptable YAML version of the document');\n }\n\n state.version = args[0];\n state.checkLineBreaks = (minor < 2);\n\n if (minor !== 1 && minor !== 2) {\n throwWarning(state, 'unsupported YAML version of the document');\n }\n },\n\n TAG: function handleTagDirective(state, name, args) {\n\n var handle, prefix;\n\n if (args.length !== 2) {\n throwError(state, 'TAG directive accepts exactly two arguments');\n }\n\n handle = args[0];\n prefix = args[1];\n\n if (!PATTERN_TAG_HANDLE.test(handle)) {\n throwError(state, 'ill-formed tag handle (first argument) of the TAG directive');\n }\n\n if (_hasOwnProperty.call(state.tagMap, handle)) {\n throwError(state, 'there is a previously declared suffix for \"' + handle + '\" tag handle');\n }\n\n if (!PATTERN_TAG_URI.test(prefix)) {\n throwError(state, 'ill-formed tag prefix (second argument) of the TAG directive');\n }\n\n state.tagMap[handle] = prefix;\n }\n};\n\n\nfunction captureSegment(state, start, end, checkJson) {\n var _position, _length, _character, _result;\n\n if (start < end) {\n _result = state.input.slice(start, end);\n\n if (checkJson) {\n for (_position = 0, _length = _result.length; _position < _length; _position += 1) {\n _character = _result.charCodeAt(_position);\n if (!(_character === 0x09 ||\n (0x20 <= _character && _character <= 0x10FFFF))) {\n throwError(state, 'expected valid JSON character');\n }\n }\n } else if (PATTERN_NON_PRINTABLE.test(_result)) {\n throwError(state, 'the stream contains non-printable characters');\n }\n\n state.result += _result;\n }\n}\n\nfunction mergeMappings(state, destination, source, overridableKeys) {\n var sourceKeys, key, index, quantity;\n\n if (!common.isObject(source)) {\n throwError(state, 'cannot merge mappings; the provided source object is unacceptable');\n }\n\n sourceKeys = Object.keys(source);\n\n for (index = 0, quantity = sourceKeys.length; index < quantity; index += 1) {\n key = sourceKeys[index];\n\n if (!_hasOwnProperty.call(destination, key)) {\n destination[key] = source[key];\n overridableKeys[key] = true;\n }\n }\n}\n\nfunction storeMappingPair(state, _result, overridableKeys, keyTag, keyNode, valueNode, startLine, startPos) {\n var index, quantity;\n\n // The output is a plain object here, so keys can only be strings.\n // We need to convert keyNode to a string, but doing so can hang the process\n // (deeply nested arrays that explode exponentially using aliases).\n if (Array.isArray(keyNode)) {\n keyNode = Array.prototype.slice.call(keyNode);\n\n for (index = 0, quantity = keyNode.length; index < quantity; index += 1) {\n if (Array.isArray(keyNode[index])) {\n throwError(state, 'nested arrays are not supported inside keys');\n }\n\n if (typeof keyNode === 'object' && _class(keyNode[index]) === '[object Object]') {\n keyNode[index] = '[object Object]';\n }\n }\n }\n\n // Avoid code execution in load() via toString property\n // (still use its own toString for arrays, timestamps,\n // and whatever user schema extensions happen to have @@toStringTag)\n if (typeof keyNode === 'object' && _class(keyNode) === '[object Object]') {\n keyNode = '[object Object]';\n }\n\n\n keyNode = String(keyNode);\n\n if (_result === null) {\n _result = {};\n }\n\n if (keyTag === 'tag:yaml.org,2002:merge') {\n if (Array.isArray(valueNode)) {\n for (index = 0, quantity = valueNode.length; index < quantity; index += 1) {\n mergeMappings(state, _result, valueNode[index], overridableKeys);\n }\n } else {\n mergeMappings(state, _result, valueNode, overridableKeys);\n }\n } else {\n if (!state.json &&\n !_hasOwnProperty.call(overridableKeys, keyNode) &&\n _hasOwnProperty.call(_result, keyNode)) {\n state.line = startLine || state.line;\n state.position = startPos || state.position;\n throwError(state, 'duplicated mapping key');\n }\n _result[keyNode] = valueNode;\n delete overridableKeys[keyNode];\n }\n\n return _result;\n}\n\nfunction readLineBreak(state) {\n var ch;\n\n ch = state.input.charCodeAt(state.position);\n\n if (ch === 0x0A/* LF */) {\n state.position++;\n } else if (ch === 0x0D/* CR */) {\n state.position++;\n if (state.input.charCodeAt(state.position) === 0x0A/* LF */) {\n state.position++;\n }\n } else {\n throwError(state, 'a line break is expected');\n }\n\n state.line += 1;\n state.lineStart = state.position;\n}\n\nfunction skipSeparationSpace(state, allowComments, checkIndent) {\n var lineBreaks = 0,\n ch = state.input.charCodeAt(state.position);\n\n while (ch !== 0) {\n while (is_WHITE_SPACE(ch)) {\n ch = state.input.charCodeAt(++state.position);\n }\n\n if (allowComments && ch === 0x23/* # */) {\n do {\n ch = state.input.charCodeAt(++state.position);\n } while (ch !== 0x0A/* LF */ && ch !== 0x0D/* CR */ && ch !== 0);\n }\n\n if (is_EOL(ch)) {\n readLineBreak(state);\n\n ch = state.input.charCodeAt(state.position);\n lineBreaks++;\n state.lineIndent = 0;\n\n while (ch === 0x20/* Space */) {\n state.lineIndent++;\n ch = state.input.charCodeAt(++state.position);\n }\n } else {\n break;\n }\n }\n\n if (checkIndent !== -1 && lineBreaks !== 0 && state.lineIndent < checkIndent) {\n throwWarning(state, 'deficient indentation');\n }\n\n return lineBreaks;\n}\n\nfunction testDocumentSeparator(state) {\n var _position = state.position,\n ch;\n\n ch = state.input.charCodeAt(_position);\n\n // Condition state.position === state.lineStart is tested\n // in parent on each call, for efficiency. No needs to test here again.\n if ((ch === 0x2D/* - */ || ch === 0x2E/* . */) &&\n ch === state.input.charCodeAt(_position + 1) &&\n ch === state.input.charCodeAt(_position + 2)) {\n\n _position += 3;\n\n ch = state.input.charCodeAt(_position);\n\n if (ch === 0 || is_WS_OR_EOL(ch)) {\n return true;\n }\n }\n\n return false;\n}\n\nfunction writeFoldedLines(state, count) {\n if (count === 1) {\n state.result += ' ';\n } else if (count > 1) {\n state.result += common.repeat('\\n', count - 1);\n }\n}\n\n\nfunction readPlainScalar(state, nodeIndent, withinFlowCollection) {\n var preceding,\n following,\n captureStart,\n captureEnd,\n hasPendingContent,\n _line,\n _lineStart,\n _lineIndent,\n _kind = state.kind,\n _result = state.result,\n ch;\n\n ch = state.input.charCodeAt(state.position);\n\n if (is_WS_OR_EOL(ch) ||\n is_FLOW_INDICATOR(ch) ||\n ch === 0x23/* # */ ||\n ch === 0x26/* & */ ||\n ch === 0x2A/* * */ ||\n ch === 0x21/* ! */ ||\n ch === 0x7C/* | */ ||\n ch === 0x3E/* > */ ||\n ch === 0x27/* ' */ ||\n ch === 0x22/* \" */ ||\n ch === 0x25/* % */ ||\n ch === 0x40/* @ */ ||\n ch === 0x60/* ` */) {\n return false;\n }\n\n if (ch === 0x3F/* ? */ || ch === 0x2D/* - */) {\n following = state.input.charCodeAt(state.position + 1);\n\n if (is_WS_OR_EOL(following) ||\n withinFlowCollection && is_FLOW_INDICATOR(following)) {\n return false;\n }\n }\n\n state.kind = 'scalar';\n state.result = '';\n captureStart = captureEnd = state.position;\n hasPendingContent = false;\n\n while (ch !== 0) {\n if (ch === 0x3A/* : */) {\n following = state.input.charCodeAt(state.position + 1);\n\n if (is_WS_OR_EOL(following) ||\n withinFlowCollection && is_FLOW_INDICATOR(following)) {\n break;\n }\n\n } else if (ch === 0x23/* # */) {\n preceding = state.input.charCodeAt(state.position - 1);\n\n if (is_WS_OR_EOL(preceding)) {\n break;\n }\n\n } else if ((state.position === state.lineStart && testDocumentSeparator(state)) ||\n withinFlowCollection && is_FLOW_INDICATOR(ch)) {\n break;\n\n } else if (is_EOL(ch)) {\n _line = state.line;\n _lineStart = state.lineStart;\n _lineIndent = state.lineIndent;\n skipSeparationSpace(state, false, -1);\n\n if (state.lineIndent >= nodeIndent) {\n hasPendingContent = true;\n ch = state.input.charCodeAt(state.position);\n continue;\n } else {\n state.position = captureEnd;\n state.line = _line;\n state.lineStart = _lineStart;\n state.lineIndent = _lineIndent;\n break;\n }\n }\n\n if (hasPendingContent) {\n captureSegment(state, captureStart, captureEnd, false);\n writeFoldedLines(state, state.line - _line);\n captureStart = captureEnd = state.position;\n hasPendingContent = false;\n }\n\n if (!is_WHITE_SPACE(ch)) {\n captureEnd = state.position + 1;\n }\n\n ch = state.input.charCodeAt(++state.position);\n }\n\n captureSegment(state, captureStart, captureEnd, false);\n\n if (state.result) {\n return true;\n }\n\n state.kind = _kind;\n state.result = _result;\n return false;\n}\n\nfunction readSingleQuotedScalar(state, nodeIndent) {\n var ch,\n captureStart, captureEnd;\n\n ch = state.input.charCodeAt(state.position);\n\n if (ch !== 0x27/* ' */) {\n return false;\n }\n\n state.kind = 'scalar';\n state.result = '';\n state.position++;\n captureStart = captureEnd = state.position;\n\n while ((ch = state.input.charCodeAt(state.position)) !== 0) {\n if (ch === 0x27/* ' */) {\n captureSegment(state, captureStart, state.position, true);\n ch = state.input.charCodeAt(++state.position);\n\n if (ch === 0x27/* ' */) {\n captureStart = state.position;\n state.position++;\n captureEnd = state.position;\n } else {\n return true;\n }\n\n } else if (is_EOL(ch)) {\n captureSegment(state, captureStart, captureEnd, true);\n writeFoldedLines(state, skipSeparationSpace(state, false, nodeIndent));\n captureStart = captureEnd = state.position;\n\n } else if (state.position === state.lineStart && testDocumentSeparator(state)) {\n throwError(state, 'unexpected end of the document within a single quoted scalar');\n\n } else {\n state.position++;\n captureEnd = state.position;\n }\n }\n\n throwError(state, 'unexpected end of the stream within a single quoted scalar');\n}\n\nfunction readDoubleQuotedScalar(state, nodeIndent) {\n var captureStart,\n captureEnd,\n hexLength,\n hexResult,\n tmp,\n ch;\n\n ch = state.input.charCodeAt(state.position);\n\n if (ch !== 0x22/* \" */) {\n return false;\n }\n\n state.kind = 'scalar';\n state.result = '';\n state.position++;\n captureStart = captureEnd = state.position;\n\n while ((ch = state.input.charCodeAt(state.position)) !== 0) {\n if (ch === 0x22/* \" */) {\n captureSegment(state, captureStart, state.position, true);\n state.position++;\n return true;\n\n } else if (ch === 0x5C/* \\ */) {\n captureSegment(state, captureStart, state.position, true);\n ch = state.input.charCodeAt(++state.position);\n\n if (is_EOL(ch)) {\n skipSeparationSpace(state, false, nodeIndent);\n\n // TODO: rework to inline fn with no type cast?\n } else if (ch < 256 && simpleEscapeCheck[ch]) {\n state.result += simpleEscapeMap[ch];\n state.position++;\n\n } else if ((tmp = escapedHexLen(ch)) > 0) {\n hexLength = tmp;\n hexResult = 0;\n\n for (; hexLength > 0; hexLength--) {\n ch = state.input.charCodeAt(++state.position);\n\n if ((tmp = fromHexCode(ch)) >= 0) {\n hexResult = (hexResult << 4) + tmp;\n\n } else {\n throwError(state, 'expected hexadecimal character');\n }\n }\n\n state.result += charFromCodepoint(hexResult);\n\n state.position++;\n\n } else {\n throwError(state, 'unknown escape sequence');\n }\n\n captureStart = captureEnd = state.position;\n\n } else if (is_EOL(ch)) {\n captureSegment(state, captureStart, captureEnd, true);\n writeFoldedLines(state, skipSeparationSpace(state, false, nodeIndent));\n captureStart = captureEnd = state.position;\n\n } else if (state.position === state.lineStart && testDocumentSeparator(state)) {\n throwError(state, 'unexpected end of the document within a double quoted scalar');\n\n } else {\n state.position++;\n captureEnd = state.position;\n }\n }\n\n throwError(state, 'unexpected end of the stream within a double quoted scalar');\n}\n\nfunction readFlowCollection(state, nodeIndent) {\n var readNext = true,\n _line,\n _tag = state.tag,\n _result,\n _anchor = state.anchor,\n following,\n terminator,\n isPair,\n isExplicitPair,\n isMapping,\n overridableKeys = {},\n keyNode,\n keyTag,\n valueNode,\n ch;\n\n ch = state.input.charCodeAt(state.position);\n\n if (ch === 0x5B/* [ */) {\n terminator = 0x5D;/* ] */\n isMapping = false;\n _result = [];\n } else if (ch === 0x7B/* { */) {\n terminator = 0x7D;/* } */\n isMapping = true;\n _result = {};\n } else {\n return false;\n }\n\n if (state.anchor !== null) {\n state.anchorMap[state.anchor] = _result;\n }\n\n ch = state.input.charCodeAt(++state.position);\n\n while (ch !== 0) {\n skipSeparationSpace(state, true, nodeIndent);\n\n ch = state.input.charCodeAt(state.position);\n\n if (ch === terminator) {\n state.position++;\n state.tag = _tag;\n state.anchor = _anchor;\n state.kind = isMapping ? 'mapping' : 'sequence';\n state.result = _result;\n return true;\n } else if (!readNext) {\n throwError(state, 'missed comma between flow collection entries');\n }\n\n keyTag = keyNode = valueNode = null;\n isPair = isExplicitPair = false;\n\n if (ch === 0x3F/* ? */) {\n following = state.input.charCodeAt(state.position + 1);\n\n if (is_WS_OR_EOL(following)) {\n isPair = isExplicitPair = true;\n state.position++;\n skipSeparationSpace(state, true, nodeIndent);\n }\n }\n\n _line = state.line;\n composeNode(state, nodeIndent, CONTEXT_FLOW_IN, false, true);\n keyTag = state.tag;\n keyNode = state.result;\n skipSeparationSpace(state, true, nodeIndent);\n\n ch = state.input.charCodeAt(state.position);\n\n if ((isExplicitPair || state.line === _line) && ch === 0x3A/* : */) {\n isPair = true;\n ch = state.input.charCodeAt(++state.position);\n skipSeparationSpace(state, true, nodeIndent);\n composeNode(state, nodeIndent, CONTEXT_FLOW_IN, false, true);\n valueNode = state.result;\n }\n\n if (isMapping) {\n storeMappingPair(state, _result, overridableKeys, keyTag, keyNode, valueNode);\n } else if (isPair) {\n _result.push(storeMappingPair(state, null, overridableKeys, keyTag, keyNode, valueNode));\n } else {\n _result.push(keyNode);\n }\n\n skipSeparationSpace(state, true, nodeIndent);\n\n ch = state.input.charCodeAt(state.position);\n\n if (ch === 0x2C/* , */) {\n readNext = true;\n ch = state.input.charCodeAt(++state.position);\n } else {\n readNext = false;\n }\n }\n\n throwError(state, 'unexpected end of the stream within a flow collection');\n}\n\nfunction readBlockScalar(state, nodeIndent) {\n var captureStart,\n folding,\n chomping = CHOMPING_CLIP,\n didReadContent = false,\n detectedIndent = false,\n textIndent = nodeIndent,\n emptyLines = 0,\n atMoreIndented = false,\n tmp,\n ch;\n\n ch = state.input.charCodeAt(state.position);\n\n if (ch === 0x7C/* | */) {\n folding = false;\n } else if (ch === 0x3E/* > */) {\n folding = true;\n } else {\n return false;\n }\n\n state.kind = 'scalar';\n state.result = '';\n\n while (ch !== 0) {\n ch = state.input.charCodeAt(++state.position);\n\n if (ch === 0x2B/* + */ || ch === 0x2D/* - */) {\n if (CHOMPING_CLIP === chomping) {\n chomping = (ch === 0x2B/* + */) ? CHOMPING_KEEP : CHOMPING_STRIP;\n } else {\n throwError(state, 'repeat of a chomping mode identifier');\n }\n\n } else if ((tmp = fromDecimalCode(ch)) >= 0) {\n if (tmp === 0) {\n throwError(state, 'bad explicit indentation width of a block scalar; it cannot be less than one');\n } else if (!detectedIndent) {\n textIndent = nodeIndent + tmp - 1;\n detectedIndent = true;\n } else {\n throwError(state, 'repeat of an indentation width identifier');\n }\n\n } else {\n break;\n }\n }\n\n if (is_WHITE_SPACE(ch)) {\n do { ch = state.input.charCodeAt(++state.position); }\n while (is_WHITE_SPACE(ch));\n\n if (ch === 0x23/* # */) {\n do { ch = state.input.charCodeAt(++state.position); }\n while (!is_EOL(ch) && (ch !== 0));\n }\n }\n\n while (ch !== 0) {\n readLineBreak(state);\n state.lineIndent = 0;\n\n ch = state.input.charCodeAt(state.position);\n\n while ((!detectedIndent || state.lineIndent < textIndent) &&\n (ch === 0x20/* Space */)) {\n state.lineIndent++;\n ch = state.input.charCodeAt(++state.position);\n }\n\n if (!detectedIndent && state.lineIndent > textIndent) {\n textIndent = state.lineIndent;\n }\n\n if (is_EOL(ch)) {\n emptyLines++;\n continue;\n }\n\n // End of the scalar.\n if (state.lineIndent < textIndent) {\n\n // Perform the chomping.\n if (chomping === CHOMPING_KEEP) {\n state.result += common.repeat('\\n', didReadContent ? 1 + emptyLines : emptyLines);\n } else if (chomping === CHOMPING_CLIP) {\n if (didReadContent) { // i.e. only if the scalar is not empty.\n state.result += '\\n';\n }\n }\n\n // Break this `while` cycle and go to the funciton's epilogue.\n break;\n }\n\n // Folded style: use fancy rules to handle line breaks.\n if (folding) {\n\n // Lines starting with white space characters (more-indented lines) are not folded.\n if (is_WHITE_SPACE(ch)) {\n atMoreIndented = true;\n // except for the first content line (cf. Example 8.1)\n state.result += common.repeat('\\n', didReadContent ? 1 + emptyLines : emptyLines);\n\n // End of more-indented block.\n } else if (atMoreIndented) {\n atMoreIndented = false;\n state.result += common.repeat('\\n', emptyLines + 1);\n\n // Just one line break - perceive as the same line.\n } else if (emptyLines === 0) {\n if (didReadContent) { // i.e. only if we have already read some scalar content.\n state.result += ' ';\n }\n\n // Several line breaks - perceive as different lines.\n } else {\n state.result += common.repeat('\\n', emptyLines);\n }\n\n // Literal style: just add exact number of line breaks between content lines.\n } else {\n // Keep all line breaks except the header line break.\n state.result += common.repeat('\\n', didReadContent ? 1 + emptyLines : emptyLines);\n }\n\n didReadContent = true;\n detectedIndent = true;\n emptyLines = 0;\n captureStart = state.position;\n\n while (!is_EOL(ch) && (ch !== 0)) {\n ch = state.input.charCodeAt(++state.position);\n }\n\n captureSegment(state, captureStart, state.position, false);\n }\n\n return true;\n}\n\nfunction readBlockSequence(state, nodeIndent) {\n var _line,\n _tag = state.tag,\n _anchor = state.anchor,\n _result = [],\n following,\n detected = false,\n ch;\n\n if (state.anchor !== null) {\n state.anchorMap[state.anchor] = _result;\n }\n\n ch = state.input.charCodeAt(state.position);\n\n while (ch !== 0) {\n\n if (ch !== 0x2D/* - */) {\n break;\n }\n\n following = state.input.charCodeAt(state.position + 1);\n\n if (!is_WS_OR_EOL(following)) {\n break;\n }\n\n detected = true;\n state.position++;\n\n if (skipSeparationSpace(state, true, -1)) {\n if (state.lineIndent <= nodeIndent) {\n _result.push(null);\n ch = state.input.charCodeAt(state.position);\n continue;\n }\n }\n\n _line = state.line;\n composeNode(state, nodeIndent, CONTEXT_BLOCK_IN, false, true);\n _result.push(state.result);\n skipSeparationSpace(state, true, -1);\n\n ch = state.input.charCodeAt(state.position);\n\n if ((state.line === _line || state.lineIndent > nodeIndent) && (ch !== 0)) {\n throwError(state, 'bad indentation of a sequence entry');\n } else if (state.lineIndent < nodeIndent) {\n break;\n }\n }\n\n if (detected) {\n state.tag = _tag;\n state.anchor = _anchor;\n state.kind = 'sequence';\n state.result = _result;\n return true;\n }\n return false;\n}\n\nfunction readBlockMapping(state, nodeIndent, flowIndent) {\n var following,\n allowCompact,\n _line,\n _pos,\n _tag = state.tag,\n _anchor = state.anchor,\n _result = {},\n overridableKeys = {},\n keyTag = null,\n keyNode = null,\n valueNode = null,\n atExplicitKey = false,\n detected = false,\n ch;\n\n if (state.anchor !== null) {\n state.anchorMap[state.anchor] = _result;\n }\n\n ch = state.input.charCodeAt(state.position);\n\n while (ch !== 0) {\n following = state.input.charCodeAt(state.position + 1);\n _line = state.line; // Save the current line.\n _pos = state.position;\n\n //\n // Explicit notation case. There are two separate blocks:\n // first for the key (denoted by \"?\") and second for the value (denoted by \":\")\n //\n if ((ch === 0x3F/* ? */ || ch === 0x3A/* : */) && is_WS_OR_EOL(following)) {\n\n if (ch === 0x3F/* ? */) {\n if (atExplicitKey) {\n storeMappingPair(state, _result, overridableKeys, keyTag, keyNode, null);\n keyTag = keyNode = valueNode = null;\n }\n\n detected = true;\n atExplicitKey = true;\n allowCompact = true;\n\n } else if (atExplicitKey) {\n // i.e. 0x3A/* : */ === character after the explicit key.\n atExplicitKey = false;\n allowCompact = true;\n\n } else {\n throwError(state, 'incomplete explicit mapping pair; a key node is missed; or followed by a non-tabulated empty line');\n }\n\n state.position += 1;\n ch = following;\n\n //\n // Implicit notation case. Flow-style node as the key first, then \":\", and the value.\n //\n } else if (composeNode(state, flowIndent, CONTEXT_FLOW_OUT, false, true)) {\n\n if (state.line === _line) {\n ch = state.input.charCodeAt(state.position);\n\n while (is_WHITE_SPACE(ch)) {\n ch = state.input.charCodeAt(++state.position);\n }\n\n if (ch === 0x3A/* : */) {\n ch = state.input.charCodeAt(++state.position);\n\n if (!is_WS_OR_EOL(ch)) {\n throwError(state, 'a whitespace character is expected after the key-value separator within a block mapping');\n }\n\n if (atExplicitKey) {\n storeMappingPair(state, _result, overridableKeys, keyTag, keyNode, null);\n keyTag = keyNode = valueNode = null;\n }\n\n detected = true;\n atExplicitKey = false;\n allowCompact = false;\n keyTag = state.tag;\n keyNode = state.result;\n\n } else if (detected) {\n throwError(state, 'can not read an implicit mapping pair; a colon is missed');\n\n } else {\n state.tag = _tag;\n state.anchor = _anchor;\n return true; // Keep the result of `composeNode`.\n }\n\n } else if (detected) {\n throwError(state, 'can not read a block mapping entry; a multiline key may not be an implicit key');\n\n } else {\n state.tag = _tag;\n state.anchor = _anchor;\n return true; // Keep the result of `composeNode`.\n }\n\n } else {\n break; // Reading is done. Go to the epilogue.\n }\n\n //\n // Common reading code for both explicit and implicit notations.\n //\n if (state.line === _line || state.lineIndent > nodeIndent) {\n if (composeNode(state, nodeIndent, CONTEXT_BLOCK_OUT, true, allowCompact)) {\n if (atExplicitKey) {\n keyNode = state.result;\n } else {\n valueNode = state.result;\n }\n }\n\n if (!atExplicitKey) {\n storeMappingPair(state, _result, overridableKeys, keyTag, keyNode, valueNode, _line, _pos);\n keyTag = keyNode = valueNode = null;\n }\n\n skipSeparationSpace(state, true, -1);\n ch = state.input.charCodeAt(state.position);\n }\n\n if (state.lineIndent > nodeIndent && (ch !== 0)) {\n throwError(state, 'bad indentation of a mapping entry');\n } else if (state.lineIndent < nodeIndent) {\n break;\n }\n }\n\n //\n // Epilogue.\n //\n\n // Special case: last mapping's node contains only the key in explicit notation.\n if (atExplicitKey) {\n storeMappingPair(state, _result, overridableKeys, keyTag, keyNode, null);\n }\n\n // Expose the resulting mapping.\n if (detected) {\n state.tag = _tag;\n state.anchor = _anchor;\n state.kind = 'mapping';\n state.result = _result;\n }\n\n return detected;\n}\n\nfunction readTagProperty(state) {\n var _position,\n isVerbatim = false,\n isNamed = false,\n tagHandle,\n tagName,\n ch;\n\n ch = state.input.charCodeAt(state.position);\n\n if (ch !== 0x21/* ! */) return false;\n\n if (state.tag !== null) {\n throwError(state, 'duplication of a tag property');\n }\n\n ch = state.input.charCodeAt(++state.position);\n\n if (ch === 0x3C/* < */) {\n isVerbatim = true;\n ch = state.input.charCodeAt(++state.position);\n\n } else if (ch === 0x21/* ! */) {\n isNamed = true;\n tagHandle = '!!';\n ch = state.input.charCodeAt(++state.position);\n\n } else {\n tagHandle = '!';\n }\n\n _position = state.position;\n\n if (isVerbatim) {\n do { ch = state.input.charCodeAt(++state.position); }\n while (ch !== 0 && ch !== 0x3E/* > */);\n\n if (state.position < state.length) {\n tagName = state.input.slice(_position, state.position);\n ch = state.input.charCodeAt(++state.position);\n } else {\n throwError(state, 'unexpected end of the stream within a verbatim tag');\n }\n } else {\n while (ch !== 0 && !is_WS_OR_EOL(ch)) {\n\n if (ch === 0x21/* ! */) {\n if (!isNamed) {\n tagHandle = state.input.slice(_position - 1, state.position + 1);\n\n if (!PATTERN_TAG_HANDLE.test(tagHandle)) {\n throwError(state, 'named tag handle cannot contain such characters');\n }\n\n isNamed = true;\n _position = state.position + 1;\n } else {\n throwError(state, 'tag suffix cannot contain exclamation marks');\n }\n }\n\n ch = state.input.charCodeAt(++state.position);\n }\n\n tagName = state.input.slice(_position, state.position);\n\n if (PATTERN_FLOW_INDICATORS.test(tagName)) {\n throwError(state, 'tag suffix cannot contain flow indicator characters');\n }\n }\n\n if (tagName && !PATTERN_TAG_URI.test(tagName)) {\n throwError(state, 'tag name cannot contain such characters: ' + tagName);\n }\n\n if (isVerbatim) {\n state.tag = tagName;\n\n } else if (_hasOwnProperty.call(state.tagMap, tagHandle)) {\n state.tag = state.tagMap[tagHandle] + tagName;\n\n } else if (tagHandle === '!') {\n state.tag = '!' + tagName;\n\n } else if (tagHandle === '!!') {\n state.tag = 'tag:yaml.org,2002:' + tagName;\n\n } else {\n throwError(state, 'undeclared tag handle \"' + tagHandle + '\"');\n }\n\n return true;\n}\n\nfunction readAnchorProperty(state) {\n var _position,\n ch;\n\n ch = state.input.charCodeAt(state.position);\n\n if (ch !== 0x26/* & */) return false;\n\n if (state.anchor !== null) {\n throwError(state, 'duplication of an anchor property');\n }\n\n ch = state.input.charCodeAt(++state.position);\n _position = state.position;\n\n while (ch !== 0 && !is_WS_OR_EOL(ch) && !is_FLOW_INDICATOR(ch)) {\n ch = state.input.charCodeAt(++state.position);\n }\n\n if (state.position === _position) {\n throwError(state, 'name of an anchor node must contain at least one character');\n }\n\n state.anchor = state.input.slice(_position, state.position);\n return true;\n}\n\nfunction readAlias(state) {\n var _position, alias,\n ch;\n\n ch = state.input.charCodeAt(state.position);\n\n if (ch !== 0x2A/* * */) return false;\n\n ch = state.input.charCodeAt(++state.position);\n _position = state.position;\n\n while (ch !== 0 && !is_WS_OR_EOL(ch) && !is_FLOW_INDICATOR(ch)) {\n ch = state.input.charCodeAt(++state.position);\n }\n\n if (state.position === _position) {\n throwError(state, 'name of an alias node must contain at least one character');\n }\n\n alias = state.input.slice(_position, state.position);\n\n if (!_hasOwnProperty.call(state.anchorMap, alias)) {\n throwError(state, 'unidentified alias \"' + alias + '\"');\n }\n\n state.result = state.anchorMap[alias];\n skipSeparationSpace(state, true, -1);\n return true;\n}\n\nfunction composeNode(state, parentIndent, nodeContext, allowToSeek, allowCompact) {\n var allowBlockStyles,\n allowBlockScalars,\n allowBlockCollections,\n indentStatus = 1, // 1: this>parent, 0: this=parent, -1: this parentIndent) {\n indentStatus = 1;\n } else if (state.lineIndent === parentIndent) {\n indentStatus = 0;\n } else if (state.lineIndent < parentIndent) {\n indentStatus = -1;\n }\n }\n }\n\n if (indentStatus === 1) {\n while (readTagProperty(state) || readAnchorProperty(state)) {\n if (skipSeparationSpace(state, true, -1)) {\n atNewLine = true;\n allowBlockCollections = allowBlockStyles;\n\n if (state.lineIndent > parentIndent) {\n indentStatus = 1;\n } else if (state.lineIndent === parentIndent) {\n indentStatus = 0;\n } else if (state.lineIndent < parentIndent) {\n indentStatus = -1;\n }\n } else {\n allowBlockCollections = false;\n }\n }\n }\n\n if (allowBlockCollections) {\n allowBlockCollections = atNewLine || allowCompact;\n }\n\n if (indentStatus === 1 || CONTEXT_BLOCK_OUT === nodeContext) {\n if (CONTEXT_FLOW_IN === nodeContext || CONTEXT_FLOW_OUT === nodeContext) {\n flowIndent = parentIndent;\n } else {\n flowIndent = parentIndent + 1;\n }\n\n blockIndent = state.position - state.lineStart;\n\n if (indentStatus === 1) {\n if (allowBlockCollections &&\n (readBlockSequence(state, blockIndent) ||\n readBlockMapping(state, blockIndent, flowIndent)) ||\n readFlowCollection(state, flowIndent)) {\n hasContent = true;\n } else {\n if ((allowBlockScalars && readBlockScalar(state, flowIndent)) ||\n readSingleQuotedScalar(state, flowIndent) ||\n readDoubleQuotedScalar(state, flowIndent)) {\n hasContent = true;\n\n } else if (readAlias(state)) {\n hasContent = true;\n\n if (state.tag !== null || state.anchor !== null) {\n throwError(state, 'alias node should not have any properties');\n }\n\n } else if (readPlainScalar(state, flowIndent, CONTEXT_FLOW_IN === nodeContext)) {\n hasContent = true;\n\n if (state.tag === null) {\n state.tag = '?';\n }\n }\n\n if (state.anchor !== null) {\n state.anchorMap[state.anchor] = state.result;\n }\n }\n } else if (indentStatus === 0) {\n // Special case: block sequences are allowed to have same indentation level as the parent.\n // http://www.yaml.org/spec/1.2/spec.html#id2799784\n hasContent = allowBlockCollections && readBlockSequence(state, blockIndent);\n }\n }\n\n if (state.tag !== null && state.tag !== '!') {\n if (state.tag === '?') {\n // Implicit resolving is not allowed for non-scalar types, and '?'\n // non-specific tag is only automatically assigned to plain scalars.\n //\n // We only need to check kind conformity in case user explicitly assigns '?'\n // tag, for example like this: \"! [0]\"\n //\n if (state.result !== null && state.kind !== 'scalar') {\n throwError(state, 'unacceptable node kind for ! tag; it should be \"scalar\", not \"' + state.kind + '\"');\n }\n\n for (typeIndex = 0, typeQuantity = state.implicitTypes.length; typeIndex < typeQuantity; typeIndex += 1) {\n type = state.implicitTypes[typeIndex];\n\n if (type.resolve(state.result)) { // `state.result` updated in resolver if matched\n state.result = type.construct(state.result);\n state.tag = type.tag;\n if (state.anchor !== null) {\n state.anchorMap[state.anchor] = state.result;\n }\n break;\n }\n }\n } else if (_hasOwnProperty.call(state.typeMap[state.kind || 'fallback'], state.tag)) {\n type = state.typeMap[state.kind || 'fallback'][state.tag];\n\n if (state.result !== null && type.kind !== state.kind) {\n throwError(state, 'unacceptable node kind for !<' + state.tag + '> tag; it should be \"' + type.kind + '\", not \"' + state.kind + '\"');\n }\n\n if (!type.resolve(state.result)) { // `state.result` updated in resolver if matched\n throwError(state, 'cannot resolve a node with !<' + state.tag + '> explicit tag');\n } else {\n state.result = type.construct(state.result);\n if (state.anchor !== null) {\n state.anchorMap[state.anchor] = state.result;\n }\n }\n } else {\n throwError(state, 'unknown tag !<' + state.tag + '>');\n }\n }\n\n if (state.listener !== null) {\n state.listener('close', state);\n }\n return state.tag !== null || state.anchor !== null || hasContent;\n}\n\nfunction readDocument(state) {\n var documentStart = state.position,\n _position,\n directiveName,\n directiveArgs,\n hasDirectives = false,\n ch;\n\n state.version = null;\n state.checkLineBreaks = state.legacy;\n state.tagMap = {};\n state.anchorMap = {};\n\n while ((ch = state.input.charCodeAt(state.position)) !== 0) {\n skipSeparationSpace(state, true, -1);\n\n ch = state.input.charCodeAt(state.position);\n\n if (state.lineIndent > 0 || ch !== 0x25/* % */) {\n break;\n }\n\n hasDirectives = true;\n ch = state.input.charCodeAt(++state.position);\n _position = state.position;\n\n while (ch !== 0 && !is_WS_OR_EOL(ch)) {\n ch = state.input.charCodeAt(++state.position);\n }\n\n directiveName = state.input.slice(_position, state.position);\n directiveArgs = [];\n\n if (directiveName.length < 1) {\n throwError(state, 'directive name must not be less than one character in length');\n }\n\n while (ch !== 0) {\n while (is_WHITE_SPACE(ch)) {\n ch = state.input.charCodeAt(++state.position);\n }\n\n if (ch === 0x23/* # */) {\n do { ch = state.input.charCodeAt(++state.position); }\n while (ch !== 0 && !is_EOL(ch));\n break;\n }\n\n if (is_EOL(ch)) break;\n\n _position = state.position;\n\n while (ch !== 0 && !is_WS_OR_EOL(ch)) {\n ch = state.input.charCodeAt(++state.position);\n }\n\n directiveArgs.push(state.input.slice(_position, state.position));\n }\n\n if (ch !== 0) readLineBreak(state);\n\n if (_hasOwnProperty.call(directiveHandlers, directiveName)) {\n directiveHandlers[directiveName](state, directiveName, directiveArgs);\n } else {\n throwWarning(state, 'unknown document directive \"' + directiveName + '\"');\n }\n }\n\n skipSeparationSpace(state, true, -1);\n\n if (state.lineIndent === 0 &&\n state.input.charCodeAt(state.position) === 0x2D/* - */ &&\n state.input.charCodeAt(state.position + 1) === 0x2D/* - */ &&\n state.input.charCodeAt(state.position + 2) === 0x2D/* - */) {\n state.position += 3;\n skipSeparationSpace(state, true, -1);\n\n } else if (hasDirectives) {\n throwError(state, 'directives end mark is expected');\n }\n\n composeNode(state, state.lineIndent - 1, CONTEXT_BLOCK_OUT, false, true);\n skipSeparationSpace(state, true, -1);\n\n if (state.checkLineBreaks &&\n PATTERN_NON_ASCII_LINE_BREAKS.test(state.input.slice(documentStart, state.position))) {\n throwWarning(state, 'non-ASCII line breaks are interpreted as content');\n }\n\n state.documents.push(state.result);\n\n if (state.position === state.lineStart && testDocumentSeparator(state)) {\n\n if (state.input.charCodeAt(state.position) === 0x2E/* . */) {\n state.position += 3;\n skipSeparationSpace(state, true, -1);\n }\n return;\n }\n\n if (state.position < (state.length - 1)) {\n throwError(state, 'end of the stream or a document separator is expected');\n } else {\n return;\n }\n}\n\n\nfunction loadDocuments(input, options) {\n input = String(input);\n options = options || {};\n\n if (input.length !== 0) {\n\n // Add tailing `\\n` if not exists\n if (input.charCodeAt(input.length - 1) !== 0x0A/* LF */ &&\n input.charCodeAt(input.length - 1) !== 0x0D/* CR */) {\n input += '\\n';\n }\n\n // Strip BOM\n if (input.charCodeAt(0) === 0xFEFF) {\n input = input.slice(1);\n }\n }\n\n var state = new State(input, options);\n\n var nullpos = input.indexOf('\\0');\n\n if (nullpos !== -1) {\n state.position = nullpos;\n throwError(state, 'null byte is not allowed in input');\n }\n\n // Use 0 as string terminator. That significantly simplifies bounds check.\n state.input += '\\0';\n\n while (state.input.charCodeAt(state.position) === 0x20/* Space */) {\n state.lineIndent += 1;\n state.position += 1;\n }\n\n while (state.position < (state.length - 1)) {\n readDocument(state);\n }\n\n return state.documents;\n}\n\n\nfunction loadAll(input, iterator, options) {\n if (iterator !== null && typeof iterator === 'object' && typeof options === 'undefined') {\n options = iterator;\n iterator = null;\n }\n\n var documents = loadDocuments(input, options);\n\n if (typeof iterator !== 'function') {\n return documents;\n }\n\n for (var index = 0, length = documents.length; index < length; index += 1) {\n iterator(documents[index]);\n }\n}\n\n\nfunction load(input, options) {\n var documents = loadDocuments(input, options);\n\n if (documents.length === 0) {\n /*eslint-disable no-undefined*/\n return undefined;\n } else if (documents.length === 1) {\n return documents[0];\n }\n throw new YAMLException('expected a single document in the stream, but found more');\n}\n\n\nfunction safeLoadAll(input, iterator, options) {\n if (typeof iterator === 'object' && iterator !== null && typeof options === 'undefined') {\n options = iterator;\n iterator = null;\n }\n\n return loadAll(input, iterator, common.extend({ schema: DEFAULT_SAFE_SCHEMA }, options));\n}\n\n\nfunction safeLoad(input, options) {\n return load(input, common.extend({ schema: DEFAULT_SAFE_SCHEMA }, options));\n}\n\n\nmodule.exports.loadAll = loadAll;\nmodule.exports.load = load;\nmodule.exports.safeLoadAll = safeLoadAll;\nmodule.exports.safeLoad = safeLoad;\n","'use strict';\n\n\nvar common = require('./common');\n\n\nfunction Mark(name, buffer, position, line, column) {\n this.name = name;\n this.buffer = buffer;\n this.position = position;\n this.line = line;\n this.column = column;\n}\n\n\nMark.prototype.getSnippet = function getSnippet(indent, maxLength) {\n var head, start, tail, end, snippet;\n\n if (!this.buffer) return null;\n\n indent = indent || 4;\n maxLength = maxLength || 75;\n\n head = '';\n start = this.position;\n\n while (start > 0 && '\\x00\\r\\n\\x85\\u2028\\u2029'.indexOf(this.buffer.charAt(start - 1)) === -1) {\n start -= 1;\n if (this.position - start > (maxLength / 2 - 1)) {\n head = ' ... ';\n start += 5;\n break;\n }\n }\n\n tail = '';\n end = this.position;\n\n while (end < this.buffer.length && '\\x00\\r\\n\\x85\\u2028\\u2029'.indexOf(this.buffer.charAt(end)) === -1) {\n end += 1;\n if (end - this.position > (maxLength / 2 - 1)) {\n tail = ' ... ';\n end -= 5;\n break;\n }\n }\n\n snippet = this.buffer.slice(start, end);\n\n return common.repeat(' ', indent) + head + snippet + tail + '\\n' +\n common.repeat(' ', indent + this.position - start + head.length) + '^';\n};\n\n\nMark.prototype.toString = function toString(compact) {\n var snippet, where = '';\n\n if (this.name) {\n where += 'in \"' + this.name + '\" ';\n }\n\n where += 'at line ' + (this.line + 1) + ', column ' + (this.column + 1);\n\n if (!compact) {\n snippet = this.getSnippet();\n\n if (snippet) {\n where += ':\\n' + snippet;\n }\n }\n\n return where;\n};\n\n\nmodule.exports = Mark;\n","'use strict';\n\n/*eslint-disable max-len*/\n\nvar common = require('./common');\nvar YAMLException = require('./exception');\nvar Type = require('./type');\n\n\nfunction compileList(schema, name, result) {\n var exclude = [];\n\n schema.include.forEach(function (includedSchema) {\n result = compileList(includedSchema, name, result);\n });\n\n schema[name].forEach(function (currentType) {\n result.forEach(function (previousType, previousIndex) {\n if (previousType.tag === currentType.tag && previousType.kind === currentType.kind) {\n exclude.push(previousIndex);\n }\n });\n\n result.push(currentType);\n });\n\n return result.filter(function (type, index) {\n return exclude.indexOf(index) === -1;\n });\n}\n\n\nfunction compileMap(/* lists... */) {\n var result = {\n scalar: {},\n sequence: {},\n mapping: {},\n fallback: {}\n }, index, length;\n\n function collectType(type) {\n result[type.kind][type.tag] = result['fallback'][type.tag] = type;\n }\n\n for (index = 0, length = arguments.length; index < length; index += 1) {\n arguments[index].forEach(collectType);\n }\n return result;\n}\n\n\nfunction Schema(definition) {\n this.include = definition.include || [];\n this.implicit = definition.implicit || [];\n this.explicit = definition.explicit || [];\n\n this.implicit.forEach(function (type) {\n if (type.loadKind && type.loadKind !== 'scalar') {\n throw new YAMLException('There is a non-scalar type in the implicit list of a schema. Implicit resolving of such types is not supported.');\n }\n });\n\n this.compiledImplicit = compileList(this, 'implicit', []);\n this.compiledExplicit = compileList(this, 'explicit', []);\n this.compiledTypeMap = compileMap(this.compiledImplicit, this.compiledExplicit);\n}\n\n\nSchema.DEFAULT = null;\n\n\nSchema.create = function createSchema() {\n var schemas, types;\n\n switch (arguments.length) {\n case 1:\n schemas = Schema.DEFAULT;\n types = arguments[0];\n break;\n\n case 2:\n schemas = arguments[0];\n types = arguments[1];\n break;\n\n default:\n throw new YAMLException('Wrong number of arguments for Schema.create function');\n }\n\n schemas = common.toArray(schemas);\n types = common.toArray(types);\n\n if (!schemas.every(function (schema) { return schema instanceof Schema; })) {\n throw new YAMLException('Specified list of super schemas (or a single Schema object) contains a non-Schema object.');\n }\n\n if (!types.every(function (type) { return type instanceof Type; })) {\n throw new YAMLException('Specified list of YAML types (or a single Type object) contains a non-Type object.');\n }\n\n return new Schema({\n include: schemas,\n explicit: types\n });\n};\n\n\nmodule.exports = Schema;\n","// Standard YAML's Core schema.\n// http://www.yaml.org/spec/1.2/spec.html#id2804923\n//\n// NOTE: JS-YAML does not support schema-specific tag resolution restrictions.\n// So, Core schema has no distinctions from JSON schema is JS-YAML.\n\n\n'use strict';\n\n\nvar Schema = require('../schema');\n\n\nmodule.exports = new Schema({\n include: [\n require('./json')\n ]\n});\n","// JS-YAML's default schema for `load` function.\n// It is not described in the YAML specification.\n//\n// This schema is based on JS-YAML's default safe schema and includes\n// JavaScript-specific types: !!js/undefined, !!js/regexp and !!js/function.\n//\n// Also this schema is used as default base schema at `Schema.create` function.\n\n\n'use strict';\n\n\nvar Schema = require('../schema');\n\n\nmodule.exports = Schema.DEFAULT = new Schema({\n include: [\n require('./default_safe')\n ],\n explicit: [\n require('../type/js/undefined'),\n require('../type/js/regexp'),\n require('../type/js/function')\n ]\n});\n","// JS-YAML's default schema for `safeLoad` function.\n// It is not described in the YAML specification.\n//\n// This schema is based on standard YAML's Core schema and includes most of\n// extra types described at YAML tag repository. (http://yaml.org/type/)\n\n\n'use strict';\n\n\nvar Schema = require('../schema');\n\n\nmodule.exports = new Schema({\n include: [\n require('./core')\n ],\n implicit: [\n require('../type/timestamp'),\n require('../type/merge')\n ],\n explicit: [\n require('../type/binary'),\n require('../type/omap'),\n require('../type/pairs'),\n require('../type/set')\n ]\n});\n","// Standard YAML's Failsafe schema.\n// http://www.yaml.org/spec/1.2/spec.html#id2802346\n\n\n'use strict';\n\n\nvar Schema = require('../schema');\n\n\nmodule.exports = new Schema({\n explicit: [\n require('../type/str'),\n require('../type/seq'),\n require('../type/map')\n ]\n});\n","// Standard YAML's JSON schema.\n// http://www.yaml.org/spec/1.2/spec.html#id2803231\n//\n// NOTE: JS-YAML does not support schema-specific tag resolution restrictions.\n// So, this schema is not such strict as defined in the YAML specification.\n// It allows numbers in binary notaion, use `Null` and `NULL` as `null`, etc.\n\n\n'use strict';\n\n\nvar Schema = require('../schema');\n\n\nmodule.exports = new Schema({\n include: [\n require('./failsafe')\n ],\n implicit: [\n require('../type/null'),\n require('../type/bool'),\n require('../type/int'),\n require('../type/float')\n ]\n});\n","'use strict';\n\nvar YAMLException = require('./exception');\n\nvar TYPE_CONSTRUCTOR_OPTIONS = [\n 'kind',\n 'resolve',\n 'construct',\n 'instanceOf',\n 'predicate',\n 'represent',\n 'defaultStyle',\n 'styleAliases'\n];\n\nvar YAML_NODE_KINDS = [\n 'scalar',\n 'sequence',\n 'mapping'\n];\n\nfunction compileStyleAliases(map) {\n var result = {};\n\n if (map !== null) {\n Object.keys(map).forEach(function (style) {\n map[style].forEach(function (alias) {\n result[String(alias)] = style;\n });\n });\n }\n\n return result;\n}\n\nfunction Type(tag, options) {\n options = options || {};\n\n Object.keys(options).forEach(function (name) {\n if (TYPE_CONSTRUCTOR_OPTIONS.indexOf(name) === -1) {\n throw new YAMLException('Unknown option \"' + name + '\" is met in definition of \"' + tag + '\" YAML type.');\n }\n });\n\n // TODO: Add tag format check.\n this.tag = tag;\n this.kind = options['kind'] || null;\n this.resolve = options['resolve'] || function () { return true; };\n this.construct = options['construct'] || function (data) { return data; };\n this.instanceOf = options['instanceOf'] || null;\n this.predicate = options['predicate'] || null;\n this.represent = options['represent'] || null;\n this.defaultStyle = options['defaultStyle'] || null;\n this.styleAliases = compileStyleAliases(options['styleAliases'] || null);\n\n if (YAML_NODE_KINDS.indexOf(this.kind) === -1) {\n throw new YAMLException('Unknown kind \"' + this.kind + '\" is specified for \"' + tag + '\" YAML type.');\n }\n}\n\nmodule.exports = Type;\n",null,"'use strict';\n\nvar Type = require('../type');\n\nfunction resolveYamlBoolean(data) {\n if (data === null) return false;\n\n var max = data.length;\n\n return (max === 4 && (data === 'true' || data === 'True' || data === 'TRUE')) ||\n (max === 5 && (data === 'false' || data === 'False' || data === 'FALSE'));\n}\n\nfunction constructYamlBoolean(data) {\n return data === 'true' ||\n data === 'True' ||\n data === 'TRUE';\n}\n\nfunction isBoolean(object) {\n return Object.prototype.toString.call(object) === '[object Boolean]';\n}\n\nmodule.exports = new Type('tag:yaml.org,2002:bool', {\n kind: 'scalar',\n resolve: resolveYamlBoolean,\n construct: constructYamlBoolean,\n predicate: isBoolean,\n represent: {\n lowercase: function (object) { return object ? 'true' : 'false'; },\n uppercase: function (object) { return object ? 'TRUE' : 'FALSE'; },\n camelcase: function (object) { return object ? 'True' : 'False'; }\n },\n defaultStyle: 'lowercase'\n});\n","'use strict';\n\nvar common = require('../common');\nvar Type = require('../type');\n\nvar YAML_FLOAT_PATTERN = new RegExp(\n // 2.5e4, 2.5 and integers\n '^(?:[-+]?(?:0|[1-9][0-9_]*)(?:\\\\.[0-9_]*)?(?:[eE][-+]?[0-9]+)?' +\n // .2e4, .2\n // special case, seems not from spec\n '|\\\\.[0-9_]+(?:[eE][-+]?[0-9]+)?' +\n // 20:59\n '|[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\\\\.[0-9_]*' +\n // .inf\n '|[-+]?\\\\.(?:inf|Inf|INF)' +\n // .nan\n '|\\\\.(?:nan|NaN|NAN))$');\n\nfunction resolveYamlFloat(data) {\n if (data === null) return false;\n\n if (!YAML_FLOAT_PATTERN.test(data) ||\n // Quick hack to not allow integers end with `_`\n // Probably should update regexp & check speed\n data[data.length - 1] === '_') {\n return false;\n }\n\n return true;\n}\n\nfunction constructYamlFloat(data) {\n var value, sign, base, digits;\n\n value = data.replace(/_/g, '').toLowerCase();\n sign = value[0] === '-' ? -1 : 1;\n digits = [];\n\n if ('+-'.indexOf(value[0]) >= 0) {\n value = value.slice(1);\n }\n\n if (value === '.inf') {\n return (sign === 1) ? Number.POSITIVE_INFINITY : Number.NEGATIVE_INFINITY;\n\n } else if (value === '.nan') {\n return NaN;\n\n } else if (value.indexOf(':') >= 0) {\n value.split(':').forEach(function (v) {\n digits.unshift(parseFloat(v, 10));\n });\n\n value = 0.0;\n base = 1;\n\n digits.forEach(function (d) {\n value += d * base;\n base *= 60;\n });\n\n return sign * value;\n\n }\n return sign * parseFloat(value, 10);\n}\n\n\nvar SCIENTIFIC_WITHOUT_DOT = /^[-+]?[0-9]+e/;\n\nfunction representYamlFloat(object, style) {\n var res;\n\n if (isNaN(object)) {\n switch (style) {\n case 'lowercase': return '.nan';\n case 'uppercase': return '.NAN';\n case 'camelcase': return '.NaN';\n }\n } else if (Number.POSITIVE_INFINITY === object) {\n switch (style) {\n case 'lowercase': return '.inf';\n case 'uppercase': return '.INF';\n case 'camelcase': return '.Inf';\n }\n } else if (Number.NEGATIVE_INFINITY === object) {\n switch (style) {\n case 'lowercase': return '-.inf';\n case 'uppercase': return '-.INF';\n case 'camelcase': return '-.Inf';\n }\n } else if (common.isNegativeZero(object)) {\n return '-0.0';\n }\n\n res = object.toString(10);\n\n // JS stringifier can build scientific format without dots: 5e-100,\n // while YAML requres dot: 5.e-100. Fix it with simple hack\n\n return SCIENTIFIC_WITHOUT_DOT.test(res) ? res.replace('e', '.e') : res;\n}\n\nfunction isFloat(object) {\n return (Object.prototype.toString.call(object) === '[object Number]') &&\n (object % 1 !== 0 || common.isNegativeZero(object));\n}\n\nmodule.exports = new Type('tag:yaml.org,2002:float', {\n kind: 'scalar',\n resolve: resolveYamlFloat,\n construct: constructYamlFloat,\n predicate: isFloat,\n represent: representYamlFloat,\n defaultStyle: 'lowercase'\n});\n","'use strict';\n\nvar common = require('../common');\nvar Type = require('../type');\n\nfunction isHexCode(c) {\n return ((0x30/* 0 */ <= c) && (c <= 0x39/* 9 */)) ||\n ((0x41/* A */ <= c) && (c <= 0x46/* F */)) ||\n ((0x61/* a */ <= c) && (c <= 0x66/* f */));\n}\n\nfunction isOctCode(c) {\n return ((0x30/* 0 */ <= c) && (c <= 0x37/* 7 */));\n}\n\nfunction isDecCode(c) {\n return ((0x30/* 0 */ <= c) && (c <= 0x39/* 9 */));\n}\n\nfunction resolveYamlInteger(data) {\n if (data === null) return false;\n\n var max = data.length,\n index = 0,\n hasDigits = false,\n ch;\n\n if (!max) return false;\n\n ch = data[index];\n\n // sign\n if (ch === '-' || ch === '+') {\n ch = data[++index];\n }\n\n if (ch === '0') {\n // 0\n if (index + 1 === max) return true;\n ch = data[++index];\n\n // base 2, base 8, base 16\n\n if (ch === 'b') {\n // base 2\n index++;\n\n for (; index < max; index++) {\n ch = data[index];\n if (ch === '_') continue;\n if (ch !== '0' && ch !== '1') return false;\n hasDigits = true;\n }\n return hasDigits && ch !== '_';\n }\n\n\n if (ch === 'x') {\n // base 16\n index++;\n\n for (; index < max; index++) {\n ch = data[index];\n if (ch === '_') continue;\n if (!isHexCode(data.charCodeAt(index))) return false;\n hasDigits = true;\n }\n return hasDigits && ch !== '_';\n }\n\n // base 8\n for (; index < max; index++) {\n ch = data[index];\n if (ch === '_') continue;\n if (!isOctCode(data.charCodeAt(index))) return false;\n hasDigits = true;\n }\n return hasDigits && ch !== '_';\n }\n\n // base 10 (except 0) or base 60\n\n // value should not start with `_`;\n if (ch === '_') return false;\n\n for (; index < max; index++) {\n ch = data[index];\n if (ch === '_') continue;\n if (ch === ':') break;\n if (!isDecCode(data.charCodeAt(index))) {\n return false;\n }\n hasDigits = true;\n }\n\n // Should have digits and should not end with `_`\n if (!hasDigits || ch === '_') return false;\n\n // if !base60 - done;\n if (ch !== ':') return true;\n\n // base60 almost not used, no needs to optimize\n return /^(:[0-5]?[0-9])+$/.test(data.slice(index));\n}\n\nfunction constructYamlInteger(data) {\n var value = data, sign = 1, ch, base, digits = [];\n\n if (value.indexOf('_') !== -1) {\n value = value.replace(/_/g, '');\n }\n\n ch = value[0];\n\n if (ch === '-' || ch === '+') {\n if (ch === '-') sign = -1;\n value = value.slice(1);\n ch = value[0];\n }\n\n if (value === '0') return 0;\n\n if (ch === '0') {\n if (value[1] === 'b') return sign * parseInt(value.slice(2), 2);\n if (value[1] === 'x') return sign * parseInt(value, 16);\n return sign * parseInt(value, 8);\n }\n\n if (value.indexOf(':') !== -1) {\n value.split(':').forEach(function (v) {\n digits.unshift(parseInt(v, 10));\n });\n\n value = 0;\n base = 1;\n\n digits.forEach(function (d) {\n value += (d * base);\n base *= 60;\n });\n\n return sign * value;\n\n }\n\n return sign * parseInt(value, 10);\n}\n\nfunction isInteger(object) {\n return (Object.prototype.toString.call(object)) === '[object Number]' &&\n (object % 1 === 0 && !common.isNegativeZero(object));\n}\n\nmodule.exports = new Type('tag:yaml.org,2002:int', {\n kind: 'scalar',\n resolve: resolveYamlInteger,\n construct: constructYamlInteger,\n predicate: isInteger,\n represent: {\n binary: function (obj) { return obj >= 0 ? '0b' + obj.toString(2) : '-0b' + obj.toString(2).slice(1); },\n octal: function (obj) { return obj >= 0 ? '0' + obj.toString(8) : '-0' + obj.toString(8).slice(1); },\n decimal: function (obj) { return obj.toString(10); },\n /* eslint-disable max-len */\n hexadecimal: function (obj) { return obj >= 0 ? '0x' + obj.toString(16).toUpperCase() : '-0x' + obj.toString(16).toUpperCase().slice(1); }\n },\n defaultStyle: 'decimal',\n styleAliases: {\n binary: [ 2, 'bin' ],\n octal: [ 8, 'oct' ],\n decimal: [ 10, 'dec' ],\n hexadecimal: [ 16, 'hex' ]\n }\n});\n",null,"'use strict';\n\nvar Type = require('../../type');\n\nfunction resolveJavascriptRegExp(data) {\n if (data === null) return false;\n if (data.length === 0) return false;\n\n var regexp = data,\n tail = /\\/([gim]*)$/.exec(data),\n modifiers = '';\n\n // if regexp starts with '/' it can have modifiers and must be properly closed\n // `/foo/gim` - modifiers tail can be maximum 3 chars\n if (regexp[0] === '/') {\n if (tail) modifiers = tail[1];\n\n if (modifiers.length > 3) return false;\n // if expression starts with /, is should be properly terminated\n if (regexp[regexp.length - modifiers.length - 1] !== '/') return false;\n }\n\n return true;\n}\n\nfunction constructJavascriptRegExp(data) {\n var regexp = data,\n tail = /\\/([gim]*)$/.exec(data),\n modifiers = '';\n\n // `/foo/gim` - tail can be maximum 4 chars\n if (regexp[0] === '/') {\n if (tail) modifiers = tail[1];\n regexp = regexp.slice(1, regexp.length - modifiers.length - 1);\n }\n\n return new RegExp(regexp, modifiers);\n}\n\nfunction representJavascriptRegExp(object /*, style*/) {\n var result = '/' + object.source + '/';\n\n if (object.global) result += 'g';\n if (object.multiline) result += 'm';\n if (object.ignoreCase) result += 'i';\n\n return result;\n}\n\nfunction isRegExp(object) {\n return Object.prototype.toString.call(object) === '[object RegExp]';\n}\n\nmodule.exports = new Type('tag:yaml.org,2002:js/regexp', {\n kind: 'scalar',\n resolve: resolveJavascriptRegExp,\n construct: constructJavascriptRegExp,\n predicate: isRegExp,\n represent: representJavascriptRegExp\n});\n","'use strict';\n\nvar Type = require('../../type');\n\nfunction resolveJavascriptUndefined() {\n return true;\n}\n\nfunction constructJavascriptUndefined() {\n /*eslint-disable no-undefined*/\n return undefined;\n}\n\nfunction representJavascriptUndefined() {\n return '';\n}\n\nfunction isUndefined(object) {\n return typeof object === 'undefined';\n}\n\nmodule.exports = new Type('tag:yaml.org,2002:js/undefined', {\n kind: 'scalar',\n resolve: resolveJavascriptUndefined,\n construct: constructJavascriptUndefined,\n predicate: isUndefined,\n represent: representJavascriptUndefined\n});\n","'use strict';\n\nvar Type = require('../type');\n\nmodule.exports = new Type('tag:yaml.org,2002:map', {\n kind: 'mapping',\n construct: function (data) { return data !== null ? data : {}; }\n});\n","'use strict';\n\nvar Type = require('../type');\n\nfunction resolveYamlMerge(data) {\n return data === '<<' || data === null;\n}\n\nmodule.exports = new Type('tag:yaml.org,2002:merge', {\n kind: 'scalar',\n resolve: resolveYamlMerge\n});\n","'use strict';\n\nvar Type = require('../type');\n\nfunction resolveYamlNull(data) {\n if (data === null) return true;\n\n var max = data.length;\n\n return (max === 1 && data === '~') ||\n (max === 4 && (data === 'null' || data === 'Null' || data === 'NULL'));\n}\n\nfunction constructYamlNull() {\n return null;\n}\n\nfunction isNull(object) {\n return object === null;\n}\n\nmodule.exports = new Type('tag:yaml.org,2002:null', {\n kind: 'scalar',\n resolve: resolveYamlNull,\n construct: constructYamlNull,\n predicate: isNull,\n represent: {\n canonical: function () { return '~'; },\n lowercase: function () { return 'null'; },\n uppercase: function () { return 'NULL'; },\n camelcase: function () { return 'Null'; }\n },\n defaultStyle: 'lowercase'\n});\n","'use strict';\n\nvar Type = require('../type');\n\nvar _hasOwnProperty = Object.prototype.hasOwnProperty;\nvar _toString = Object.prototype.toString;\n\nfunction resolveYamlOmap(data) {\n if (data === null) return true;\n\n var objectKeys = [], index, length, pair, pairKey, pairHasKey,\n object = data;\n\n for (index = 0, length = object.length; index < length; index += 1) {\n pair = object[index];\n pairHasKey = false;\n\n if (_toString.call(pair) !== '[object Object]') return false;\n\n for (pairKey in pair) {\n if (_hasOwnProperty.call(pair, pairKey)) {\n if (!pairHasKey) pairHasKey = true;\n else return false;\n }\n }\n\n if (!pairHasKey) return false;\n\n if (objectKeys.indexOf(pairKey) === -1) objectKeys.push(pairKey);\n else return false;\n }\n\n return true;\n}\n\nfunction constructYamlOmap(data) {\n return data !== null ? data : [];\n}\n\nmodule.exports = new Type('tag:yaml.org,2002:omap', {\n kind: 'sequence',\n resolve: resolveYamlOmap,\n construct: constructYamlOmap\n});\n","'use strict';\n\nvar Type = require('../type');\n\nvar _toString = Object.prototype.toString;\n\nfunction resolveYamlPairs(data) {\n if (data === null) return true;\n\n var index, length, pair, keys, result,\n object = data;\n\n result = new Array(object.length);\n\n for (index = 0, length = object.length; index < length; index += 1) {\n pair = object[index];\n\n if (_toString.call(pair) !== '[object Object]') return false;\n\n keys = Object.keys(pair);\n\n if (keys.length !== 1) return false;\n\n result[index] = [ keys[0], pair[keys[0]] ];\n }\n\n return true;\n}\n\nfunction constructYamlPairs(data) {\n if (data === null) return [];\n\n var index, length, pair, keys, result,\n object = data;\n\n result = new Array(object.length);\n\n for (index = 0, length = object.length; index < length; index += 1) {\n pair = object[index];\n\n keys = Object.keys(pair);\n\n result[index] = [ keys[0], pair[keys[0]] ];\n }\n\n return result;\n}\n\nmodule.exports = new Type('tag:yaml.org,2002:pairs', {\n kind: 'sequence',\n resolve: resolveYamlPairs,\n construct: constructYamlPairs\n});\n","'use strict';\n\nvar Type = require('../type');\n\nmodule.exports = new Type('tag:yaml.org,2002:seq', {\n kind: 'sequence',\n construct: function (data) { return data !== null ? data : []; }\n});\n","'use strict';\n\nvar Type = require('../type');\n\nvar _hasOwnProperty = Object.prototype.hasOwnProperty;\n\nfunction resolveYamlSet(data) {\n if (data === null) return true;\n\n var key, object = data;\n\n for (key in object) {\n if (_hasOwnProperty.call(object, key)) {\n if (object[key] !== null) return false;\n }\n }\n\n return true;\n}\n\nfunction constructYamlSet(data) {\n return data !== null ? data : {};\n}\n\nmodule.exports = new Type('tag:yaml.org,2002:set', {\n kind: 'mapping',\n resolve: resolveYamlSet,\n construct: constructYamlSet\n});\n","'use strict';\n\nvar Type = require('../type');\n\nmodule.exports = new Type('tag:yaml.org,2002:str', {\n kind: 'scalar',\n construct: function (data) { return data !== null ? data : ''; }\n});\n","'use strict';\n\nvar Type = require('../type');\n\nvar YAML_DATE_REGEXP = new RegExp(\n '^([0-9][0-9][0-9][0-9])' + // [1] year\n '-([0-9][0-9])' + // [2] month\n '-([0-9][0-9])$'); // [3] day\n\nvar YAML_TIMESTAMP_REGEXP = new RegExp(\n '^([0-9][0-9][0-9][0-9])' + // [1] year\n '-([0-9][0-9]?)' + // [2] month\n '-([0-9][0-9]?)' + // [3] day\n '(?:[Tt]|[ \\\\t]+)' + // ...\n '([0-9][0-9]?)' + // [4] hour\n ':([0-9][0-9])' + // [5] minute\n ':([0-9][0-9])' + // [6] second\n '(?:\\\\.([0-9]*))?' + // [7] fraction\n '(?:[ \\\\t]*(Z|([-+])([0-9][0-9]?)' + // [8] tz [9] tz_sign [10] tz_hour\n '(?::([0-9][0-9]))?))?$'); // [11] tz_minute\n\nfunction resolveYamlTimestamp(data) {\n if (data === null) return false;\n if (YAML_DATE_REGEXP.exec(data) !== null) return true;\n if (YAML_TIMESTAMP_REGEXP.exec(data) !== null) return true;\n return false;\n}\n\nfunction constructYamlTimestamp(data) {\n var match, year, month, day, hour, minute, second, fraction = 0,\n delta = null, tz_hour, tz_minute, date;\n\n match = YAML_DATE_REGEXP.exec(data);\n if (match === null) match = YAML_TIMESTAMP_REGEXP.exec(data);\n\n if (match === null) throw new Error('Date resolve error');\n\n // match: [1] year [2] month [3] day\n\n year = +(match[1]);\n month = +(match[2]) - 1; // JS month starts with 0\n day = +(match[3]);\n\n if (!match[4]) { // no hour\n return new Date(Date.UTC(year, month, day));\n }\n\n // match: [4] hour [5] minute [6] second [7] fraction\n\n hour = +(match[4]);\n minute = +(match[5]);\n second = +(match[6]);\n\n if (match[7]) {\n fraction = match[7].slice(0, 3);\n while (fraction.length < 3) { // milli-seconds\n fraction += '0';\n }\n fraction = +fraction;\n }\n\n // match: [8] tz [9] tz_sign [10] tz_hour [11] tz_minute\n\n if (match[9]) {\n tz_hour = +(match[10]);\n tz_minute = +(match[11] || 0);\n delta = (tz_hour * 60 + tz_minute) * 60000; // delta in mili-seconds\n if (match[9] === '-') delta = -delta;\n }\n\n date = new Date(Date.UTC(year, month, day, hour, minute, second, fraction));\n\n if (delta) date.setTime(date.getTime() - delta);\n\n return date;\n}\n\nfunction representYamlTimestamp(object /*, style*/) {\n return object.toISOString();\n}\n\nmodule.exports = new Type('tag:yaml.org,2002:timestamp', {\n kind: 'scalar',\n resolve: resolveYamlTimestamp,\n construct: constructYamlTimestamp,\n instanceOf: Date,\n represent: representYamlTimestamp\n});\n","(function(){\n\n // Copyright (c) 2005 Tom Wu\n // All Rights Reserved.\n // See \"LICENSE\" for details.\n\n // Basic JavaScript BN library - subset useful for RSA encryption.\n\n // Bits per digit\n var dbits;\n\n // JavaScript engine analysis\n var canary = 0xdeadbeefcafe;\n var j_lm = ((canary&0xffffff)==0xefcafe);\n\n // (public) Constructor\n function BigInteger(a,b,c) {\n if(a != null)\n if(\"number\" == typeof a) this.fromNumber(a,b,c);\n else if(b == null && \"string\" != typeof a) this.fromString(a,256);\n else this.fromString(a,b);\n }\n\n // return new, unset BigInteger\n function nbi() { return new BigInteger(null); }\n\n // am: Compute w_j += (x*this_i), propagate carries,\n // c is initial carry, returns final carry.\n // c < 3*dvalue, x < 2*dvalue, this_i < dvalue\n // We need to select the fastest one that works in this environment.\n\n // am1: use a single mult and divide to get the high bits,\n // max digit bits should be 26 because\n // max internal value = 2*dvalue^2-2*dvalue (< 2^53)\n function am1(i,x,w,j,c,n) {\n while(--n >= 0) {\n var v = x*this[i++]+w[j]+c;\n c = Math.floor(v/0x4000000);\n w[j++] = v&0x3ffffff;\n }\n return c;\n }\n // am2 avoids a big mult-and-extract completely.\n // Max digit bits should be <= 30 because we do bitwise ops\n // on values up to 2*hdvalue^2-hdvalue-1 (< 2^31)\n function am2(i,x,w,j,c,n) {\n var xl = x&0x7fff, xh = x>>15;\n while(--n >= 0) {\n var l = this[i]&0x7fff;\n var h = this[i++]>>15;\n var m = xh*l+h*xl;\n l = xl*l+((m&0x7fff)<<15)+w[j]+(c&0x3fffffff);\n c = (l>>>30)+(m>>>15)+xh*h+(c>>>30);\n w[j++] = l&0x3fffffff;\n }\n return c;\n }\n // Alternately, set max digit bits to 28 since some\n // browsers slow down when dealing with 32-bit numbers.\n function am3(i,x,w,j,c,n) {\n var xl = x&0x3fff, xh = x>>14;\n while(--n >= 0) {\n var l = this[i]&0x3fff;\n var h = this[i++]>>14;\n var m = xh*l+h*xl;\n l = xl*l+((m&0x3fff)<<14)+w[j]+c;\n c = (l>>28)+(m>>14)+xh*h;\n w[j++] = l&0xfffffff;\n }\n return c;\n }\n var inBrowser = typeof navigator !== \"undefined\";\n if(inBrowser && j_lm && (navigator.appName == \"Microsoft Internet Explorer\")) {\n BigInteger.prototype.am = am2;\n dbits = 30;\n }\n else if(inBrowser && j_lm && (navigator.appName != \"Netscape\")) {\n BigInteger.prototype.am = am1;\n dbits = 26;\n }\n else { // Mozilla/Netscape seems to prefer am3\n BigInteger.prototype.am = am3;\n dbits = 28;\n }\n\n BigInteger.prototype.DB = dbits;\n BigInteger.prototype.DM = ((1<= 0; --i) r[i] = this[i];\n r.t = this.t;\n r.s = this.s;\n }\n\n // (protected) set from integer value x, -DV <= x < DV\n function bnpFromInt(x) {\n this.t = 1;\n this.s = (x<0)?-1:0;\n if(x > 0) this[0] = x;\n else if(x < -1) this[0] = x+this.DV;\n else this.t = 0;\n }\n\n // return bigint initialized to value\n function nbv(i) { var r = nbi(); r.fromInt(i); return r; }\n\n // (protected) set from string and radix\n function bnpFromString(s,b) {\n var k;\n if(b == 16) k = 4;\n else if(b == 8) k = 3;\n else if(b == 256) k = 8; // byte array\n else if(b == 2) k = 1;\n else if(b == 32) k = 5;\n else if(b == 4) k = 2;\n else { this.fromRadix(s,b); return; }\n this.t = 0;\n this.s = 0;\n var i = s.length, mi = false, sh = 0;\n while(--i >= 0) {\n var x = (k==8)?s[i]&0xff:intAt(s,i);\n if(x < 0) {\n if(s.charAt(i) == \"-\") mi = true;\n continue;\n }\n mi = false;\n if(sh == 0)\n this[this.t++] = x;\n else if(sh+k > this.DB) {\n this[this.t-1] |= (x&((1<<(this.DB-sh))-1))<>(this.DB-sh));\n }\n else\n this[this.t-1] |= x<= this.DB) sh -= this.DB;\n }\n if(k == 8 && (s[0]&0x80) != 0) {\n this.s = -1;\n if(sh > 0) this[this.t-1] |= ((1<<(this.DB-sh))-1)< 0 && this[this.t-1] == c) --this.t;\n }\n\n // (public) return string representation in given radix\n function bnToString(b) {\n if(this.s < 0) return \"-\"+this.negate().toString(b);\n var k;\n if(b == 16) k = 4;\n else if(b == 8) k = 3;\n else if(b == 2) k = 1;\n else if(b == 32) k = 5;\n else if(b == 4) k = 2;\n else return this.toRadix(b);\n var km = (1< 0) {\n if(p < this.DB && (d = this[i]>>p) > 0) { m = true; r = int2char(d); }\n while(i >= 0) {\n if(p < k) {\n d = (this[i]&((1<>(p+=this.DB-k);\n }\n else {\n d = (this[i]>>(p-=k))&km;\n if(p <= 0) { p += this.DB; --i; }\n }\n if(d > 0) m = true;\n if(m) r += int2char(d);\n }\n }\n return m?r:\"0\";\n }\n\n // (public) -this\n function bnNegate() { var r = nbi(); BigInteger.ZERO.subTo(this,r); return r; }\n\n // (public) |this|\n function bnAbs() { return (this.s<0)?this.negate():this; }\n\n // (public) return + if this > a, - if this < a, 0 if equal\n function bnCompareTo(a) {\n var r = this.s-a.s;\n if(r != 0) return r;\n var i = this.t;\n r = i-a.t;\n if(r != 0) return (this.s<0)?-r:r;\n while(--i >= 0) if((r=this[i]-a[i]) != 0) return r;\n return 0;\n }\n\n // returns bit length of the integer x\n function nbits(x) {\n var r = 1, t;\n if((t=x>>>16) != 0) { x = t; r += 16; }\n if((t=x>>8) != 0) { x = t; r += 8; }\n if((t=x>>4) != 0) { x = t; r += 4; }\n if((t=x>>2) != 0) { x = t; r += 2; }\n if((t=x>>1) != 0) { x = t; r += 1; }\n return r;\n }\n\n // (public) return the number of bits in \"this\"\n function bnBitLength() {\n if(this.t <= 0) return 0;\n return this.DB*(this.t-1)+nbits(this[this.t-1]^(this.s&this.DM));\n }\n\n // (protected) r = this << n*DB\n function bnpDLShiftTo(n,r) {\n var i;\n for(i = this.t-1; i >= 0; --i) r[i+n] = this[i];\n for(i = n-1; i >= 0; --i) r[i] = 0;\n r.t = this.t+n;\n r.s = this.s;\n }\n\n // (protected) r = this >> n*DB\n function bnpDRShiftTo(n,r) {\n for(var i = n; i < this.t; ++i) r[i-n] = this[i];\n r.t = Math.max(this.t-n,0);\n r.s = this.s;\n }\n\n // (protected) r = this << n\n function bnpLShiftTo(n,r) {\n var bs = n%this.DB;\n var cbs = this.DB-bs;\n var bm = (1<= 0; --i) {\n r[i+ds+1] = (this[i]>>cbs)|c;\n c = (this[i]&bm)<= 0; --i) r[i] = 0;\n r[ds] = c;\n r.t = this.t+ds+1;\n r.s = this.s;\n r.clamp();\n }\n\n // (protected) r = this >> n\n function bnpRShiftTo(n,r) {\n r.s = this.s;\n var ds = Math.floor(n/this.DB);\n if(ds >= this.t) { r.t = 0; return; }\n var bs = n%this.DB;\n var cbs = this.DB-bs;\n var bm = (1<>bs;\n for(var i = ds+1; i < this.t; ++i) {\n r[i-ds-1] |= (this[i]&bm)<>bs;\n }\n if(bs > 0) r[this.t-ds-1] |= (this.s&bm)<>= this.DB;\n }\n if(a.t < this.t) {\n c -= a.s;\n while(i < this.t) {\n c += this[i];\n r[i++] = c&this.DM;\n c >>= this.DB;\n }\n c += this.s;\n }\n else {\n c += this.s;\n while(i < a.t) {\n c -= a[i];\n r[i++] = c&this.DM;\n c >>= this.DB;\n }\n c -= a.s;\n }\n r.s = (c<0)?-1:0;\n if(c < -1) r[i++] = this.DV+c;\n else if(c > 0) r[i++] = c;\n r.t = i;\n r.clamp();\n }\n\n // (protected) r = this * a, r != this,a (HAC 14.12)\n // \"this\" should be the larger one if appropriate.\n function bnpMultiplyTo(a,r) {\n var x = this.abs(), y = a.abs();\n var i = x.t;\n r.t = i+y.t;\n while(--i >= 0) r[i] = 0;\n for(i = 0; i < y.t; ++i) r[i+x.t] = x.am(0,y[i],r,i,0,x.t);\n r.s = 0;\n r.clamp();\n if(this.s != a.s) BigInteger.ZERO.subTo(r,r);\n }\n\n // (protected) r = this^2, r != this (HAC 14.16)\n function bnpSquareTo(r) {\n var x = this.abs();\n var i = r.t = 2*x.t;\n while(--i >= 0) r[i] = 0;\n for(i = 0; i < x.t-1; ++i) {\n var c = x.am(i,x[i],r,2*i,0,1);\n if((r[i+x.t]+=x.am(i+1,2*x[i],r,2*i+1,c,x.t-i-1)) >= x.DV) {\n r[i+x.t] -= x.DV;\n r[i+x.t+1] = 1;\n }\n }\n if(r.t > 0) r[r.t-1] += x.am(i,x[i],r,2*i,0,1);\n r.s = 0;\n r.clamp();\n }\n\n // (protected) divide this by m, quotient and remainder to q, r (HAC 14.20)\n // r != q, this != m. q or r may be null.\n function bnpDivRemTo(m,q,r) {\n var pm = m.abs();\n if(pm.t <= 0) return;\n var pt = this.abs();\n if(pt.t < pm.t) {\n if(q != null) q.fromInt(0);\n if(r != null) this.copyTo(r);\n return;\n }\n if(r == null) r = nbi();\n var y = nbi(), ts = this.s, ms = m.s;\n var nsh = this.DB-nbits(pm[pm.t-1]); // normalize modulus\n if(nsh > 0) { pm.lShiftTo(nsh,y); pt.lShiftTo(nsh,r); }\n else { pm.copyTo(y); pt.copyTo(r); }\n var ys = y.t;\n var y0 = y[ys-1];\n if(y0 == 0) return;\n var yt = y0*(1<1)?y[ys-2]>>this.F2:0);\n var d1 = this.FV/yt, d2 = (1<= 0) {\n r[r.t++] = 1;\n r.subTo(t,r);\n }\n BigInteger.ONE.dlShiftTo(ys,t);\n t.subTo(y,y); // \"negative\" y so we can replace sub with am later\n while(y.t < ys) y[y.t++] = 0;\n while(--j >= 0) {\n // Estimate quotient digit\n var qd = (r[--i]==y0)?this.DM:Math.floor(r[i]*d1+(r[i-1]+e)*d2);\n if((r[i]+=y.am(0,qd,r,j,0,ys)) < qd) { // Try it out\n y.dlShiftTo(j,t);\n r.subTo(t,r);\n while(r[i] < --qd) r.subTo(t,r);\n }\n }\n if(q != null) {\n r.drShiftTo(ys,q);\n if(ts != ms) BigInteger.ZERO.subTo(q,q);\n }\n r.t = ys;\n r.clamp();\n if(nsh > 0) r.rShiftTo(nsh,r); // Denormalize remainder\n if(ts < 0) BigInteger.ZERO.subTo(r,r);\n }\n\n // (public) this mod a\n function bnMod(a) {\n var r = nbi();\n this.abs().divRemTo(a,null,r);\n if(this.s < 0 && r.compareTo(BigInteger.ZERO) > 0) a.subTo(r,r);\n return r;\n }\n\n // Modular reduction using \"classic\" algorithm\n function Classic(m) { this.m = m; }\n function cConvert(x) {\n if(x.s < 0 || x.compareTo(this.m) >= 0) return x.mod(this.m);\n else return x;\n }\n function cRevert(x) { return x; }\n function cReduce(x) { x.divRemTo(this.m,null,x); }\n function cMulTo(x,y,r) { x.multiplyTo(y,r); this.reduce(r); }\n function cSqrTo(x,r) { x.squareTo(r); this.reduce(r); }\n\n Classic.prototype.convert = cConvert;\n Classic.prototype.revert = cRevert;\n Classic.prototype.reduce = cReduce;\n Classic.prototype.mulTo = cMulTo;\n Classic.prototype.sqrTo = cSqrTo;\n\n // (protected) return \"-1/this % 2^DB\"; useful for Mont. reduction\n // justification:\n // xy == 1 (mod m)\n // xy = 1+km\n // xy(2-xy) = (1+km)(1-km)\n // x[y(2-xy)] = 1-k^2m^2\n // x[y(2-xy)] == 1 (mod m^2)\n // if y is 1/x mod m, then y(2-xy) is 1/x mod m^2\n // should reduce x and y(2-xy) by m^2 at each step to keep size bounded.\n // JS multiply \"overflows\" differently from C/C++, so care is needed here.\n function bnpInvDigit() {\n if(this.t < 1) return 0;\n var x = this[0];\n if((x&1) == 0) return 0;\n var y = x&3; // y == 1/x mod 2^2\n y = (y*(2-(x&0xf)*y))&0xf; // y == 1/x mod 2^4\n y = (y*(2-(x&0xff)*y))&0xff; // y == 1/x mod 2^8\n y = (y*(2-(((x&0xffff)*y)&0xffff)))&0xffff; // y == 1/x mod 2^16\n // last step - calculate inverse mod DV directly;\n // assumes 16 < DB <= 32 and assumes ability to handle 48-bit ints\n y = (y*(2-x*y%this.DV))%this.DV; // y == 1/x mod 2^dbits\n // we really want the negative inverse, and -DV < y < DV\n return (y>0)?this.DV-y:-y;\n }\n\n // Montgomery reduction\n function Montgomery(m) {\n this.m = m;\n this.mp = m.invDigit();\n this.mpl = this.mp&0x7fff;\n this.mph = this.mp>>15;\n this.um = (1<<(m.DB-15))-1;\n this.mt2 = 2*m.t;\n }\n\n // xR mod m\n function montConvert(x) {\n var r = nbi();\n x.abs().dlShiftTo(this.m.t,r);\n r.divRemTo(this.m,null,r);\n if(x.s < 0 && r.compareTo(BigInteger.ZERO) > 0) this.m.subTo(r,r);\n return r;\n }\n\n // x/R mod m\n function montRevert(x) {\n var r = nbi();\n x.copyTo(r);\n this.reduce(r);\n return r;\n }\n\n // x = x/R mod m (HAC 14.32)\n function montReduce(x) {\n while(x.t <= this.mt2) // pad x so am has enough room later\n x[x.t++] = 0;\n for(var i = 0; i < this.m.t; ++i) {\n // faster way of calculating u0 = x[i]*mp mod DV\n var j = x[i]&0x7fff;\n var u0 = (j*this.mpl+(((j*this.mph+(x[i]>>15)*this.mpl)&this.um)<<15))&x.DM;\n // use am to combine the multiply-shift-add into one call\n j = i+this.m.t;\n x[j] += this.m.am(0,u0,x,i,0,this.m.t);\n // propagate carry\n while(x[j] >= x.DV) { x[j] -= x.DV; x[++j]++; }\n }\n x.clamp();\n x.drShiftTo(this.m.t,x);\n if(x.compareTo(this.m) >= 0) x.subTo(this.m,x);\n }\n\n // r = \"x^2/R mod m\"; x != r\n function montSqrTo(x,r) { x.squareTo(r); this.reduce(r); }\n\n // r = \"xy/R mod m\"; x,y != r\n function montMulTo(x,y,r) { x.multiplyTo(y,r); this.reduce(r); }\n\n Montgomery.prototype.convert = montConvert;\n Montgomery.prototype.revert = montRevert;\n Montgomery.prototype.reduce = montReduce;\n Montgomery.prototype.mulTo = montMulTo;\n Montgomery.prototype.sqrTo = montSqrTo;\n\n // (protected) true iff this is even\n function bnpIsEven() { return ((this.t>0)?(this[0]&1):this.s) == 0; }\n\n // (protected) this^e, e < 2^32, doing sqr and mul with \"r\" (HAC 14.79)\n function bnpExp(e,z) {\n if(e > 0xffffffff || e < 1) return BigInteger.ONE;\n var r = nbi(), r2 = nbi(), g = z.convert(this), i = nbits(e)-1;\n g.copyTo(r);\n while(--i >= 0) {\n z.sqrTo(r,r2);\n if((e&(1< 0) z.mulTo(r2,g,r);\n else { var t = r; r = r2; r2 = t; }\n }\n return z.revert(r);\n }\n\n // (public) this^e % m, 0 <= e < 2^32\n function bnModPowInt(e,m) {\n var z;\n if(e < 256 || m.isEven()) z = new Classic(m); else z = new Montgomery(m);\n return this.exp(e,z);\n }\n\n // protected\n BigInteger.prototype.copyTo = bnpCopyTo;\n BigInteger.prototype.fromInt = bnpFromInt;\n BigInteger.prototype.fromString = bnpFromString;\n BigInteger.prototype.clamp = bnpClamp;\n BigInteger.prototype.dlShiftTo = bnpDLShiftTo;\n BigInteger.prototype.drShiftTo = bnpDRShiftTo;\n BigInteger.prototype.lShiftTo = bnpLShiftTo;\n BigInteger.prototype.rShiftTo = bnpRShiftTo;\n BigInteger.prototype.subTo = bnpSubTo;\n BigInteger.prototype.multiplyTo = bnpMultiplyTo;\n BigInteger.prototype.squareTo = bnpSquareTo;\n BigInteger.prototype.divRemTo = bnpDivRemTo;\n BigInteger.prototype.invDigit = bnpInvDigit;\n BigInteger.prototype.isEven = bnpIsEven;\n BigInteger.prototype.exp = bnpExp;\n\n // public\n BigInteger.prototype.toString = bnToString;\n BigInteger.prototype.negate = bnNegate;\n BigInteger.prototype.abs = bnAbs;\n BigInteger.prototype.compareTo = bnCompareTo;\n BigInteger.prototype.bitLength = bnBitLength;\n BigInteger.prototype.mod = bnMod;\n BigInteger.prototype.modPowInt = bnModPowInt;\n\n // \"constants\"\n BigInteger.ZERO = nbv(0);\n BigInteger.ONE = nbv(1);\n\n // Copyright (c) 2005-2009 Tom Wu\n // All Rights Reserved.\n // See \"LICENSE\" for details.\n\n // Extended JavaScript BN functions, required for RSA private ops.\n\n // Version 1.1: new BigInteger(\"0\", 10) returns \"proper\" zero\n // Version 1.2: square() API, isProbablePrime fix\n\n // (public)\n function bnClone() { var r = nbi(); this.copyTo(r); return r; }\n\n // (public) return value as integer\n function bnIntValue() {\n if(this.s < 0) {\n if(this.t == 1) return this[0]-this.DV;\n else if(this.t == 0) return -1;\n }\n else if(this.t == 1) return this[0];\n else if(this.t == 0) return 0;\n // assumes 16 < DB < 32\n return ((this[1]&((1<<(32-this.DB))-1))<>24; }\n\n // (public) return value as short (assumes DB>=16)\n function bnShortValue() { return (this.t==0)?this.s:(this[0]<<16)>>16; }\n\n // (protected) return x s.t. r^x < DV\n function bnpChunkSize(r) { return Math.floor(Math.LN2*this.DB/Math.log(r)); }\n\n // (public) 0 if this == 0, 1 if this > 0\n function bnSigNum() {\n if(this.s < 0) return -1;\n else if(this.t <= 0 || (this.t == 1 && this[0] <= 0)) return 0;\n else return 1;\n }\n\n // (protected) convert to radix string\n function bnpToRadix(b) {\n if(b == null) b = 10;\n if(this.signum() == 0 || b < 2 || b > 36) return \"0\";\n var cs = this.chunkSize(b);\n var a = Math.pow(b,cs);\n var d = nbv(a), y = nbi(), z = nbi(), r = \"\";\n this.divRemTo(d,y,z);\n while(y.signum() > 0) {\n r = (a+z.intValue()).toString(b).substr(1) + r;\n y.divRemTo(d,y,z);\n }\n return z.intValue().toString(b) + r;\n }\n\n // (protected) convert from radix string\n function bnpFromRadix(s,b) {\n this.fromInt(0);\n if(b == null) b = 10;\n var cs = this.chunkSize(b);\n var d = Math.pow(b,cs), mi = false, j = 0, w = 0;\n for(var i = 0; i < s.length; ++i) {\n var x = intAt(s,i);\n if(x < 0) {\n if(s.charAt(i) == \"-\" && this.signum() == 0) mi = true;\n continue;\n }\n w = b*w+x;\n if(++j >= cs) {\n this.dMultiply(d);\n this.dAddOffset(w,0);\n j = 0;\n w = 0;\n }\n }\n if(j > 0) {\n this.dMultiply(Math.pow(b,j));\n this.dAddOffset(w,0);\n }\n if(mi) BigInteger.ZERO.subTo(this,this);\n }\n\n // (protected) alternate constructor\n function bnpFromNumber(a,b,c) {\n if(\"number\" == typeof b) {\n // new BigInteger(int,int,RNG)\n if(a < 2) this.fromInt(1);\n else {\n this.fromNumber(a,c);\n if(!this.testBit(a-1))\t// force MSB set\n this.bitwiseTo(BigInteger.ONE.shiftLeft(a-1),op_or,this);\n if(this.isEven()) this.dAddOffset(1,0); // force odd\n while(!this.isProbablePrime(b)) {\n this.dAddOffset(2,0);\n if(this.bitLength() > a) this.subTo(BigInteger.ONE.shiftLeft(a-1),this);\n }\n }\n }\n else {\n // new BigInteger(int,RNG)\n var x = new Array(), t = a&7;\n x.length = (a>>3)+1;\n b.nextBytes(x);\n if(t > 0) x[0] &= ((1< 0) {\n if(p < this.DB && (d = this[i]>>p) != (this.s&this.DM)>>p)\n r[k++] = d|(this.s<<(this.DB-p));\n while(i >= 0) {\n if(p < 8) {\n d = (this[i]&((1<>(p+=this.DB-8);\n }\n else {\n d = (this[i]>>(p-=8))&0xff;\n if(p <= 0) { p += this.DB; --i; }\n }\n if((d&0x80) != 0) d |= -256;\n if(k == 0 && (this.s&0x80) != (d&0x80)) ++k;\n if(k > 0 || d != this.s) r[k++] = d;\n }\n }\n return r;\n }\n\n function bnEquals(a) { return(this.compareTo(a)==0); }\n function bnMin(a) { return(this.compareTo(a)<0)?this:a; }\n function bnMax(a) { return(this.compareTo(a)>0)?this:a; }\n\n // (protected) r = this op a (bitwise)\n function bnpBitwiseTo(a,op,r) {\n var i, f, m = Math.min(a.t,this.t);\n for(i = 0; i < m; ++i) r[i] = op(this[i],a[i]);\n if(a.t < this.t) {\n f = a.s&this.DM;\n for(i = m; i < this.t; ++i) r[i] = op(this[i],f);\n r.t = this.t;\n }\n else {\n f = this.s&this.DM;\n for(i = m; i < a.t; ++i) r[i] = op(f,a[i]);\n r.t = a.t;\n }\n r.s = op(this.s,a.s);\n r.clamp();\n }\n\n // (public) this & a\n function op_and(x,y) { return x&y; }\n function bnAnd(a) { var r = nbi(); this.bitwiseTo(a,op_and,r); return r; }\n\n // (public) this | a\n function op_or(x,y) { return x|y; }\n function bnOr(a) { var r = nbi(); this.bitwiseTo(a,op_or,r); return r; }\n\n // (public) this ^ a\n function op_xor(x,y) { return x^y; }\n function bnXor(a) { var r = nbi(); this.bitwiseTo(a,op_xor,r); return r; }\n\n // (public) this & ~a\n function op_andnot(x,y) { return x&~y; }\n function bnAndNot(a) { var r = nbi(); this.bitwiseTo(a,op_andnot,r); return r; }\n\n // (public) ~this\n function bnNot() {\n var r = nbi();\n for(var i = 0; i < this.t; ++i) r[i] = this.DM&~this[i];\n r.t = this.t;\n r.s = ~this.s;\n return r;\n }\n\n // (public) this << n\n function bnShiftLeft(n) {\n var r = nbi();\n if(n < 0) this.rShiftTo(-n,r); else this.lShiftTo(n,r);\n return r;\n }\n\n // (public) this >> n\n function bnShiftRight(n) {\n var r = nbi();\n if(n < 0) this.lShiftTo(-n,r); else this.rShiftTo(n,r);\n return r;\n }\n\n // return index of lowest 1-bit in x, x < 2^31\n function lbit(x) {\n if(x == 0) return -1;\n var r = 0;\n if((x&0xffff) == 0) { x >>= 16; r += 16; }\n if((x&0xff) == 0) { x >>= 8; r += 8; }\n if((x&0xf) == 0) { x >>= 4; r += 4; }\n if((x&3) == 0) { x >>= 2; r += 2; }\n if((x&1) == 0) ++r;\n return r;\n }\n\n // (public) returns index of lowest 1-bit (or -1 if none)\n function bnGetLowestSetBit() {\n for(var i = 0; i < this.t; ++i)\n if(this[i] != 0) return i*this.DB+lbit(this[i]);\n if(this.s < 0) return this.t*this.DB;\n return -1;\n }\n\n // return number of 1 bits in x\n function cbit(x) {\n var r = 0;\n while(x != 0) { x &= x-1; ++r; }\n return r;\n }\n\n // (public) return number of set bits\n function bnBitCount() {\n var r = 0, x = this.s&this.DM;\n for(var i = 0; i < this.t; ++i) r += cbit(this[i]^x);\n return r;\n }\n\n // (public) true iff nth bit is set\n function bnTestBit(n) {\n var j = Math.floor(n/this.DB);\n if(j >= this.t) return(this.s!=0);\n return((this[j]&(1<<(n%this.DB)))!=0);\n }\n\n // (protected) this op (1<>= this.DB;\n }\n if(a.t < this.t) {\n c += a.s;\n while(i < this.t) {\n c += this[i];\n r[i++] = c&this.DM;\n c >>= this.DB;\n }\n c += this.s;\n }\n else {\n c += this.s;\n while(i < a.t) {\n c += a[i];\n r[i++] = c&this.DM;\n c >>= this.DB;\n }\n c += a.s;\n }\n r.s = (c<0)?-1:0;\n if(c > 0) r[i++] = c;\n else if(c < -1) r[i++] = this.DV+c;\n r.t = i;\n r.clamp();\n }\n\n // (public) this + a\n function bnAdd(a) { var r = nbi(); this.addTo(a,r); return r; }\n\n // (public) this - a\n function bnSubtract(a) { var r = nbi(); this.subTo(a,r); return r; }\n\n // (public) this * a\n function bnMultiply(a) { var r = nbi(); this.multiplyTo(a,r); return r; }\n\n // (public) this^2\n function bnSquare() { var r = nbi(); this.squareTo(r); return r; }\n\n // (public) this / a\n function bnDivide(a) { var r = nbi(); this.divRemTo(a,r,null); return r; }\n\n // (public) this % a\n function bnRemainder(a) { var r = nbi(); this.divRemTo(a,null,r); return r; }\n\n // (public) [this/a,this%a]\n function bnDivideAndRemainder(a) {\n var q = nbi(), r = nbi();\n this.divRemTo(a,q,r);\n return new Array(q,r);\n }\n\n // (protected) this *= n, this >= 0, 1 < n < DV\n function bnpDMultiply(n) {\n this[this.t] = this.am(0,n-1,this,0,0,this.t);\n ++this.t;\n this.clamp();\n }\n\n // (protected) this += n << w words, this >= 0\n function bnpDAddOffset(n,w) {\n if(n == 0) return;\n while(this.t <= w) this[this.t++] = 0;\n this[w] += n;\n while(this[w] >= this.DV) {\n this[w] -= this.DV;\n if(++w >= this.t) this[this.t++] = 0;\n ++this[w];\n }\n }\n\n // A \"null\" reducer\n function NullExp() {}\n function nNop(x) { return x; }\n function nMulTo(x,y,r) { x.multiplyTo(y,r); }\n function nSqrTo(x,r) { x.squareTo(r); }\n\n NullExp.prototype.convert = nNop;\n NullExp.prototype.revert = nNop;\n NullExp.prototype.mulTo = nMulTo;\n NullExp.prototype.sqrTo = nSqrTo;\n\n // (public) this^e\n function bnPow(e) { return this.exp(e,new NullExp()); }\n\n // (protected) r = lower n words of \"this * a\", a.t <= n\n // \"this\" should be the larger one if appropriate.\n function bnpMultiplyLowerTo(a,n,r) {\n var i = Math.min(this.t+a.t,n);\n r.s = 0; // assumes a,this >= 0\n r.t = i;\n while(i > 0) r[--i] = 0;\n var j;\n for(j = r.t-this.t; i < j; ++i) r[i+this.t] = this.am(0,a[i],r,i,0,this.t);\n for(j = Math.min(a.t,n); i < j; ++i) this.am(0,a[i],r,i,0,n-i);\n r.clamp();\n }\n\n // (protected) r = \"this * a\" without lower n words, n > 0\n // \"this\" should be the larger one if appropriate.\n function bnpMultiplyUpperTo(a,n,r) {\n --n;\n var i = r.t = this.t+a.t-n;\n r.s = 0; // assumes a,this >= 0\n while(--i >= 0) r[i] = 0;\n for(i = Math.max(n-this.t,0); i < a.t; ++i)\n r[this.t+i-n] = this.am(n-i,a[i],r,0,0,this.t+i-n);\n r.clamp();\n r.drShiftTo(1,r);\n }\n\n // Barrett modular reduction\n function Barrett(m) {\n // setup Barrett\n this.r2 = nbi();\n this.q3 = nbi();\n BigInteger.ONE.dlShiftTo(2*m.t,this.r2);\n this.mu = this.r2.divide(m);\n this.m = m;\n }\n\n function barrettConvert(x) {\n if(x.s < 0 || x.t > 2*this.m.t) return x.mod(this.m);\n else if(x.compareTo(this.m) < 0) return x;\n else { var r = nbi(); x.copyTo(r); this.reduce(r); return r; }\n }\n\n function barrettRevert(x) { return x; }\n\n // x = x mod m (HAC 14.42)\n function barrettReduce(x) {\n x.drShiftTo(this.m.t-1,this.r2);\n if(x.t > this.m.t+1) { x.t = this.m.t+1; x.clamp(); }\n this.mu.multiplyUpperTo(this.r2,this.m.t+1,this.q3);\n this.m.multiplyLowerTo(this.q3,this.m.t+1,this.r2);\n while(x.compareTo(this.r2) < 0) x.dAddOffset(1,this.m.t+1);\n x.subTo(this.r2,x);\n while(x.compareTo(this.m) >= 0) x.subTo(this.m,x);\n }\n\n // r = x^2 mod m; x != r\n function barrettSqrTo(x,r) { x.squareTo(r); this.reduce(r); }\n\n // r = x*y mod m; x,y != r\n function barrettMulTo(x,y,r) { x.multiplyTo(y,r); this.reduce(r); }\n\n Barrett.prototype.convert = barrettConvert;\n Barrett.prototype.revert = barrettRevert;\n Barrett.prototype.reduce = barrettReduce;\n Barrett.prototype.mulTo = barrettMulTo;\n Barrett.prototype.sqrTo = barrettSqrTo;\n\n // (public) this^e % m (HAC 14.85)\n function bnModPow(e,m) {\n var i = e.bitLength(), k, r = nbv(1), z;\n if(i <= 0) return r;\n else if(i < 18) k = 1;\n else if(i < 48) k = 3;\n else if(i < 144) k = 4;\n else if(i < 768) k = 5;\n else k = 6;\n if(i < 8)\n z = new Classic(m);\n else if(m.isEven())\n z = new Barrett(m);\n else\n z = new Montgomery(m);\n\n // precomputation\n var g = new Array(), n = 3, k1 = k-1, km = (1< 1) {\n var g2 = nbi();\n z.sqrTo(g[1],g2);\n while(n <= km) {\n g[n] = nbi();\n z.mulTo(g2,g[n-2],g[n]);\n n += 2;\n }\n }\n\n var j = e.t-1, w, is1 = true, r2 = nbi(), t;\n i = nbits(e[j])-1;\n while(j >= 0) {\n if(i >= k1) w = (e[j]>>(i-k1))&km;\n else {\n w = (e[j]&((1<<(i+1))-1))<<(k1-i);\n if(j > 0) w |= e[j-1]>>(this.DB+i-k1);\n }\n\n n = k;\n while((w&1) == 0) { w >>= 1; --n; }\n if((i -= n) < 0) { i += this.DB; --j; }\n if(is1) {\t// ret == 1, don't bother squaring or multiplying it\n g[w].copyTo(r);\n is1 = false;\n }\n else {\n while(n > 1) { z.sqrTo(r,r2); z.sqrTo(r2,r); n -= 2; }\n if(n > 0) z.sqrTo(r,r2); else { t = r; r = r2; r2 = t; }\n z.mulTo(r2,g[w],r);\n }\n\n while(j >= 0 && (e[j]&(1< 0) {\n x.rShiftTo(g,x);\n y.rShiftTo(g,y);\n }\n while(x.signum() > 0) {\n if((i = x.getLowestSetBit()) > 0) x.rShiftTo(i,x);\n if((i = y.getLowestSetBit()) > 0) y.rShiftTo(i,y);\n if(x.compareTo(y) >= 0) {\n x.subTo(y,x);\n x.rShiftTo(1,x);\n }\n else {\n y.subTo(x,y);\n y.rShiftTo(1,y);\n }\n }\n if(g > 0) y.lShiftTo(g,y);\n return y;\n }\n\n // (protected) this % n, n < 2^26\n function bnpModInt(n) {\n if(n <= 0) return 0;\n var d = this.DV%n, r = (this.s<0)?n-1:0;\n if(this.t > 0)\n if(d == 0) r = this[0]%n;\n else for(var i = this.t-1; i >= 0; --i) r = (d*r+this[i])%n;\n return r;\n }\n\n // (public) 1/this % m (HAC 14.61)\n function bnModInverse(m) {\n var ac = m.isEven();\n if((this.isEven() && ac) || m.signum() == 0) return BigInteger.ZERO;\n var u = m.clone(), v = this.clone();\n var a = nbv(1), b = nbv(0), c = nbv(0), d = nbv(1);\n while(u.signum() != 0) {\n while(u.isEven()) {\n u.rShiftTo(1,u);\n if(ac) {\n if(!a.isEven() || !b.isEven()) { a.addTo(this,a); b.subTo(m,b); }\n a.rShiftTo(1,a);\n }\n else if(!b.isEven()) b.subTo(m,b);\n b.rShiftTo(1,b);\n }\n while(v.isEven()) {\n v.rShiftTo(1,v);\n if(ac) {\n if(!c.isEven() || !d.isEven()) { c.addTo(this,c); d.subTo(m,d); }\n c.rShiftTo(1,c);\n }\n else if(!d.isEven()) d.subTo(m,d);\n d.rShiftTo(1,d);\n }\n if(u.compareTo(v) >= 0) {\n u.subTo(v,u);\n if(ac) a.subTo(c,a);\n b.subTo(d,b);\n }\n else {\n v.subTo(u,v);\n if(ac) c.subTo(a,c);\n d.subTo(b,d);\n }\n }\n if(v.compareTo(BigInteger.ONE) != 0) return BigInteger.ZERO;\n if(d.compareTo(m) >= 0) return d.subtract(m);\n if(d.signum() < 0) d.addTo(m,d); else return d;\n if(d.signum() < 0) return d.add(m); else return d;\n }\n\n var lowprimes = [2,3,5,7,11,13,17,19,23,29,31,37,41,43,47,53,59,61,67,71,73,79,83,89,97,101,103,107,109,113,127,131,137,139,149,151,157,163,167,173,179,181,191,193,197,199,211,223,227,229,233,239,241,251,257,263,269,271,277,281,283,293,307,311,313,317,331,337,347,349,353,359,367,373,379,383,389,397,401,409,419,421,431,433,439,443,449,457,461,463,467,479,487,491,499,503,509,521,523,541,547,557,563,569,571,577,587,593,599,601,607,613,617,619,631,641,643,647,653,659,661,673,677,683,691,701,709,719,727,733,739,743,751,757,761,769,773,787,797,809,811,821,823,827,829,839,853,857,859,863,877,881,883,887,907,911,919,929,937,941,947,953,967,971,977,983,991,997];\n var lplim = (1<<26)/lowprimes[lowprimes.length-1];\n\n // (public) test primality with certainty >= 1-.5^t\n function bnIsProbablePrime(t) {\n var i, x = this.abs();\n if(x.t == 1 && x[0] <= lowprimes[lowprimes.length-1]) {\n for(i = 0; i < lowprimes.length; ++i)\n if(x[0] == lowprimes[i]) return true;\n return false;\n }\n if(x.isEven()) return false;\n i = 1;\n while(i < lowprimes.length) {\n var m = lowprimes[i], j = i+1;\n while(j < lowprimes.length && m < lplim) m *= lowprimes[j++];\n m = x.modInt(m);\n while(i < j) if(m%lowprimes[i++] == 0) return false;\n }\n return x.millerRabin(t);\n }\n\n // (protected) true if probably prime (HAC 4.24, Miller-Rabin)\n function bnpMillerRabin(t) {\n var n1 = this.subtract(BigInteger.ONE);\n var k = n1.getLowestSetBit();\n if(k <= 0) return false;\n var r = n1.shiftRight(k);\n t = (t+1)>>1;\n if(t > lowprimes.length) t = lowprimes.length;\n var a = nbi();\n for(var i = 0; i < t; ++i) {\n //Pick bases at random, instead of starting at 2\n a.fromInt(lowprimes[Math.floor(Math.random()*lowprimes.length)]);\n var y = a.modPow(r,this);\n if(y.compareTo(BigInteger.ONE) != 0 && y.compareTo(n1) != 0) {\n var j = 1;\n while(j++ < k && y.compareTo(n1) != 0) {\n y = y.modPowInt(2,this);\n if(y.compareTo(BigInteger.ONE) == 0) return false;\n }\n if(y.compareTo(n1) != 0) return false;\n }\n }\n return true;\n }\n\n // protected\n BigInteger.prototype.chunkSize = bnpChunkSize;\n BigInteger.prototype.toRadix = bnpToRadix;\n BigInteger.prototype.fromRadix = bnpFromRadix;\n BigInteger.prototype.fromNumber = bnpFromNumber;\n BigInteger.prototype.bitwiseTo = bnpBitwiseTo;\n BigInteger.prototype.changeBit = bnpChangeBit;\n BigInteger.prototype.addTo = bnpAddTo;\n BigInteger.prototype.dMultiply = bnpDMultiply;\n BigInteger.prototype.dAddOffset = bnpDAddOffset;\n BigInteger.prototype.multiplyLowerTo = bnpMultiplyLowerTo;\n BigInteger.prototype.multiplyUpperTo = bnpMultiplyUpperTo;\n BigInteger.prototype.modInt = bnpModInt;\n BigInteger.prototype.millerRabin = bnpMillerRabin;\n\n // public\n BigInteger.prototype.clone = bnClone;\n BigInteger.prototype.intValue = bnIntValue;\n BigInteger.prototype.byteValue = bnByteValue;\n BigInteger.prototype.shortValue = bnShortValue;\n BigInteger.prototype.signum = bnSigNum;\n BigInteger.prototype.toByteArray = bnToByteArray;\n BigInteger.prototype.equals = bnEquals;\n BigInteger.prototype.min = bnMin;\n BigInteger.prototype.max = bnMax;\n BigInteger.prototype.and = bnAnd;\n BigInteger.prototype.or = bnOr;\n BigInteger.prototype.xor = bnXor;\n BigInteger.prototype.andNot = bnAndNot;\n BigInteger.prototype.not = bnNot;\n BigInteger.prototype.shiftLeft = bnShiftLeft;\n BigInteger.prototype.shiftRight = bnShiftRight;\n BigInteger.prototype.getLowestSetBit = bnGetLowestSetBit;\n BigInteger.prototype.bitCount = bnBitCount;\n BigInteger.prototype.testBit = bnTestBit;\n BigInteger.prototype.setBit = bnSetBit;\n BigInteger.prototype.clearBit = bnClearBit;\n BigInteger.prototype.flipBit = bnFlipBit;\n BigInteger.prototype.add = bnAdd;\n BigInteger.prototype.subtract = bnSubtract;\n BigInteger.prototype.multiply = bnMultiply;\n BigInteger.prototype.divide = bnDivide;\n BigInteger.prototype.remainder = bnRemainder;\n BigInteger.prototype.divideAndRemainder = bnDivideAndRemainder;\n BigInteger.prototype.modPow = bnModPow;\n BigInteger.prototype.modInverse = bnModInverse;\n BigInteger.prototype.pow = bnPow;\n BigInteger.prototype.gcd = bnGCD;\n BigInteger.prototype.isProbablePrime = bnIsProbablePrime;\n\n // JSBN-specific extension\n BigInteger.prototype.square = bnSquare;\n\n // Expose the Barrett function\n BigInteger.prototype.Barrett = Barrett\n\n // BigInteger interfaces not implemented in jsbn:\n\n // BigInteger(int signum, byte[] magnitude)\n // double doubleValue()\n // float floatValue()\n // int hashCode()\n // long longValue()\n // static BigInteger valueOf(long val)\n\n\t// Random number generator - requires a PRNG backend, e.g. prng4.js\n\n\t// For best results, put code like\n\t// \n\t// in your main HTML document.\n\n\tvar rng_state;\n\tvar rng_pool;\n\tvar rng_pptr;\n\n\t// Mix in a 32-bit integer into the pool\n\tfunction rng_seed_int(x) {\n\t rng_pool[rng_pptr++] ^= x & 255;\n\t rng_pool[rng_pptr++] ^= (x >> 8) & 255;\n\t rng_pool[rng_pptr++] ^= (x >> 16) & 255;\n\t rng_pool[rng_pptr++] ^= (x >> 24) & 255;\n\t if(rng_pptr >= rng_psize) rng_pptr -= rng_psize;\n\t}\n\n\t// Mix in the current time (w/milliseconds) into the pool\n\tfunction rng_seed_time() {\n\t rng_seed_int(new Date().getTime());\n\t}\n\n\t// Initialize the pool with junk if needed.\n\tif(rng_pool == null) {\n\t rng_pool = new Array();\n\t rng_pptr = 0;\n\t var t;\n\t if(typeof window !== \"undefined\" && window.crypto) {\n\t\tif (window.crypto.getRandomValues) {\n\t\t // Use webcrypto if available\n\t\t var ua = new Uint8Array(32);\n\t\t window.crypto.getRandomValues(ua);\n\t\t for(t = 0; t < 32; ++t)\n\t\t\trng_pool[rng_pptr++] = ua[t];\n\t\t}\n\t\telse if(navigator.appName == \"Netscape\" && navigator.appVersion < \"5\") {\n\t\t // Extract entropy (256 bits) from NS4 RNG if available\n\t\t var z = window.crypto.random(32);\n\t\t for(t = 0; t < z.length; ++t)\n\t\t\trng_pool[rng_pptr++] = z.charCodeAt(t) & 255;\n\t\t}\n\t }\n\t while(rng_pptr < rng_psize) { // extract some randomness from Math.random()\n\t\tt = Math.floor(65536 * Math.random());\n\t\trng_pool[rng_pptr++] = t >>> 8;\n\t\trng_pool[rng_pptr++] = t & 255;\n\t }\n\t rng_pptr = 0;\n\t rng_seed_time();\n\t //rng_seed_int(window.screenX);\n\t //rng_seed_int(window.screenY);\n\t}\n\n\tfunction rng_get_byte() {\n\t if(rng_state == null) {\n\t\trng_seed_time();\n\t\trng_state = prng_newstate();\n\t\trng_state.init(rng_pool);\n\t\tfor(rng_pptr = 0; rng_pptr < rng_pool.length; ++rng_pptr)\n\t\t rng_pool[rng_pptr] = 0;\n\t\trng_pptr = 0;\n\t\t//rng_pool = null;\n\t }\n\t // TODO: allow reseeding after first request\n\t return rng_state.next();\n\t}\n\n\tfunction rng_get_bytes(ba) {\n\t var i;\n\t for(i = 0; i < ba.length; ++i) ba[i] = rng_get_byte();\n\t}\n\n\tfunction SecureRandom() {}\n\n\tSecureRandom.prototype.nextBytes = rng_get_bytes;\n\n\t// prng4.js - uses Arcfour as a PRNG\n\n\tfunction Arcfour() {\n\t this.i = 0;\n\t this.j = 0;\n\t this.S = new Array();\n\t}\n\n\t// Initialize arcfour context from key, an array of ints, each from [0..255]\n\tfunction ARC4init(key) {\n\t var i, j, t;\n\t for(i = 0; i < 256; ++i)\n\t\tthis.S[i] = i;\n\t j = 0;\n\t for(i = 0; i < 256; ++i) {\n\t\tj = (j + this.S[i] + key[i % key.length]) & 255;\n\t\tt = this.S[i];\n\t\tthis.S[i] = this.S[j];\n\t\tthis.S[j] = t;\n\t }\n\t this.i = 0;\n\t this.j = 0;\n\t}\n\n\tfunction ARC4next() {\n\t var t;\n\t this.i = (this.i + 1) & 255;\n\t this.j = (this.j + this.S[this.i]) & 255;\n\t t = this.S[this.i];\n\t this.S[this.i] = this.S[this.j];\n\t this.S[this.j] = t;\n\t return this.S[(t + this.S[this.i]) & 255];\n\t}\n\n\tArcfour.prototype.init = ARC4init;\n\tArcfour.prototype.next = ARC4next;\n\n\t// Plug in your RNG constructor here\n\tfunction prng_newstate() {\n\t return new Arcfour();\n\t}\n\n\t// Pool size must be a multiple of 4 and greater than 32.\n\t// An array of bytes the size of the pool will be passed to init()\n\tvar rng_psize = 256;\n\n BigInteger.SecureRandom = SecureRandom;\n BigInteger.BigInteger = BigInteger;\n if (typeof exports !== 'undefined') {\n exports = module.exports = BigInteger;\n } else {\n this.BigInteger = BigInteger;\n this.SecureRandom = SecureRandom;\n }\n\n}).call(this);\n","//TODO: handle reviver/dehydrate function like normal\n//and handle indentation, like normal.\n//if anyone needs this... please send pull request.\n\nexports.stringify = function stringify (o) {\n if('undefined' == typeof o) return o\n\n if(o && Buffer.isBuffer(o))\n return JSON.stringify(':base64:' + o.toString('base64'))\n\n if(o && o.toJSON)\n o = o.toJSON()\n\n if(o && 'object' === typeof o) {\n var s = ''\n var array = Array.isArray(o)\n s = array ? '[' : '{'\n var first = true\n\n for(var k in o) {\n var ignore = 'function' == typeof o[k] || (!array && 'undefined' === typeof o[k])\n if(Object.hasOwnProperty.call(o, k) && !ignore) {\n if(!first)\n s += ','\n first = false\n if (array) {\n if(o[k] == undefined)\n s += 'null'\n else\n s += stringify(o[k])\n } else if (o[k] !== void(0)) {\n s += stringify(k) + ':' + stringify(o[k])\n }\n }\n }\n\n s += array ? ']' : '}'\n\n return s\n } else if ('string' === typeof o) {\n return JSON.stringify(/^:/.test(o) ? ':' + o : o)\n } else if ('undefined' === typeof o) {\n return 'null';\n } else\n return JSON.stringify(o)\n}\n\nexports.parse = function (s) {\n return JSON.parse(s, function (key, value) {\n if('string' === typeof value) {\n if(/^:base64:/.test(value))\n return new Buffer(value.substring(8), 'base64')\n else\n return /^:/.test(value) ? value.substring(1) : value \n }\n return value\n })\n}\n","'use strict';\n\nvar traverse = module.exports = function (schema, opts, cb) {\n // Legacy support for v0.3.1 and earlier.\n if (typeof opts == 'function') {\n cb = opts;\n opts = {};\n }\n\n cb = opts.cb || cb;\n var pre = (typeof cb == 'function') ? cb : cb.pre || function() {};\n var post = cb.post || function() {};\n\n _traverse(opts, pre, post, schema, '', schema);\n};\n\n\ntraverse.keywords = {\n additionalItems: true,\n items: true,\n contains: true,\n additionalProperties: true,\n propertyNames: true,\n not: true\n};\n\ntraverse.arrayKeywords = {\n items: true,\n allOf: true,\n anyOf: true,\n oneOf: true\n};\n\ntraverse.propsKeywords = {\n definitions: true,\n properties: true,\n patternProperties: true,\n dependencies: true\n};\n\ntraverse.skipKeywords = {\n default: true,\n enum: true,\n const: true,\n required: true,\n maximum: true,\n minimum: true,\n exclusiveMaximum: true,\n exclusiveMinimum: true,\n multipleOf: true,\n maxLength: true,\n minLength: true,\n pattern: true,\n format: true,\n maxItems: true,\n minItems: true,\n uniqueItems: true,\n maxProperties: true,\n minProperties: true\n};\n\n\nfunction _traverse(opts, pre, post, schema, jsonPtr, rootSchema, parentJsonPtr, parentKeyword, parentSchema, keyIndex) {\n if (schema && typeof schema == 'object' && !Array.isArray(schema)) {\n pre(schema, jsonPtr, rootSchema, parentJsonPtr, parentKeyword, parentSchema, keyIndex);\n for (var key in schema) {\n var sch = schema[key];\n if (Array.isArray(sch)) {\n if (key in traverse.arrayKeywords) {\n for (var i=0; i schema.maxItems){\r\n\t\t\t\t\t\taddError(\"There must be a maximum of \" + schema.maxItems + \" in the array\");\r\n\t\t\t\t\t}\r\n\t\t\t\t}else if(schema.properties || schema.additionalProperties){\r\n\t\t\t\t\terrors.concat(checkObj(value, schema.properties, path, schema.additionalProperties));\r\n\t\t\t\t}\r\n\t\t\t\tif(schema.pattern && typeof value == 'string' && !value.match(schema.pattern)){\r\n\t\t\t\t\taddError(\"does not match the regex pattern \" + schema.pattern);\r\n\t\t\t\t}\r\n\t\t\t\tif(schema.maxLength && typeof value == 'string' && value.length > schema.maxLength){\r\n\t\t\t\t\taddError(\"may only be \" + schema.maxLength + \" characters long\");\r\n\t\t\t\t}\r\n\t\t\t\tif(schema.minLength && typeof value == 'string' && value.length < schema.minLength){\r\n\t\t\t\t\taddError(\"must be at least \" + schema.minLength + \" characters long\");\r\n\t\t\t\t}\r\n\t\t\t\tif(typeof schema.minimum !== undefined && typeof value == typeof schema.minimum &&\r\n\t\t\t\t\t\tschema.minimum > value){\r\n\t\t\t\t\taddError(\"must have a minimum value of \" + schema.minimum);\r\n\t\t\t\t}\r\n\t\t\t\tif(typeof schema.maximum !== undefined && typeof value == typeof schema.maximum &&\r\n\t\t\t\t\t\tschema.maximum < value){\r\n\t\t\t\t\taddError(\"must have a maximum value of \" + schema.maximum);\r\n\t\t\t\t}\r\n\t\t\t\tif(schema['enum']){\r\n\t\t\t\t\tvar enumer = schema['enum'];\r\n\t\t\t\t\tl = enumer.length;\r\n\t\t\t\t\tvar found;\r\n\t\t\t\t\tfor(var j = 0; j < l; j++){\r\n\t\t\t\t\t\tif(enumer[j]===value){\r\n\t\t\t\t\t\t\tfound=1;\r\n\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif(!found){\r\n\t\t\t\t\t\taddError(\"does not have a value in the enumeration \" + enumer.join(\", \"));\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\tif(typeof schema.maxDecimal == 'number' &&\r\n\t\t\t\t\t(value.toString().match(new RegExp(\"\\\\.[0-9]{\" + (schema.maxDecimal + 1) + \",}\")))){\r\n\t\t\t\t\taddError(\"may only have \" + schema.maxDecimal + \" digits of decimal places\");\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn null;\r\n\t}\r\n\t// validate an object against a schema\r\n\tfunction checkObj(instance,objTypeDef,path,additionalProp){\r\n\r\n\t\tif(typeof objTypeDef =='object'){\r\n\t\t\tif(typeof instance != 'object' || instance instanceof Array){\r\n\t\t\t\terrors.push({property:path,message:\"an object is required\"});\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tfor(var i in objTypeDef){ \r\n\t\t\t\tif(objTypeDef.hasOwnProperty(i)){\r\n\t\t\t\t\tvar value = instance[i];\r\n\t\t\t\t\t// skip _not_ specified properties\r\n\t\t\t\t\tif (value === undefined && options.existingOnly) continue;\r\n\t\t\t\t\tvar propDef = objTypeDef[i];\r\n\t\t\t\t\t// set default\r\n\t\t\t\t\tif(value === undefined && propDef[\"default\"]){\r\n\t\t\t\t\t\tvalue = instance[i] = propDef[\"default\"];\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif(options.coerce && i in instance){\r\n\t\t\t\t\t\tvalue = instance[i] = options.coerce(value, propDef);\r\n\t\t\t\t\t}\r\n\t\t\t\t\tcheckProp(value,propDef,path,i);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\tfor(i in instance){\r\n\t\t\tif(instance.hasOwnProperty(i) && !(i.charAt(0) == '_' && i.charAt(1) == '_') && objTypeDef && !objTypeDef[i] && additionalProp===false){\r\n\t\t\t\tif (options.filter) {\r\n\t\t\t\t\tdelete instance[i];\r\n\t\t\t\t\tcontinue;\r\n\t\t\t\t} else {\r\n\t\t\t\t\terrors.push({property:path,message:(typeof value) + \"The property \" + i +\r\n\t\t\t\t\t\t\" is not defined in the schema and the schema does not allow additional properties\"});\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tvar requires = objTypeDef && objTypeDef[i] && objTypeDef[i].requires;\r\n\t\t\tif(requires && !(requires in instance)){\r\n\t\t\t\terrors.push({property:path,message:\"the presence of the property \" + i + \" requires that \" + requires + \" also be present\"});\r\n\t\t\t}\r\n\t\t\tvalue = instance[i];\r\n\t\t\tif(additionalProp && (!(objTypeDef && typeof objTypeDef == 'object') || !(i in objTypeDef))){\r\n\t\t\t\tif(options.coerce){\r\n\t\t\t\t\tvalue = instance[i] = options.coerce(value, additionalProp);\r\n\t\t\t\t}\r\n\t\t\t\tcheckProp(value,additionalProp,path,i);\r\n\t\t\t}\r\n\t\t\tif(!_changing && value && value.$schema){\r\n\t\t\t\terrors = errors.concat(checkProp(value,value.$schema,path,i));\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn errors;\r\n\t}\r\n\tif(schema){\r\n\t\tcheckProp(instance,schema,'',_changing || '');\r\n\t}\r\n\tif(!_changing && instance && instance.$schema){\r\n\t\tcheckProp(instance,instance.$schema,'','');\r\n\t}\r\n\treturn {valid:!errors.length,errors:errors};\r\n};\r\nexports.mustBeValid = function(result){\r\n\t//\tsummary:\r\n\t//\t\tThis checks to ensure that the result is valid and will throw an appropriate error message if it is not\r\n\t// result: the result returned from checkPropertyChange or validate\r\n\tif(!result.valid){\r\n\t\tthrow new TypeError(result.errors.map(function(error){return \"for property \" + error.property + ': ' + error.message;}).join(\", \\n\"));\r\n\t}\r\n}\r\n\r\nreturn exports;\r\n}));\r\n","var util = require('util'),\n TransformStream = require('stream').Transform;\n\nmodule.exports = function (options) {\n return new JSONStream(options);\n};\n\nvar JSONStream = module.exports.JSONStream = function (options) {\n options = options || {};\n TransformStream.call(this, options);\n this._writableState.objectMode = false;\n this._readableState.objectMode = true;\n this._async = options.async || false;\n};\nutil.inherits(JSONStream, TransformStream);\n\nJSONStream.prototype._transform = function (data, encoding, callback) {\n if (!Buffer.isBuffer(data)) data = new Buffer(data);\n if (this._buffer) {\n data = Buffer.concat([this._buffer, data]);\n }\n\n var ptr = 0, start = 0;\n while (++ptr <= data.length) {\n if (data[ptr] === 10 || ptr === data.length) {\n var line;\n try {\n line = JSON.parse(data.slice(start, ptr));\n }\n catch (ex) { }\n if (line) {\n this.push(line);\n line = null;\n }\n if (data[ptr] === 10) start = ++ptr;\n }\n }\n\n this._buffer = data.slice(start);\n return this._async\n ? void setImmediate(callback)\n : void callback();\n};\n","exports = module.exports = stringify\nexports.getSerialize = serializer\n\nfunction stringify(obj, replacer, spaces, cycleReplacer) {\n return JSON.stringify(obj, serializer(replacer, cycleReplacer), spaces)\n}\n\nfunction serializer(replacer, cycleReplacer) {\n var stack = [], keys = []\n\n if (cycleReplacer == null) cycleReplacer = function(key, value) {\n if (stack[0] === value) return \"[Circular ~]\"\n return \"[Circular ~.\" + keys.slice(0, stack.indexOf(value)).join(\".\") + \"]\"\n }\n\n return function(key, value) {\n if (stack.length > 0) {\n var thisPos = stack.indexOf(this)\n ~thisPos ? stack.splice(thisPos + 1) : stack.push(this)\n ~thisPos ? keys.splice(thisPos, Infinity, key) : keys.push(key)\n if (~stack.indexOf(value)) value = cycleReplacer.call(this, key, value)\n }\n else stack.push(value)\n\n return replacer == null ? value : replacer.call(this, key, value)\n }\n}\n","(function (global, factory) {\n typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) :\n typeof define === 'function' && define.amd ? define(['exports'], factory) :\n (global = global || self, factory(global.JSONPath = {}));\n}(this, function (exports) { 'use strict';\n\n function _typeof(obj) {\n if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") {\n _typeof = function (obj) {\n return typeof obj;\n };\n } else {\n _typeof = function (obj) {\n return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj;\n };\n }\n\n return _typeof(obj);\n }\n\n function _classCallCheck(instance, Constructor) {\n if (!(instance instanceof Constructor)) {\n throw new TypeError(\"Cannot call a class as a function\");\n }\n }\n\n function _inherits(subClass, superClass) {\n if (typeof superClass !== \"function\" && superClass !== null) {\n throw new TypeError(\"Super expression must either be null or a function\");\n }\n\n subClass.prototype = Object.create(superClass && superClass.prototype, {\n constructor: {\n value: subClass,\n writable: true,\n configurable: true\n }\n });\n if (superClass) _setPrototypeOf(subClass, superClass);\n }\n\n function _getPrototypeOf(o) {\n _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) {\n return o.__proto__ || Object.getPrototypeOf(o);\n };\n return _getPrototypeOf(o);\n }\n\n function _setPrototypeOf(o, p) {\n _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) {\n o.__proto__ = p;\n return o;\n };\n\n return _setPrototypeOf(o, p);\n }\n\n function isNativeReflectConstruct() {\n if (typeof Reflect === \"undefined\" || !Reflect.construct) return false;\n if (Reflect.construct.sham) return false;\n if (typeof Proxy === \"function\") return true;\n\n try {\n Date.prototype.toString.call(Reflect.construct(Date, [], function () {}));\n return true;\n } catch (e) {\n return false;\n }\n }\n\n function _construct(Parent, args, Class) {\n if (isNativeReflectConstruct()) {\n _construct = Reflect.construct;\n } else {\n _construct = function _construct(Parent, args, Class) {\n var a = [null];\n a.push.apply(a, args);\n var Constructor = Function.bind.apply(Parent, a);\n var instance = new Constructor();\n if (Class) _setPrototypeOf(instance, Class.prototype);\n return instance;\n };\n }\n\n return _construct.apply(null, arguments);\n }\n\n function _isNativeFunction(fn) {\n return Function.toString.call(fn).indexOf(\"[native code]\") !== -1;\n }\n\n function _wrapNativeSuper(Class) {\n var _cache = typeof Map === \"function\" ? new Map() : undefined;\n\n _wrapNativeSuper = function _wrapNativeSuper(Class) {\n if (Class === null || !_isNativeFunction(Class)) return Class;\n\n if (typeof Class !== \"function\") {\n throw new TypeError(\"Super expression must either be null or a function\");\n }\n\n if (typeof _cache !== \"undefined\") {\n if (_cache.has(Class)) return _cache.get(Class);\n\n _cache.set(Class, Wrapper);\n }\n\n function Wrapper() {\n return _construct(Class, arguments, _getPrototypeOf(this).constructor);\n }\n\n Wrapper.prototype = Object.create(Class.prototype, {\n constructor: {\n value: Wrapper,\n enumerable: false,\n writable: true,\n configurable: true\n }\n });\n return _setPrototypeOf(Wrapper, Class);\n };\n\n return _wrapNativeSuper(Class);\n }\n\n function _assertThisInitialized(self) {\n if (self === void 0) {\n throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");\n }\n\n return self;\n }\n\n function _possibleConstructorReturn(self, call) {\n if (call && (typeof call === \"object\" || typeof call === \"function\")) {\n return call;\n }\n\n return _assertThisInitialized(self);\n }\n\n /* eslint-disable no-eval */\n var globalEval = eval; // eslint-disable-next-line import/no-commonjs\n\n var supportsNodeVM = typeof module !== 'undefined' && Boolean(module.exports) && !(typeof navigator !== 'undefined' && navigator.product === 'ReactNative');\n var allowedResultTypes = ['value', 'path', 'pointer', 'parent', 'parentProperty', 'all'];\n var hasOwnProp = Object.prototype.hasOwnProperty;\n /**\n * Copy items out of one array into another.\n * @param {Array} source Array with items to copy\n * @param {Array} target Array to which to copy\n * @param {Function} conditionCb Callback passed the current item; will move\n * item if evaluates to `true`\n * @returns {undefined}\n */\n\n var moveToAnotherArray = function moveToAnotherArray(source, target, conditionCb) {\n var il = source.length;\n\n for (var i = 0; i < il; i++) {\n var item = source[i];\n\n if (conditionCb(item)) {\n target.push(source.splice(i--, 1)[0]);\n }\n }\n };\n\n var vm = supportsNodeVM ? require('vm') : {\n /**\n * @param {string} expr Expression to evaluate\n * @param {Object} context Object whose items will be added to evaluation\n * @returns {*} Result of evaluated code\n */\n runInNewContext: function runInNewContext(expr, context) {\n var keys = Object.keys(context);\n var funcs = [];\n moveToAnotherArray(keys, funcs, function (key) {\n return typeof context[key] === 'function';\n });\n var code = funcs.reduce(function (s, func) {\n var fString = context[func].toString();\n\n if (!/function/.exec(fString)) {\n fString = 'function ' + fString;\n }\n\n return 'var ' + func + '=' + fString + ';' + s;\n }, '') + keys.reduce(function (s, vr) {\n return 'var ' + vr + '=' + JSON.stringify(context[vr]).replace( // http://www.thespanner.co.uk/2011/07/25/the-json-specification-is-now-wrong/\n /\\u2028|\\u2029/g, function (m) {\n return \"\\\\u202\" + (m === \"\\u2028\" ? '8' : '9');\n }) + ';' + s;\n }, expr);\n return globalEval(code);\n }\n };\n /**\n * Copies array and then pushes item into it.\n * @param {Array} arr Array to copy and into which to push\n * @param {*} item Array item to add (to end)\n * @returns {Array} Copy of the original array\n */\n\n function push(arr, item) {\n arr = arr.slice();\n arr.push(item);\n return arr;\n }\n /**\n * Copies array and then unshifts item into it.\n * @param {*} item Array item to add (to beginning)\n * @param {Array} arr Array to copy and into which to unshift\n * @returns {Array} Copy of the original array\n */\n\n\n function unshift(item, arr) {\n arr = arr.slice();\n arr.unshift(item);\n return arr;\n }\n /**\n * Caught when JSONPath is used without `new` but rethrown if with `new`\n * @extends Error\n */\n\n\n var NewError =\n /*#__PURE__*/\n function (_Error) {\n _inherits(NewError, _Error);\n\n /**\n * @param {*} value The evaluated scalar value\n */\n function NewError(value) {\n var _this;\n\n _classCallCheck(this, NewError);\n\n _this = _possibleConstructorReturn(this, _getPrototypeOf(NewError).call(this, 'JSONPath should not be called with \"new\" (it prevents return of (unwrapped) scalar values)'));\n _this.avoidNew = true;\n _this.value = value;\n _this.name = 'NewError';\n return _this;\n }\n\n return NewError;\n }(_wrapNativeSuper(Error));\n /**\n * @param {Object} [opts] If present, must be an object\n * @param {string} expr JSON path to evaluate\n * @param {JSON} obj JSON object to evaluate against\n * @param {Function} callback Passed 3 arguments: 1) desired payload per `resultType`,\n * 2) `\"value\"|\"property\"`, 3) Full returned object with all payloads\n * @param {Function} otherTypeCallback If `@other()` is at the end of one's query, this\n * will be invoked with the value of the item, its path, its parent, and its parent's\n * property name, and it should return a boolean indicating whether the supplied value\n * belongs to the \"other\" type or not (or it may handle transformations and return `false`).\n * @returns {JSONPath}\n * @class\n */\n\n\n function JSONPath(opts, expr, obj, callback, otherTypeCallback) {\n // eslint-disable-next-line no-restricted-syntax\n if (!(this instanceof JSONPath)) {\n try {\n return new JSONPath(opts, expr, obj, callback, otherTypeCallback);\n } catch (e) {\n if (!e.avoidNew) {\n throw e;\n }\n\n return e.value;\n }\n }\n\n if (typeof opts === 'string') {\n otherTypeCallback = callback;\n callback = obj;\n obj = expr;\n expr = opts;\n opts = {};\n }\n\n opts = opts || {};\n var objArgs = hasOwnProp.call(opts, 'json') && hasOwnProp.call(opts, 'path');\n this.json = opts.json || obj;\n this.path = opts.path || expr;\n this.resultType = opts.resultType && opts.resultType.toLowerCase() || 'value';\n this.flatten = opts.flatten || false;\n this.wrap = hasOwnProp.call(opts, 'wrap') ? opts.wrap : true;\n this.sandbox = opts.sandbox || {};\n this.preventEval = opts.preventEval || false;\n this.parent = opts.parent || null;\n this.parentProperty = opts.parentProperty || null;\n this.callback = opts.callback || callback || null;\n\n this.otherTypeCallback = opts.otherTypeCallback || otherTypeCallback || function () {\n throw new Error('You must supply an otherTypeCallback callback option with the @other() operator.');\n };\n\n if (opts.autostart !== false) {\n var ret = this.evaluate({\n path: objArgs ? opts.path : expr,\n json: objArgs ? opts.json : obj\n });\n\n if (!ret || _typeof(ret) !== 'object') {\n throw new NewError(ret);\n }\n\n return ret;\n }\n } // PUBLIC METHODS\n\n\n JSONPath.prototype.evaluate = function (expr, json, callback, otherTypeCallback) {\n var that = this;\n var currParent = this.parent,\n currParentProperty = this.parentProperty;\n var flatten = this.flatten,\n wrap = this.wrap;\n this.currResultType = this.resultType;\n this.currPreventEval = this.preventEval;\n this.currSandbox = this.sandbox;\n callback = callback || this.callback;\n this.currOtherTypeCallback = otherTypeCallback || this.otherTypeCallback;\n json = json || this.json;\n expr = expr || this.path;\n\n if (expr && _typeof(expr) === 'object') {\n if (!expr.path) {\n throw new Error('You must supply a \"path\" property when providing an object argument to JSONPath.evaluate().');\n }\n\n json = hasOwnProp.call(expr, 'json') ? expr.json : json;\n flatten = hasOwnProp.call(expr, 'flatten') ? expr.flatten : flatten;\n this.currResultType = hasOwnProp.call(expr, 'resultType') ? expr.resultType : this.currResultType;\n this.currSandbox = hasOwnProp.call(expr, 'sandbox') ? expr.sandbox : this.currSandbox;\n wrap = hasOwnProp.call(expr, 'wrap') ? expr.wrap : wrap;\n this.currPreventEval = hasOwnProp.call(expr, 'preventEval') ? expr.preventEval : this.currPreventEval;\n callback = hasOwnProp.call(expr, 'callback') ? expr.callback : callback;\n this.currOtherTypeCallback = hasOwnProp.call(expr, 'otherTypeCallback') ? expr.otherTypeCallback : this.currOtherTypeCallback;\n currParent = hasOwnProp.call(expr, 'parent') ? expr.parent : currParent;\n currParentProperty = hasOwnProp.call(expr, 'parentProperty') ? expr.parentProperty : currParentProperty;\n expr = expr.path;\n }\n\n currParent = currParent || null;\n currParentProperty = currParentProperty || null;\n\n if (Array.isArray(expr)) {\n expr = JSONPath.toPathString(expr);\n }\n\n if (!expr || !json || !allowedResultTypes.includes(this.currResultType)) {\n return undefined;\n }\n\n this._obj = json;\n var exprList = JSONPath.toPathArray(expr);\n\n if (exprList[0] === '$' && exprList.length > 1) {\n exprList.shift();\n }\n\n this._hasParentSelector = null;\n\n var result = this._trace(exprList, json, ['$'], currParent, currParentProperty, callback).filter(function (ea) {\n return ea && !ea.isParentSelector;\n });\n\n if (!result.length) {\n return wrap ? [] : undefined;\n }\n\n if (result.length === 1 && !wrap && !Array.isArray(result[0].value)) {\n return this._getPreferredOutput(result[0]);\n }\n\n return result.reduce(function (rslt, ea) {\n var valOrPath = that._getPreferredOutput(ea);\n\n if (flatten && Array.isArray(valOrPath)) {\n rslt = rslt.concat(valOrPath);\n } else {\n rslt.push(valOrPath);\n }\n\n return rslt;\n }, []);\n }; // PRIVATE METHODS\n\n\n JSONPath.prototype._getPreferredOutput = function (ea) {\n var resultType = this.currResultType;\n\n switch (resultType) {\n default:\n throw new TypeError('Unknown result type');\n\n case 'all':\n ea.pointer = JSONPath.toPointer(ea.path);\n ea.path = typeof ea.path === 'string' ? ea.path : JSONPath.toPathString(ea.path);\n return ea;\n\n case 'value':\n case 'parent':\n case 'parentProperty':\n return ea[resultType];\n\n case 'path':\n return JSONPath.toPathString(ea[resultType]);\n\n case 'pointer':\n return JSONPath.toPointer(ea.path);\n }\n };\n\n JSONPath.prototype._handleCallback = function (fullRetObj, callback, type) {\n if (callback) {\n var preferredOutput = this._getPreferredOutput(fullRetObj);\n\n fullRetObj.path = typeof fullRetObj.path === 'string' ? fullRetObj.path : JSONPath.toPathString(fullRetObj.path); // eslint-disable-next-line callback-return\n\n callback(preferredOutput, type, fullRetObj);\n }\n };\n\n JSONPath.prototype._trace = function (expr, val, path, parent, parentPropName, callback, literalPriority) {\n // No expr to follow? return path and value as the result of this trace branch\n var retObj;\n var that = this;\n\n if (!expr.length) {\n retObj = {\n path: path,\n value: val,\n parent: parent,\n parentProperty: parentPropName\n };\n\n this._handleCallback(retObj, callback, 'value');\n\n return retObj;\n }\n\n var loc = expr[0],\n x = expr.slice(1); // We need to gather the return value of recursive trace calls in order to\n // do the parent sel computation.\n\n var ret = [];\n\n function addRet(elems) {\n if (Array.isArray(elems)) {\n // This was causing excessive stack size in Node (with or without Babel) against our performance test: `ret.push(...elems);`\n elems.forEach(function (t) {\n ret.push(t);\n });\n } else {\n ret.push(elems);\n }\n }\n\n if ((typeof loc !== 'string' || literalPriority) && val && hasOwnProp.call(val, loc)) {\n // simple case--directly follow property\n addRet(this._trace(x, val[loc], push(path, loc), val, loc, callback));\n } else if (loc === '*') {\n // all child properties\n // eslint-disable-next-line no-shadow\n this._walk(loc, x, val, path, parent, parentPropName, callback, function (m, l, x, v, p, par, pr, cb) {\n addRet(that._trace(unshift(m, x), v, p, par, pr, cb, true));\n });\n } else if (loc === '..') {\n // all descendent parent properties\n addRet(this._trace(x, val, path, parent, parentPropName, callback)); // Check remaining expression with val's immediate children\n // eslint-disable-next-line no-shadow\n\n this._walk(loc, x, val, path, parent, parentPropName, callback, function (m, l, x, v, p, par, pr, cb) {\n // We don't join m and x here because we only want parents, not scalar values\n if (_typeof(v[m]) === 'object') {\n // Keep going with recursive descent on val's object children\n addRet(that._trace(unshift(l, x), v[m], push(p, m), v, m, cb));\n }\n }); // The parent sel computation is handled in the frame above using the\n // ancestor object of val\n\n } else if (loc === '^') {\n // This is not a final endpoint, so we do not invoke the callback here\n this._hasParentSelector = true;\n return path.length ? {\n path: path.slice(0, -1),\n expr: x,\n isParentSelector: true\n } : [];\n } else if (loc === '~') {\n // property name\n retObj = {\n path: push(path, loc),\n value: parentPropName,\n parent: parent,\n parentProperty: null\n };\n\n this._handleCallback(retObj, callback, 'property');\n\n return retObj;\n } else if (loc === '$') {\n // root only\n addRet(this._trace(x, val, path, null, null, callback));\n } else if (/^(-?\\d*):(-?\\d*):?(\\d*)$/.test(loc)) {\n // [start:end:step] Python slice syntax\n addRet(this._slice(loc, x, val, path, parent, parentPropName, callback));\n } else if (loc.indexOf('?(') === 0) {\n // [?(expr)] (filtering)\n if (this.currPreventEval) {\n throw new Error('Eval [?(expr)] prevented in JSONPath expression.');\n } // eslint-disable-next-line no-shadow\n\n\n this._walk(loc, x, val, path, parent, parentPropName, callback, function (m, l, x, v, p, par, pr, cb) {\n if (that._eval(l.replace(/^\\?\\((.*?)\\)$/, '$1'), v[m], m, p, par, pr)) {\n addRet(that._trace(unshift(m, x), v, p, par, pr, cb));\n }\n });\n } else if (loc[0] === '(') {\n // [(expr)] (dynamic property/index)\n if (this.currPreventEval) {\n throw new Error('Eval [(expr)] prevented in JSONPath expression.');\n } // As this will resolve to a property name (but we don't know it yet), property and parent information is relative to the parent of the property to which this expression will resolve\n\n\n addRet(this._trace(unshift(this._eval(loc, val, path[path.length - 1], path.slice(0, -1), parent, parentPropName), x), val, path, parent, parentPropName, callback));\n } else if (loc[0] === '@') {\n // value type: @boolean(), etc.\n var addType = false;\n var valueType = loc.slice(1, -2);\n\n switch (valueType) {\n default:\n throw new TypeError('Unknown value type ' + valueType);\n\n case 'scalar':\n if (!val || !['object', 'function'].includes(_typeof(val))) {\n addType = true;\n }\n\n break;\n\n case 'boolean':\n case 'string':\n case 'undefined':\n case 'function':\n if (_typeof(val) === valueType) {\n // eslint-disable-line valid-typeof\n addType = true;\n }\n\n break;\n\n case 'number':\n if (_typeof(val) === valueType && isFinite(val)) {\n // eslint-disable-line valid-typeof\n addType = true;\n }\n\n break;\n\n case 'nonFinite':\n if (typeof val === 'number' && !isFinite(val)) {\n addType = true;\n }\n\n break;\n\n case 'object':\n if (val && _typeof(val) === valueType) {\n // eslint-disable-line valid-typeof\n addType = true;\n }\n\n break;\n\n case 'array':\n if (Array.isArray(val)) {\n addType = true;\n }\n\n break;\n\n case 'other':\n addType = this.currOtherTypeCallback(val, path, parent, parentPropName);\n break;\n\n case 'integer':\n if (val === Number(val) && isFinite(val) && !(val % 1)) {\n addType = true;\n }\n\n break;\n\n case 'null':\n if (val === null) {\n addType = true;\n }\n\n break;\n }\n\n if (addType) {\n retObj = {\n path: path,\n value: val,\n parent: parent,\n parentProperty: parentPropName\n };\n\n this._handleCallback(retObj, callback, 'value');\n\n return retObj;\n }\n } else if (loc[0] === '`' && val && hasOwnProp.call(val, loc.slice(1))) {\n // `-escaped property\n var locProp = loc.slice(1);\n addRet(this._trace(x, val[locProp], push(path, locProp), val, locProp, callback, true));\n } else if (loc.includes(',')) {\n // [name1,name2,...]\n var parts = loc.split(',');\n var _iteratorNormalCompletion = true;\n var _didIteratorError = false;\n var _iteratorError = undefined;\n\n try {\n for (var _iterator = parts[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {\n var part = _step.value;\n addRet(this._trace(unshift(part, x), val, path, parent, parentPropName, callback));\n }\n } catch (err) {\n _didIteratorError = true;\n _iteratorError = err;\n } finally {\n try {\n if (!_iteratorNormalCompletion && _iterator[\"return\"] != null) {\n _iterator[\"return\"]();\n }\n } finally {\n if (_didIteratorError) {\n throw _iteratorError;\n }\n }\n }\n } else if (!literalPriority && val && hasOwnProp.call(val, loc)) {\n // simple case--directly follow property\n addRet(this._trace(x, val[loc], push(path, loc), val, loc, callback, true));\n } // We check the resulting values for parent selections. For parent\n // selections we discard the value object and continue the trace with the\n // current val object\n\n\n if (this._hasParentSelector) {\n // eslint-disable-next-line unicorn/no-for-loop\n for (var t = 0; t < ret.length; t++) {\n var rett = ret[t];\n\n if (rett.isParentSelector) {\n var tmp = that._trace(rett.expr, val, rett.path, parent, parentPropName, callback);\n\n if (Array.isArray(tmp)) {\n ret[t] = tmp[0];\n var tl = tmp.length;\n\n for (var tt = 1; tt < tl; tt++) {\n t++;\n ret.splice(t, 0, tmp[tt]);\n }\n } else {\n ret[t] = tmp;\n }\n }\n }\n }\n\n return ret;\n };\n\n JSONPath.prototype._walk = function (loc, expr, val, path, parent, parentPropName, callback, f) {\n if (Array.isArray(val)) {\n var n = val.length;\n\n for (var i = 0; i < n; i++) {\n f(i, loc, expr, val, path, parent, parentPropName, callback);\n }\n } else if (_typeof(val) === 'object') {\n for (var m in val) {\n if (hasOwnProp.call(val, m)) {\n f(m, loc, expr, val, path, parent, parentPropName, callback);\n }\n }\n }\n };\n\n JSONPath.prototype._slice = function (loc, expr, val, path, parent, parentPropName, callback) {\n if (!Array.isArray(val)) {\n return undefined;\n }\n\n var len = val.length,\n parts = loc.split(':'),\n step = parts[2] && parseInt(parts[2]) || 1;\n var start = parts[0] && parseInt(parts[0]) || 0,\n end = parts[1] && parseInt(parts[1]) || len;\n start = start < 0 ? Math.max(0, start + len) : Math.min(len, start);\n end = end < 0 ? Math.max(0, end + len) : Math.min(len, end);\n var ret = [];\n\n for (var i = start; i < end; i += step) {\n var tmp = this._trace(unshift(i, expr), val, path, parent, parentPropName, callback);\n\n if (Array.isArray(tmp)) {\n // This was causing excessive stack size in Node (with or without Babel) against our performance test: `ret.push(...tmp);`\n tmp.forEach(function (t) {\n ret.push(t);\n });\n } else {\n ret.push(tmp);\n }\n }\n\n return ret;\n };\n\n JSONPath.prototype._eval = function (code, _v, _vname, path, parent, parentPropName) {\n if (!this._obj || !_v) {\n return false;\n }\n\n if (code.includes('@parentProperty')) {\n this.currSandbox._$_parentProperty = parentPropName;\n code = code.replace(/@parentProperty/g, '_$_parentProperty');\n }\n\n if (code.includes('@parent')) {\n this.currSandbox._$_parent = parent;\n code = code.replace(/@parent/g, '_$_parent');\n }\n\n if (code.includes('@property')) {\n this.currSandbox._$_property = _vname;\n code = code.replace(/@property/g, '_$_property');\n }\n\n if (code.includes('@path')) {\n this.currSandbox._$_path = JSONPath.toPathString(path.concat([_vname]));\n code = code.replace(/@path/g, '_$_path');\n }\n\n if (code.match(/@([.\\s)[])/)) {\n this.currSandbox._$_v = _v;\n code = code.replace(/@([.\\s)[])/g, '_$_v$1');\n }\n\n try {\n return vm.runInNewContext(code, this.currSandbox);\n } catch (e) {\n // eslint-disable-next-line no-console\n console.log(e);\n throw new Error('jsonPath: ' + e.message + ': ' + code);\n }\n }; // PUBLIC CLASS PROPERTIES AND METHODS\n // Could store the cache object itself\n\n\n JSONPath.cache = {};\n /**\n * @param {string[]} pathArr Array to convert\n * @returns {string} The path string\n */\n\n JSONPath.toPathString = function (pathArr) {\n var x = pathArr,\n n = x.length;\n var p = '$';\n\n for (var i = 1; i < n; i++) {\n if (!/^(~|\\^|@.*?\\(\\))$/.test(x[i])) {\n p += /^[0-9*]+$/.test(x[i]) ? '[' + x[i] + ']' : \"['\" + x[i] + \"']\";\n }\n }\n\n return p;\n };\n /**\n * @param {string} pointer JSON Path\n * @returns {string} JSON Pointer\n */\n\n\n JSONPath.toPointer = function (pointer) {\n var x = pointer,\n n = x.length;\n var p = '';\n\n for (var i = 1; i < n; i++) {\n if (!/^(~|\\^|@.*?\\(\\))$/.test(x[i])) {\n p += '/' + x[i].toString().replace(/~/g, '~0').replace(/\\//g, '~1');\n }\n }\n\n return p;\n };\n /**\n * @param {string} expr Expression to convert\n * @returns {string[]}\n */\n\n\n JSONPath.toPathArray = function (expr) {\n var cache = JSONPath.cache;\n\n if (cache[expr]) {\n return cache[expr].concat();\n }\n\n var subx = [];\n var normalized = expr // Properties\n .replace(/@(?:null|boolean|number|string|integer|undefined|nonFinite|scalar|array|object|function|other)\\(\\)/g, ';$&;') // Parenthetical evaluations (filtering and otherwise), directly\n // within brackets or single quotes\n .replace(/[['](\\??\\(.*?\\))[\\]']/g, function ($0, $1) {\n return '[#' + (subx.push($1) - 1) + ']';\n }) // Escape periods and tildes within properties\n .replace(/\\['([^'\\]]*)'\\]/g, function ($0, prop) {\n return \"['\" + prop.replace(/\\./g, '%@%').replace(/~/g, '%%@@%%') + \"']\";\n }) // Properties operator\n .replace(/~/g, ';~;') // Split by property boundaries\n .replace(/'?\\.'?(?![^[]*\\])|\\['?/g, ';') // Reinsert periods within properties\n .replace(/%@%/g, '.') // Reinsert tildes within properties\n .replace(/%%@@%%/g, '~') // Parent\n .replace(/(?:;)?(\\^+)(?:;)?/g, function ($0, ups) {\n return ';' + ups.split('').join(';') + ';';\n }) // Descendents\n .replace(/;;;|;;/g, ';..;') // Remove trailing\n .replace(/;$|'?\\]|'$/g, '');\n var exprList = normalized.split(';').map(function (exp) {\n var match = exp.match(/#(\\d+)/);\n return !match || !match[1] ? exp : subx[match[1]];\n });\n cache[expr] = exprList;\n return cache[expr];\n };\n\n exports.JSONPath = JSONPath;\n\n Object.defineProperty(exports, '__esModule', { value: true });\n\n}));\n","/*\n * lib/jsprim.js: utilities for primitive JavaScript types\n */\n\nvar mod_assert = require('assert-plus');\nvar mod_util = require('util');\n\nvar mod_extsprintf = require('extsprintf');\nvar mod_verror = require('verror');\nvar mod_jsonschema = require('json-schema');\n\n/*\n * Public interface\n */\nexports.deepCopy = deepCopy;\nexports.deepEqual = deepEqual;\nexports.isEmpty = isEmpty;\nexports.hasKey = hasKey;\nexports.forEachKey = forEachKey;\nexports.pluck = pluck;\nexports.flattenObject = flattenObject;\nexports.flattenIter = flattenIter;\nexports.validateJsonObject = validateJsonObjectJS;\nexports.validateJsonObjectJS = validateJsonObjectJS;\nexports.randElt = randElt;\nexports.extraProperties = extraProperties;\nexports.mergeObjects = mergeObjects;\n\nexports.startsWith = startsWith;\nexports.endsWith = endsWith;\n\nexports.parseInteger = parseInteger;\n\nexports.iso8601 = iso8601;\nexports.rfc1123 = rfc1123;\nexports.parseDateTime = parseDateTime;\n\nexports.hrtimediff = hrtimeDiff;\nexports.hrtimeDiff = hrtimeDiff;\nexports.hrtimeAccum = hrtimeAccum;\nexports.hrtimeAdd = hrtimeAdd;\nexports.hrtimeNanosec = hrtimeNanosec;\nexports.hrtimeMicrosec = hrtimeMicrosec;\nexports.hrtimeMillisec = hrtimeMillisec;\n\n\n/*\n * Deep copy an acyclic *basic* Javascript object. This only handles basic\n * scalars (strings, numbers, booleans) and arbitrarily deep arrays and objects\n * containing these. This does *not* handle instances of other classes.\n */\nfunction deepCopy(obj)\n{\n\tvar ret, key;\n\tvar marker = '__deepCopy';\n\n\tif (obj && obj[marker])\n\t\tthrow (new Error('attempted deep copy of cyclic object'));\n\n\tif (obj && obj.constructor == Object) {\n\t\tret = {};\n\t\tobj[marker] = true;\n\n\t\tfor (key in obj) {\n\t\t\tif (key == marker)\n\t\t\t\tcontinue;\n\n\t\t\tret[key] = deepCopy(obj[key]);\n\t\t}\n\n\t\tdelete (obj[marker]);\n\t\treturn (ret);\n\t}\n\n\tif (obj && obj.constructor == Array) {\n\t\tret = [];\n\t\tobj[marker] = true;\n\n\t\tfor (key = 0; key < obj.length; key++)\n\t\t\tret.push(deepCopy(obj[key]));\n\n\t\tdelete (obj[marker]);\n\t\treturn (ret);\n\t}\n\n\t/*\n\t * It must be a primitive type -- just return it.\n\t */\n\treturn (obj);\n}\n\nfunction deepEqual(obj1, obj2)\n{\n\tif (typeof (obj1) != typeof (obj2))\n\t\treturn (false);\n\n\tif (obj1 === null || obj2 === null || typeof (obj1) != 'object')\n\t\treturn (obj1 === obj2);\n\n\tif (obj1.constructor != obj2.constructor)\n\t\treturn (false);\n\n\tvar k;\n\tfor (k in obj1) {\n\t\tif (!obj2.hasOwnProperty(k))\n\t\t\treturn (false);\n\n\t\tif (!deepEqual(obj1[k], obj2[k]))\n\t\t\treturn (false);\n\t}\n\n\tfor (k in obj2) {\n\t\tif (!obj1.hasOwnProperty(k))\n\t\t\treturn (false);\n\t}\n\n\treturn (true);\n}\n\nfunction isEmpty(obj)\n{\n\tvar key;\n\tfor (key in obj)\n\t\treturn (false);\n\treturn (true);\n}\n\nfunction hasKey(obj, key)\n{\n\tmod_assert.equal(typeof (key), 'string');\n\treturn (Object.prototype.hasOwnProperty.call(obj, key));\n}\n\nfunction forEachKey(obj, callback)\n{\n\tfor (var key in obj) {\n\t\tif (hasKey(obj, key)) {\n\t\t\tcallback(key, obj[key]);\n\t\t}\n\t}\n}\n\nfunction pluck(obj, key)\n{\n\tmod_assert.equal(typeof (key), 'string');\n\treturn (pluckv(obj, key));\n}\n\nfunction pluckv(obj, key)\n{\n\tif (obj === null || typeof (obj) !== 'object')\n\t\treturn (undefined);\n\n\tif (obj.hasOwnProperty(key))\n\t\treturn (obj[key]);\n\n\tvar i = key.indexOf('.');\n\tif (i == -1)\n\t\treturn (undefined);\n\n\tvar key1 = key.substr(0, i);\n\tif (!obj.hasOwnProperty(key1))\n\t\treturn (undefined);\n\n\treturn (pluckv(obj[key1], key.substr(i + 1)));\n}\n\n/*\n * Invoke callback(row) for each entry in the array that would be returned by\n * flattenObject(data, depth). This is just like flattenObject(data,\n * depth).forEach(callback), except that the intermediate array is never\n * created.\n */\nfunction flattenIter(data, depth, callback)\n{\n\tdoFlattenIter(data, depth, [], callback);\n}\n\nfunction doFlattenIter(data, depth, accum, callback)\n{\n\tvar each;\n\tvar key;\n\n\tif (depth === 0) {\n\t\teach = accum.slice(0);\n\t\teach.push(data);\n\t\tcallback(each);\n\t\treturn;\n\t}\n\n\tmod_assert.ok(data !== null);\n\tmod_assert.equal(typeof (data), 'object');\n\tmod_assert.equal(typeof (depth), 'number');\n\tmod_assert.ok(depth >= 0);\n\n\tfor (key in data) {\n\t\teach = accum.slice(0);\n\t\teach.push(key);\n\t\tdoFlattenIter(data[key], depth - 1, each, callback);\n\t}\n}\n\nfunction flattenObject(data, depth)\n{\n\tif (depth === 0)\n\t\treturn ([ data ]);\n\n\tmod_assert.ok(data !== null);\n\tmod_assert.equal(typeof (data), 'object');\n\tmod_assert.equal(typeof (depth), 'number');\n\tmod_assert.ok(depth >= 0);\n\n\tvar rv = [];\n\tvar key;\n\n\tfor (key in data) {\n\t\tflattenObject(data[key], depth - 1).forEach(function (p) {\n\t\t\trv.push([ key ].concat(p));\n\t\t});\n\t}\n\n\treturn (rv);\n}\n\nfunction startsWith(str, prefix)\n{\n\treturn (str.substr(0, prefix.length) == prefix);\n}\n\nfunction endsWith(str, suffix)\n{\n\treturn (str.substr(\n\t str.length - suffix.length, suffix.length) == suffix);\n}\n\nfunction iso8601(d)\n{\n\tif (typeof (d) == 'number')\n\t\td = new Date(d);\n\tmod_assert.ok(d.constructor === Date);\n\treturn (mod_extsprintf.sprintf('%4d-%02d-%02dT%02d:%02d:%02d.%03dZ',\n\t d.getUTCFullYear(), d.getUTCMonth() + 1, d.getUTCDate(),\n\t d.getUTCHours(), d.getUTCMinutes(), d.getUTCSeconds(),\n\t d.getUTCMilliseconds()));\n}\n\nvar RFC1123_MONTHS = [\n 'Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun',\n 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'];\nvar RFC1123_DAYS = [\n 'Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'];\n\nfunction rfc1123(date) {\n\treturn (mod_extsprintf.sprintf('%s, %02d %s %04d %02d:%02d:%02d GMT',\n\t RFC1123_DAYS[date.getUTCDay()], date.getUTCDate(),\n\t RFC1123_MONTHS[date.getUTCMonth()], date.getUTCFullYear(),\n\t date.getUTCHours(), date.getUTCMinutes(),\n\t date.getUTCSeconds()));\n}\n\n/*\n * Parses a date expressed as a string, as either a number of milliseconds since\n * the epoch or any string format that Date accepts, giving preference to the\n * former where these two sets overlap (e.g., small numbers).\n */\nfunction parseDateTime(str)\n{\n\t/*\n\t * This is irritatingly implicit, but significantly more concise than\n\t * alternatives. The \"+str\" will convert a string containing only a\n\t * number directly to a Number, or NaN for other strings. Thus, if the\n\t * conversion succeeds, we use it (this is the milliseconds-since-epoch\n\t * case). Otherwise, we pass the string directly to the Date\n\t * constructor to parse.\n\t */\n\tvar numeric = +str;\n\tif (!isNaN(numeric)) {\n\t\treturn (new Date(numeric));\n\t} else {\n\t\treturn (new Date(str));\n\t}\n}\n\n\n/*\n * Number.*_SAFE_INTEGER isn't present before node v0.12, so we hardcode\n * the ES6 definitions here, while allowing for them to someday be higher.\n */\nvar MAX_SAFE_INTEGER = Number.MAX_SAFE_INTEGER || 9007199254740991;\nvar MIN_SAFE_INTEGER = Number.MIN_SAFE_INTEGER || -9007199254740991;\n\n\n/*\n * Default options for parseInteger().\n */\nvar PI_DEFAULTS = {\n\tbase: 10,\n\tallowSign: true,\n\tallowPrefix: false,\n\tallowTrailing: false,\n\tallowImprecise: false,\n\ttrimWhitespace: false,\n\tleadingZeroIsOctal: false\n};\n\nvar CP_0 = 0x30;\nvar CP_9 = 0x39;\n\nvar CP_A = 0x41;\nvar CP_B = 0x42;\nvar CP_O = 0x4f;\nvar CP_T = 0x54;\nvar CP_X = 0x58;\nvar CP_Z = 0x5a;\n\nvar CP_a = 0x61;\nvar CP_b = 0x62;\nvar CP_o = 0x6f;\nvar CP_t = 0x74;\nvar CP_x = 0x78;\nvar CP_z = 0x7a;\n\nvar PI_CONV_DEC = 0x30;\nvar PI_CONV_UC = 0x37;\nvar PI_CONV_LC = 0x57;\n\n\n/*\n * A stricter version of parseInt() that provides options for changing what\n * is an acceptable string (for example, disallowing trailing characters).\n */\nfunction parseInteger(str, uopts)\n{\n\tmod_assert.string(str, 'str');\n\tmod_assert.optionalObject(uopts, 'options');\n\n\tvar baseOverride = false;\n\tvar options = PI_DEFAULTS;\n\n\tif (uopts) {\n\t\tbaseOverride = hasKey(uopts, 'base');\n\t\toptions = mergeObjects(options, uopts);\n\t\tmod_assert.number(options.base, 'options.base');\n\t\tmod_assert.ok(options.base >= 2, 'options.base >= 2');\n\t\tmod_assert.ok(options.base <= 36, 'options.base <= 36');\n\t\tmod_assert.bool(options.allowSign, 'options.allowSign');\n\t\tmod_assert.bool(options.allowPrefix, 'options.allowPrefix');\n\t\tmod_assert.bool(options.allowTrailing,\n\t\t 'options.allowTrailing');\n\t\tmod_assert.bool(options.allowImprecise,\n\t\t 'options.allowImprecise');\n\t\tmod_assert.bool(options.trimWhitespace,\n\t\t 'options.trimWhitespace');\n\t\tmod_assert.bool(options.leadingZeroIsOctal,\n\t\t 'options.leadingZeroIsOctal');\n\n\t\tif (options.leadingZeroIsOctal) {\n\t\t\tmod_assert.ok(!baseOverride,\n\t\t\t '\"base\" and \"leadingZeroIsOctal\" are ' +\n\t\t\t 'mutually exclusive');\n\t\t}\n\t}\n\n\tvar c;\n\tvar pbase = -1;\n\tvar base = options.base;\n\tvar start;\n\tvar mult = 1;\n\tvar value = 0;\n\tvar idx = 0;\n\tvar len = str.length;\n\n\t/* Trim any whitespace on the left side. */\n\tif (options.trimWhitespace) {\n\t\twhile (idx < len && isSpace(str.charCodeAt(idx))) {\n\t\t\t++idx;\n\t\t}\n\t}\n\n\t/* Check the number for a leading sign. */\n\tif (options.allowSign) {\n\t\tif (str[idx] === '-') {\n\t\t\tidx += 1;\n\t\t\tmult = -1;\n\t\t} else if (str[idx] === '+') {\n\t\t\tidx += 1;\n\t\t}\n\t}\n\n\t/* Parse the base-indicating prefix if there is one. */\n\tif (str[idx] === '0') {\n\t\tif (options.allowPrefix) {\n\t\t\tpbase = prefixToBase(str.charCodeAt(idx + 1));\n\t\t\tif (pbase !== -1 && (!baseOverride || pbase === base)) {\n\t\t\t\tbase = pbase;\n\t\t\t\tidx += 2;\n\t\t\t}\n\t\t}\n\n\t\tif (pbase === -1 && options.leadingZeroIsOctal) {\n\t\t\tbase = 8;\n\t\t}\n\t}\n\n\t/* Parse the actual digits. */\n\tfor (start = idx; idx < len; ++idx) {\n\t\tc = translateDigit(str.charCodeAt(idx));\n\t\tif (c !== -1 && c < base) {\n\t\t\tvalue *= base;\n\t\t\tvalue += c;\n\t\t} else {\n\t\t\tbreak;\n\t\t}\n\t}\n\n\t/* If we didn't parse any digits, we have an invalid number. */\n\tif (start === idx) {\n\t\treturn (new Error('invalid number: ' + JSON.stringify(str)));\n\t}\n\n\t/* Trim any whitespace on the right side. */\n\tif (options.trimWhitespace) {\n\t\twhile (idx < len && isSpace(str.charCodeAt(idx))) {\n\t\t\t++idx;\n\t\t}\n\t}\n\n\t/* Check for trailing characters. */\n\tif (idx < len && !options.allowTrailing) {\n\t\treturn (new Error('trailing characters after number: ' +\n\t\t JSON.stringify(str.slice(idx))));\n\t}\n\n\t/* If our value is 0, we return now, to avoid returning -0. */\n\tif (value === 0) {\n\t\treturn (0);\n\t}\n\n\t/* Calculate our final value. */\n\tvar result = value * mult;\n\n\t/*\n\t * If the string represents a value that cannot be precisely represented\n\t * by JavaScript, then we want to check that:\n\t *\n\t * - We never increased the value past MAX_SAFE_INTEGER\n\t * - We don't make the result negative and below MIN_SAFE_INTEGER\n\t *\n\t * Because we only ever increment the value during parsing, there's no\n\t * chance of moving past MAX_SAFE_INTEGER and then dropping below it\n\t * again, losing precision in the process. This means that we only need\n\t * to do our checks here, at the end.\n\t */\n\tif (!options.allowImprecise &&\n\t (value > MAX_SAFE_INTEGER || result < MIN_SAFE_INTEGER)) {\n\t\treturn (new Error('number is outside of the supported range: ' +\n\t\t JSON.stringify(str.slice(start, idx))));\n\t}\n\n\treturn (result);\n}\n\n\n/*\n * Interpret a character code as a base-36 digit.\n */\nfunction translateDigit(d)\n{\n\tif (d >= CP_0 && d <= CP_9) {\n\t\t/* '0' to '9' -> 0 to 9 */\n\t\treturn (d - PI_CONV_DEC);\n\t} else if (d >= CP_A && d <= CP_Z) {\n\t\t/* 'A' - 'Z' -> 10 to 35 */\n\t\treturn (d - PI_CONV_UC);\n\t} else if (d >= CP_a && d <= CP_z) {\n\t\t/* 'a' - 'z' -> 10 to 35 */\n\t\treturn (d - PI_CONV_LC);\n\t} else {\n\t\t/* Invalid character code */\n\t\treturn (-1);\n\t}\n}\n\n\n/*\n * Test if a value matches the ECMAScript definition of trimmable whitespace.\n */\nfunction isSpace(c)\n{\n\treturn (c === 0x20) ||\n\t (c >= 0x0009 && c <= 0x000d) ||\n\t (c === 0x00a0) ||\n\t (c === 0x1680) ||\n\t (c === 0x180e) ||\n\t (c >= 0x2000 && c <= 0x200a) ||\n\t (c === 0x2028) ||\n\t (c === 0x2029) ||\n\t (c === 0x202f) ||\n\t (c === 0x205f) ||\n\t (c === 0x3000) ||\n\t (c === 0xfeff);\n}\n\n\n/*\n * Determine which base a character indicates (e.g., 'x' indicates hex).\n */\nfunction prefixToBase(c)\n{\n\tif (c === CP_b || c === CP_B) {\n\t\t/* 0b/0B (binary) */\n\t\treturn (2);\n\t} else if (c === CP_o || c === CP_O) {\n\t\t/* 0o/0O (octal) */\n\t\treturn (8);\n\t} else if (c === CP_t || c === CP_T) {\n\t\t/* 0t/0T (decimal) */\n\t\treturn (10);\n\t} else if (c === CP_x || c === CP_X) {\n\t\t/* 0x/0X (hexadecimal) */\n\t\treturn (16);\n\t} else {\n\t\t/* Not a meaningful character */\n\t\treturn (-1);\n\t}\n}\n\n\nfunction validateJsonObjectJS(schema, input)\n{\n\tvar report = mod_jsonschema.validate(input, schema);\n\n\tif (report.errors.length === 0)\n\t\treturn (null);\n\n\t/* Currently, we only do anything useful with the first error. */\n\tvar error = report.errors[0];\n\n\t/* The failed property is given by a URI with an irrelevant prefix. */\n\tvar propname = error['property'];\n\tvar reason = error['message'].toLowerCase();\n\tvar i, j;\n\n\t/*\n\t * There's at least one case where the property error message is\n\t * confusing at best. We work around this here.\n\t */\n\tif ((i = reason.indexOf('the property ')) != -1 &&\n\t (j = reason.indexOf(' is not defined in the schema and the ' +\n\t 'schema does not allow additional properties')) != -1) {\n\t\ti += 'the property '.length;\n\t\tif (propname === '')\n\t\t\tpropname = reason.substr(i, j - i);\n\t\telse\n\t\t\tpropname = propname + '.' + reason.substr(i, j - i);\n\n\t\treason = 'unsupported property';\n\t}\n\n\tvar rv = new mod_verror.VError('property \"%s\": %s', propname, reason);\n\trv.jsv_details = error;\n\treturn (rv);\n}\n\nfunction randElt(arr)\n{\n\tmod_assert.ok(Array.isArray(arr) && arr.length > 0,\n\t 'randElt argument must be a non-empty array');\n\n\treturn (arr[Math.floor(Math.random() * arr.length)]);\n}\n\nfunction assertHrtime(a)\n{\n\tmod_assert.ok(a[0] >= 0 && a[1] >= 0,\n\t 'negative numbers not allowed in hrtimes');\n\tmod_assert.ok(a[1] < 1e9, 'nanoseconds column overflow');\n}\n\n/*\n * Compute the time elapsed between hrtime readings A and B, where A is later\n * than B. hrtime readings come from Node's process.hrtime(). There is no\n * defined way to represent negative deltas, so it's illegal to diff B from A\n * where the time denoted by B is later than the time denoted by A. If this\n * becomes valuable, we can define a representation and extend the\n * implementation to support it.\n */\nfunction hrtimeDiff(a, b)\n{\n\tassertHrtime(a);\n\tassertHrtime(b);\n\tmod_assert.ok(a[0] > b[0] || (a[0] == b[0] && a[1] >= b[1]),\n\t 'negative differences not allowed');\n\n\tvar rv = [ a[0] - b[0], 0 ];\n\n\tif (a[1] >= b[1]) {\n\t\trv[1] = a[1] - b[1];\n\t} else {\n\t\trv[0]--;\n\t\trv[1] = 1e9 - (b[1] - a[1]);\n\t}\n\n\treturn (rv);\n}\n\n/*\n * Convert a hrtime reading from the array format returned by Node's\n * process.hrtime() into a scalar number of nanoseconds.\n */\nfunction hrtimeNanosec(a)\n{\n\tassertHrtime(a);\n\n\treturn (Math.floor(a[0] * 1e9 + a[1]));\n}\n\n/*\n * Convert a hrtime reading from the array format returned by Node's\n * process.hrtime() into a scalar number of microseconds.\n */\nfunction hrtimeMicrosec(a)\n{\n\tassertHrtime(a);\n\n\treturn (Math.floor(a[0] * 1e6 + a[1] / 1e3));\n}\n\n/*\n * Convert a hrtime reading from the array format returned by Node's\n * process.hrtime() into a scalar number of milliseconds.\n */\nfunction hrtimeMillisec(a)\n{\n\tassertHrtime(a);\n\n\treturn (Math.floor(a[0] * 1e3 + a[1] / 1e6));\n}\n\n/*\n * Add two hrtime readings A and B, overwriting A with the result of the\n * addition. This function is useful for accumulating several hrtime intervals\n * into a counter. Returns A.\n */\nfunction hrtimeAccum(a, b)\n{\n\tassertHrtime(a);\n\tassertHrtime(b);\n\n\t/*\n\t * Accumulate the nanosecond component.\n\t */\n\ta[1] += b[1];\n\tif (a[1] >= 1e9) {\n\t\t/*\n\t\t * The nanosecond component overflowed, so carry to the seconds\n\t\t * field.\n\t\t */\n\t\ta[0]++;\n\t\ta[1] -= 1e9;\n\t}\n\n\t/*\n\t * Accumulate the seconds component.\n\t */\n\ta[0] += b[0];\n\n\treturn (a);\n}\n\n/*\n * Add two hrtime readings A and B, returning the result as a new hrtime array.\n * Does not modify either input argument.\n */\nfunction hrtimeAdd(a, b)\n{\n\tassertHrtime(a);\n\n\tvar rv = [ a[0], a[1] ];\n\n\treturn (hrtimeAccum(rv, b));\n}\n\n\n/*\n * Check an object for unexpected properties. Accepts the object to check, and\n * an array of allowed property names (strings). Returns an array of key names\n * that were found on the object, but did not appear in the list of allowed\n * properties. If no properties were found, the returned array will be of\n * zero length.\n */\nfunction extraProperties(obj, allowed)\n{\n\tmod_assert.ok(typeof (obj) === 'object' && obj !== null,\n\t 'obj argument must be a non-null object');\n\tmod_assert.ok(Array.isArray(allowed),\n\t 'allowed argument must be an array of strings');\n\tfor (var i = 0; i < allowed.length; i++) {\n\t\tmod_assert.ok(typeof (allowed[i]) === 'string',\n\t\t 'allowed argument must be an array of strings');\n\t}\n\n\treturn (Object.keys(obj).filter(function (key) {\n\t\treturn (allowed.indexOf(key) === -1);\n\t}));\n}\n\n/*\n * Given three sets of properties \"provided\" (may be undefined), \"overrides\"\n * (required), and \"defaults\" (may be undefined), construct an object containing\n * the union of these sets with \"overrides\" overriding \"provided\", and\n * \"provided\" overriding \"defaults\". None of the input objects are modified.\n */\nfunction mergeObjects(provided, overrides, defaults)\n{\n\tvar rv, k;\n\n\trv = {};\n\tif (defaults) {\n\t\tfor (k in defaults)\n\t\t\trv[k] = defaults[k];\n\t}\n\n\tif (provided) {\n\t\tfor (k in provided)\n\t\t\trv[k] = provided[k];\n\t}\n\n\tif (overrides) {\n\t\tfor (k in overrides)\n\t\t\trv[k] = overrides[k];\n\t}\n\n\treturn (rv);\n}\n",null,"/**\n * Fetches a bearer token via comamnd\n */\n\n'use strict'\n\n// for API compatability\n/* eslint no-sync: 0 */\nconst spawnSync = require('child_process').spawnSync\n\nfunction getProperty (propertyName, object) {\n // remove leading .\n if (propertyName.match(/^\\./)) {\n propertyName = propertyName.replace(/^\\./, '')\n }\n\n const parts = propertyName.split('.')\n const length = parts.length\n\n let property = object || this\n for (let i = 0; i < length; i++) {\n property = property[parts[i]]\n }\n\n return property\n}\n\nmodule.exports = {\n refresh: function (config) {\n return new Promise((resolve, reject) => {\n const cmd = config['cmd-path']\n const args = config['cmd-args'].split(' ')\n const cmdEnv = config['cmd-env']\n\n let output\n\n if (process.platform === 'win32') {\n output = spawnSync(cmd, args, {\n env: Object.assign({}, process.env, cmdEnv),\n windowsHide: true,\n shell: true\n })\n } else {\n output = spawnSync(cmd, args, {\n env: Object.assign({}, process.env, cmdEnv),\n windowsHide: true\n })\n }\n\n let result\n try {\n result = JSON.parse(output.stdout.toString('utf8'))\n } catch (err) {\n return reject(new Error('Failed to run cmd.'))\n }\n\n const token = getProperty(config['token-key'].replace(/[{}]+/g, ''), result)\n\n return resolve(token)\n })\n }\n}\n","/**\n * Refreshes a OpenID token.\n */\n\n'use strict'\n\nconst Issuer = require('openid-client').Issuer\n\nmodule.exports = {\n refresh: function (config) {\n return new Promise((resolve, reject) => {\n Issuer.discover(config['idp-issuer-url'])\n .then(function (ourIssuer) {\n const client = new ourIssuer.Client({\n client_id: config['client-id'],\n client_secret: config['client-secret']\n })\n\n return client.refresh(config['refresh-token'])\n })\n .then(tokenSet => {\n return resolve(tokenSet.id_token)\n })\n .catch(reject)\n })\n }\n}\n",null,"'use strict'\n/* eslint no-process-env: 0 no-sync:0 */\n\nconst deprecate = require('depd')('kubernetes-client')\nconst fs = require('fs')\nconst path = require('path')\nconst yaml = require('js-yaml')\nconst merge = require('deepmerge')\n\nconst root = process.env.KUBERNETES_CLIENT_SERVICEACCOUNT_ROOT || '/var/run/secrets/kubernetes.io/serviceaccount/'\nconst caPath = path.join(root, 'ca.crt')\nconst tokenPath = path.join(root, 'token')\nconst namespacePath = path.join(root, 'namespace')\n\nfunction convertKubeconfig (kubeconfig) {\n const context = kubeconfig.getCurrentContext()\n const cluster = kubeconfig.getCurrentCluster()\n const user = kubeconfig.getCurrentUser()\n const namespace = context.namespace\n\n let ca\n let insecureSkipTlsVerify = false\n if (cluster) {\n if (cluster.caFile) {\n ca = fs.readFileSync(path.normalize(cluster.caFile))\n } else if (cluster.caData) {\n ca = Buffer.from(cluster.caData, 'base64').toString()\n }\n insecureSkipTlsVerify = cluster.skipTLSVerify\n }\n\n let cert\n let key\n\n let auth = {}\n if (user) {\n if (user.certFile) {\n cert = fs.readFileSync(path.normalize(user.certFile))\n } else if (user.certData) {\n cert = Buffer.from(user.certData, 'base64').toString()\n }\n\n if (user.keyFile) {\n key = fs.readFileSync(path.normalize(user.keyFile))\n } else if (user.keyData) {\n key = Buffer.from(user.keyData, 'base64').toString()\n }\n\n if (user.token) {\n auth.bearer = user.token\n }\n\n if (user.authProvider) {\n const config = user.authProvider.config\n\n // if we can't determine the type, just fail later (or don't refresh).\n let type = null\n let token = null\n if (config['cmd-path']) {\n type = 'cmd'\n token = config['access-token']\n } else if (config['idp-issuer-url']) {\n type = 'openid'\n token = config['id-token']\n }\n\n // If we have just an access-token, allow that... will expire later though.\n if (config['access-token'] && !type) {\n token = config['access-token']\n }\n\n auth = {\n request: {\n bearer: token\n },\n provider: {\n config,\n type\n }\n }\n }\n\n if (user.exec) {\n const env = {}\n if (user.exec.env) {\n user.exec.env.forEach(variable => {\n env[variable.name] = variable.value\n })\n }\n let args = ''\n if (user.exec.args) {\n args = user.exec.args.join(' ')\n }\n auth = {\n provider: {\n type: 'cmd',\n config: {\n 'cmd-args': args,\n 'cmd-path': user.exec.command,\n 'token-key': 'status.token',\n 'cmd-env': env\n }\n }\n }\n }\n\n if (user.username) auth.user = user.username\n if (user.password) auth.pass = user.password\n }\n\n return {\n url: cluster.server,\n auth: Object.keys(auth).length ? auth : null,\n ca,\n insecureSkipTlsVerify,\n namespace,\n cert,\n key\n }\n}\n\nmodule.exports.convertKubeconfig = convertKubeconfig\n\nfunction defaultConfigPaths () {\n if (process.env.KUBECONFIG) {\n // From https://kubernetes.io/docs/tasks/access-application-cluster/configure-access-multiple-clusters/#set-the-kubeconfig-environment-variable\n // KUBECONFIG can support multiple config files.\n const delimiter = process.platform === 'win32' ? ';' : ':'\n return process.env.KUBECONFIG.split(delimiter)\n }\n const homeDir = process.env[(process.platform === 'win32') ? 'USERPROFILE' : 'HOME']\n return [path.join(homeDir, '.kube', 'config')]\n}\n\n/**\n* Returns with in cluster config\n* Based on: https://github.com/kubernetes/client-go/blob/124670e99da15091e13916f0ad4b2b2df2a39cd5/rest/config.go#L274\n* and http://kubernetes.io/docs/user-guide/accessing-the-cluster/#accessing-the-api-from-a-pod\n*\n* @function getInCluster\n* @returns {Object} { url, cert, auth, namespace }\n*/\nfunction getInCluster () {\n const host = process.env.KUBERNETES_SERVICE_HOST\n const port = process.env.KUBERNETES_SERVICE_PORT\n if (!host || !port) {\n throw new TypeError(\n 'Unable to load in-cluster configuration, KUBERNETES_SERVICE_HOST' +\n ' and KUBERNETES_SERVICE_PORT must be defined')\n }\n\n const ca = fs.readFileSync(caPath, 'utf8')\n const bearer = fs.readFileSync(tokenPath, 'utf8')\n const namespace = fs.readFileSync(namespacePath, 'utf8')\n\n return {\n url: `https://${host}:${port}`,\n ca,\n auth: { bearer },\n namespace\n }\n}\n\nmodule.exports.getInCluster = deprecate.function(\n getInCluster,\n 'getInCluster see https://github.com/godaddy/kubernetes-client/blob/master/merging-with-kubernetes.md#request-kubeconfig-')\n\n//\n// Accept a manually specified current-context to take precedence over\n// `current-context`\n//\n/* eslint-disable complexity, max-statements */\nfunction fromKubeconfig (kubeconfig, current) {\n if (!kubeconfig) kubeconfig = loadKubeconfig()\n // if kubeconfig is provided as a path to the yaml file,\n // or array of paths to the yaml files,\n // automatically load it.\n if (typeof kubeconfig === 'string' || Array.isArray(kubeconfig)) {\n kubeconfig = loadKubeconfig(kubeconfig)\n }\n\n current = current || kubeconfig['current-context']\n const context = kubeconfig.contexts\n .find(item => item.name === current).context\n const cluster = kubeconfig.clusters\n .find(item => item.name === context.cluster).cluster\n const userConfig = kubeconfig.users\n .find(user => user.name === context.user)\n const user = userConfig ? userConfig.user : null\n const namespace = context.namespace\n\n let ca\n let insecureSkipTlsVerify = false\n if (cluster) {\n if (cluster['certificate-authority']) {\n ca = fs.readFileSync(path.normalize(cluster['certificate-authority']))\n } else if (cluster['certificate-authority-data']) {\n ca = Buffer.from(cluster['certificate-authority-data'], 'base64').toString()\n }\n\n if (cluster['insecure-skip-tls-verify']) {\n insecureSkipTlsVerify = cluster['insecure-skip-tls-verify']\n }\n }\n\n let cert\n let key\n\n let auth = {}\n if (user) {\n if (user['client-certificate']) {\n cert = fs.readFileSync(path.normalize(user['client-certificate']))\n } else if (user['client-certificate-data']) {\n cert = Buffer.from(user['client-certificate-data'], 'base64').toString()\n }\n\n if (user['client-key']) {\n key = fs.readFileSync(path.normalize(user['client-key']))\n } else if (user['client-key-data']) {\n key = Buffer.from(user['client-key-data'], 'base64').toString()\n }\n\n if (user.token) {\n auth.bearer = user.token\n }\n\n if (user['auth-provider']) {\n const config = user['auth-provider'].config\n\n // if we can't determine the type, just fail later (or don't refresh).\n let type = null\n let token = null\n if (config['cmd-path']) {\n type = 'cmd'\n token = config['access-token']\n } else if (config['idp-issuer-url']) {\n type = 'openid'\n token = config['id-token']\n }\n\n // If we have just an access-token, allow that... will expire later though.\n if (config['access-token'] && !type) {\n token = config['access-token']\n }\n\n auth = {\n request: {\n bearer: token\n },\n provider: {\n config,\n type\n }\n }\n }\n\n if (user.exec) {\n const env = {}\n if (user.exec.env) {\n user.exec.env.forEach(variable => {\n env[variable.name] = variable.value\n })\n }\n let args = ''\n if (user.exec.args) {\n args = user.exec.args.join(' ')\n }\n auth = {\n provider: {\n type: 'cmd',\n config: {\n 'cmd-args': args,\n 'cmd-path': user.exec.command,\n 'token-key': 'status.token',\n 'cmd-env': env\n }\n }\n }\n }\n\n if (user.username) auth.user = user.username\n if (user.password) auth.pass = user.password\n }\n\n return {\n url: cluster.server,\n namespace,\n auth: Object.keys(auth).length ? auth : null,\n ca,\n insecureSkipTlsVerify,\n key,\n cert\n }\n}\n/* eslint-enable complexity, max-statements */\n\nmodule.exports.fromKubeconfig = deprecate.function(\n fromKubeconfig,\n 'fromKubeconfig see https://github.com/godaddy/kubernetes-client/blob/master/merging-with-kubernetes.md#request-kubeconfig-')\n\nfunction mapCertificates (cfgPath, config) {\n const configDir = path.dirname(cfgPath)\n\n if (config.clusters) {\n config.clusters.filter(cluster => cluster.cluster['certificate-authority']).forEach(cluster => {\n cluster.cluster['certificate-authority'] = path.resolve(configDir, cluster.cluster['certificate-authority'])\n })\n }\n\n if (config.users) {\n config.users.filter(user => user.user['client-certificate']).forEach(user => {\n user.user['client-certificate'] = path.resolve(configDir, user.user['client-certificate'])\n })\n\n config.users.filter(user => user.user['client-key']).forEach(user => {\n user.user['client-key'] = path.resolve(configDir, user.user['client-key'])\n })\n }\n\n return config\n}\n\nfunction loadKubeconfig (cfgPath) {\n let cfgPaths\n\n if (!cfgPath) {\n cfgPaths = defaultConfigPaths()\n } else if (Array.isArray(cfgPath)) {\n cfgPaths = cfgPath\n } else {\n cfgPaths = [cfgPath]\n }\n\n const configs = cfgPaths.map(cfgPath => {\n const config = yaml.safeLoad(fs.readFileSync(cfgPath))\n return mapCertificates(cfgPath, config)\n })\n\n return merge.all(configs)\n}\n\nmodule.exports.loadKubeconfig = deprecate.function(\n loadKubeconfig,\n 'loadKubeconfig see https://github.com/godaddy/kubernetes-client/blob/master/merging-with-kubernetes.md#request-kubeconfig-')\n","const Request = require('./client')\n\nRequest.config = require('./config')\n\nmodule.exports = Request\n","'use strict'\n\n// We support the full names and all the abbbreviated aliases:\n// http://kubernetes.io/docs/user-guide/kubectl-overview/\n// and anything else we think is useful.\nconst resourceAliases = {\n clusterroles: [],\n clusterrolebindings: [],\n componentstatuses: ['cs'],\n configmaps: ['cm'],\n cronjobs: [],\n customresourcedefinitions: ['crd'],\n daemonsets: ['ds'],\n deployments: ['deploy'],\n events: ['ev'],\n endpoints: ['ep'],\n horizontalpodautoscalers: ['hpa'],\n ingresses: ['ing'],\n jobs: [],\n limitranges: ['limits'],\n namespaces: ['ns'],\n nodes: ['no'],\n persistentvolumes: ['pv'],\n persistentvolumeclaims: ['pvc'],\n // Deprecated name of statefulsets in kubernetes 1.4\n petsets: [],\n pods: ['po'],\n replicationcontrollers: ['rc'],\n replicasets: ['rs'],\n resourcequotas: ['quota'],\n roles: [],\n rolebindings: [],\n // Deprecated name of cronjobs in kubernetes 1.4\n scheduledjobs: [],\n secrets: [],\n serviceaccounts: [],\n services: ['svc'],\n statefulsets: [],\n // Deprecated name of customresourcedefinition in kubernetes 1.7\n thirdpartyresources: []\n}\n\nconst esPlurals = {\n componentstatuses: true,\n ingresses: true\n}\n\nconst excludeFromAliasing = {\n apis: true,\n status: true\n}\n\nmodule.exports = function (resourceType) {\n let aliases = [resourceType]\n if (resourceAliases[resourceType]) {\n aliases = aliases.concat(resourceAliases[resourceType])\n }\n\n //\n // NOTE(sbw): try to catch things that shouldn't have singular aliases. This\n // fails on some relatively common resources, like \"status\".\n //\n if ((resourceType.slice(-1) !== 's') || (resourceType in excludeFromAliasing)) {\n return aliases\n }\n\n const trimLength = esPlurals[resourceType] ? 2 : 1\n const single = resourceType.substr(0, resourceType.length - trimLength)\n aliases.push(single)\n return aliases\n}\n","const k8s = require('@kubernetes/client-node')\n\nmodule.exports = k8s.KubeConfig\n","const deprecate = require('depd')('kubernetes-client')\n\nmodule.exports = {\n Client: require('./swagger-client').Client,\n Client1_13: require('./swagger-client').Client1_13,\n alias: require('./alias'),\n config: require('../backends/request/config'),\n KubeConfig: require('./config')\n}\n\ndeprecate.property(\n module.exports,\n 'config',\n 'require(\\'kubernetes-client\\').config,' +\n ' use require(\\'kubernetes-client/backends/request\\').config.')\n","'use strict'\n/* eslint-disable no-sync */\n\n/**\n * @file Convert a Swagger specification into a kubernetes-client API client.\n *\n * Represent Swagger a Path Item Object [1] with chains of objects:\n *\n * /api/v1/namespaces -> api.v1.namespaces\n *\n * Associate operations on a Path Item Object with functions:\n *\n * GET /api/v1/namespaces -> api.v1.namespaces.get()\n *\n * Represent Path Templating [2] with function calls:\n *\n * /api/v1/namespaces/{namespace}/pods -> api.v1.namespaces(namespace).pods\n *\n * Iterate over a Paths Object [3] to generate whole API client.\n *\n * [1]: https://swagger.io/specification/#pathItemObject\n * [2]: https://swagger.io/specification/#pathTemplating\n * [3]: https://swagger.io/specification/#pathsObject\n */\n\nconst Component = require('swagger-fluent').Component\nconst deprecate = require('depd')('kubernetes-client')\nconst fs = require('fs')\nconst KubeConfig = require('./config')\nconst path = require('path')\nconst zlib = require('zlib')\n\nconst getAliases = require('./alias')\nconst Request = require('../backends/request')\n\nclass Root extends Component {\n _getSpec (pathname) {\n return this.backend.http({ method: 'GET', pathname })\n .then(res => {\n return res.body\n })\n }\n\n /**\n * Load swagger.json from kube-apiserver.\n * @returns {Promise} Promise\n */\n loadSpec () {\n return this._getSpec('/openapi/v2')\n .catch(() => {\n return this._getSpec('/swagger.json')\n })\n .then(res => {\n this._addSpec(res)\n return this\n })\n .catch(err => {\n throw new Error(`Failed to get /openapi/v2 and /swagger.json: ${err.message}`)\n })\n }\n\n _getLogByteStream (options) {\n return this.backend.getLogByteStream(Object.assign({\n method: 'GET',\n pathItemObject: this.pathItemObject,\n pathname: this.getPath(),\n pathnameParameters: this.getPathnameParameters()\n }, options))\n }\n\n async _getWatchObjectStream (options) {\n return this.backend.getWatchObjectStream(Object.assign({\n method: 'GET',\n pathItemObject: this.pathItemObject,\n pathname: this.getPath(),\n pathnameParameters: this.getPathnameParameters()\n }, options))\n }\n\n _addEndpoint (endpoint) {\n const component = super._addEndpoint(endpoint)\n if (!component) return component\n\n //\n // Deprecate stream API.\n //\n if (endpoint.pathItem.get) {\n const action = endpoint.pathItem.get['x-kubernetes-action']\n if (action === 'watch' || action === 'watchlist') {\n component.getStream = deprecate.function(\n component.getStream,\n '.getStream use .getObjectStream, see ' +\n 'https://github.com/godaddy/kubernetes-client/blob/master/merging-with-kubernetes.md')\n component.getObjectStream = component._getWatchObjectStream\n } else if (endpoint.name === '/api/v1/namespaces/{namespace}/pods/{name}/log') {\n component.getStream = deprecate.function(\n component.getStream,\n '.getStream use .getByteStream, see ' +\n 'https://github.com/godaddy/kubernetes-client/blob/master/merging-with-kubernetes.md')\n component.getByteStream = component._getLogByteStream\n } else {\n component.getStream = deprecate.function(\n component.getStream,\n '.getStream see https://github.com/godaddy/kubernetes-client/blob/master/merging-with-kubernetes.md')\n }\n }\n }\n\n addCustomResourceDefinition (manifest) {\n const group = manifest.spec.group\n const name = manifest.spec.names.plural\n const namespace = manifest.spec.scope === 'Cluster' ? '' : '/namespaces/{namespace}'\n\n const addSpec = (version) => {\n const spec = { paths: {} }\n //\n // Make just enough of Swagger spec to generate some useful endpoints.\n //\n const templatePath = `/apis/${group}/${version}${namespace}/${name}/{name}`\n spec.paths[templatePath] = ['delete', 'get', 'patch', 'put'].reduce((acc, method) => {\n acc[method] = { operationId: `${method}Template${name}` }\n return acc\n }, {})\n\n const resourcePath = `/apis/${group}/${version}${namespace}/${name}`\n spec.paths[resourcePath] = ['get', 'post'].reduce((acc, method) => {\n acc[method] = { operationId: `${method}${name}` }\n return acc\n }, {})\n //\n // Namespaced CRDs get a cluster-level GET endpoint.\n // Similar to GET /api/v1/pods.\n //\n if (manifest.spec.scope === 'Namespaced') {\n const clusterPath = `/apis/${group}/${version}/${name}`\n spec.paths[clusterPath] = {\n get: {\n operationId: `getCluster${name}`\n }\n }\n }\n\n const watchPaths = {\n watchCluster: `/apis/${group}/${version}/watch/${name}`,\n watchNamespace: `/apis/${group}/${version}/watch${namespace}/${name}`,\n watchResource: `/apis/${group}/${version}/watch${namespace}/${name}/{name}`\n }\n Object.keys(watchPaths).forEach(operationId => {\n const watchPath = watchPaths[operationId]\n spec.paths[watchPath] = {\n get: {\n 'x-kubernetes-action': 'watch',\n operationId: `operationId${name}`\n }\n }\n })\n\n // Add status endpoint - see https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.11/#customresourcesubresourcestatus-v1beta1-apiextensions-k8s-io\n if (manifest.spec.subresources && manifest.spec.subresources.status) {\n const statusPath = `/apis/${group}/${version}${namespace}/${name}/{name}/status`\n spec.paths[statusPath] = ['get', 'put'].reduce((acc, method) => {\n acc[method] = { operationId: `${method}Template${name}` }\n return acc\n }, {})\n }\n\n // Add scale endpoints - see https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.11/#customresourcesubresourcescale-v1beta1-apiextensions-k8s-io\n if (manifest.spec.subresources && manifest.spec.subresources.scale) {\n const statusPath = `/apis/${group}/${version}${namespace}/${name}/{name}/scale`\n spec.paths[statusPath] = ['get', 'put'].reduce((acc, method) => {\n acc[method] = { operationId: `${method}Template${name}` }\n return acc\n }, {})\n }\n\n this._addSpec(spec)\n }\n\n if (manifest.spec.version) {\n addSpec(manifest.spec.version)\n } else {\n const versions = manifest.spec.versions || []\n versions.forEach(version => addSpec(version.name))\n }\n }\n}\n\nclass Client {\n constructor (options) {\n options = options || {}\n\n if (options.config) {\n deprecate('Client({ config }), see ' +\n 'https://github.com/godaddy/kubernetes-client/blob/master/merging-with-kubernetes.md')\n }\n\n let backend = options.backend\n if (!backend) {\n if (options.config) {\n backend = new Request(options.config)\n } else {\n const kubeconfig = new KubeConfig()\n kubeconfig.loadFromDefault()\n backend = new Request({ kubeconfig })\n }\n }\n\n let spec = options.spec\n if (!spec && options.version) {\n const swaggerPath = path.join(\n __dirname,\n 'specs',\n `swagger-${options.version}.json.gz`)\n spec = JSON.parse(zlib.gunzipSync(fs.readFileSync(swaggerPath)))\n }\n\n const root = new Root({ splits: [], backend, getNames: options.getNames || getAliases })\n if (spec) root._addSpec(spec)\n return root\n }\n}\n\n// eslint-disable-next-line camelcase\nclass Client1_13 extends Client {\n constructor (options) {\n super(Object.assign({}, options, { version: '1.13' }))\n }\n}\n\nmodule.exports = {\n Client,\n Client1_13\n}\n","'use strict';\n\nconst WebSocket = require('./lib/websocket');\n\nWebSocket.createWebSocketStream = require('./lib/stream');\nWebSocket.Server = require('./lib/websocket-server');\nWebSocket.Receiver = require('./lib/receiver');\nWebSocket.Sender = require('./lib/sender');\n\nmodule.exports = WebSocket;\n","'use strict';\n\nconst { EMPTY_BUFFER } = require('./constants');\n\n/**\n * Merges an array of buffers into a new buffer.\n *\n * @param {Buffer[]} list The array of buffers to concat\n * @param {Number} totalLength The total length of buffers in the list\n * @return {Buffer} The resulting buffer\n * @public\n */\nfunction concat(list, totalLength) {\n if (list.length === 0) return EMPTY_BUFFER;\n if (list.length === 1) return list[0];\n\n const target = Buffer.allocUnsafe(totalLength);\n let offset = 0;\n\n for (let i = 0; i < list.length; i++) {\n const buf = list[i];\n target.set(buf, offset);\n offset += buf.length;\n }\n\n if (offset < totalLength) return target.slice(0, offset);\n\n return target;\n}\n\n/**\n * Masks a buffer using the given mask.\n *\n * @param {Buffer} source The buffer to mask\n * @param {Buffer} mask The mask to use\n * @param {Buffer} output The buffer where to store the result\n * @param {Number} offset The offset at which to start writing\n * @param {Number} length The number of bytes to mask.\n * @public\n */\nfunction _mask(source, mask, output, offset, length) {\n for (let i = 0; i < length; i++) {\n output[offset + i] = source[i] ^ mask[i & 3];\n }\n}\n\n/**\n * Unmasks a buffer using the given mask.\n *\n * @param {Buffer} buffer The buffer to unmask\n * @param {Buffer} mask The mask to use\n * @public\n */\nfunction _unmask(buffer, mask) {\n // Required until https://github.com/nodejs/node/issues/9006 is resolved.\n const length = buffer.length;\n for (let i = 0; i < length; i++) {\n buffer[i] ^= mask[i & 3];\n }\n}\n\n/**\n * Converts a buffer to an `ArrayBuffer`.\n *\n * @param {Buffer} buf The buffer to convert\n * @return {ArrayBuffer} Converted buffer\n * @public\n */\nfunction toArrayBuffer(buf) {\n if (buf.byteLength === buf.buffer.byteLength) {\n return buf.buffer;\n }\n\n return buf.buffer.slice(buf.byteOffset, buf.byteOffset + buf.byteLength);\n}\n\n/**\n * Converts `data` to a `Buffer`.\n *\n * @param {*} data The data to convert\n * @return {Buffer} The buffer\n * @throws {TypeError}\n * @public\n */\nfunction toBuffer(data) {\n toBuffer.readOnly = true;\n\n if (Buffer.isBuffer(data)) return data;\n\n let buf;\n\n if (data instanceof ArrayBuffer) {\n buf = Buffer.from(data);\n } else if (ArrayBuffer.isView(data)) {\n buf = Buffer.from(data.buffer, data.byteOffset, data.byteLength);\n } else {\n buf = Buffer.from(data);\n toBuffer.readOnly = false;\n }\n\n return buf;\n}\n\ntry {\n const bufferUtil = require('bufferutil');\n const bu = bufferUtil.BufferUtil || bufferUtil;\n\n module.exports = {\n concat,\n mask(source, mask, output, offset, length) {\n if (length < 48) _mask(source, mask, output, offset, length);\n else bu.mask(source, mask, output, offset, length);\n },\n toArrayBuffer,\n toBuffer,\n unmask(buffer, mask) {\n if (buffer.length < 32) _unmask(buffer, mask);\n else bu.unmask(buffer, mask);\n }\n };\n} catch (e) /* istanbul ignore next */ {\n module.exports = {\n concat,\n mask: _mask,\n toArrayBuffer,\n toBuffer,\n unmask: _unmask\n };\n}\n","'use strict';\n\nmodule.exports = {\n BINARY_TYPES: ['nodebuffer', 'arraybuffer', 'fragments'],\n GUID: '258EAFA5-E914-47DA-95CA-C5AB0DC85B11',\n kStatusCode: Symbol('status-code'),\n kWebSocket: Symbol('websocket'),\n EMPTY_BUFFER: Buffer.alloc(0),\n NOOP: () => {}\n};\n","'use strict';\n\n/**\n * Class representing an event.\n *\n * @private\n */\nclass Event {\n /**\n * Create a new `Event`.\n *\n * @param {String} type The name of the event\n * @param {Object} target A reference to the target to which the event was\n * dispatched\n */\n constructor(type, target) {\n this.target = target;\n this.type = type;\n }\n}\n\n/**\n * Class representing a message event.\n *\n * @extends Event\n * @private\n */\nclass MessageEvent extends Event {\n /**\n * Create a new `MessageEvent`.\n *\n * @param {(String|Buffer|ArrayBuffer|Buffer[])} data The received data\n * @param {WebSocket} target A reference to the target to which the event was\n * dispatched\n */\n constructor(data, target) {\n super('message', target);\n\n this.data = data;\n }\n}\n\n/**\n * Class representing a close event.\n *\n * @extends Event\n * @private\n */\nclass CloseEvent extends Event {\n /**\n * Create a new `CloseEvent`.\n *\n * @param {Number} code The status code explaining why the connection is being\n * closed\n * @param {String} reason A human-readable string explaining why the\n * connection is closing\n * @param {WebSocket} target A reference to the target to which the event was\n * dispatched\n */\n constructor(code, reason, target) {\n super('close', target);\n\n this.wasClean = target._closeFrameReceived && target._closeFrameSent;\n this.reason = reason;\n this.code = code;\n }\n}\n\n/**\n * Class representing an open event.\n *\n * @extends Event\n * @private\n */\nclass OpenEvent extends Event {\n /**\n * Create a new `OpenEvent`.\n *\n * @param {WebSocket} target A reference to the target to which the event was\n * dispatched\n */\n constructor(target) {\n super('open', target);\n }\n}\n\n/**\n * Class representing an error event.\n *\n * @extends Event\n * @private\n */\nclass ErrorEvent extends Event {\n /**\n * Create a new `ErrorEvent`.\n *\n * @param {Object} error The error that generated this event\n * @param {WebSocket} target A reference to the target to which the event was\n * dispatched\n */\n constructor(error, target) {\n super('error', target);\n\n this.message = error.message;\n this.error = error;\n }\n}\n\n/**\n * This provides methods for emulating the `EventTarget` interface. It's not\n * meant to be used directly.\n *\n * @mixin\n */\nconst EventTarget = {\n /**\n * Register an event listener.\n *\n * @param {String} type A string representing the event type to listen for\n * @param {Function} listener The listener to add\n * @param {Object} [options] An options object specifies characteristics about\n * the event listener\n * @param {Boolean} [options.once=false] A `Boolean`` indicating that the\n * listener should be invoked at most once after being added. If `true`,\n * the listener would be automatically removed when invoked.\n * @public\n */\n addEventListener(type, listener, options) {\n if (typeof listener !== 'function') return;\n\n function onMessage(data) {\n listener.call(this, new MessageEvent(data, this));\n }\n\n function onClose(code, message) {\n listener.call(this, new CloseEvent(code, message, this));\n }\n\n function onError(error) {\n listener.call(this, new ErrorEvent(error, this));\n }\n\n function onOpen() {\n listener.call(this, new OpenEvent(this));\n }\n\n const method = options && options.once ? 'once' : 'on';\n\n if (type === 'message') {\n onMessage._listener = listener;\n this[method](type, onMessage);\n } else if (type === 'close') {\n onClose._listener = listener;\n this[method](type, onClose);\n } else if (type === 'error') {\n onError._listener = listener;\n this[method](type, onError);\n } else if (type === 'open') {\n onOpen._listener = listener;\n this[method](type, onOpen);\n } else {\n this[method](type, listener);\n }\n },\n\n /**\n * Remove an event listener.\n *\n * @param {String} type A string representing the event type to remove\n * @param {Function} listener The listener to remove\n * @public\n */\n removeEventListener(type, listener) {\n const listeners = this.listeners(type);\n\n for (let i = 0; i < listeners.length; i++) {\n if (listeners[i] === listener || listeners[i]._listener === listener) {\n this.removeListener(type, listeners[i]);\n }\n }\n }\n};\n\nmodule.exports = EventTarget;\n","'use strict';\n\n//\n// Allowed token characters:\n//\n// '!', '#', '$', '%', '&', ''', '*', '+', '-',\n// '.', 0-9, A-Z, '^', '_', '`', a-z, '|', '~'\n//\n// tokenChars[32] === 0 // ' '\n// tokenChars[33] === 1 // '!'\n// tokenChars[34] === 0 // '\"'\n// ...\n//\n// prettier-ignore\nconst tokenChars = [\n 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 0 - 15\n 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 16 - 31\n 0, 1, 0, 1, 1, 1, 1, 1, 0, 0, 1, 1, 0, 1, 1, 0, // 32 - 47\n 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, // 48 - 63\n 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 64 - 79\n 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 1, 1, // 80 - 95\n 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 96 - 111\n 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 0, 1, 0 // 112 - 127\n];\n\n/**\n * Adds an offer to the map of extension offers or a parameter to the map of\n * parameters.\n *\n * @param {Object} dest The map of extension offers or parameters\n * @param {String} name The extension or parameter name\n * @param {(Object|Boolean|String)} elem The extension parameters or the\n * parameter value\n * @private\n */\nfunction push(dest, name, elem) {\n if (dest[name] === undefined) dest[name] = [elem];\n else dest[name].push(elem);\n}\n\n/**\n * Parses the `Sec-WebSocket-Extensions` header into an object.\n *\n * @param {String} header The field value of the header\n * @return {Object} The parsed object\n * @public\n */\nfunction parse(header) {\n const offers = Object.create(null);\n\n if (header === undefined || header === '') return offers;\n\n let params = Object.create(null);\n let mustUnescape = false;\n let isEscaping = false;\n let inQuotes = false;\n let extensionName;\n let paramName;\n let start = -1;\n let end = -1;\n let i = 0;\n\n for (; i < header.length; i++) {\n const code = header.charCodeAt(i);\n\n if (extensionName === undefined) {\n if (end === -1 && tokenChars[code] === 1) {\n if (start === -1) start = i;\n } else if (code === 0x20 /* ' ' */ || code === 0x09 /* '\\t' */) {\n if (end === -1 && start !== -1) end = i;\n } else if (code === 0x3b /* ';' */ || code === 0x2c /* ',' */) {\n if (start === -1) {\n throw new SyntaxError(`Unexpected character at index ${i}`);\n }\n\n if (end === -1) end = i;\n const name = header.slice(start, end);\n if (code === 0x2c) {\n push(offers, name, params);\n params = Object.create(null);\n } else {\n extensionName = name;\n }\n\n start = end = -1;\n } else {\n throw new SyntaxError(`Unexpected character at index ${i}`);\n }\n } else if (paramName === undefined) {\n if (end === -1 && tokenChars[code] === 1) {\n if (start === -1) start = i;\n } else if (code === 0x20 || code === 0x09) {\n if (end === -1 && start !== -1) end = i;\n } else if (code === 0x3b || code === 0x2c) {\n if (start === -1) {\n throw new SyntaxError(`Unexpected character at index ${i}`);\n }\n\n if (end === -1) end = i;\n push(params, header.slice(start, end), true);\n if (code === 0x2c) {\n push(offers, extensionName, params);\n params = Object.create(null);\n extensionName = undefined;\n }\n\n start = end = -1;\n } else if (code === 0x3d /* '=' */ && start !== -1 && end === -1) {\n paramName = header.slice(start, i);\n start = end = -1;\n } else {\n throw new SyntaxError(`Unexpected character at index ${i}`);\n }\n } else {\n //\n // The value of a quoted-string after unescaping must conform to the\n // token ABNF, so only token characters are valid.\n // Ref: https://tools.ietf.org/html/rfc6455#section-9.1\n //\n if (isEscaping) {\n if (tokenChars[code] !== 1) {\n throw new SyntaxError(`Unexpected character at index ${i}`);\n }\n if (start === -1) start = i;\n else if (!mustUnescape) mustUnescape = true;\n isEscaping = false;\n } else if (inQuotes) {\n if (tokenChars[code] === 1) {\n if (start === -1) start = i;\n } else if (code === 0x22 /* '\"' */ && start !== -1) {\n inQuotes = false;\n end = i;\n } else if (code === 0x5c /* '\\' */) {\n isEscaping = true;\n } else {\n throw new SyntaxError(`Unexpected character at index ${i}`);\n }\n } else if (code === 0x22 && header.charCodeAt(i - 1) === 0x3d) {\n inQuotes = true;\n } else if (end === -1 && tokenChars[code] === 1) {\n if (start === -1) start = i;\n } else if (start !== -1 && (code === 0x20 || code === 0x09)) {\n if (end === -1) end = i;\n } else if (code === 0x3b || code === 0x2c) {\n if (start === -1) {\n throw new SyntaxError(`Unexpected character at index ${i}`);\n }\n\n if (end === -1) end = i;\n let value = header.slice(start, end);\n if (mustUnescape) {\n value = value.replace(/\\\\/g, '');\n mustUnescape = false;\n }\n push(params, paramName, value);\n if (code === 0x2c) {\n push(offers, extensionName, params);\n params = Object.create(null);\n extensionName = undefined;\n }\n\n paramName = undefined;\n start = end = -1;\n } else {\n throw new SyntaxError(`Unexpected character at index ${i}`);\n }\n }\n }\n\n if (start === -1 || inQuotes) {\n throw new SyntaxError('Unexpected end of input');\n }\n\n if (end === -1) end = i;\n const token = header.slice(start, end);\n if (extensionName === undefined) {\n push(offers, token, params);\n } else {\n if (paramName === undefined) {\n push(params, token, true);\n } else if (mustUnescape) {\n push(params, paramName, token.replace(/\\\\/g, ''));\n } else {\n push(params, paramName, token);\n }\n push(offers, extensionName, params);\n }\n\n return offers;\n}\n\n/**\n * Builds the `Sec-WebSocket-Extensions` header field value.\n *\n * @param {Object} extensions The map of extensions and parameters to format\n * @return {String} A string representing the given object\n * @public\n */\nfunction format(extensions) {\n return Object.keys(extensions)\n .map((extension) => {\n let configurations = extensions[extension];\n if (!Array.isArray(configurations)) configurations = [configurations];\n return configurations\n .map((params) => {\n return [extension]\n .concat(\n Object.keys(params).map((k) => {\n let values = params[k];\n if (!Array.isArray(values)) values = [values];\n return values\n .map((v) => (v === true ? k : `${k}=${v}`))\n .join('; ');\n })\n )\n .join('; ');\n })\n .join(', ');\n })\n .join(', ');\n}\n\nmodule.exports = { format, parse };\n","'use strict';\n\nconst kDone = Symbol('kDone');\nconst kRun = Symbol('kRun');\n\n/**\n * A very simple job queue with adjustable concurrency. Adapted from\n * https://github.com/STRML/async-limiter\n */\nclass Limiter {\n /**\n * Creates a new `Limiter`.\n *\n * @param {Number} [concurrency=Infinity] The maximum number of jobs allowed\n * to run concurrently\n */\n constructor(concurrency) {\n this[kDone] = () => {\n this.pending--;\n this[kRun]();\n };\n this.concurrency = concurrency || Infinity;\n this.jobs = [];\n this.pending = 0;\n }\n\n /**\n * Adds a job to the queue.\n *\n * @param {Function} job The job to run\n * @public\n */\n add(job) {\n this.jobs.push(job);\n this[kRun]();\n }\n\n /**\n * Removes a job from the queue and runs it if possible.\n *\n * @private\n */\n [kRun]() {\n if (this.pending === this.concurrency) return;\n\n if (this.jobs.length) {\n const job = this.jobs.shift();\n\n this.pending++;\n job(this[kDone]);\n }\n }\n}\n\nmodule.exports = Limiter;\n","'use strict';\n\nconst zlib = require('zlib');\n\nconst bufferUtil = require('./buffer-util');\nconst Limiter = require('./limiter');\nconst { kStatusCode, NOOP } = require('./constants');\n\nconst TRAILER = Buffer.from([0x00, 0x00, 0xff, 0xff]);\nconst kPerMessageDeflate = Symbol('permessage-deflate');\nconst kTotalLength = Symbol('total-length');\nconst kCallback = Symbol('callback');\nconst kBuffers = Symbol('buffers');\nconst kError = Symbol('error');\n\n//\n// We limit zlib concurrency, which prevents severe memory fragmentation\n// as documented in https://github.com/nodejs/node/issues/8871#issuecomment-250915913\n// and https://github.com/websockets/ws/issues/1202\n//\n// Intentionally global; it's the global thread pool that's an issue.\n//\nlet zlibLimiter;\n\n/**\n * permessage-deflate implementation.\n */\nclass PerMessageDeflate {\n /**\n * Creates a PerMessageDeflate instance.\n *\n * @param {Object} [options] Configuration options\n * @param {Boolean} [options.serverNoContextTakeover=false] Request/accept\n * disabling of server context takeover\n * @param {Boolean} [options.clientNoContextTakeover=false] Advertise/\n * acknowledge disabling of client context takeover\n * @param {(Boolean|Number)} [options.serverMaxWindowBits] Request/confirm the\n * use of a custom server window size\n * @param {(Boolean|Number)} [options.clientMaxWindowBits] Advertise support\n * for, or request, a custom client window size\n * @param {Object} [options.zlibDeflateOptions] Options to pass to zlib on\n * deflate\n * @param {Object} [options.zlibInflateOptions] Options to pass to zlib on\n * inflate\n * @param {Number} [options.threshold=1024] Size (in bytes) below which\n * messages should not be compressed\n * @param {Number} [options.concurrencyLimit=10] The number of concurrent\n * calls to zlib\n * @param {Boolean} [isServer=false] Create the instance in either server or\n * client mode\n * @param {Number} [maxPayload=0] The maximum allowed message length\n */\n constructor(options, isServer, maxPayload) {\n this._maxPayload = maxPayload | 0;\n this._options = options || {};\n this._threshold =\n this._options.threshold !== undefined ? this._options.threshold : 1024;\n this._isServer = !!isServer;\n this._deflate = null;\n this._inflate = null;\n\n this.params = null;\n\n if (!zlibLimiter) {\n const concurrency =\n this._options.concurrencyLimit !== undefined\n ? this._options.concurrencyLimit\n : 10;\n zlibLimiter = new Limiter(concurrency);\n }\n }\n\n /**\n * @type {String}\n */\n static get extensionName() {\n return 'permessage-deflate';\n }\n\n /**\n * Create an extension negotiation offer.\n *\n * @return {Object} Extension parameters\n * @public\n */\n offer() {\n const params = {};\n\n if (this._options.serverNoContextTakeover) {\n params.server_no_context_takeover = true;\n }\n if (this._options.clientNoContextTakeover) {\n params.client_no_context_takeover = true;\n }\n if (this._options.serverMaxWindowBits) {\n params.server_max_window_bits = this._options.serverMaxWindowBits;\n }\n if (this._options.clientMaxWindowBits) {\n params.client_max_window_bits = this._options.clientMaxWindowBits;\n } else if (this._options.clientMaxWindowBits == null) {\n params.client_max_window_bits = true;\n }\n\n return params;\n }\n\n /**\n * Accept an extension negotiation offer/response.\n *\n * @param {Array} configurations The extension negotiation offers/reponse\n * @return {Object} Accepted configuration\n * @public\n */\n accept(configurations) {\n configurations = this.normalizeParams(configurations);\n\n this.params = this._isServer\n ? this.acceptAsServer(configurations)\n : this.acceptAsClient(configurations);\n\n return this.params;\n }\n\n /**\n * Releases all resources used by the extension.\n *\n * @public\n */\n cleanup() {\n if (this._inflate) {\n this._inflate.close();\n this._inflate = null;\n }\n\n if (this._deflate) {\n const callback = this._deflate[kCallback];\n\n this._deflate.close();\n this._deflate = null;\n\n if (callback) {\n callback(\n new Error(\n 'The deflate stream was closed while data was being processed'\n )\n );\n }\n }\n }\n\n /**\n * Accept an extension negotiation offer.\n *\n * @param {Array} offers The extension negotiation offers\n * @return {Object} Accepted configuration\n * @private\n */\n acceptAsServer(offers) {\n const opts = this._options;\n const accepted = offers.find((params) => {\n if (\n (opts.serverNoContextTakeover === false &&\n params.server_no_context_takeover) ||\n (params.server_max_window_bits &&\n (opts.serverMaxWindowBits === false ||\n (typeof opts.serverMaxWindowBits === 'number' &&\n opts.serverMaxWindowBits > params.server_max_window_bits))) ||\n (typeof opts.clientMaxWindowBits === 'number' &&\n !params.client_max_window_bits)\n ) {\n return false;\n }\n\n return true;\n });\n\n if (!accepted) {\n throw new Error('None of the extension offers can be accepted');\n }\n\n if (opts.serverNoContextTakeover) {\n accepted.server_no_context_takeover = true;\n }\n if (opts.clientNoContextTakeover) {\n accepted.client_no_context_takeover = true;\n }\n if (typeof opts.serverMaxWindowBits === 'number') {\n accepted.server_max_window_bits = opts.serverMaxWindowBits;\n }\n if (typeof opts.clientMaxWindowBits === 'number') {\n accepted.client_max_window_bits = opts.clientMaxWindowBits;\n } else if (\n accepted.client_max_window_bits === true ||\n opts.clientMaxWindowBits === false\n ) {\n delete accepted.client_max_window_bits;\n }\n\n return accepted;\n }\n\n /**\n * Accept the extension negotiation response.\n *\n * @param {Array} response The extension negotiation response\n * @return {Object} Accepted configuration\n * @private\n */\n acceptAsClient(response) {\n const params = response[0];\n\n if (\n this._options.clientNoContextTakeover === false &&\n params.client_no_context_takeover\n ) {\n throw new Error('Unexpected parameter \"client_no_context_takeover\"');\n }\n\n if (!params.client_max_window_bits) {\n if (typeof this._options.clientMaxWindowBits === 'number') {\n params.client_max_window_bits = this._options.clientMaxWindowBits;\n }\n } else if (\n this._options.clientMaxWindowBits === false ||\n (typeof this._options.clientMaxWindowBits === 'number' &&\n params.client_max_window_bits > this._options.clientMaxWindowBits)\n ) {\n throw new Error(\n 'Unexpected or invalid parameter \"client_max_window_bits\"'\n );\n }\n\n return params;\n }\n\n /**\n * Normalize parameters.\n *\n * @param {Array} configurations The extension negotiation offers/reponse\n * @return {Array} The offers/response with normalized parameters\n * @private\n */\n normalizeParams(configurations) {\n configurations.forEach((params) => {\n Object.keys(params).forEach((key) => {\n let value = params[key];\n\n if (value.length > 1) {\n throw new Error(`Parameter \"${key}\" must have only a single value`);\n }\n\n value = value[0];\n\n if (key === 'client_max_window_bits') {\n if (value !== true) {\n const num = +value;\n if (!Number.isInteger(num) || num < 8 || num > 15) {\n throw new TypeError(\n `Invalid value for parameter \"${key}\": ${value}`\n );\n }\n value = num;\n } else if (!this._isServer) {\n throw new TypeError(\n `Invalid value for parameter \"${key}\": ${value}`\n );\n }\n } else if (key === 'server_max_window_bits') {\n const num = +value;\n if (!Number.isInteger(num) || num < 8 || num > 15) {\n throw new TypeError(\n `Invalid value for parameter \"${key}\": ${value}`\n );\n }\n value = num;\n } else if (\n key === 'client_no_context_takeover' ||\n key === 'server_no_context_takeover'\n ) {\n if (value !== true) {\n throw new TypeError(\n `Invalid value for parameter \"${key}\": ${value}`\n );\n }\n } else {\n throw new Error(`Unknown parameter \"${key}\"`);\n }\n\n params[key] = value;\n });\n });\n\n return configurations;\n }\n\n /**\n * Decompress data. Concurrency limited.\n *\n * @param {Buffer} data Compressed data\n * @param {Boolean} fin Specifies whether or not this is the last fragment\n * @param {Function} callback Callback\n * @public\n */\n decompress(data, fin, callback) {\n zlibLimiter.add((done) => {\n this._decompress(data, fin, (err, result) => {\n done();\n callback(err, result);\n });\n });\n }\n\n /**\n * Compress data. Concurrency limited.\n *\n * @param {Buffer} data Data to compress\n * @param {Boolean} fin Specifies whether or not this is the last fragment\n * @param {Function} callback Callback\n * @public\n */\n compress(data, fin, callback) {\n zlibLimiter.add((done) => {\n this._compress(data, fin, (err, result) => {\n done();\n callback(err, result);\n });\n });\n }\n\n /**\n * Decompress data.\n *\n * @param {Buffer} data Compressed data\n * @param {Boolean} fin Specifies whether or not this is the last fragment\n * @param {Function} callback Callback\n * @private\n */\n _decompress(data, fin, callback) {\n const endpoint = this._isServer ? 'client' : 'server';\n\n if (!this._inflate) {\n const key = `${endpoint}_max_window_bits`;\n const windowBits =\n typeof this.params[key] !== 'number'\n ? zlib.Z_DEFAULT_WINDOWBITS\n : this.params[key];\n\n this._inflate = zlib.createInflateRaw({\n ...this._options.zlibInflateOptions,\n windowBits\n });\n this._inflate[kPerMessageDeflate] = this;\n this._inflate[kTotalLength] = 0;\n this._inflate[kBuffers] = [];\n this._inflate.on('error', inflateOnError);\n this._inflate.on('data', inflateOnData);\n }\n\n this._inflate[kCallback] = callback;\n\n this._inflate.write(data);\n if (fin) this._inflate.write(TRAILER);\n\n this._inflate.flush(() => {\n const err = this._inflate[kError];\n\n if (err) {\n this._inflate.close();\n this._inflate = null;\n callback(err);\n return;\n }\n\n const data = bufferUtil.concat(\n this._inflate[kBuffers],\n this._inflate[kTotalLength]\n );\n\n if (this._inflate._readableState.endEmitted) {\n this._inflate.close();\n this._inflate = null;\n } else {\n this._inflate[kTotalLength] = 0;\n this._inflate[kBuffers] = [];\n\n if (fin && this.params[`${endpoint}_no_context_takeover`]) {\n this._inflate.reset();\n }\n }\n\n callback(null, data);\n });\n }\n\n /**\n * Compress data.\n *\n * @param {Buffer} data Data to compress\n * @param {Boolean} fin Specifies whether or not this is the last fragment\n * @param {Function} callback Callback\n * @private\n */\n _compress(data, fin, callback) {\n const endpoint = this._isServer ? 'server' : 'client';\n\n if (!this._deflate) {\n const key = `${endpoint}_max_window_bits`;\n const windowBits =\n typeof this.params[key] !== 'number'\n ? zlib.Z_DEFAULT_WINDOWBITS\n : this.params[key];\n\n this._deflate = zlib.createDeflateRaw({\n ...this._options.zlibDeflateOptions,\n windowBits\n });\n\n this._deflate[kTotalLength] = 0;\n this._deflate[kBuffers] = [];\n\n //\n // An `'error'` event is emitted, only on Node.js < 10.0.0, if the\n // `zlib.DeflateRaw` instance is closed while data is being processed.\n // This can happen if `PerMessageDeflate#cleanup()` is called at the wrong\n // time due to an abnormal WebSocket closure.\n //\n this._deflate.on('error', NOOP);\n this._deflate.on('data', deflateOnData);\n }\n\n this._deflate[kCallback] = callback;\n\n this._deflate.write(data);\n this._deflate.flush(zlib.Z_SYNC_FLUSH, () => {\n if (!this._deflate) {\n //\n // The deflate stream was closed while data was being processed.\n //\n return;\n }\n\n let data = bufferUtil.concat(\n this._deflate[kBuffers],\n this._deflate[kTotalLength]\n );\n\n if (fin) data = data.slice(0, data.length - 4);\n\n //\n // Ensure that the callback will not be called again in\n // `PerMessageDeflate#cleanup()`.\n //\n this._deflate[kCallback] = null;\n\n this._deflate[kTotalLength] = 0;\n this._deflate[kBuffers] = [];\n\n if (fin && this.params[`${endpoint}_no_context_takeover`]) {\n this._deflate.reset();\n }\n\n callback(null, data);\n });\n }\n}\n\nmodule.exports = PerMessageDeflate;\n\n/**\n * The listener of the `zlib.DeflateRaw` stream `'data'` event.\n *\n * @param {Buffer} chunk A chunk of data\n * @private\n */\nfunction deflateOnData(chunk) {\n this[kBuffers].push(chunk);\n this[kTotalLength] += chunk.length;\n}\n\n/**\n * The listener of the `zlib.InflateRaw` stream `'data'` event.\n *\n * @param {Buffer} chunk A chunk of data\n * @private\n */\nfunction inflateOnData(chunk) {\n this[kTotalLength] += chunk.length;\n\n if (\n this[kPerMessageDeflate]._maxPayload < 1 ||\n this[kTotalLength] <= this[kPerMessageDeflate]._maxPayload\n ) {\n this[kBuffers].push(chunk);\n return;\n }\n\n this[kError] = new RangeError('Max payload size exceeded');\n this[kError][kStatusCode] = 1009;\n this.removeListener('data', inflateOnData);\n this.reset();\n}\n\n/**\n * The listener of the `zlib.InflateRaw` stream `'error'` event.\n *\n * @param {Error} err The emitted error\n * @private\n */\nfunction inflateOnError(err) {\n //\n // There is no need to call `Zlib#close()` as the handle is automatically\n // closed when an error is emitted.\n //\n this[kPerMessageDeflate]._inflate = null;\n err[kStatusCode] = 1007;\n this[kCallback](err);\n}\n","'use strict';\n\nconst { Writable } = require('stream');\n\nconst PerMessageDeflate = require('./permessage-deflate');\nconst {\n BINARY_TYPES,\n EMPTY_BUFFER,\n kStatusCode,\n kWebSocket\n} = require('./constants');\nconst { concat, toArrayBuffer, unmask } = require('./buffer-util');\nconst { isValidStatusCode, isValidUTF8 } = require('./validation');\n\nconst GET_INFO = 0;\nconst GET_PAYLOAD_LENGTH_16 = 1;\nconst GET_PAYLOAD_LENGTH_64 = 2;\nconst GET_MASK = 3;\nconst GET_DATA = 4;\nconst INFLATING = 5;\n\n/**\n * HyBi Receiver implementation.\n *\n * @extends stream.Writable\n */\nclass Receiver extends Writable {\n /**\n * Creates a Receiver instance.\n *\n * @param {String} [binaryType=nodebuffer] The type for binary data\n * @param {Object} [extensions] An object containing the negotiated extensions\n * @param {Boolean} [isServer=false] Specifies whether to operate in client or\n * server mode\n * @param {Number} [maxPayload=0] The maximum allowed message length\n */\n constructor(binaryType, extensions, isServer, maxPayload) {\n super();\n\n this._binaryType = binaryType || BINARY_TYPES[0];\n this[kWebSocket] = undefined;\n this._extensions = extensions || {};\n this._isServer = !!isServer;\n this._maxPayload = maxPayload | 0;\n\n this._bufferedBytes = 0;\n this._buffers = [];\n\n this._compressed = false;\n this._payloadLength = 0;\n this._mask = undefined;\n this._fragmented = 0;\n this._masked = false;\n this._fin = false;\n this._opcode = 0;\n\n this._totalPayloadLength = 0;\n this._messageLength = 0;\n this._fragments = [];\n\n this._state = GET_INFO;\n this._loop = false;\n }\n\n /**\n * Implements `Writable.prototype._write()`.\n *\n * @param {Buffer} chunk The chunk of data to write\n * @param {String} encoding The character encoding of `chunk`\n * @param {Function} cb Callback\n * @private\n */\n _write(chunk, encoding, cb) {\n if (this._opcode === 0x08 && this._state == GET_INFO) return cb();\n\n this._bufferedBytes += chunk.length;\n this._buffers.push(chunk);\n this.startLoop(cb);\n }\n\n /**\n * Consumes `n` bytes from the buffered data.\n *\n * @param {Number} n The number of bytes to consume\n * @return {Buffer} The consumed bytes\n * @private\n */\n consume(n) {\n this._bufferedBytes -= n;\n\n if (n === this._buffers[0].length) return this._buffers.shift();\n\n if (n < this._buffers[0].length) {\n const buf = this._buffers[0];\n this._buffers[0] = buf.slice(n);\n return buf.slice(0, n);\n }\n\n const dst = Buffer.allocUnsafe(n);\n\n do {\n const buf = this._buffers[0];\n const offset = dst.length - n;\n\n if (n >= buf.length) {\n dst.set(this._buffers.shift(), offset);\n } else {\n dst.set(new Uint8Array(buf.buffer, buf.byteOffset, n), offset);\n this._buffers[0] = buf.slice(n);\n }\n\n n -= buf.length;\n } while (n > 0);\n\n return dst;\n }\n\n /**\n * Starts the parsing loop.\n *\n * @param {Function} cb Callback\n * @private\n */\n startLoop(cb) {\n let err;\n this._loop = true;\n\n do {\n switch (this._state) {\n case GET_INFO:\n err = this.getInfo();\n break;\n case GET_PAYLOAD_LENGTH_16:\n err = this.getPayloadLength16();\n break;\n case GET_PAYLOAD_LENGTH_64:\n err = this.getPayloadLength64();\n break;\n case GET_MASK:\n this.getMask();\n break;\n case GET_DATA:\n err = this.getData(cb);\n break;\n default:\n // `INFLATING`\n this._loop = false;\n return;\n }\n } while (this._loop);\n\n cb(err);\n }\n\n /**\n * Reads the first two bytes of a frame.\n *\n * @return {(RangeError|undefined)} A possible error\n * @private\n */\n getInfo() {\n if (this._bufferedBytes < 2) {\n this._loop = false;\n return;\n }\n\n const buf = this.consume(2);\n\n if ((buf[0] & 0x30) !== 0x00) {\n this._loop = false;\n return error(RangeError, 'RSV2 and RSV3 must be clear', true, 1002);\n }\n\n const compressed = (buf[0] & 0x40) === 0x40;\n\n if (compressed && !this._extensions[PerMessageDeflate.extensionName]) {\n this._loop = false;\n return error(RangeError, 'RSV1 must be clear', true, 1002);\n }\n\n this._fin = (buf[0] & 0x80) === 0x80;\n this._opcode = buf[0] & 0x0f;\n this._payloadLength = buf[1] & 0x7f;\n\n if (this._opcode === 0x00) {\n if (compressed) {\n this._loop = false;\n return error(RangeError, 'RSV1 must be clear', true, 1002);\n }\n\n if (!this._fragmented) {\n this._loop = false;\n return error(RangeError, 'invalid opcode 0', true, 1002);\n }\n\n this._opcode = this._fragmented;\n } else if (this._opcode === 0x01 || this._opcode === 0x02) {\n if (this._fragmented) {\n this._loop = false;\n return error(RangeError, `invalid opcode ${this._opcode}`, true, 1002);\n }\n\n this._compressed = compressed;\n } else if (this._opcode > 0x07 && this._opcode < 0x0b) {\n if (!this._fin) {\n this._loop = false;\n return error(RangeError, 'FIN must be set', true, 1002);\n }\n\n if (compressed) {\n this._loop = false;\n return error(RangeError, 'RSV1 must be clear', true, 1002);\n }\n\n if (this._payloadLength > 0x7d) {\n this._loop = false;\n return error(\n RangeError,\n `invalid payload length ${this._payloadLength}`,\n true,\n 1002\n );\n }\n } else {\n this._loop = false;\n return error(RangeError, `invalid opcode ${this._opcode}`, true, 1002);\n }\n\n if (!this._fin && !this._fragmented) this._fragmented = this._opcode;\n this._masked = (buf[1] & 0x80) === 0x80;\n\n if (this._isServer) {\n if (!this._masked) {\n this._loop = false;\n return error(RangeError, 'MASK must be set', true, 1002);\n }\n } else if (this._masked) {\n this._loop = false;\n return error(RangeError, 'MASK must be clear', true, 1002);\n }\n\n if (this._payloadLength === 126) this._state = GET_PAYLOAD_LENGTH_16;\n else if (this._payloadLength === 127) this._state = GET_PAYLOAD_LENGTH_64;\n else return this.haveLength();\n }\n\n /**\n * Gets extended payload length (7+16).\n *\n * @return {(RangeError|undefined)} A possible error\n * @private\n */\n getPayloadLength16() {\n if (this._bufferedBytes < 2) {\n this._loop = false;\n return;\n }\n\n this._payloadLength = this.consume(2).readUInt16BE(0);\n return this.haveLength();\n }\n\n /**\n * Gets extended payload length (7+64).\n *\n * @return {(RangeError|undefined)} A possible error\n * @private\n */\n getPayloadLength64() {\n if (this._bufferedBytes < 8) {\n this._loop = false;\n return;\n }\n\n const buf = this.consume(8);\n const num = buf.readUInt32BE(0);\n\n //\n // The maximum safe integer in JavaScript is 2^53 - 1. An error is returned\n // if payload length is greater than this number.\n //\n if (num > Math.pow(2, 53 - 32) - 1) {\n this._loop = false;\n return error(\n RangeError,\n 'Unsupported WebSocket frame: payload length > 2^53 - 1',\n false,\n 1009\n );\n }\n\n this._payloadLength = num * Math.pow(2, 32) + buf.readUInt32BE(4);\n return this.haveLength();\n }\n\n /**\n * Payload length has been read.\n *\n * @return {(RangeError|undefined)} A possible error\n * @private\n */\n haveLength() {\n if (this._payloadLength && this._opcode < 0x08) {\n this._totalPayloadLength += this._payloadLength;\n if (this._totalPayloadLength > this._maxPayload && this._maxPayload > 0) {\n this._loop = false;\n return error(RangeError, 'Max payload size exceeded', false, 1009);\n }\n }\n\n if (this._masked) this._state = GET_MASK;\n else this._state = GET_DATA;\n }\n\n /**\n * Reads mask bytes.\n *\n * @private\n */\n getMask() {\n if (this._bufferedBytes < 4) {\n this._loop = false;\n return;\n }\n\n this._mask = this.consume(4);\n this._state = GET_DATA;\n }\n\n /**\n * Reads data bytes.\n *\n * @param {Function} cb Callback\n * @return {(Error|RangeError|undefined)} A possible error\n * @private\n */\n getData(cb) {\n let data = EMPTY_BUFFER;\n\n if (this._payloadLength) {\n if (this._bufferedBytes < this._payloadLength) {\n this._loop = false;\n return;\n }\n\n data = this.consume(this._payloadLength);\n if (this._masked) unmask(data, this._mask);\n }\n\n if (this._opcode > 0x07) return this.controlMessage(data);\n\n if (this._compressed) {\n this._state = INFLATING;\n this.decompress(data, cb);\n return;\n }\n\n if (data.length) {\n //\n // This message is not compressed so its lenght is the sum of the payload\n // length of all fragments.\n //\n this._messageLength = this._totalPayloadLength;\n this._fragments.push(data);\n }\n\n return this.dataMessage();\n }\n\n /**\n * Decompresses data.\n *\n * @param {Buffer} data Compressed data\n * @param {Function} cb Callback\n * @private\n */\n decompress(data, cb) {\n const perMessageDeflate = this._extensions[PerMessageDeflate.extensionName];\n\n perMessageDeflate.decompress(data, this._fin, (err, buf) => {\n if (err) return cb(err);\n\n if (buf.length) {\n this._messageLength += buf.length;\n if (this._messageLength > this._maxPayload && this._maxPayload > 0) {\n return cb(\n error(RangeError, 'Max payload size exceeded', false, 1009)\n );\n }\n\n this._fragments.push(buf);\n }\n\n const er = this.dataMessage();\n if (er) return cb(er);\n\n this.startLoop(cb);\n });\n }\n\n /**\n * Handles a data message.\n *\n * @return {(Error|undefined)} A possible error\n * @private\n */\n dataMessage() {\n if (this._fin) {\n const messageLength = this._messageLength;\n const fragments = this._fragments;\n\n this._totalPayloadLength = 0;\n this._messageLength = 0;\n this._fragmented = 0;\n this._fragments = [];\n\n if (this._opcode === 2) {\n let data;\n\n if (this._binaryType === 'nodebuffer') {\n data = concat(fragments, messageLength);\n } else if (this._binaryType === 'arraybuffer') {\n data = toArrayBuffer(concat(fragments, messageLength));\n } else {\n data = fragments;\n }\n\n this.emit('message', data);\n } else {\n const buf = concat(fragments, messageLength);\n\n if (!isValidUTF8(buf)) {\n this._loop = false;\n return error(Error, 'invalid UTF-8 sequence', true, 1007);\n }\n\n this.emit('message', buf.toString());\n }\n }\n\n this._state = GET_INFO;\n }\n\n /**\n * Handles a control message.\n *\n * @param {Buffer} data Data to handle\n * @return {(Error|RangeError|undefined)} A possible error\n * @private\n */\n controlMessage(data) {\n if (this._opcode === 0x08) {\n this._loop = false;\n\n if (data.length === 0) {\n this.emit('conclude', 1005, '');\n this.end();\n } else if (data.length === 1) {\n return error(RangeError, 'invalid payload length 1', true, 1002);\n } else {\n const code = data.readUInt16BE(0);\n\n if (!isValidStatusCode(code)) {\n return error(RangeError, `invalid status code ${code}`, true, 1002);\n }\n\n const buf = data.slice(2);\n\n if (!isValidUTF8(buf)) {\n return error(Error, 'invalid UTF-8 sequence', true, 1007);\n }\n\n this.emit('conclude', code, buf.toString());\n this.end();\n }\n } else if (this._opcode === 0x09) {\n this.emit('ping', data);\n } else {\n this.emit('pong', data);\n }\n\n this._state = GET_INFO;\n }\n}\n\nmodule.exports = Receiver;\n\n/**\n * Builds an error object.\n *\n * @param {(Error|RangeError)} ErrorCtor The error constructor\n * @param {String} message The error message\n * @param {Boolean} prefix Specifies whether or not to add a default prefix to\n * `message`\n * @param {Number} statusCode The status code\n * @return {(Error|RangeError)} The error\n * @private\n */\nfunction error(ErrorCtor, message, prefix, statusCode) {\n const err = new ErrorCtor(\n prefix ? `Invalid WebSocket frame: ${message}` : message\n );\n\n Error.captureStackTrace(err, error);\n err[kStatusCode] = statusCode;\n return err;\n}\n","'use strict';\n\nconst { randomFillSync } = require('crypto');\n\nconst PerMessageDeflate = require('./permessage-deflate');\nconst { EMPTY_BUFFER } = require('./constants');\nconst { isValidStatusCode } = require('./validation');\nconst { mask: applyMask, toBuffer } = require('./buffer-util');\n\nconst mask = Buffer.alloc(4);\n\n/**\n * HyBi Sender implementation.\n */\nclass Sender {\n /**\n * Creates a Sender instance.\n *\n * @param {net.Socket} socket The connection socket\n * @param {Object} [extensions] An object containing the negotiated extensions\n */\n constructor(socket, extensions) {\n this._extensions = extensions || {};\n this._socket = socket;\n\n this._firstFragment = true;\n this._compress = false;\n\n this._bufferedBytes = 0;\n this._deflating = false;\n this._queue = [];\n }\n\n /**\n * Frames a piece of data according to the HyBi WebSocket protocol.\n *\n * @param {Buffer} data The data to frame\n * @param {Object} options Options object\n * @param {Number} options.opcode The opcode\n * @param {Boolean} [options.readOnly=false] Specifies whether `data` can be\n * modified\n * @param {Boolean} [options.fin=false] Specifies whether or not to set the\n * FIN bit\n * @param {Boolean} [options.mask=false] Specifies whether or not to mask\n * `data`\n * @param {Boolean} [options.rsv1=false] Specifies whether or not to set the\n * RSV1 bit\n * @return {Buffer[]} The framed data as a list of `Buffer` instances\n * @public\n */\n static frame(data, options) {\n const merge = options.mask && options.readOnly;\n let offset = options.mask ? 6 : 2;\n let payloadLength = data.length;\n\n if (data.length >= 65536) {\n offset += 8;\n payloadLength = 127;\n } else if (data.length > 125) {\n offset += 2;\n payloadLength = 126;\n }\n\n const target = Buffer.allocUnsafe(merge ? data.length + offset : offset);\n\n target[0] = options.fin ? options.opcode | 0x80 : options.opcode;\n if (options.rsv1) target[0] |= 0x40;\n\n target[1] = payloadLength;\n\n if (payloadLength === 126) {\n target.writeUInt16BE(data.length, 2);\n } else if (payloadLength === 127) {\n target.writeUInt32BE(0, 2);\n target.writeUInt32BE(data.length, 6);\n }\n\n if (!options.mask) return [target, data];\n\n randomFillSync(mask, 0, 4);\n\n target[1] |= 0x80;\n target[offset - 4] = mask[0];\n target[offset - 3] = mask[1];\n target[offset - 2] = mask[2];\n target[offset - 1] = mask[3];\n\n if (merge) {\n applyMask(data, mask, target, offset, data.length);\n return [target];\n }\n\n applyMask(data, mask, data, 0, data.length);\n return [target, data];\n }\n\n /**\n * Sends a close message to the other peer.\n *\n * @param {Number} [code] The status code component of the body\n * @param {String} [data] The message component of the body\n * @param {Boolean} [mask=false] Specifies whether or not to mask the message\n * @param {Function} [cb] Callback\n * @public\n */\n close(code, data, mask, cb) {\n let buf;\n\n if (code === undefined) {\n buf = EMPTY_BUFFER;\n } else if (typeof code !== 'number' || !isValidStatusCode(code)) {\n throw new TypeError('First argument must be a valid error code number');\n } else if (data === undefined || data === '') {\n buf = Buffer.allocUnsafe(2);\n buf.writeUInt16BE(code, 0);\n } else {\n const length = Buffer.byteLength(data);\n\n if (length > 123) {\n throw new RangeError('The message must not be greater than 123 bytes');\n }\n\n buf = Buffer.allocUnsafe(2 + length);\n buf.writeUInt16BE(code, 0);\n buf.write(data, 2);\n }\n\n if (this._deflating) {\n this.enqueue([this.doClose, buf, mask, cb]);\n } else {\n this.doClose(buf, mask, cb);\n }\n }\n\n /**\n * Frames and sends a close message.\n *\n * @param {Buffer} data The message to send\n * @param {Boolean} [mask=false] Specifies whether or not to mask `data`\n * @param {Function} [cb] Callback\n * @private\n */\n doClose(data, mask, cb) {\n this.sendFrame(\n Sender.frame(data, {\n fin: true,\n rsv1: false,\n opcode: 0x08,\n mask,\n readOnly: false\n }),\n cb\n );\n }\n\n /**\n * Sends a ping message to the other peer.\n *\n * @param {*} data The message to send\n * @param {Boolean} [mask=false] Specifies whether or not to mask `data`\n * @param {Function} [cb] Callback\n * @public\n */\n ping(data, mask, cb) {\n const buf = toBuffer(data);\n\n if (buf.length > 125) {\n throw new RangeError('The data size must not be greater than 125 bytes');\n }\n\n if (this._deflating) {\n this.enqueue([this.doPing, buf, mask, toBuffer.readOnly, cb]);\n } else {\n this.doPing(buf, mask, toBuffer.readOnly, cb);\n }\n }\n\n /**\n * Frames and sends a ping message.\n *\n * @param {Buffer} data The message to send\n * @param {Boolean} [mask=false] Specifies whether or not to mask `data`\n * @param {Boolean} [readOnly=false] Specifies whether `data` can be modified\n * @param {Function} [cb] Callback\n * @private\n */\n doPing(data, mask, readOnly, cb) {\n this.sendFrame(\n Sender.frame(data, {\n fin: true,\n rsv1: false,\n opcode: 0x09,\n mask,\n readOnly\n }),\n cb\n );\n }\n\n /**\n * Sends a pong message to the other peer.\n *\n * @param {*} data The message to send\n * @param {Boolean} [mask=false] Specifies whether or not to mask `data`\n * @param {Function} [cb] Callback\n * @public\n */\n pong(data, mask, cb) {\n const buf = toBuffer(data);\n\n if (buf.length > 125) {\n throw new RangeError('The data size must not be greater than 125 bytes');\n }\n\n if (this._deflating) {\n this.enqueue([this.doPong, buf, mask, toBuffer.readOnly, cb]);\n } else {\n this.doPong(buf, mask, toBuffer.readOnly, cb);\n }\n }\n\n /**\n * Frames and sends a pong message.\n *\n * @param {Buffer} data The message to send\n * @param {Boolean} [mask=false] Specifies whether or not to mask `data`\n * @param {Boolean} [readOnly=false] Specifies whether `data` can be modified\n * @param {Function} [cb] Callback\n * @private\n */\n doPong(data, mask, readOnly, cb) {\n this.sendFrame(\n Sender.frame(data, {\n fin: true,\n rsv1: false,\n opcode: 0x0a,\n mask,\n readOnly\n }),\n cb\n );\n }\n\n /**\n * Sends a data message to the other peer.\n *\n * @param {*} data The message to send\n * @param {Object} options Options object\n * @param {Boolean} [options.compress=false] Specifies whether or not to\n * compress `data`\n * @param {Boolean} [options.binary=false] Specifies whether `data` is binary\n * or text\n * @param {Boolean} [options.fin=false] Specifies whether the fragment is the\n * last one\n * @param {Boolean} [options.mask=false] Specifies whether or not to mask\n * `data`\n * @param {Function} [cb] Callback\n * @public\n */\n send(data, options, cb) {\n const buf = toBuffer(data);\n const perMessageDeflate = this._extensions[PerMessageDeflate.extensionName];\n let opcode = options.binary ? 2 : 1;\n let rsv1 = options.compress;\n\n if (this._firstFragment) {\n this._firstFragment = false;\n if (rsv1 && perMessageDeflate) {\n rsv1 = buf.length >= perMessageDeflate._threshold;\n }\n this._compress = rsv1;\n } else {\n rsv1 = false;\n opcode = 0;\n }\n\n if (options.fin) this._firstFragment = true;\n\n if (perMessageDeflate) {\n const opts = {\n fin: options.fin,\n rsv1,\n opcode,\n mask: options.mask,\n readOnly: toBuffer.readOnly\n };\n\n if (this._deflating) {\n this.enqueue([this.dispatch, buf, this._compress, opts, cb]);\n } else {\n this.dispatch(buf, this._compress, opts, cb);\n }\n } else {\n this.sendFrame(\n Sender.frame(buf, {\n fin: options.fin,\n rsv1: false,\n opcode,\n mask: options.mask,\n readOnly: toBuffer.readOnly\n }),\n cb\n );\n }\n }\n\n /**\n * Dispatches a data message.\n *\n * @param {Buffer} data The message to send\n * @param {Boolean} [compress=false] Specifies whether or not to compress\n * `data`\n * @param {Object} options Options object\n * @param {Number} options.opcode The opcode\n * @param {Boolean} [options.readOnly=false] Specifies whether `data` can be\n * modified\n * @param {Boolean} [options.fin=false] Specifies whether or not to set the\n * FIN bit\n * @param {Boolean} [options.mask=false] Specifies whether or not to mask\n * `data`\n * @param {Boolean} [options.rsv1=false] Specifies whether or not to set the\n * RSV1 bit\n * @param {Function} [cb] Callback\n * @private\n */\n dispatch(data, compress, options, cb) {\n if (!compress) {\n this.sendFrame(Sender.frame(data, options), cb);\n return;\n }\n\n const perMessageDeflate = this._extensions[PerMessageDeflate.extensionName];\n\n this._bufferedBytes += data.length;\n this._deflating = true;\n perMessageDeflate.compress(data, options.fin, (_, buf) => {\n if (this._socket.destroyed) {\n const err = new Error(\n 'The socket was closed while data was being compressed'\n );\n\n if (typeof cb === 'function') cb(err);\n\n for (let i = 0; i < this._queue.length; i++) {\n const callback = this._queue[i][4];\n\n if (typeof callback === 'function') callback(err);\n }\n\n return;\n }\n\n this._bufferedBytes -= data.length;\n this._deflating = false;\n options.readOnly = false;\n this.sendFrame(Sender.frame(buf, options), cb);\n this.dequeue();\n });\n }\n\n /**\n * Executes queued send operations.\n *\n * @private\n */\n dequeue() {\n while (!this._deflating && this._queue.length) {\n const params = this._queue.shift();\n\n this._bufferedBytes -= params[1].length;\n Reflect.apply(params[0], this, params.slice(1));\n }\n }\n\n /**\n * Enqueues a send operation.\n *\n * @param {Array} params Send operation parameters.\n * @private\n */\n enqueue(params) {\n this._bufferedBytes += params[1].length;\n this._queue.push(params);\n }\n\n /**\n * Sends a frame.\n *\n * @param {Buffer[]} list The frame to send\n * @param {Function} [cb] Callback\n * @private\n */\n sendFrame(list, cb) {\n if (list.length === 2) {\n this._socket.cork();\n this._socket.write(list[0]);\n this._socket.write(list[1], cb);\n this._socket.uncork();\n } else {\n this._socket.write(list[0], cb);\n }\n }\n}\n\nmodule.exports = Sender;\n","'use strict';\n\nconst { Duplex } = require('stream');\n\n/**\n * Emits the `'close'` event on a stream.\n *\n * @param {stream.Duplex} The stream.\n * @private\n */\nfunction emitClose(stream) {\n stream.emit('close');\n}\n\n/**\n * The listener of the `'end'` event.\n *\n * @private\n */\nfunction duplexOnEnd() {\n if (!this.destroyed && this._writableState.finished) {\n this.destroy();\n }\n}\n\n/**\n * The listener of the `'error'` event.\n *\n * @param {Error} err The error\n * @private\n */\nfunction duplexOnError(err) {\n this.removeListener('error', duplexOnError);\n this.destroy();\n if (this.listenerCount('error') === 0) {\n // Do not suppress the throwing behavior.\n this.emit('error', err);\n }\n}\n\n/**\n * Wraps a `WebSocket` in a duplex stream.\n *\n * @param {WebSocket} ws The `WebSocket` to wrap\n * @param {Object} [options] The options for the `Duplex` constructor\n * @return {stream.Duplex} The duplex stream\n * @public\n */\nfunction createWebSocketStream(ws, options) {\n let resumeOnReceiverDrain = true;\n\n function receiverOnDrain() {\n if (resumeOnReceiverDrain) ws._socket.resume();\n }\n\n if (ws.readyState === ws.CONNECTING) {\n ws.once('open', function open() {\n ws._receiver.removeAllListeners('drain');\n ws._receiver.on('drain', receiverOnDrain);\n });\n } else {\n ws._receiver.removeAllListeners('drain');\n ws._receiver.on('drain', receiverOnDrain);\n }\n\n const duplex = new Duplex({\n ...options,\n autoDestroy: false,\n emitClose: false,\n objectMode: false,\n writableObjectMode: false\n });\n\n ws.on('message', function message(msg) {\n if (!duplex.push(msg)) {\n resumeOnReceiverDrain = false;\n ws._socket.pause();\n }\n });\n\n ws.once('error', function error(err) {\n if (duplex.destroyed) return;\n\n duplex.destroy(err);\n });\n\n ws.once('close', function close() {\n if (duplex.destroyed) return;\n\n duplex.push(null);\n });\n\n duplex._destroy = function (err, callback) {\n if (ws.readyState === ws.CLOSED) {\n callback(err);\n process.nextTick(emitClose, duplex);\n return;\n }\n\n let called = false;\n\n ws.once('error', function error(err) {\n called = true;\n callback(err);\n });\n\n ws.once('close', function close() {\n if (!called) callback(err);\n process.nextTick(emitClose, duplex);\n });\n ws.terminate();\n };\n\n duplex._final = function (callback) {\n if (ws.readyState === ws.CONNECTING) {\n ws.once('open', function open() {\n duplex._final(callback);\n });\n return;\n }\n\n // If the value of the `_socket` property is `null` it means that `ws` is a\n // client websocket and the handshake failed. In fact, when this happens, a\n // socket is never assigned to the websocket. Wait for the `'error'` event\n // that will be emitted by the websocket.\n if (ws._socket === null) return;\n\n if (ws._socket._writableState.finished) {\n callback();\n if (duplex._readableState.endEmitted) duplex.destroy();\n } else {\n ws._socket.once('finish', function finish() {\n // `duplex` is not destroyed here because the `'end'` event will be\n // emitted on `duplex` after this `'finish'` event. The EOF signaling\n // `null` chunk is, in fact, pushed when the websocket emits `'close'`.\n callback();\n });\n ws.close();\n }\n };\n\n duplex._read = function () {\n if (ws.readyState === ws.OPEN && !resumeOnReceiverDrain) {\n resumeOnReceiverDrain = true;\n if (!ws._receiver._writableState.needDrain) ws._socket.resume();\n }\n };\n\n duplex._write = function (chunk, encoding, callback) {\n if (ws.readyState === ws.CONNECTING) {\n ws.once('open', function open() {\n duplex._write(chunk, encoding, callback);\n });\n return;\n }\n\n ws.send(chunk, callback);\n };\n\n duplex.on('end', duplexOnEnd);\n duplex.on('error', duplexOnError);\n return duplex;\n}\n\nmodule.exports = createWebSocketStream;\n","'use strict';\n\n/**\n * Checks if a status code is allowed in a close frame.\n *\n * @param {Number} code The status code\n * @return {Boolean} `true` if the status code is valid, else `false`\n * @public\n */\nfunction isValidStatusCode(code) {\n return (\n (code >= 1000 &&\n code <= 1014 &&\n code !== 1004 &&\n code !== 1005 &&\n code !== 1006) ||\n (code >= 3000 && code <= 4999)\n );\n}\n\n/**\n * Checks if a given buffer contains only correct UTF-8.\n * Ported from https://www.cl.cam.ac.uk/%7Emgk25/ucs/utf8_check.c by\n * Markus Kuhn.\n *\n * @param {Buffer} buf The buffer to check\n * @return {Boolean} `true` if `buf` contains only correct UTF-8, else `false`\n * @public\n */\nfunction _isValidUTF8(buf) {\n const len = buf.length;\n let i = 0;\n\n while (i < len) {\n if (buf[i] < 0x80) {\n // 0xxxxxxx\n i++;\n } else if ((buf[i] & 0xe0) === 0xc0) {\n // 110xxxxx 10xxxxxx\n if (\n i + 1 === len ||\n (buf[i + 1] & 0xc0) !== 0x80 ||\n (buf[i] & 0xfe) === 0xc0 // Overlong\n ) {\n return false;\n } else {\n i += 2;\n }\n } else if ((buf[i] & 0xf0) === 0xe0) {\n // 1110xxxx 10xxxxxx 10xxxxxx\n if (\n i + 2 >= len ||\n (buf[i + 1] & 0xc0) !== 0x80 ||\n (buf[i + 2] & 0xc0) !== 0x80 ||\n (buf[i] === 0xe0 && (buf[i + 1] & 0xe0) === 0x80) || // Overlong\n (buf[i] === 0xed && (buf[i + 1] & 0xe0) === 0xa0) // Surrogate (U+D800 - U+DFFF)\n ) {\n return false;\n } else {\n i += 3;\n }\n } else if ((buf[i] & 0xf8) === 0xf0) {\n // 11110xxx 10xxxxxx 10xxxxxx 10xxxxxx\n if (\n i + 3 >= len ||\n (buf[i + 1] & 0xc0) !== 0x80 ||\n (buf[i + 2] & 0xc0) !== 0x80 ||\n (buf[i + 3] & 0xc0) !== 0x80 ||\n (buf[i] === 0xf0 && (buf[i + 1] & 0xf0) === 0x80) || // Overlong\n (buf[i] === 0xf4 && buf[i + 1] > 0x8f) ||\n buf[i] > 0xf4 // > U+10FFFF\n ) {\n return false;\n } else {\n i += 4;\n }\n } else {\n return false;\n }\n }\n\n return true;\n}\n\ntry {\n let isValidUTF8 = require('utf-8-validate');\n\n /* istanbul ignore if */\n if (typeof isValidUTF8 === 'object') {\n isValidUTF8 = isValidUTF8.Validation.isValidUTF8; // utf-8-validate@<3.0.0\n }\n\n module.exports = {\n isValidStatusCode,\n isValidUTF8(buf) {\n return buf.length < 150 ? _isValidUTF8(buf) : isValidUTF8(buf);\n }\n };\n} catch (e) /* istanbul ignore next */ {\n module.exports = {\n isValidStatusCode,\n isValidUTF8: _isValidUTF8\n };\n}\n","'use strict';\n\nconst EventEmitter = require('events');\nconst { createHash } = require('crypto');\nconst { createServer, STATUS_CODES } = require('http');\n\nconst PerMessageDeflate = require('./permessage-deflate');\nconst WebSocket = require('./websocket');\nconst { format, parse } = require('./extension');\nconst { GUID, kWebSocket } = require('./constants');\n\nconst keyRegex = /^[+/0-9A-Za-z]{22}==$/;\n\n/**\n * Class representing a WebSocket server.\n *\n * @extends EventEmitter\n */\nclass WebSocketServer extends EventEmitter {\n /**\n * Create a `WebSocketServer` instance.\n *\n * @param {Object} options Configuration options\n * @param {Number} [options.backlog=511] The maximum length of the queue of\n * pending connections\n * @param {Boolean} [options.clientTracking=true] Specifies whether or not to\n * track clients\n * @param {Function} [options.handleProtocols] A hook to handle protocols\n * @param {String} [options.host] The hostname where to bind the server\n * @param {Number} [options.maxPayload=104857600] The maximum allowed message\n * size\n * @param {Boolean} [options.noServer=false] Enable no server mode\n * @param {String} [options.path] Accept only connections matching this path\n * @param {(Boolean|Object)} [options.perMessageDeflate=false] Enable/disable\n * permessage-deflate\n * @param {Number} [options.port] The port where to bind the server\n * @param {http.Server} [options.server] A pre-created HTTP/S server to use\n * @param {Function} [options.verifyClient] A hook to reject connections\n * @param {Function} [callback] A listener for the `listening` event\n */\n constructor(options, callback) {\n super();\n\n options = {\n maxPayload: 100 * 1024 * 1024,\n perMessageDeflate: false,\n handleProtocols: null,\n clientTracking: true,\n verifyClient: null,\n noServer: false,\n backlog: null, // use default (511 as implemented in net.js)\n server: null,\n host: null,\n path: null,\n port: null,\n ...options\n };\n\n if (options.port == null && !options.server && !options.noServer) {\n throw new TypeError(\n 'One of the \"port\", \"server\", or \"noServer\" options must be specified'\n );\n }\n\n if (options.port != null) {\n this._server = createServer((req, res) => {\n const body = STATUS_CODES[426];\n\n res.writeHead(426, {\n 'Content-Length': body.length,\n 'Content-Type': 'text/plain'\n });\n res.end(body);\n });\n this._server.listen(\n options.port,\n options.host,\n options.backlog,\n callback\n );\n } else if (options.server) {\n this._server = options.server;\n }\n\n if (this._server) {\n const emitConnection = this.emit.bind(this, 'connection');\n\n this._removeListeners = addListeners(this._server, {\n listening: this.emit.bind(this, 'listening'),\n error: this.emit.bind(this, 'error'),\n upgrade: (req, socket, head) => {\n this.handleUpgrade(req, socket, head, emitConnection);\n }\n });\n }\n\n if (options.perMessageDeflate === true) options.perMessageDeflate = {};\n if (options.clientTracking) this.clients = new Set();\n this.options = options;\n }\n\n /**\n * Returns the bound address, the address family name, and port of the server\n * as reported by the operating system if listening on an IP socket.\n * If the server is listening on a pipe or UNIX domain socket, the name is\n * returned as a string.\n *\n * @return {(Object|String|null)} The address of the server\n * @public\n */\n address() {\n if (this.options.noServer) {\n throw new Error('The server is operating in \"noServer\" mode');\n }\n\n if (!this._server) return null;\n return this._server.address();\n }\n\n /**\n * Close the server.\n *\n * @param {Function} [cb] Callback\n * @public\n */\n close(cb) {\n if (cb) this.once('close', cb);\n\n //\n // Terminate all associated clients.\n //\n if (this.clients) {\n for (const client of this.clients) client.terminate();\n }\n\n const server = this._server;\n\n if (server) {\n this._removeListeners();\n this._removeListeners = this._server = null;\n\n //\n // Close the http server if it was internally created.\n //\n if (this.options.port != null) {\n server.close(() => this.emit('close'));\n return;\n }\n }\n\n process.nextTick(emitClose, this);\n }\n\n /**\n * See if a given request should be handled by this server instance.\n *\n * @param {http.IncomingMessage} req Request object to inspect\n * @return {Boolean} `true` if the request is valid, else `false`\n * @public\n */\n shouldHandle(req) {\n if (this.options.path) {\n const index = req.url.indexOf('?');\n const pathname = index !== -1 ? req.url.slice(0, index) : req.url;\n\n if (pathname !== this.options.path) return false;\n }\n\n return true;\n }\n\n /**\n * Handle a HTTP Upgrade request.\n *\n * @param {http.IncomingMessage} req The request object\n * @param {net.Socket} socket The network socket between the server and client\n * @param {Buffer} head The first packet of the upgraded stream\n * @param {Function} cb Callback\n * @public\n */\n handleUpgrade(req, socket, head, cb) {\n socket.on('error', socketOnError);\n\n const key =\n req.headers['sec-websocket-key'] !== undefined\n ? req.headers['sec-websocket-key'].trim()\n : false;\n const version = +req.headers['sec-websocket-version'];\n const extensions = {};\n\n if (\n req.method !== 'GET' ||\n req.headers.upgrade.toLowerCase() !== 'websocket' ||\n !key ||\n !keyRegex.test(key) ||\n (version !== 8 && version !== 13) ||\n !this.shouldHandle(req)\n ) {\n return abortHandshake(socket, 400);\n }\n\n if (this.options.perMessageDeflate) {\n const perMessageDeflate = new PerMessageDeflate(\n this.options.perMessageDeflate,\n true,\n this.options.maxPayload\n );\n\n try {\n const offers = parse(req.headers['sec-websocket-extensions']);\n\n if (offers[PerMessageDeflate.extensionName]) {\n perMessageDeflate.accept(offers[PerMessageDeflate.extensionName]);\n extensions[PerMessageDeflate.extensionName] = perMessageDeflate;\n }\n } catch (err) {\n return abortHandshake(socket, 400);\n }\n }\n\n //\n // Optionally call external client verification handler.\n //\n if (this.options.verifyClient) {\n const info = {\n origin:\n req.headers[`${version === 8 ? 'sec-websocket-origin' : 'origin'}`],\n secure: !!(req.socket.authorized || req.socket.encrypted),\n req\n };\n\n if (this.options.verifyClient.length === 2) {\n this.options.verifyClient(info, (verified, code, message, headers) => {\n if (!verified) {\n return abortHandshake(socket, code || 401, message, headers);\n }\n\n this.completeUpgrade(key, extensions, req, socket, head, cb);\n });\n return;\n }\n\n if (!this.options.verifyClient(info)) return abortHandshake(socket, 401);\n }\n\n this.completeUpgrade(key, extensions, req, socket, head, cb);\n }\n\n /**\n * Upgrade the connection to WebSocket.\n *\n * @param {String} key The value of the `Sec-WebSocket-Key` header\n * @param {Object} extensions The accepted extensions\n * @param {http.IncomingMessage} req The request object\n * @param {net.Socket} socket The network socket between the server and client\n * @param {Buffer} head The first packet of the upgraded stream\n * @param {Function} cb Callback\n * @throws {Error} If called more than once with the same socket\n * @private\n */\n completeUpgrade(key, extensions, req, socket, head, cb) {\n //\n // Destroy the socket if the client has already sent a FIN packet.\n //\n if (!socket.readable || !socket.writable) return socket.destroy();\n\n if (socket[kWebSocket]) {\n throw new Error(\n 'server.handleUpgrade() was called more than once with the same ' +\n 'socket, possibly due to a misconfiguration'\n );\n }\n\n const digest = createHash('sha1')\n .update(key + GUID)\n .digest('base64');\n\n const headers = [\n 'HTTP/1.1 101 Switching Protocols',\n 'Upgrade: websocket',\n 'Connection: Upgrade',\n `Sec-WebSocket-Accept: ${digest}`\n ];\n\n const ws = new WebSocket(null);\n let protocol = req.headers['sec-websocket-protocol'];\n\n if (protocol) {\n protocol = protocol.trim().split(/ *, */);\n\n //\n // Optionally call external protocol selection handler.\n //\n if (this.options.handleProtocols) {\n protocol = this.options.handleProtocols(protocol, req);\n } else {\n protocol = protocol[0];\n }\n\n if (protocol) {\n headers.push(`Sec-WebSocket-Protocol: ${protocol}`);\n ws._protocol = protocol;\n }\n }\n\n if (extensions[PerMessageDeflate.extensionName]) {\n const params = extensions[PerMessageDeflate.extensionName].params;\n const value = format({\n [PerMessageDeflate.extensionName]: [params]\n });\n headers.push(`Sec-WebSocket-Extensions: ${value}`);\n ws._extensions = extensions;\n }\n\n //\n // Allow external modification/inspection of handshake headers.\n //\n this.emit('headers', headers, req);\n\n socket.write(headers.concat('\\r\\n').join('\\r\\n'));\n socket.removeListener('error', socketOnError);\n\n ws.setSocket(socket, head, this.options.maxPayload);\n\n if (this.clients) {\n this.clients.add(ws);\n ws.on('close', () => this.clients.delete(ws));\n }\n\n cb(ws, req);\n }\n}\n\nmodule.exports = WebSocketServer;\n\n/**\n * Add event listeners on an `EventEmitter` using a map of \n * pairs.\n *\n * @param {EventEmitter} server The event emitter\n * @param {Object.} map The listeners to add\n * @return {Function} A function that will remove the added listeners when\n * called\n * @private\n */\nfunction addListeners(server, map) {\n for (const event of Object.keys(map)) server.on(event, map[event]);\n\n return function removeListeners() {\n for (const event of Object.keys(map)) {\n server.removeListener(event, map[event]);\n }\n };\n}\n\n/**\n * Emit a `'close'` event on an `EventEmitter`.\n *\n * @param {EventEmitter} server The event emitter\n * @private\n */\nfunction emitClose(server) {\n server.emit('close');\n}\n\n/**\n * Handle premature socket errors.\n *\n * @private\n */\nfunction socketOnError() {\n this.destroy();\n}\n\n/**\n * Close the connection when preconditions are not fulfilled.\n *\n * @param {net.Socket} socket The socket of the upgrade request\n * @param {Number} code The HTTP response status code\n * @param {String} [message] The HTTP response body\n * @param {Object} [headers] Additional HTTP response headers\n * @private\n */\nfunction abortHandshake(socket, code, message, headers) {\n if (socket.writable) {\n message = message || STATUS_CODES[code];\n headers = {\n Connection: 'close',\n 'Content-Type': 'text/html',\n 'Content-Length': Buffer.byteLength(message),\n ...headers\n };\n\n socket.write(\n `HTTP/1.1 ${code} ${STATUS_CODES[code]}\\r\\n` +\n Object.keys(headers)\n .map((h) => `${h}: ${headers[h]}`)\n .join('\\r\\n') +\n '\\r\\n\\r\\n' +\n message\n );\n }\n\n socket.removeListener('error', socketOnError);\n socket.destroy();\n}\n","'use strict';\n\nconst EventEmitter = require('events');\nconst https = require('https');\nconst http = require('http');\nconst net = require('net');\nconst tls = require('tls');\nconst { randomBytes, createHash } = require('crypto');\nconst { URL } = require('url');\n\nconst PerMessageDeflate = require('./permessage-deflate');\nconst Receiver = require('./receiver');\nconst Sender = require('./sender');\nconst {\n BINARY_TYPES,\n EMPTY_BUFFER,\n GUID,\n kStatusCode,\n kWebSocket,\n NOOP\n} = require('./constants');\nconst { addEventListener, removeEventListener } = require('./event-target');\nconst { format, parse } = require('./extension');\nconst { toBuffer } = require('./buffer-util');\n\nconst readyStates = ['CONNECTING', 'OPEN', 'CLOSING', 'CLOSED'];\nconst protocolVersions = [8, 13];\nconst closeTimeout = 30 * 1000;\n\n/**\n * Class representing a WebSocket.\n *\n * @extends EventEmitter\n */\nclass WebSocket extends EventEmitter {\n /**\n * Create a new `WebSocket`.\n *\n * @param {(String|url.URL)} address The URL to which to connect\n * @param {(String|String[])} [protocols] The subprotocols\n * @param {Object} [options] Connection options\n */\n constructor(address, protocols, options) {\n super();\n\n this._binaryType = BINARY_TYPES[0];\n this._closeCode = 1006;\n this._closeFrameReceived = false;\n this._closeFrameSent = false;\n this._closeMessage = '';\n this._closeTimer = null;\n this._extensions = {};\n this._protocol = '';\n this._readyState = WebSocket.CONNECTING;\n this._receiver = null;\n this._sender = null;\n this._socket = null;\n\n if (address !== null) {\n this._bufferedAmount = 0;\n this._isServer = false;\n this._redirects = 0;\n\n if (Array.isArray(protocols)) {\n protocols = protocols.join(', ');\n } else if (typeof protocols === 'object' && protocols !== null) {\n options = protocols;\n protocols = undefined;\n }\n\n initAsClient(this, address, protocols, options);\n } else {\n this._isServer = true;\n }\n }\n\n /**\n * This deviates from the WHATWG interface since ws doesn't support the\n * required default \"blob\" type (instead we define a custom \"nodebuffer\"\n * type).\n *\n * @type {String}\n */\n get binaryType() {\n return this._binaryType;\n }\n\n set binaryType(type) {\n if (!BINARY_TYPES.includes(type)) return;\n\n this._binaryType = type;\n\n //\n // Allow to change `binaryType` on the fly.\n //\n if (this._receiver) this._receiver._binaryType = type;\n }\n\n /**\n * @type {Number}\n */\n get bufferedAmount() {\n if (!this._socket) return this._bufferedAmount;\n\n return this._socket._writableState.length + this._sender._bufferedBytes;\n }\n\n /**\n * @type {String}\n */\n get extensions() {\n return Object.keys(this._extensions).join();\n }\n\n /**\n * @type {String}\n */\n get protocol() {\n return this._protocol;\n }\n\n /**\n * @type {Number}\n */\n get readyState() {\n return this._readyState;\n }\n\n /**\n * @type {String}\n */\n get url() {\n return this._url;\n }\n\n /**\n * Set up the socket and the internal resources.\n *\n * @param {net.Socket} socket The network socket between the server and client\n * @param {Buffer} head The first packet of the upgraded stream\n * @param {Number} [maxPayload=0] The maximum allowed message size\n * @private\n */\n setSocket(socket, head, maxPayload) {\n const receiver = new Receiver(\n this.binaryType,\n this._extensions,\n this._isServer,\n maxPayload\n );\n\n this._sender = new Sender(socket, this._extensions);\n this._receiver = receiver;\n this._socket = socket;\n\n receiver[kWebSocket] = this;\n socket[kWebSocket] = this;\n\n receiver.on('conclude', receiverOnConclude);\n receiver.on('drain', receiverOnDrain);\n receiver.on('error', receiverOnError);\n receiver.on('message', receiverOnMessage);\n receiver.on('ping', receiverOnPing);\n receiver.on('pong', receiverOnPong);\n\n socket.setTimeout(0);\n socket.setNoDelay();\n\n if (head.length > 0) socket.unshift(head);\n\n socket.on('close', socketOnClose);\n socket.on('data', socketOnData);\n socket.on('end', socketOnEnd);\n socket.on('error', socketOnError);\n\n this._readyState = WebSocket.OPEN;\n this.emit('open');\n }\n\n /**\n * Emit the `'close'` event.\n *\n * @private\n */\n emitClose() {\n if (!this._socket) {\n this._readyState = WebSocket.CLOSED;\n this.emit('close', this._closeCode, this._closeMessage);\n return;\n }\n\n if (this._extensions[PerMessageDeflate.extensionName]) {\n this._extensions[PerMessageDeflate.extensionName].cleanup();\n }\n\n this._receiver.removeAllListeners();\n this._readyState = WebSocket.CLOSED;\n this.emit('close', this._closeCode, this._closeMessage);\n }\n\n /**\n * Start a closing handshake.\n *\n * +----------+ +-----------+ +----------+\n * - - -|ws.close()|-->|close frame|-->|ws.close()|- - -\n * | +----------+ +-----------+ +----------+ |\n * +----------+ +-----------+ |\n * CLOSING |ws.close()|<--|close frame|<--+-----+ CLOSING\n * +----------+ +-----------+ |\n * | | | +---+ |\n * +------------------------+-->|fin| - - - -\n * | +---+ | +---+\n * - - - - -|fin|<---------------------+\n * +---+\n *\n * @param {Number} [code] Status code explaining why the connection is closing\n * @param {String} [data] A string explaining why the connection is closing\n * @public\n */\n close(code, data) {\n if (this.readyState === WebSocket.CLOSED) return;\n if (this.readyState === WebSocket.CONNECTING) {\n const msg = 'WebSocket was closed before the connection was established';\n return abortHandshake(this, this._req, msg);\n }\n\n if (this.readyState === WebSocket.CLOSING) {\n if (this._closeFrameSent && this._closeFrameReceived) this._socket.end();\n return;\n }\n\n this._readyState = WebSocket.CLOSING;\n this._sender.close(code, data, !this._isServer, (err) => {\n //\n // This error is handled by the `'error'` listener on the socket. We only\n // want to know if the close frame has been sent here.\n //\n if (err) return;\n\n this._closeFrameSent = true;\n if (this._closeFrameReceived) this._socket.end();\n });\n\n //\n // Specify a timeout for the closing handshake to complete.\n //\n this._closeTimer = setTimeout(\n this._socket.destroy.bind(this._socket),\n closeTimeout\n );\n }\n\n /**\n * Send a ping.\n *\n * @param {*} [data] The data to send\n * @param {Boolean} [mask] Indicates whether or not to mask `data`\n * @param {Function} [cb] Callback which is executed when the ping is sent\n * @public\n */\n ping(data, mask, cb) {\n if (this.readyState === WebSocket.CONNECTING) {\n throw new Error('WebSocket is not open: readyState 0 (CONNECTING)');\n }\n\n if (typeof data === 'function') {\n cb = data;\n data = mask = undefined;\n } else if (typeof mask === 'function') {\n cb = mask;\n mask = undefined;\n }\n\n if (typeof data === 'number') data = data.toString();\n\n if (this.readyState !== WebSocket.OPEN) {\n sendAfterClose(this, data, cb);\n return;\n }\n\n if (mask === undefined) mask = !this._isServer;\n this._sender.ping(data || EMPTY_BUFFER, mask, cb);\n }\n\n /**\n * Send a pong.\n *\n * @param {*} [data] The data to send\n * @param {Boolean} [mask] Indicates whether or not to mask `data`\n * @param {Function} [cb] Callback which is executed when the pong is sent\n * @public\n */\n pong(data, mask, cb) {\n if (this.readyState === WebSocket.CONNECTING) {\n throw new Error('WebSocket is not open: readyState 0 (CONNECTING)');\n }\n\n if (typeof data === 'function') {\n cb = data;\n data = mask = undefined;\n } else if (typeof mask === 'function') {\n cb = mask;\n mask = undefined;\n }\n\n if (typeof data === 'number') data = data.toString();\n\n if (this.readyState !== WebSocket.OPEN) {\n sendAfterClose(this, data, cb);\n return;\n }\n\n if (mask === undefined) mask = !this._isServer;\n this._sender.pong(data || EMPTY_BUFFER, mask, cb);\n }\n\n /**\n * Send a data message.\n *\n * @param {*} data The message to send\n * @param {Object} [options] Options object\n * @param {Boolean} [options.compress] Specifies whether or not to compress\n * `data`\n * @param {Boolean} [options.binary] Specifies whether `data` is binary or\n * text\n * @param {Boolean} [options.fin=true] Specifies whether the fragment is the\n * last one\n * @param {Boolean} [options.mask] Specifies whether or not to mask `data`\n * @param {Function} [cb] Callback which is executed when data is written out\n * @public\n */\n send(data, options, cb) {\n if (this.readyState === WebSocket.CONNECTING) {\n throw new Error('WebSocket is not open: readyState 0 (CONNECTING)');\n }\n\n if (typeof options === 'function') {\n cb = options;\n options = {};\n }\n\n if (typeof data === 'number') data = data.toString();\n\n if (this.readyState !== WebSocket.OPEN) {\n sendAfterClose(this, data, cb);\n return;\n }\n\n const opts = {\n binary: typeof data !== 'string',\n mask: !this._isServer,\n compress: true,\n fin: true,\n ...options\n };\n\n if (!this._extensions[PerMessageDeflate.extensionName]) {\n opts.compress = false;\n }\n\n this._sender.send(data || EMPTY_BUFFER, opts, cb);\n }\n\n /**\n * Forcibly close the connection.\n *\n * @public\n */\n terminate() {\n if (this.readyState === WebSocket.CLOSED) return;\n if (this.readyState === WebSocket.CONNECTING) {\n const msg = 'WebSocket was closed before the connection was established';\n return abortHandshake(this, this._req, msg);\n }\n\n if (this._socket) {\n this._readyState = WebSocket.CLOSING;\n this._socket.destroy();\n }\n }\n}\n\nreadyStates.forEach((readyState, i) => {\n const descriptor = { enumerable: true, value: i };\n\n Object.defineProperty(WebSocket.prototype, readyState, descriptor);\n Object.defineProperty(WebSocket, readyState, descriptor);\n});\n\n[\n 'binaryType',\n 'bufferedAmount',\n 'extensions',\n 'protocol',\n 'readyState',\n 'url'\n].forEach((property) => {\n Object.defineProperty(WebSocket.prototype, property, { enumerable: true });\n});\n\n//\n// Add the `onopen`, `onerror`, `onclose`, and `onmessage` attributes.\n// See https://html.spec.whatwg.org/multipage/comms.html#the-websocket-interface\n//\n['open', 'error', 'close', 'message'].forEach((method) => {\n Object.defineProperty(WebSocket.prototype, `on${method}`, {\n configurable: true,\n enumerable: true,\n /**\n * Return the listener of the event.\n *\n * @return {(Function|undefined)} The event listener or `undefined`\n * @public\n */\n get() {\n const listeners = this.listeners(method);\n for (let i = 0; i < listeners.length; i++) {\n if (listeners[i]._listener) return listeners[i]._listener;\n }\n\n return undefined;\n },\n /**\n * Add a listener for the event.\n *\n * @param {Function} listener The listener to add\n * @public\n */\n set(listener) {\n const listeners = this.listeners(method);\n for (let i = 0; i < listeners.length; i++) {\n //\n // Remove only the listeners added via `addEventListener`.\n //\n if (listeners[i]._listener) this.removeListener(method, listeners[i]);\n }\n this.addEventListener(method, listener);\n }\n });\n});\n\nWebSocket.prototype.addEventListener = addEventListener;\nWebSocket.prototype.removeEventListener = removeEventListener;\n\nmodule.exports = WebSocket;\n\n/**\n * Initialize a WebSocket client.\n *\n * @param {WebSocket} websocket The client to initialize\n * @param {(String|url.URL)} address The URL to which to connect\n * @param {String} [protocols] The subprotocols\n * @param {Object} [options] Connection options\n * @param {(Boolean|Object)} [options.perMessageDeflate=true] Enable/disable\n * permessage-deflate\n * @param {Number} [options.handshakeTimeout] Timeout in milliseconds for the\n * handshake request\n * @param {Number} [options.protocolVersion=13] Value of the\n * `Sec-WebSocket-Version` header\n * @param {String} [options.origin] Value of the `Origin` or\n * `Sec-WebSocket-Origin` header\n * @param {Number} [options.maxPayload=104857600] The maximum allowed message\n * size\n * @param {Boolean} [options.followRedirects=false] Whether or not to follow\n * redirects\n * @param {Number} [options.maxRedirects=10] The maximum number of redirects\n * allowed\n * @private\n */\nfunction initAsClient(websocket, address, protocols, options) {\n const opts = {\n protocolVersion: protocolVersions[1],\n maxPayload: 100 * 1024 * 1024,\n perMessageDeflate: true,\n followRedirects: false,\n maxRedirects: 10,\n ...options,\n createConnection: undefined,\n socketPath: undefined,\n hostname: undefined,\n protocol: undefined,\n timeout: undefined,\n method: undefined,\n host: undefined,\n path: undefined,\n port: undefined\n };\n\n if (!protocolVersions.includes(opts.protocolVersion)) {\n throw new RangeError(\n `Unsupported protocol version: ${opts.protocolVersion} ` +\n `(supported versions: ${protocolVersions.join(', ')})`\n );\n }\n\n let parsedUrl;\n\n if (address instanceof URL) {\n parsedUrl = address;\n websocket._url = address.href;\n } else {\n parsedUrl = new URL(address);\n websocket._url = address;\n }\n\n const isUnixSocket = parsedUrl.protocol === 'ws+unix:';\n\n if (!parsedUrl.host && (!isUnixSocket || !parsedUrl.pathname)) {\n throw new Error(`Invalid URL: ${websocket.url}`);\n }\n\n const isSecure =\n parsedUrl.protocol === 'wss:' || parsedUrl.protocol === 'https:';\n const defaultPort = isSecure ? 443 : 80;\n const key = randomBytes(16).toString('base64');\n const get = isSecure ? https.get : http.get;\n let perMessageDeflate;\n\n opts.createConnection = isSecure ? tlsConnect : netConnect;\n opts.defaultPort = opts.defaultPort || defaultPort;\n opts.port = parsedUrl.port || defaultPort;\n opts.host = parsedUrl.hostname.startsWith('[')\n ? parsedUrl.hostname.slice(1, -1)\n : parsedUrl.hostname;\n opts.headers = {\n 'Sec-WebSocket-Version': opts.protocolVersion,\n 'Sec-WebSocket-Key': key,\n Connection: 'Upgrade',\n Upgrade: 'websocket',\n ...opts.headers\n };\n opts.path = parsedUrl.pathname + parsedUrl.search;\n opts.timeout = opts.handshakeTimeout;\n\n if (opts.perMessageDeflate) {\n perMessageDeflate = new PerMessageDeflate(\n opts.perMessageDeflate !== true ? opts.perMessageDeflate : {},\n false,\n opts.maxPayload\n );\n opts.headers['Sec-WebSocket-Extensions'] = format({\n [PerMessageDeflate.extensionName]: perMessageDeflate.offer()\n });\n }\n if (protocols) {\n opts.headers['Sec-WebSocket-Protocol'] = protocols;\n }\n if (opts.origin) {\n if (opts.protocolVersion < 13) {\n opts.headers['Sec-WebSocket-Origin'] = opts.origin;\n } else {\n opts.headers.Origin = opts.origin;\n }\n }\n if (parsedUrl.username || parsedUrl.password) {\n opts.auth = `${parsedUrl.username}:${parsedUrl.password}`;\n }\n\n if (isUnixSocket) {\n const parts = opts.path.split(':');\n\n opts.socketPath = parts[0];\n opts.path = parts[1];\n }\n\n let req = (websocket._req = get(opts));\n\n if (opts.timeout) {\n req.on('timeout', () => {\n abortHandshake(websocket, req, 'Opening handshake has timed out');\n });\n }\n\n req.on('error', (err) => {\n if (req === null || req.aborted) return;\n\n req = websocket._req = null;\n websocket._readyState = WebSocket.CLOSING;\n websocket.emit('error', err);\n websocket.emitClose();\n });\n\n req.on('response', (res) => {\n const location = res.headers.location;\n const statusCode = res.statusCode;\n\n if (\n location &&\n opts.followRedirects &&\n statusCode >= 300 &&\n statusCode < 400\n ) {\n if (++websocket._redirects > opts.maxRedirects) {\n abortHandshake(websocket, req, 'Maximum redirects exceeded');\n return;\n }\n\n req.abort();\n\n const addr = new URL(location, address);\n\n initAsClient(websocket, addr, protocols, options);\n } else if (!websocket.emit('unexpected-response', req, res)) {\n abortHandshake(\n websocket,\n req,\n `Unexpected server response: ${res.statusCode}`\n );\n }\n });\n\n req.on('upgrade', (res, socket, head) => {\n websocket.emit('upgrade', res);\n\n //\n // The user may have closed the connection from a listener of the `upgrade`\n // event.\n //\n if (websocket.readyState !== WebSocket.CONNECTING) return;\n\n req = websocket._req = null;\n\n const digest = createHash('sha1')\n .update(key + GUID)\n .digest('base64');\n\n if (res.headers['sec-websocket-accept'] !== digest) {\n abortHandshake(websocket, socket, 'Invalid Sec-WebSocket-Accept header');\n return;\n }\n\n const serverProt = res.headers['sec-websocket-protocol'];\n const protList = (protocols || '').split(/, */);\n let protError;\n\n if (!protocols && serverProt) {\n protError = 'Server sent a subprotocol but none was requested';\n } else if (protocols && !serverProt) {\n protError = 'Server sent no subprotocol';\n } else if (serverProt && !protList.includes(serverProt)) {\n protError = 'Server sent an invalid subprotocol';\n }\n\n if (protError) {\n abortHandshake(websocket, socket, protError);\n return;\n }\n\n if (serverProt) websocket._protocol = serverProt;\n\n if (perMessageDeflate) {\n try {\n const extensions = parse(res.headers['sec-websocket-extensions']);\n\n if (extensions[PerMessageDeflate.extensionName]) {\n perMessageDeflate.accept(extensions[PerMessageDeflate.extensionName]);\n websocket._extensions[\n PerMessageDeflate.extensionName\n ] = perMessageDeflate;\n }\n } catch (err) {\n abortHandshake(\n websocket,\n socket,\n 'Invalid Sec-WebSocket-Extensions header'\n );\n return;\n }\n }\n\n websocket.setSocket(socket, head, opts.maxPayload);\n });\n}\n\n/**\n * Create a `net.Socket` and initiate a connection.\n *\n * @param {Object} options Connection options\n * @return {net.Socket} The newly created socket used to start the connection\n * @private\n */\nfunction netConnect(options) {\n options.path = options.socketPath;\n return net.connect(options);\n}\n\n/**\n * Create a `tls.TLSSocket` and initiate a connection.\n *\n * @param {Object} options Connection options\n * @return {tls.TLSSocket} The newly created socket used to start the connection\n * @private\n */\nfunction tlsConnect(options) {\n options.path = undefined;\n\n if (!options.servername && options.servername !== '') {\n options.servername = net.isIP(options.host) ? '' : options.host;\n }\n\n return tls.connect(options);\n}\n\n/**\n * Abort the handshake and emit an error.\n *\n * @param {WebSocket} websocket The WebSocket instance\n * @param {(http.ClientRequest|net.Socket)} stream The request to abort or the\n * socket to destroy\n * @param {String} message The error message\n * @private\n */\nfunction abortHandshake(websocket, stream, message) {\n websocket._readyState = WebSocket.CLOSING;\n\n const err = new Error(message);\n Error.captureStackTrace(err, abortHandshake);\n\n if (stream.setHeader) {\n stream.abort();\n\n if (stream.socket && !stream.socket.destroyed) {\n //\n // On Node.js >= 14.3.0 `request.abort()` does not destroy the socket if\n // called after the request completed. See\n // https://github.com/websockets/ws/issues/1869.\n //\n stream.socket.destroy();\n }\n\n stream.once('abort', websocket.emitClose.bind(websocket));\n websocket.emit('error', err);\n } else {\n stream.destroy(err);\n stream.once('error', websocket.emit.bind(websocket, 'error'));\n stream.once('close', websocket.emitClose.bind(websocket));\n }\n}\n\n/**\n * Handle cases where the `ping()`, `pong()`, or `send()` methods are called\n * when the `readyState` attribute is `CLOSING` or `CLOSED`.\n *\n * @param {WebSocket} websocket The WebSocket instance\n * @param {*} [data] The data to send\n * @param {Function} [cb] Callback\n * @private\n */\nfunction sendAfterClose(websocket, data, cb) {\n if (data) {\n const length = toBuffer(data).length;\n\n //\n // The `_bufferedAmount` property is used only when the peer is a client and\n // the opening handshake fails. Under these circumstances, in fact, the\n // `setSocket()` method is not called, so the `_socket` and `_sender`\n // properties are set to `null`.\n //\n if (websocket._socket) websocket._sender._bufferedBytes += length;\n else websocket._bufferedAmount += length;\n }\n\n if (cb) {\n const err = new Error(\n `WebSocket is not open: readyState ${websocket.readyState} ` +\n `(${readyStates[websocket.readyState]})`\n );\n cb(err);\n }\n}\n\n/**\n * The listener of the `Receiver` `'conclude'` event.\n *\n * @param {Number} code The status code\n * @param {String} reason The reason for closing\n * @private\n */\nfunction receiverOnConclude(code, reason) {\n const websocket = this[kWebSocket];\n\n websocket._socket.removeListener('data', socketOnData);\n websocket._socket.resume();\n\n websocket._closeFrameReceived = true;\n websocket._closeMessage = reason;\n websocket._closeCode = code;\n\n if (code === 1005) websocket.close();\n else websocket.close(code, reason);\n}\n\n/**\n * The listener of the `Receiver` `'drain'` event.\n *\n * @private\n */\nfunction receiverOnDrain() {\n this[kWebSocket]._socket.resume();\n}\n\n/**\n * The listener of the `Receiver` `'error'` event.\n *\n * @param {(RangeError|Error)} err The emitted error\n * @private\n */\nfunction receiverOnError(err) {\n const websocket = this[kWebSocket];\n\n websocket._socket.removeListener('data', socketOnData);\n\n websocket._readyState = WebSocket.CLOSING;\n websocket._closeCode = err[kStatusCode];\n websocket.emit('error', err);\n websocket._socket.destroy();\n}\n\n/**\n * The listener of the `Receiver` `'finish'` event.\n *\n * @private\n */\nfunction receiverOnFinish() {\n this[kWebSocket].emitClose();\n}\n\n/**\n * The listener of the `Receiver` `'message'` event.\n *\n * @param {(String|Buffer|ArrayBuffer|Buffer[])} data The message\n * @private\n */\nfunction receiverOnMessage(data) {\n this[kWebSocket].emit('message', data);\n}\n\n/**\n * The listener of the `Receiver` `'ping'` event.\n *\n * @param {Buffer} data The data included in the ping frame\n * @private\n */\nfunction receiverOnPing(data) {\n const websocket = this[kWebSocket];\n\n websocket.pong(data, !websocket._isServer, NOOP);\n websocket.emit('ping', data);\n}\n\n/**\n * The listener of the `Receiver` `'pong'` event.\n *\n * @param {Buffer} data The data included in the pong frame\n * @private\n */\nfunction receiverOnPong(data) {\n this[kWebSocket].emit('pong', data);\n}\n\n/**\n * The listener of the `net.Socket` `'close'` event.\n *\n * @private\n */\nfunction socketOnClose() {\n const websocket = this[kWebSocket];\n\n this.removeListener('close', socketOnClose);\n this.removeListener('end', socketOnEnd);\n\n websocket._readyState = WebSocket.CLOSING;\n\n //\n // The close frame might not have been received or the `'end'` event emitted,\n // for example, if the socket was destroyed due to an error. Ensure that the\n // `receiver` stream is closed after writing any remaining buffered data to\n // it. If the readable side of the socket is in flowing mode then there is no\n // buffered data as everything has been already written and `readable.read()`\n // will return `null`. If instead, the socket is paused, any possible buffered\n // data will be read as a single chunk and emitted synchronously in a single\n // `'data'` event.\n //\n websocket._socket.read();\n websocket._receiver.end();\n\n this.removeListener('data', socketOnData);\n this[kWebSocket] = undefined;\n\n clearTimeout(websocket._closeTimer);\n\n if (\n websocket._receiver._writableState.finished ||\n websocket._receiver._writableState.errorEmitted\n ) {\n websocket.emitClose();\n } else {\n websocket._receiver.on('error', receiverOnFinish);\n websocket._receiver.on('finish', receiverOnFinish);\n }\n}\n\n/**\n * The listener of the `net.Socket` `'data'` event.\n *\n * @param {Buffer} chunk A chunk of data\n * @private\n */\nfunction socketOnData(chunk) {\n if (!this[kWebSocket]._receiver.write(chunk)) {\n this.pause();\n }\n}\n\n/**\n * The listener of the `net.Socket` `'end'` event.\n *\n * @private\n */\nfunction socketOnEnd() {\n const websocket = this[kWebSocket];\n\n websocket._readyState = WebSocket.CLOSING;\n websocket._receiver.end();\n this.end();\n}\n\n/**\n * The listener of the `net.Socket` `'error'` event.\n *\n * @private\n */\nfunction socketOnError() {\n const websocket = this[kWebSocket];\n\n this.removeListener('error', socketOnError);\n this.on('error', NOOP);\n\n if (websocket) {\n websocket._readyState = WebSocket.CLOSING;\n this.destroy();\n }\n}\n","'use strict';\nmodule.exports = function (obj) {\n\tvar ret = {};\n\tvar keys = Object.keys(Object(obj));\n\n\tfor (var i = 0; i < keys.length; i++) {\n\t\tret[keys[i].toLowerCase()] = obj[keys[i]];\n\t}\n\n\treturn ret;\n};\n","'use strict'\n\n// A linked list to keep track of recently-used-ness\nconst Yallist = require('yallist')\n\nconst MAX = Symbol('max')\nconst LENGTH = Symbol('length')\nconst LENGTH_CALCULATOR = Symbol('lengthCalculator')\nconst ALLOW_STALE = Symbol('allowStale')\nconst MAX_AGE = Symbol('maxAge')\nconst DISPOSE = Symbol('dispose')\nconst NO_DISPOSE_ON_SET = Symbol('noDisposeOnSet')\nconst LRU_LIST = Symbol('lruList')\nconst CACHE = Symbol('cache')\nconst UPDATE_AGE_ON_GET = Symbol('updateAgeOnGet')\n\nconst naiveLength = () => 1\n\n// lruList is a yallist where the head is the youngest\n// item, and the tail is the oldest. the list contains the Hit\n// objects as the entries.\n// Each Hit object has a reference to its Yallist.Node. This\n// never changes.\n//\n// cache is a Map (or PseudoMap) that matches the keys to\n// the Yallist.Node object.\nclass LRUCache {\n constructor (options) {\n if (typeof options === 'number')\n options = { max: options }\n\n if (!options)\n options = {}\n\n if (options.max && (typeof options.max !== 'number' || options.max < 0))\n throw new TypeError('max must be a non-negative number')\n // Kind of weird to have a default max of Infinity, but oh well.\n const max = this[MAX] = options.max || Infinity\n\n const lc = options.length || naiveLength\n this[LENGTH_CALCULATOR] = (typeof lc !== 'function') ? naiveLength : lc\n this[ALLOW_STALE] = options.stale || false\n if (options.maxAge && typeof options.maxAge !== 'number')\n throw new TypeError('maxAge must be a number')\n this[MAX_AGE] = options.maxAge || 0\n this[DISPOSE] = options.dispose\n this[NO_DISPOSE_ON_SET] = options.noDisposeOnSet || false\n this[UPDATE_AGE_ON_GET] = options.updateAgeOnGet || false\n this.reset()\n }\n\n // resize the cache when the max changes.\n set max (mL) {\n if (typeof mL !== 'number' || mL < 0)\n throw new TypeError('max must be a non-negative number')\n\n this[MAX] = mL || Infinity\n trim(this)\n }\n get max () {\n return this[MAX]\n }\n\n set allowStale (allowStale) {\n this[ALLOW_STALE] = !!allowStale\n }\n get allowStale () {\n return this[ALLOW_STALE]\n }\n\n set maxAge (mA) {\n if (typeof mA !== 'number')\n throw new TypeError('maxAge must be a non-negative number')\n\n this[MAX_AGE] = mA\n trim(this)\n }\n get maxAge () {\n return this[MAX_AGE]\n }\n\n // resize the cache when the lengthCalculator changes.\n set lengthCalculator (lC) {\n if (typeof lC !== 'function')\n lC = naiveLength\n\n if (lC !== this[LENGTH_CALCULATOR]) {\n this[LENGTH_CALCULATOR] = lC\n this[LENGTH] = 0\n this[LRU_LIST].forEach(hit => {\n hit.length = this[LENGTH_CALCULATOR](hit.value, hit.key)\n this[LENGTH] += hit.length\n })\n }\n trim(this)\n }\n get lengthCalculator () { return this[LENGTH_CALCULATOR] }\n\n get length () { return this[LENGTH] }\n get itemCount () { return this[LRU_LIST].length }\n\n rforEach (fn, thisp) {\n thisp = thisp || this\n for (let walker = this[LRU_LIST].tail; walker !== null;) {\n const prev = walker.prev\n forEachStep(this, fn, walker, thisp)\n walker = prev\n }\n }\n\n forEach (fn, thisp) {\n thisp = thisp || this\n for (let walker = this[LRU_LIST].head; walker !== null;) {\n const next = walker.next\n forEachStep(this, fn, walker, thisp)\n walker = next\n }\n }\n\n keys () {\n return this[LRU_LIST].toArray().map(k => k.key)\n }\n\n values () {\n return this[LRU_LIST].toArray().map(k => k.value)\n }\n\n reset () {\n if (this[DISPOSE] &&\n this[LRU_LIST] &&\n this[LRU_LIST].length) {\n this[LRU_LIST].forEach(hit => this[DISPOSE](hit.key, hit.value))\n }\n\n this[CACHE] = new Map() // hash of items by key\n this[LRU_LIST] = new Yallist() // list of items in order of use recency\n this[LENGTH] = 0 // length of items in the list\n }\n\n dump () {\n return this[LRU_LIST].map(hit =>\n isStale(this, hit) ? false : {\n k: hit.key,\n v: hit.value,\n e: hit.now + (hit.maxAge || 0)\n }).toArray().filter(h => h)\n }\n\n dumpLru () {\n return this[LRU_LIST]\n }\n\n set (key, value, maxAge) {\n maxAge = maxAge || this[MAX_AGE]\n\n if (maxAge && typeof maxAge !== 'number')\n throw new TypeError('maxAge must be a number')\n\n const now = maxAge ? Date.now() : 0\n const len = this[LENGTH_CALCULATOR](value, key)\n\n if (this[CACHE].has(key)) {\n if (len > this[MAX]) {\n del(this, this[CACHE].get(key))\n return false\n }\n\n const node = this[CACHE].get(key)\n const item = node.value\n\n // dispose of the old one before overwriting\n // split out into 2 ifs for better coverage tracking\n if (this[DISPOSE]) {\n if (!this[NO_DISPOSE_ON_SET])\n this[DISPOSE](key, item.value)\n }\n\n item.now = now\n item.maxAge = maxAge\n item.value = value\n this[LENGTH] += len - item.length\n item.length = len\n this.get(key)\n trim(this)\n return true\n }\n\n const hit = new Entry(key, value, len, now, maxAge)\n\n // oversized objects fall out of cache automatically.\n if (hit.length > this[MAX]) {\n if (this[DISPOSE])\n this[DISPOSE](key, value)\n\n return false\n }\n\n this[LENGTH] += hit.length\n this[LRU_LIST].unshift(hit)\n this[CACHE].set(key, this[LRU_LIST].head)\n trim(this)\n return true\n }\n\n has (key) {\n if (!this[CACHE].has(key)) return false\n const hit = this[CACHE].get(key).value\n return !isStale(this, hit)\n }\n\n get (key) {\n return get(this, key, true)\n }\n\n peek (key) {\n return get(this, key, false)\n }\n\n pop () {\n const node = this[LRU_LIST].tail\n if (!node)\n return null\n\n del(this, node)\n return node.value\n }\n\n del (key) {\n del(this, this[CACHE].get(key))\n }\n\n load (arr) {\n // reset the cache\n this.reset()\n\n const now = Date.now()\n // A previous serialized cache has the most recent items first\n for (let l = arr.length - 1; l >= 0; l--) {\n const hit = arr[l]\n const expiresAt = hit.e || 0\n if (expiresAt === 0)\n // the item was created without expiration in a non aged cache\n this.set(hit.k, hit.v)\n else {\n const maxAge = expiresAt - now\n // dont add already expired items\n if (maxAge > 0) {\n this.set(hit.k, hit.v, maxAge)\n }\n }\n }\n }\n\n prune () {\n this[CACHE].forEach((value, key) => get(this, key, false))\n }\n}\n\nconst get = (self, key, doUse) => {\n const node = self[CACHE].get(key)\n if (node) {\n const hit = node.value\n if (isStale(self, hit)) {\n del(self, node)\n if (!self[ALLOW_STALE])\n return undefined\n } else {\n if (doUse) {\n if (self[UPDATE_AGE_ON_GET])\n node.value.now = Date.now()\n self[LRU_LIST].unshiftNode(node)\n }\n }\n return hit.value\n }\n}\n\nconst isStale = (self, hit) => {\n if (!hit || (!hit.maxAge && !self[MAX_AGE]))\n return false\n\n const diff = Date.now() - hit.now\n return hit.maxAge ? diff > hit.maxAge\n : self[MAX_AGE] && (diff > self[MAX_AGE])\n}\n\nconst trim = self => {\n if (self[LENGTH] > self[MAX]) {\n for (let walker = self[LRU_LIST].tail;\n self[LENGTH] > self[MAX] && walker !== null;) {\n // We know that we're about to delete this one, and also\n // what the next least recently used key will be, so just\n // go ahead and set it now.\n const prev = walker.prev\n del(self, walker)\n walker = prev\n }\n }\n}\n\nconst del = (self, node) => {\n if (node) {\n const hit = node.value\n if (self[DISPOSE])\n self[DISPOSE](hit.key, hit.value)\n\n self[LENGTH] -= hit.length\n self[CACHE].delete(hit.key)\n self[LRU_LIST].removeNode(node)\n }\n}\n\nclass Entry {\n constructor (key, value, length, now, maxAge) {\n this.key = key\n this.value = value\n this.length = length\n this.now = now\n this.maxAge = maxAge || 0\n }\n}\n\nconst forEachStep = (self, fn, node, thisp) => {\n let hit = node.value\n if (isStale(self, hit)) {\n del(self, node)\n if (!self[ALLOW_STALE])\n hit = undefined\n }\n if (hit)\n fn.call(thisp, hit.value, hit.key, self)\n}\n\nmodule.exports = LRUCache\n","// ISC @ Julien Fontanet\n\n\"use strict\";\n\n// ===================================================================\n\nvar construct = typeof Reflect !== \"undefined\" ? Reflect.construct : undefined;\nvar defineProperty = Object.defineProperty;\n\n// -------------------------------------------------------------------\n\nvar captureStackTrace = Error.captureStackTrace;\nif (captureStackTrace === undefined) {\n captureStackTrace = function captureStackTrace(error) {\n var container = new Error();\n\n defineProperty(error, \"stack\", {\n configurable: true,\n get: function getStack() {\n var stack = container.stack;\n\n // Replace property with value for faster future accesses.\n defineProperty(this, \"stack\", {\n configurable: true,\n value: stack,\n writable: true,\n });\n\n return stack;\n },\n set: function setStack(stack) {\n defineProperty(error, \"stack\", {\n configurable: true,\n value: stack,\n writable: true,\n });\n },\n });\n };\n}\n\n// -------------------------------------------------------------------\n\nfunction BaseError(message) {\n if (message !== undefined) {\n defineProperty(this, \"message\", {\n configurable: true,\n value: message,\n writable: true,\n });\n }\n\n var cname = this.constructor.name;\n if (cname !== undefined && cname !== this.name) {\n defineProperty(this, \"name\", {\n configurable: true,\n value: cname,\n writable: true,\n });\n }\n\n captureStackTrace(this, this.constructor);\n}\n\nBaseError.prototype = Object.create(Error.prototype, {\n // See: https://github.com/JsCommunity/make-error/issues/4\n constructor: {\n configurable: true,\n value: BaseError,\n writable: true,\n },\n});\n\n// -------------------------------------------------------------------\n\n// Sets the name of a function if possible (depends of the JS engine).\nvar setFunctionName = (function() {\n function setFunctionName(fn, name) {\n return defineProperty(fn, \"name\", {\n configurable: true,\n value: name,\n });\n }\n try {\n var f = function() {};\n setFunctionName(f, \"foo\");\n if (f.name === \"foo\") {\n return setFunctionName;\n }\n } catch (_) {}\n})();\n\n// -------------------------------------------------------------------\n\nfunction makeError(constructor, super_) {\n if (super_ == null || super_ === Error) {\n super_ = BaseError;\n } else if (typeof super_ !== \"function\") {\n throw new TypeError(\"super_ should be a function\");\n }\n\n var name;\n if (typeof constructor === \"string\") {\n name = constructor;\n constructor =\n construct !== undefined\n ? function() {\n return construct(super_, arguments, this.constructor);\n }\n : function() {\n super_.apply(this, arguments);\n };\n\n // If the name can be set, do it once and for all.\n if (setFunctionName !== undefined) {\n setFunctionName(constructor, name);\n name = undefined;\n }\n } else if (typeof constructor !== \"function\") {\n throw new TypeError(\"constructor should be either a string or a function\");\n }\n\n // Also register the super constructor also as `constructor.super_` just\n // like Node's `util.inherits()`.\n //\n // eslint-disable-next-line dot-notation\n constructor.super_ = constructor[\"super\"] = super_;\n\n var properties = {\n constructor: {\n configurable: true,\n value: constructor,\n writable: true,\n },\n };\n\n // If the name could not be set on the constructor, set it on the\n // prototype.\n if (name !== undefined) {\n properties.name = {\n configurable: true,\n value: name,\n writable: true,\n };\n }\n constructor.prototype = Object.create(super_.prototype, properties);\n\n return constructor;\n}\nexports = module.exports = makeError;\nexports.BaseError = BaseError;\n","/*!\n * mime-db\n * Copyright(c) 2014 Jonathan Ong\n * MIT Licensed\n */\n\n/**\n * Module exports.\n */\n\nmodule.exports = require('./db.json')\n","/*!\n * mime-types\n * Copyright(c) 2014 Jonathan Ong\n * Copyright(c) 2015 Douglas Christopher Wilson\n * MIT Licensed\n */\n\n'use strict'\n\n/**\n * Module dependencies.\n * @private\n */\n\nvar db = require('mime-db')\nvar extname = require('path').extname\n\n/**\n * Module variables.\n * @private\n */\n\nvar EXTRACT_TYPE_REGEXP = /^\\s*([^;\\s]*)(?:;|\\s|$)/\nvar TEXT_TYPE_REGEXP = /^text\\//i\n\n/**\n * Module exports.\n * @public\n */\n\nexports.charset = charset\nexports.charsets = { lookup: charset }\nexports.contentType = contentType\nexports.extension = extension\nexports.extensions = Object.create(null)\nexports.lookup = lookup\nexports.types = Object.create(null)\n\n// Populate the extensions/types maps\npopulateMaps(exports.extensions, exports.types)\n\n/**\n * Get the default charset for a MIME type.\n *\n * @param {string} type\n * @return {boolean|string}\n */\n\nfunction charset (type) {\n if (!type || typeof type !== 'string') {\n return false\n }\n\n // TODO: use media-typer\n var match = EXTRACT_TYPE_REGEXP.exec(type)\n var mime = match && db[match[1].toLowerCase()]\n\n if (mime && mime.charset) {\n return mime.charset\n }\n\n // default text/* to utf-8\n if (match && TEXT_TYPE_REGEXP.test(match[1])) {\n return 'UTF-8'\n }\n\n return false\n}\n\n/**\n * Create a full Content-Type header given a MIME type or extension.\n *\n * @param {string} str\n * @return {boolean|string}\n */\n\nfunction contentType (str) {\n // TODO: should this even be in this module?\n if (!str || typeof str !== 'string') {\n return false\n }\n\n var mime = str.indexOf('/') === -1\n ? exports.lookup(str)\n : str\n\n if (!mime) {\n return false\n }\n\n // TODO: use content-type or other module\n if (mime.indexOf('charset') === -1) {\n var charset = exports.charset(mime)\n if (charset) mime += '; charset=' + charset.toLowerCase()\n }\n\n return mime\n}\n\n/**\n * Get the default extension for a MIME type.\n *\n * @param {string} type\n * @return {boolean|string}\n */\n\nfunction extension (type) {\n if (!type || typeof type !== 'string') {\n return false\n }\n\n // TODO: use media-typer\n var match = EXTRACT_TYPE_REGEXP.exec(type)\n\n // get extensions\n var exts = match && exports.extensions[match[1].toLowerCase()]\n\n if (!exts || !exts.length) {\n return false\n }\n\n return exts[0]\n}\n\n/**\n * Lookup the MIME type for a file path/extension.\n *\n * @param {string} path\n * @return {boolean|string}\n */\n\nfunction lookup (path) {\n if (!path || typeof path !== 'string') {\n return false\n }\n\n // get the extension (\"ext\" or \".ext\" or full path)\n var extension = extname('x.' + path)\n .toLowerCase()\n .substr(1)\n\n if (!extension) {\n return false\n }\n\n return exports.types[extension] || false\n}\n\n/**\n * Populate the extensions and types maps.\n * @private\n */\n\nfunction populateMaps (extensions, types) {\n // source preference (least -> most)\n var preference = ['nginx', 'apache', undefined, 'iana']\n\n Object.keys(db).forEach(function forEachMimeType (type) {\n var mime = db[type]\n var exts = mime.extensions\n\n if (!exts || !exts.length) {\n return\n }\n\n // mime -> extensions\n extensions[type] = exts\n\n // extension -> mime\n for (var i = 0; i < exts.length; i++) {\n var extension = exts[i]\n\n if (types[extension]) {\n var from = preference.indexOf(db[types[extension]].source)\n var to = preference.indexOf(mime.source)\n\n if (types[extension] !== 'application/octet-stream' &&\n (from > to || (from === to && types[extension].substr(0, 12) === 'application/'))) {\n // skip the remapping\n continue\n }\n }\n\n // set the extension -> mime\n types[extension] = type\n }\n })\n}\n","'use strict';\n\n// We define these manually to ensure they're always copied\n// even if they would move up the prototype chain\n// https://nodejs.org/api/http.html#http_class_http_incomingmessage\nconst knownProps = [\n\t'destroy',\n\t'setTimeout',\n\t'socket',\n\t'headers',\n\t'trailers',\n\t'rawHeaders',\n\t'statusCode',\n\t'httpVersion',\n\t'httpVersionMinor',\n\t'httpVersionMajor',\n\t'rawTrailers',\n\t'statusMessage'\n];\n\nmodule.exports = (fromStream, toStream) => {\n\tconst fromProps = new Set(Object.keys(fromStream).concat(knownProps));\n\n\tfor (const prop of fromProps) {\n\t\t// Don't overwrite existing properties\n\t\tif (prop in toStream) {\n\t\t\tcontinue;\n\t\t}\n\n\t\ttoStream[prop] = typeof fromStream[prop] === 'function' ? fromStream[prop].bind(fromStream) : fromStream[prop];\n\t}\n};\n","module.exports = minimatch\nminimatch.Minimatch = Minimatch\n\nvar path = { sep: '/' }\ntry {\n path = require('path')\n} catch (er) {}\n\nvar GLOBSTAR = minimatch.GLOBSTAR = Minimatch.GLOBSTAR = {}\nvar expand = require('brace-expansion')\n\nvar plTypes = {\n '!': { open: '(?:(?!(?:', close: '))[^/]*?)'},\n '?': { open: '(?:', close: ')?' },\n '+': { open: '(?:', close: ')+' },\n '*': { open: '(?:', close: ')*' },\n '@': { open: '(?:', close: ')' }\n}\n\n// any single thing other than /\n// don't need to escape / when using new RegExp()\nvar qmark = '[^/]'\n\n// * => any number of characters\nvar star = qmark + '*?'\n\n// ** when dots are allowed. Anything goes, except .. and .\n// not (^ or / followed by one or two dots followed by $ or /),\n// followed by anything, any number of times.\nvar twoStarDot = '(?:(?!(?:\\\\\\/|^)(?:\\\\.{1,2})($|\\\\\\/)).)*?'\n\n// not a ^ or / followed by a dot,\n// followed by anything, any number of times.\nvar twoStarNoDot = '(?:(?!(?:\\\\\\/|^)\\\\.).)*?'\n\n// characters that need to be escaped in RegExp.\nvar reSpecials = charSet('().*{}+?[]^$\\\\!')\n\n// \"abc\" -> { a:true, b:true, c:true }\nfunction charSet (s) {\n return s.split('').reduce(function (set, c) {\n set[c] = true\n return set\n }, {})\n}\n\n// normalizes slashes.\nvar slashSplit = /\\/+/\n\nminimatch.filter = filter\nfunction filter (pattern, options) {\n options = options || {}\n return function (p, i, list) {\n return minimatch(p, pattern, options)\n }\n}\n\nfunction ext (a, b) {\n a = a || {}\n b = b || {}\n var t = {}\n Object.keys(b).forEach(function (k) {\n t[k] = b[k]\n })\n Object.keys(a).forEach(function (k) {\n t[k] = a[k]\n })\n return t\n}\n\nminimatch.defaults = function (def) {\n if (!def || !Object.keys(def).length) return minimatch\n\n var orig = minimatch\n\n var m = function minimatch (p, pattern, options) {\n return orig.minimatch(p, pattern, ext(def, options))\n }\n\n m.Minimatch = function Minimatch (pattern, options) {\n return new orig.Minimatch(pattern, ext(def, options))\n }\n\n return m\n}\n\nMinimatch.defaults = function (def) {\n if (!def || !Object.keys(def).length) return Minimatch\n return minimatch.defaults(def).Minimatch\n}\n\nfunction minimatch (p, pattern, options) {\n if (typeof pattern !== 'string') {\n throw new TypeError('glob pattern string required')\n }\n\n if (!options) options = {}\n\n // shortcut: comments match nothing.\n if (!options.nocomment && pattern.charAt(0) === '#') {\n return false\n }\n\n // \"\" only matches \"\"\n if (pattern.trim() === '') return p === ''\n\n return new Minimatch(pattern, options).match(p)\n}\n\nfunction Minimatch (pattern, options) {\n if (!(this instanceof Minimatch)) {\n return new Minimatch(pattern, options)\n }\n\n if (typeof pattern !== 'string') {\n throw new TypeError('glob pattern string required')\n }\n\n if (!options) options = {}\n pattern = pattern.trim()\n\n // windows support: need to use /, not \\\n if (path.sep !== '/') {\n pattern = pattern.split(path.sep).join('/')\n }\n\n this.options = options\n this.set = []\n this.pattern = pattern\n this.regexp = null\n this.negate = false\n this.comment = false\n this.empty = false\n\n // make the set of regexps etc.\n this.make()\n}\n\nMinimatch.prototype.debug = function () {}\n\nMinimatch.prototype.make = make\nfunction make () {\n // don't do it more than once.\n if (this._made) return\n\n var pattern = this.pattern\n var options = this.options\n\n // empty patterns and comments match nothing.\n if (!options.nocomment && pattern.charAt(0) === '#') {\n this.comment = true\n return\n }\n if (!pattern) {\n this.empty = true\n return\n }\n\n // step 1: figure out negation, etc.\n this.parseNegate()\n\n // step 2: expand braces\n var set = this.globSet = this.braceExpand()\n\n if (options.debug) this.debug = console.error\n\n this.debug(this.pattern, set)\n\n // step 3: now we have a set, so turn each one into a series of path-portion\n // matching patterns.\n // These will be regexps, except in the case of \"**\", which is\n // set to the GLOBSTAR object for globstar behavior,\n // and will not contain any / characters\n set = this.globParts = set.map(function (s) {\n return s.split(slashSplit)\n })\n\n this.debug(this.pattern, set)\n\n // glob --> regexps\n set = set.map(function (s, si, set) {\n return s.map(this.parse, this)\n }, this)\n\n this.debug(this.pattern, set)\n\n // filter out everything that didn't compile properly.\n set = set.filter(function (s) {\n return s.indexOf(false) === -1\n })\n\n this.debug(this.pattern, set)\n\n this.set = set\n}\n\nMinimatch.prototype.parseNegate = parseNegate\nfunction parseNegate () {\n var pattern = this.pattern\n var negate = false\n var options = this.options\n var negateOffset = 0\n\n if (options.nonegate) return\n\n for (var i = 0, l = pattern.length\n ; i < l && pattern.charAt(i) === '!'\n ; i++) {\n negate = !negate\n negateOffset++\n }\n\n if (negateOffset) this.pattern = pattern.substr(negateOffset)\n this.negate = negate\n}\n\n// Brace expansion:\n// a{b,c}d -> abd acd\n// a{b,}c -> abc ac\n// a{0..3}d -> a0d a1d a2d a3d\n// a{b,c{d,e}f}g -> abg acdfg acefg\n// a{b,c}d{e,f}g -> abdeg acdeg abdeg abdfg\n//\n// Invalid sets are not expanded.\n// a{2..}b -> a{2..}b\n// a{b}c -> a{b}c\nminimatch.braceExpand = function (pattern, options) {\n return braceExpand(pattern, options)\n}\n\nMinimatch.prototype.braceExpand = braceExpand\n\nfunction braceExpand (pattern, options) {\n if (!options) {\n if (this instanceof Minimatch) {\n options = this.options\n } else {\n options = {}\n }\n }\n\n pattern = typeof pattern === 'undefined'\n ? this.pattern : pattern\n\n if (typeof pattern === 'undefined') {\n throw new TypeError('undefined pattern')\n }\n\n if (options.nobrace ||\n !pattern.match(/\\{.*\\}/)) {\n // shortcut. no need to expand.\n return [pattern]\n }\n\n return expand(pattern)\n}\n\n// parse a component of the expanded set.\n// At this point, no pattern may contain \"/\" in it\n// so we're going to return a 2d array, where each entry is the full\n// pattern, split on '/', and then turned into a regular expression.\n// A regexp is made at the end which joins each array with an\n// escaped /, and another full one which joins each regexp with |.\n//\n// Following the lead of Bash 4.1, note that \"**\" only has special meaning\n// when it is the *only* thing in a path portion. Otherwise, any series\n// of * is equivalent to a single *. Globstar behavior is enabled by\n// default, and can be disabled by setting options.noglobstar.\nMinimatch.prototype.parse = parse\nvar SUBPARSE = {}\nfunction parse (pattern, isSub) {\n if (pattern.length > 1024 * 64) {\n throw new TypeError('pattern is too long')\n }\n\n var options = this.options\n\n // shortcuts\n if (!options.noglobstar && pattern === '**') return GLOBSTAR\n if (pattern === '') return ''\n\n var re = ''\n var hasMagic = !!options.nocase\n var escaping = false\n // ? => one single character\n var patternListStack = []\n var negativeLists = []\n var stateChar\n var inClass = false\n var reClassStart = -1\n var classStart = -1\n // . and .. never match anything that doesn't start with .,\n // even when options.dot is set.\n var patternStart = pattern.charAt(0) === '.' ? '' // anything\n // not (start or / followed by . or .. followed by / or end)\n : options.dot ? '(?!(?:^|\\\\\\/)\\\\.{1,2}(?:$|\\\\\\/))'\n : '(?!\\\\.)'\n var self = this\n\n function clearStateChar () {\n if (stateChar) {\n // we had some state-tracking character\n // that wasn't consumed by this pass.\n switch (stateChar) {\n case '*':\n re += star\n hasMagic = true\n break\n case '?':\n re += qmark\n hasMagic = true\n break\n default:\n re += '\\\\' + stateChar\n break\n }\n self.debug('clearStateChar %j %j', stateChar, re)\n stateChar = false\n }\n }\n\n for (var i = 0, len = pattern.length, c\n ; (i < len) && (c = pattern.charAt(i))\n ; i++) {\n this.debug('%s\\t%s %s %j', pattern, i, re, c)\n\n // skip over any that are escaped.\n if (escaping && reSpecials[c]) {\n re += '\\\\' + c\n escaping = false\n continue\n }\n\n switch (c) {\n case '/':\n // completely not allowed, even escaped.\n // Should already be path-split by now.\n return false\n\n case '\\\\':\n clearStateChar()\n escaping = true\n continue\n\n // the various stateChar values\n // for the \"extglob\" stuff.\n case '?':\n case '*':\n case '+':\n case '@':\n case '!':\n this.debug('%s\\t%s %s %j <-- stateChar', pattern, i, re, c)\n\n // all of those are literals inside a class, except that\n // the glob [!a] means [^a] in regexp\n if (inClass) {\n this.debug(' in class')\n if (c === '!' && i === classStart + 1) c = '^'\n re += c\n continue\n }\n\n // if we already have a stateChar, then it means\n // that there was something like ** or +? in there.\n // Handle the stateChar, then proceed with this one.\n self.debug('call clearStateChar %j', stateChar)\n clearStateChar()\n stateChar = c\n // if extglob is disabled, then +(asdf|foo) isn't a thing.\n // just clear the statechar *now*, rather than even diving into\n // the patternList stuff.\n if (options.noext) clearStateChar()\n continue\n\n case '(':\n if (inClass) {\n re += '('\n continue\n }\n\n if (!stateChar) {\n re += '\\\\('\n continue\n }\n\n patternListStack.push({\n type: stateChar,\n start: i - 1,\n reStart: re.length,\n open: plTypes[stateChar].open,\n close: plTypes[stateChar].close\n })\n // negation is (?:(?!js)[^/]*)\n re += stateChar === '!' ? '(?:(?!(?:' : '(?:'\n this.debug('plType %j %j', stateChar, re)\n stateChar = false\n continue\n\n case ')':\n if (inClass || !patternListStack.length) {\n re += '\\\\)'\n continue\n }\n\n clearStateChar()\n hasMagic = true\n var pl = patternListStack.pop()\n // negation is (?:(?!js)[^/]*)\n // The others are (?:)\n re += pl.close\n if (pl.type === '!') {\n negativeLists.push(pl)\n }\n pl.reEnd = re.length\n continue\n\n case '|':\n if (inClass || !patternListStack.length || escaping) {\n re += '\\\\|'\n escaping = false\n continue\n }\n\n clearStateChar()\n re += '|'\n continue\n\n // these are mostly the same in regexp and glob\n case '[':\n // swallow any state-tracking char before the [\n clearStateChar()\n\n if (inClass) {\n re += '\\\\' + c\n continue\n }\n\n inClass = true\n classStart = i\n reClassStart = re.length\n re += c\n continue\n\n case ']':\n // a right bracket shall lose its special\n // meaning and represent itself in\n // a bracket expression if it occurs\n // first in the list. -- POSIX.2 2.8.3.2\n if (i === classStart + 1 || !inClass) {\n re += '\\\\' + c\n escaping = false\n continue\n }\n\n // handle the case where we left a class open.\n // \"[z-a]\" is valid, equivalent to \"\\[z-a\\]\"\n if (inClass) {\n // split where the last [ was, make sure we don't have\n // an invalid re. if so, re-walk the contents of the\n // would-be class to re-translate any characters that\n // were passed through as-is\n // TODO: It would probably be faster to determine this\n // without a try/catch and a new RegExp, but it's tricky\n // to do safely. For now, this is safe and works.\n var cs = pattern.substring(classStart + 1, i)\n try {\n RegExp('[' + cs + ']')\n } catch (er) {\n // not a valid class!\n var sp = this.parse(cs, SUBPARSE)\n re = re.substr(0, reClassStart) + '\\\\[' + sp[0] + '\\\\]'\n hasMagic = hasMagic || sp[1]\n inClass = false\n continue\n }\n }\n\n // finish up the class.\n hasMagic = true\n inClass = false\n re += c\n continue\n\n default:\n // swallow any state char that wasn't consumed\n clearStateChar()\n\n if (escaping) {\n // no need\n escaping = false\n } else if (reSpecials[c]\n && !(c === '^' && inClass)) {\n re += '\\\\'\n }\n\n re += c\n\n } // switch\n } // for\n\n // handle the case where we left a class open.\n // \"[abc\" is valid, equivalent to \"\\[abc\"\n if (inClass) {\n // split where the last [ was, and escape it\n // this is a huge pita. We now have to re-walk\n // the contents of the would-be class to re-translate\n // any characters that were passed through as-is\n cs = pattern.substr(classStart + 1)\n sp = this.parse(cs, SUBPARSE)\n re = re.substr(0, reClassStart) + '\\\\[' + sp[0]\n hasMagic = hasMagic || sp[1]\n }\n\n // handle the case where we had a +( thing at the *end*\n // of the pattern.\n // each pattern list stack adds 3 chars, and we need to go through\n // and escape any | chars that were passed through as-is for the regexp.\n // Go through and escape them, taking care not to double-escape any\n // | chars that were already escaped.\n for (pl = patternListStack.pop(); pl; pl = patternListStack.pop()) {\n var tail = re.slice(pl.reStart + pl.open.length)\n this.debug('setting tail', re, pl)\n // maybe some even number of \\, then maybe 1 \\, followed by a |\n tail = tail.replace(/((?:\\\\{2}){0,64})(\\\\?)\\|/g, function (_, $1, $2) {\n if (!$2) {\n // the | isn't already escaped, so escape it.\n $2 = '\\\\'\n }\n\n // need to escape all those slashes *again*, without escaping the\n // one that we need for escaping the | character. As it works out,\n // escaping an even number of slashes can be done by simply repeating\n // it exactly after itself. That's why this trick works.\n //\n // I am sorry that you have to see this.\n return $1 + $1 + $2 + '|'\n })\n\n this.debug('tail=%j\\n %s', tail, tail, pl, re)\n var t = pl.type === '*' ? star\n : pl.type === '?' ? qmark\n : '\\\\' + pl.type\n\n hasMagic = true\n re = re.slice(0, pl.reStart) + t + '\\\\(' + tail\n }\n\n // handle trailing things that only matter at the very end.\n clearStateChar()\n if (escaping) {\n // trailing \\\\\n re += '\\\\\\\\'\n }\n\n // only need to apply the nodot start if the re starts with\n // something that could conceivably capture a dot\n var addPatternStart = false\n switch (re.charAt(0)) {\n case '.':\n case '[':\n case '(': addPatternStart = true\n }\n\n // Hack to work around lack of negative lookbehind in JS\n // A pattern like: *.!(x).!(y|z) needs to ensure that a name\n // like 'a.xyz.yz' doesn't match. So, the first negative\n // lookahead, has to look ALL the way ahead, to the end of\n // the pattern.\n for (var n = negativeLists.length - 1; n > -1; n--) {\n var nl = negativeLists[n]\n\n var nlBefore = re.slice(0, nl.reStart)\n var nlFirst = re.slice(nl.reStart, nl.reEnd - 8)\n var nlLast = re.slice(nl.reEnd - 8, nl.reEnd)\n var nlAfter = re.slice(nl.reEnd)\n\n nlLast += nlAfter\n\n // Handle nested stuff like *(*.js|!(*.json)), where open parens\n // mean that we should *not* include the ) in the bit that is considered\n // \"after\" the negated section.\n var openParensBefore = nlBefore.split('(').length - 1\n var cleanAfter = nlAfter\n for (i = 0; i < openParensBefore; i++) {\n cleanAfter = cleanAfter.replace(/\\)[+*?]?/, '')\n }\n nlAfter = cleanAfter\n\n var dollar = ''\n if (nlAfter === '' && isSub !== SUBPARSE) {\n dollar = '$'\n }\n var newRe = nlBefore + nlFirst + nlAfter + dollar + nlLast\n re = newRe\n }\n\n // if the re is not \"\" at this point, then we need to make sure\n // it doesn't match against an empty path part.\n // Otherwise a/* will match a/, which it should not.\n if (re !== '' && hasMagic) {\n re = '(?=.)' + re\n }\n\n if (addPatternStart) {\n re = patternStart + re\n }\n\n // parsing just a piece of a larger pattern.\n if (isSub === SUBPARSE) {\n return [re, hasMagic]\n }\n\n // skip the regexp for non-magical patterns\n // unescape anything in it, though, so that it'll be\n // an exact match against a file etc.\n if (!hasMagic) {\n return globUnescape(pattern)\n }\n\n var flags = options.nocase ? 'i' : ''\n try {\n var regExp = new RegExp('^' + re + '$', flags)\n } catch (er) {\n // If it was an invalid regular expression, then it can't match\n // anything. This trick looks for a character after the end of\n // the string, which is of course impossible, except in multi-line\n // mode, but it's not a /m regex.\n return new RegExp('$.')\n }\n\n regExp._glob = pattern\n regExp._src = re\n\n return regExp\n}\n\nminimatch.makeRe = function (pattern, options) {\n return new Minimatch(pattern, options || {}).makeRe()\n}\n\nMinimatch.prototype.makeRe = makeRe\nfunction makeRe () {\n if (this.regexp || this.regexp === false) return this.regexp\n\n // at this point, this.set is a 2d array of partial\n // pattern strings, or \"**\".\n //\n // It's better to use .match(). This function shouldn't\n // be used, really, but it's pretty convenient sometimes,\n // when you just want to work with a regex.\n var set = this.set\n\n if (!set.length) {\n this.regexp = false\n return this.regexp\n }\n var options = this.options\n\n var twoStar = options.noglobstar ? star\n : options.dot ? twoStarDot\n : twoStarNoDot\n var flags = options.nocase ? 'i' : ''\n\n var re = set.map(function (pattern) {\n return pattern.map(function (p) {\n return (p === GLOBSTAR) ? twoStar\n : (typeof p === 'string') ? regExpEscape(p)\n : p._src\n }).join('\\\\\\/')\n }).join('|')\n\n // must match entire pattern\n // ending in a * or ** will make it less strict.\n re = '^(?:' + re + ')$'\n\n // can match anything, as long as it's not this.\n if (this.negate) re = '^(?!' + re + ').*$'\n\n try {\n this.regexp = new RegExp(re, flags)\n } catch (ex) {\n this.regexp = false\n }\n return this.regexp\n}\n\nminimatch.match = function (list, pattern, options) {\n options = options || {}\n var mm = new Minimatch(pattern, options)\n list = list.filter(function (f) {\n return mm.match(f)\n })\n if (mm.options.nonull && !list.length) {\n list.push(pattern)\n }\n return list\n}\n\nMinimatch.prototype.match = match\nfunction match (f, partial) {\n this.debug('match', f, this.pattern)\n // short-circuit in the case of busted things.\n // comments, etc.\n if (this.comment) return false\n if (this.empty) return f === ''\n\n if (f === '/' && partial) return true\n\n var options = this.options\n\n // windows: need to use /, not \\\n if (path.sep !== '/') {\n f = f.split(path.sep).join('/')\n }\n\n // treat the test path as a set of pathparts.\n f = f.split(slashSplit)\n this.debug(this.pattern, 'split', f)\n\n // just ONE of the pattern sets in this.set needs to match\n // in order for it to be valid. If negating, then just one\n // match means that we have failed.\n // Either way, return on the first hit.\n\n var set = this.set\n this.debug(this.pattern, 'set', set)\n\n // Find the basename of the path by looking for the last non-empty segment\n var filename\n var i\n for (i = f.length - 1; i >= 0; i--) {\n filename = f[i]\n if (filename) break\n }\n\n for (i = 0; i < set.length; i++) {\n var pattern = set[i]\n var file = f\n if (options.matchBase && pattern.length === 1) {\n file = [filename]\n }\n var hit = this.matchOne(file, pattern, partial)\n if (hit) {\n if (options.flipNegate) return true\n return !this.negate\n }\n }\n\n // didn't get any hits. this is success if it's a negative\n // pattern, failure otherwise.\n if (options.flipNegate) return false\n return this.negate\n}\n\n// set partial to true to test if, for example,\n// \"/a/b\" matches the start of \"/*/b/*/d\"\n// Partial means, if you run out of file before you run\n// out of pattern, then that's fine, as long as all\n// the parts match.\nMinimatch.prototype.matchOne = function (file, pattern, partial) {\n var options = this.options\n\n this.debug('matchOne',\n { 'this': this, file: file, pattern: pattern })\n\n this.debug('matchOne', file.length, pattern.length)\n\n for (var fi = 0,\n pi = 0,\n fl = file.length,\n pl = pattern.length\n ; (fi < fl) && (pi < pl)\n ; fi++, pi++) {\n this.debug('matchOne loop')\n var p = pattern[pi]\n var f = file[fi]\n\n this.debug(pattern, p, f)\n\n // should be impossible.\n // some invalid regexp stuff in the set.\n if (p === false) return false\n\n if (p === GLOBSTAR) {\n this.debug('GLOBSTAR', [pattern, p, f])\n\n // \"**\"\n // a/**/b/**/c would match the following:\n // a/b/x/y/z/c\n // a/x/y/z/b/c\n // a/b/x/b/x/c\n // a/b/c\n // To do this, take the rest of the pattern after\n // the **, and see if it would match the file remainder.\n // If so, return success.\n // If not, the ** \"swallows\" a segment, and try again.\n // This is recursively awful.\n //\n // a/**/b/**/c matching a/b/x/y/z/c\n // - a matches a\n // - doublestar\n // - matchOne(b/x/y/z/c, b/**/c)\n // - b matches b\n // - doublestar\n // - matchOne(x/y/z/c, c) -> no\n // - matchOne(y/z/c, c) -> no\n // - matchOne(z/c, c) -> no\n // - matchOne(c, c) yes, hit\n var fr = fi\n var pr = pi + 1\n if (pr === pl) {\n this.debug('** at the end')\n // a ** at the end will just swallow the rest.\n // We have found a match.\n // however, it will not swallow /.x, unless\n // options.dot is set.\n // . and .. are *never* matched by **, for explosively\n // exponential reasons.\n for (; fi < fl; fi++) {\n if (file[fi] === '.' || file[fi] === '..' ||\n (!options.dot && file[fi].charAt(0) === '.')) return false\n }\n return true\n }\n\n // ok, let's see if we can swallow whatever we can.\n while (fr < fl) {\n var swallowee = file[fr]\n\n this.debug('\\nglobstar while', file, fr, pattern, pr, swallowee)\n\n // XXX remove this slice. Just pass the start index.\n if (this.matchOne(file.slice(fr), pattern.slice(pr), partial)) {\n this.debug('globstar found match!', fr, fl, swallowee)\n // found a match.\n return true\n } else {\n // can't swallow \".\" or \"..\" ever.\n // can only swallow \".foo\" when explicitly asked.\n if (swallowee === '.' || swallowee === '..' ||\n (!options.dot && swallowee.charAt(0) === '.')) {\n this.debug('dot detected!', file, fr, pattern, pr)\n break\n }\n\n // ** swallows a segment, and continue.\n this.debug('globstar swallow a segment, and continue')\n fr++\n }\n }\n\n // no match was found.\n // However, in partial mode, we can't say this is necessarily over.\n // If there's more *pattern* left, then\n if (partial) {\n // ran out of file\n this.debug('\\n>>> no match, partial?', file, fr, pattern, pr)\n if (fr === fl) return true\n }\n return false\n }\n\n // something other than **\n // non-magic patterns just have to match exactly\n // patterns with magic have been turned into regexps.\n var hit\n if (typeof p === 'string') {\n if (options.nocase) {\n hit = f.toLowerCase() === p.toLowerCase()\n } else {\n hit = f === p\n }\n this.debug('string match', p, f, hit)\n } else {\n hit = f.match(p)\n this.debug('pattern match', p, f, hit)\n }\n\n if (!hit) return false\n }\n\n // Note: ending in / means that we'll get a final \"\"\n // at the end of the pattern. This can only match a\n // corresponding \"\" at the end of the file.\n // If the file ends in /, then it can only match a\n // a pattern that ends in /, unless the pattern just\n // doesn't have any more for it. But, a/b/ should *not*\n // match \"a/b/*\", even though \"\" matches against the\n // [^/]*? pattern, except in partial mode, where it might\n // simply not be reached yet.\n // However, a/b/ should still satisfy a/*\n\n // now either we fell off the end of the pattern, or we're done.\n if (fi === fl && pi === pl) {\n // ran out of pattern and filename at the same time.\n // an exact hit!\n return true\n } else if (fi === fl) {\n // ran out of file, but still had pattern left.\n // this is ok if we're doing the match as part of\n // a glob fs traversal.\n return partial\n } else if (pi === pl) {\n // ran out of pattern, still have file left.\n // this is only acceptable if we're on the very last\n // empty segment of a file with a trailing slash.\n // a/* should match a/b/\n var emptyFileEnd = (fi === fl - 1) && (file[fi] === '')\n return emptyFileEnd\n }\n\n // should be unreachable.\n throw new Error('wtf?')\n}\n\n// replace stuff like \\* with *\nfunction globUnescape (s) {\n return s.replace(/\\\\(.)/g, '$1')\n}\n\nfunction regExpEscape (s) {\n return s.replace(/[-[\\]{}()*+?.,\\\\^$|#\\s]/g, '\\\\$&')\n}\n","'use strict';\n// TODO: Use the `URL` global when targeting Node.js 10\nconst URLParser = typeof URL === 'undefined' ? require('url').URL : URL;\n\n// https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/Data_URIs\nconst DATA_URL_DEFAULT_MIME_TYPE = 'text/plain';\nconst DATA_URL_DEFAULT_CHARSET = 'us-ascii';\n\nconst testParameter = (name, filters) => {\n\treturn filters.some(filter => filter instanceof RegExp ? filter.test(name) : filter === name);\n};\n\nconst normalizeDataURL = (urlString, {stripHash}) => {\n\tconst parts = urlString.match(/^data:(.*?),(.*?)(?:#(.*))?$/);\n\n\tif (!parts) {\n\t\tthrow new Error(`Invalid URL: ${urlString}`);\n\t}\n\n\tconst mediaType = parts[1].split(';');\n\tconst body = parts[2];\n\tconst hash = stripHash ? '' : parts[3];\n\n\tlet base64 = false;\n\n\tif (mediaType[mediaType.length - 1] === 'base64') {\n\t\tmediaType.pop();\n\t\tbase64 = true;\n\t}\n\n\t// Lowercase MIME type\n\tconst mimeType = (mediaType.shift() || '').toLowerCase();\n\tconst attributes = mediaType\n\t\t.map(attribute => {\n\t\t\tlet [key, value = ''] = attribute.split('=').map(string => string.trim());\n\n\t\t\t// Lowercase `charset`\n\t\t\tif (key === 'charset') {\n\t\t\t\tvalue = value.toLowerCase();\n\n\t\t\t\tif (value === DATA_URL_DEFAULT_CHARSET) {\n\t\t\t\t\treturn '';\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn `${key}${value ? `=${value}` : ''}`;\n\t\t})\n\t\t.filter(Boolean);\n\n\tconst normalizedMediaType = [\n\t\t...attributes\n\t];\n\n\tif (base64) {\n\t\tnormalizedMediaType.push('base64');\n\t}\n\n\tif (normalizedMediaType.length !== 0 || (mimeType && mimeType !== DATA_URL_DEFAULT_MIME_TYPE)) {\n\t\tnormalizedMediaType.unshift(mimeType);\n\t}\n\n\treturn `data:${normalizedMediaType.join(';')},${base64 ? body.trim() : body}${hash ? `#${hash}` : ''}`;\n};\n\nconst normalizeUrl = (urlString, options) => {\n\toptions = {\n\t\tdefaultProtocol: 'http:',\n\t\tnormalizeProtocol: true,\n\t\tforceHttp: false,\n\t\tforceHttps: false,\n\t\tstripAuthentication: true,\n\t\tstripHash: false,\n\t\tstripWWW: true,\n\t\tremoveQueryParameters: [/^utm_\\w+/i],\n\t\tremoveTrailingSlash: true,\n\t\tremoveDirectoryIndex: false,\n\t\tsortQueryParameters: true,\n\t\t...options\n\t};\n\n\t// TODO: Remove this at some point in the future\n\tif (Reflect.has(options, 'normalizeHttps')) {\n\t\tthrow new Error('options.normalizeHttps is renamed to options.forceHttp');\n\t}\n\n\tif (Reflect.has(options, 'normalizeHttp')) {\n\t\tthrow new Error('options.normalizeHttp is renamed to options.forceHttps');\n\t}\n\n\tif (Reflect.has(options, 'stripFragment')) {\n\t\tthrow new Error('options.stripFragment is renamed to options.stripHash');\n\t}\n\n\turlString = urlString.trim();\n\n\t// Data URL\n\tif (/^data:/i.test(urlString)) {\n\t\treturn normalizeDataURL(urlString, options);\n\t}\n\n\tconst hasRelativeProtocol = urlString.startsWith('//');\n\tconst isRelativeUrl = !hasRelativeProtocol && /^\\.*\\//.test(urlString);\n\n\t// Prepend protocol\n\tif (!isRelativeUrl) {\n\t\turlString = urlString.replace(/^(?!(?:\\w+:)?\\/\\/)|^\\/\\//, options.defaultProtocol);\n\t}\n\n\tconst urlObj = new URLParser(urlString);\n\n\tif (options.forceHttp && options.forceHttps) {\n\t\tthrow new Error('The `forceHttp` and `forceHttps` options cannot be used together');\n\t}\n\n\tif (options.forceHttp && urlObj.protocol === 'https:') {\n\t\turlObj.protocol = 'http:';\n\t}\n\n\tif (options.forceHttps && urlObj.protocol === 'http:') {\n\t\turlObj.protocol = 'https:';\n\t}\n\n\t// Remove auth\n\tif (options.stripAuthentication) {\n\t\turlObj.username = '';\n\t\turlObj.password = '';\n\t}\n\n\t// Remove hash\n\tif (options.stripHash) {\n\t\turlObj.hash = '';\n\t}\n\n\t// Remove duplicate slashes if not preceded by a protocol\n\tif (urlObj.pathname) {\n\t\t// TODO: Use the following instead when targeting Node.js 10\n\t\t// `urlObj.pathname = urlObj.pathname.replace(/(? {\n\t\t\tif (/^(?!\\/)/g.test(p1)) {\n\t\t\t\treturn `${p1}/`;\n\t\t\t}\n\n\t\t\treturn '/';\n\t\t});\n\t}\n\n\t// Decode URI octets\n\tif (urlObj.pathname) {\n\t\turlObj.pathname = decodeURI(urlObj.pathname);\n\t}\n\n\t// Remove directory index\n\tif (options.removeDirectoryIndex === true) {\n\t\toptions.removeDirectoryIndex = [/^index\\.[a-z]+$/];\n\t}\n\n\tif (Array.isArray(options.removeDirectoryIndex) && options.removeDirectoryIndex.length > 0) {\n\t\tlet pathComponents = urlObj.pathname.split('/');\n\t\tconst lastComponent = pathComponents[pathComponents.length - 1];\n\n\t\tif (testParameter(lastComponent, options.removeDirectoryIndex)) {\n\t\t\tpathComponents = pathComponents.slice(0, pathComponents.length - 1);\n\t\t\turlObj.pathname = pathComponents.slice(1).join('/') + '/';\n\t\t}\n\t}\n\n\tif (urlObj.hostname) {\n\t\t// Remove trailing dot\n\t\turlObj.hostname = urlObj.hostname.replace(/\\.$/, '');\n\n\t\t// Remove `www.`\n\t\tif (options.stripWWW && /^www\\.([a-z\\-\\d]{2,63})\\.([a-z.]{2,5})$/.test(urlObj.hostname)) {\n\t\t\t// Each label should be max 63 at length (min: 2).\n\t\t\t// The extension should be max 5 at length (min: 2).\n\t\t\t// Source: https://en.wikipedia.org/wiki/Hostname#Restrictions_on_valid_host_names\n\t\t\turlObj.hostname = urlObj.hostname.replace(/^www\\./, '');\n\t\t}\n\t}\n\n\t// Remove query unwanted parameters\n\tif (Array.isArray(options.removeQueryParameters)) {\n\t\tfor (const key of [...urlObj.searchParams.keys()]) {\n\t\t\tif (testParameter(key, options.removeQueryParameters)) {\n\t\t\t\turlObj.searchParams.delete(key);\n\t\t\t}\n\t\t}\n\t}\n\n\t// Sort query parameters\n\tif (options.sortQueryParameters) {\n\t\turlObj.searchParams.sort();\n\t}\n\n\tif (options.removeTrailingSlash) {\n\t\turlObj.pathname = urlObj.pathname.replace(/\\/$/, '');\n\t}\n\n\t// Take advantage of many of the Node `url` normalizations\n\turlString = urlObj.toString();\n\n\t// Remove ending `/`\n\tif ((options.removeTrailingSlash || urlObj.pathname === '/') && urlObj.hash === '') {\n\t\turlString = urlString.replace(/\\/$/, '');\n\t}\n\n\t// Restore relative protocol, if applicable\n\tif (hasRelativeProtocol && !options.normalizeProtocol) {\n\t\turlString = urlString.replace(/^http:\\/\\//, '//');\n\t}\n\n\t// Remove http/https\n\tif (options.stripProtocol) {\n\t\turlString = urlString.replace(/^(?:https?:)?\\/\\//, '');\n\t}\n\n\treturn urlString;\n};\n\nmodule.exports = normalizeUrl;\n// TODO: Remove this for the next major release\nmodule.exports.default = normalizeUrl;\n","var crypto = require('crypto')\n\nfunction sha (key, body, algorithm) {\n return crypto.createHmac(algorithm, key).update(body).digest('base64')\n}\n\nfunction rsa (key, body) {\n return crypto.createSign('RSA-SHA1').update(body).sign(key, 'base64')\n}\n\nfunction rfc3986 (str) {\n return encodeURIComponent(str)\n .replace(/!/g,'%21')\n .replace(/\\*/g,'%2A')\n .replace(/\\(/g,'%28')\n .replace(/\\)/g,'%29')\n .replace(/'/g,'%27')\n}\n\n// Maps object to bi-dimensional array\n// Converts { foo: 'A', bar: [ 'b', 'B' ]} to\n// [ ['foo', 'A'], ['bar', 'b'], ['bar', 'B'] ]\nfunction map (obj) {\n var key, val, arr = []\n for (key in obj) {\n val = obj[key]\n if (Array.isArray(val))\n for (var i = 0; i < val.length; i++)\n arr.push([key, val[i]])\n else if (typeof val === 'object')\n for (var prop in val)\n arr.push([key + '[' + prop + ']', val[prop]])\n else\n arr.push([key, val])\n }\n return arr\n}\n\n// Compare function for sort\nfunction compare (a, b) {\n return a > b ? 1 : a < b ? -1 : 0\n}\n\nfunction generateBase (httpMethod, base_uri, params) {\n // adapted from https://dev.twitter.com/docs/auth/oauth and \n // https://dev.twitter.com/docs/auth/creating-signature\n\n // Parameter normalization\n // http://tools.ietf.org/html/rfc5849#section-3.4.1.3.2\n var normalized = map(params)\n // 1. First, the name and value of each parameter are encoded\n .map(function (p) {\n return [ rfc3986(p[0]), rfc3986(p[1] || '') ]\n })\n // 2. The parameters are sorted by name, using ascending byte value\n // ordering. If two or more parameters share the same name, they\n // are sorted by their value.\n .sort(function (a, b) {\n return compare(a[0], b[0]) || compare(a[1], b[1])\n })\n // 3. The name of each parameter is concatenated to its corresponding\n // value using an \"=\" character (ASCII code 61) as a separator, even\n // if the value is empty.\n .map(function (p) { return p.join('=') })\n // 4. The sorted name/value pairs are concatenated together into a\n // single string by using an \"&\" character (ASCII code 38) as\n // separator.\n .join('&')\n\n var base = [\n rfc3986(httpMethod ? httpMethod.toUpperCase() : 'GET'),\n rfc3986(base_uri),\n rfc3986(normalized)\n ].join('&')\n\n return base\n}\n\nfunction hmacsign (httpMethod, base_uri, params, consumer_secret, token_secret) {\n var base = generateBase(httpMethod, base_uri, params)\n var key = [\n consumer_secret || '',\n token_secret || ''\n ].map(rfc3986).join('&')\n\n return sha(key, base, 'sha1')\n}\n\nfunction hmacsign256 (httpMethod, base_uri, params, consumer_secret, token_secret) {\n var base = generateBase(httpMethod, base_uri, params)\n var key = [\n consumer_secret || '',\n token_secret || ''\n ].map(rfc3986).join('&')\n\n return sha(key, base, 'sha256')\n}\n\nfunction rsasign (httpMethod, base_uri, params, private_key, token_secret) {\n var base = generateBase(httpMethod, base_uri, params)\n var key = private_key || ''\n\n return rsa(key, base)\n}\n\nfunction plaintext (consumer_secret, token_secret) {\n var key = [\n consumer_secret || '',\n token_secret || ''\n ].map(rfc3986).join('&')\n\n return key\n}\n\nfunction sign (signMethod, httpMethod, base_uri, params, consumer_secret, token_secret) {\n var method\n var skipArgs = 1\n\n switch (signMethod) {\n case 'RSA-SHA1':\n method = rsasign\n break\n case 'HMAC-SHA1':\n method = hmacsign\n break\n case 'HMAC-SHA256':\n method = hmacsign256\n break\n case 'PLAINTEXT':\n method = plaintext\n skipArgs = 4\n break\n default:\n throw new Error('Signature method not supported: ' + signMethod)\n }\n\n return method.apply(null, [].slice.call(arguments, skipArgs))\n}\n\nexports.hmacsign = hmacsign\nexports.hmacsign256 = hmacsign256\nexports.rsasign = rsasign\nexports.plaintext = plaintext\nexports.sign = sign\nexports.rfc3986 = rfc3986\nexports.generateBase = generateBase","'use strict';\n\nvar crypto = require('crypto');\n\n/**\n * Exported function\n *\n * Options:\n *\n * - `algorithm` hash algo to be used by this instance: *'sha1', 'md5'\n * - `excludeValues` {true|*false} hash object keys, values ignored\n * - `encoding` hash encoding, supports 'buffer', '*hex', 'binary', 'base64'\n * - `ignoreUnknown` {true|*false} ignore unknown object types\n * - `replacer` optional function that replaces values before hashing\n * - `respectFunctionProperties` {*true|false} consider function properties when hashing\n * - `respectFunctionNames` {*true|false} consider 'name' property of functions for hashing\n * - `respectType` {*true|false} Respect special properties (prototype, constructor)\n * when hashing to distinguish between types\n * - `unorderedArrays` {true|*false} Sort all arrays before hashing\n * - `unorderedSets` {*true|false} Sort `Set` and `Map` instances before hashing\n * * = default\n *\n * @param {object} object value to hash\n * @param {object} options hashing options\n * @return {string} hash value\n * @api public\n */\nexports = module.exports = objectHash;\n\nfunction objectHash(object, options){\n options = applyDefaults(object, options);\n\n return hash(object, options);\n}\n\n/**\n * Exported sugar methods\n *\n * @param {object} object value to hash\n * @return {string} hash value\n * @api public\n */\nexports.sha1 = function(object){\n return objectHash(object);\n};\nexports.keys = function(object){\n return objectHash(object, {excludeValues: true, algorithm: 'sha1', encoding: 'hex'});\n};\nexports.MD5 = function(object){\n return objectHash(object, {algorithm: 'md5', encoding: 'hex'});\n};\nexports.keysMD5 = function(object){\n return objectHash(object, {algorithm: 'md5', encoding: 'hex', excludeValues: true});\n};\n\n// Internals\nvar hashes = crypto.getHashes ? crypto.getHashes().slice() : ['sha1', 'md5'];\nhashes.push('passthrough');\nvar encodings = ['buffer', 'hex', 'binary', 'base64'];\n\nfunction applyDefaults(object, sourceOptions){\n sourceOptions = sourceOptions || {};\n\n // create a copy rather than mutating\n var options = {};\n options.algorithm = sourceOptions.algorithm || 'sha1';\n options.encoding = sourceOptions.encoding || 'hex';\n options.excludeValues = sourceOptions.excludeValues ? true : false;\n options.algorithm = options.algorithm.toLowerCase();\n options.encoding = options.encoding.toLowerCase();\n options.ignoreUnknown = sourceOptions.ignoreUnknown !== true ? false : true; // default to false\n options.respectType = sourceOptions.respectType === false ? false : true; // default to true\n options.respectFunctionNames = sourceOptions.respectFunctionNames === false ? false : true;\n options.respectFunctionProperties = sourceOptions.respectFunctionProperties === false ? false : true;\n options.unorderedArrays = sourceOptions.unorderedArrays !== true ? false : true; // default to false\n options.unorderedSets = sourceOptions.unorderedSets === false ? false : true; // default to false\n options.unorderedObjects = sourceOptions.unorderedObjects === false ? false : true; // default to true\n options.replacer = sourceOptions.replacer || undefined;\n options.excludeKeys = sourceOptions.excludeKeys || undefined;\n\n if(typeof object === 'undefined') {\n throw new Error('Object argument required.');\n }\n\n // if there is a case-insensitive match in the hashes list, accept it\n // (i.e. SHA256 for sha256)\n for (var i = 0; i < hashes.length; ++i) {\n if (hashes[i].toLowerCase() === options.algorithm.toLowerCase()) {\n options.algorithm = hashes[i];\n }\n }\n\n if(hashes.indexOf(options.algorithm) === -1){\n throw new Error('Algorithm \"' + options.algorithm + '\" not supported. ' +\n 'supported values: ' + hashes.join(', '));\n }\n\n if(encodings.indexOf(options.encoding) === -1 &&\n options.algorithm !== 'passthrough'){\n throw new Error('Encoding \"' + options.encoding + '\" not supported. ' +\n 'supported values: ' + encodings.join(', '));\n }\n\n return options;\n}\n\n/** Check if the given function is a native function */\nfunction isNativeFunction(f) {\n if ((typeof f) !== 'function') {\n return false;\n }\n var exp = /^function\\s+\\w*\\s*\\(\\s*\\)\\s*{\\s+\\[native code\\]\\s+}$/i;\n return exp.exec(Function.prototype.toString.call(f)) != null;\n}\n\nfunction hash(object, options) {\n var hashingStream;\n\n if (options.algorithm !== 'passthrough') {\n hashingStream = crypto.createHash(options.algorithm);\n } else {\n hashingStream = new PassThrough();\n }\n\n if (typeof hashingStream.write === 'undefined') {\n hashingStream.write = hashingStream.update;\n hashingStream.end = hashingStream.update;\n }\n\n var hasher = typeHasher(options, hashingStream);\n hasher.dispatch(object);\n if (!hashingStream.update) {\n hashingStream.end('');\n }\n\n if (hashingStream.digest) {\n return hashingStream.digest(options.encoding === 'buffer' ? undefined : options.encoding);\n }\n\n var buf = hashingStream.read();\n if (options.encoding === 'buffer') {\n return buf;\n }\n\n return buf.toString(options.encoding);\n}\n\n/**\n * Expose streaming API\n *\n * @param {object} object Value to serialize\n * @param {object} options Options, as for hash()\n * @param {object} stream A stream to write the serializiation to\n * @api public\n */\nexports.writeToStream = function(object, options, stream) {\n if (typeof stream === 'undefined') {\n stream = options;\n options = {};\n }\n\n options = applyDefaults(object, options);\n\n return typeHasher(options, stream).dispatch(object);\n};\n\nfunction typeHasher(options, writeTo, context){\n context = context || [];\n var write = function(str) {\n if (writeTo.update) {\n return writeTo.update(str, 'utf8');\n } else {\n return writeTo.write(str, 'utf8');\n }\n };\n\n return {\n dispatch: function(value){\n if (options.replacer) {\n value = options.replacer(value);\n }\n\n var type = typeof value;\n if (value === null) {\n type = 'null';\n }\n\n //console.log(\"[DEBUG] Dispatch: \", value, \"->\", type, \" -> \", \"_\" + type);\n\n return this['_' + type](value);\n },\n _object: function(object) {\n var pattern = (/\\[object (.*)\\]/i);\n var objString = Object.prototype.toString.call(object);\n var objType = pattern.exec(objString);\n if (!objType) { // object type did not match [object ...]\n objType = 'unknown:[' + objString + ']';\n } else {\n objType = objType[1]; // take only the class name\n }\n\n objType = objType.toLowerCase();\n\n var objectNumber = null;\n\n if ((objectNumber = context.indexOf(object)) >= 0) {\n return this.dispatch('[CIRCULAR:' + objectNumber + ']');\n } else {\n context.push(object);\n }\n\n if (typeof Buffer !== 'undefined' && Buffer.isBuffer && Buffer.isBuffer(object)) {\n write('buffer:');\n return write(object);\n }\n\n if(objType !== 'object' && objType !== 'function' && objType !== 'asyncfunction') {\n if(this['_' + objType]) {\n this['_' + objType](object);\n } else if (options.ignoreUnknown) {\n return write('[' + objType + ']');\n } else {\n throw new Error('Unknown object type \"' + objType + '\"');\n }\n }else{\n var keys = Object.keys(object);\n if (options.unorderedObjects) {\n keys = keys.sort();\n }\n // Make sure to incorporate special properties, so\n // Types with different prototypes will produce\n // a different hash and objects derived from\n // different functions (`new Foo`, `new Bar`) will\n // produce different hashes.\n // We never do this for native functions since some\n // seem to break because of that.\n if (options.respectType !== false && !isNativeFunction(object)) {\n keys.splice(0, 0, 'prototype', '__proto__', 'constructor');\n }\n\n if (options.excludeKeys) {\n keys = keys.filter(function(key) { return !options.excludeKeys(key); });\n }\n\n write('object:' + keys.length + ':');\n var self = this;\n return keys.forEach(function(key){\n self.dispatch(key);\n write(':');\n if(!options.excludeValues) {\n self.dispatch(object[key]);\n }\n write(',');\n });\n }\n },\n _array: function(arr, unordered){\n unordered = typeof unordered !== 'undefined' ? unordered :\n options.unorderedArrays !== false; // default to options.unorderedArrays\n\n var self = this;\n write('array:' + arr.length + ':');\n if (!unordered || arr.length <= 1) {\n return arr.forEach(function(entry) {\n return self.dispatch(entry);\n });\n }\n\n // the unordered case is a little more complicated:\n // since there is no canonical ordering on objects,\n // i.e. {a:1} < {a:2} and {a:1} > {a:2} are both false,\n // we first serialize each entry using a PassThrough stream\n // before sorting.\n // also: we can’t use the same context array for all entries\n // since the order of hashing should *not* matter. instead,\n // we keep track of the additions to a copy of the context array\n // and add all of them to the global context array when we’re done\n var contextAdditions = [];\n var entries = arr.map(function(entry) {\n var strm = new PassThrough();\n var localContext = context.slice(); // make copy\n var hasher = typeHasher(options, strm, localContext);\n hasher.dispatch(entry);\n // take only what was added to localContext and append it to contextAdditions\n contextAdditions = contextAdditions.concat(localContext.slice(context.length));\n return strm.read().toString();\n });\n context = context.concat(contextAdditions);\n entries.sort();\n return this._array(entries, false);\n },\n _date: function(date){\n return write('date:' + date.toJSON());\n },\n _symbol: function(sym){\n return write('symbol:' + sym.toString());\n },\n _error: function(err){\n return write('error:' + err.toString());\n },\n _boolean: function(bool){\n return write('bool:' + bool.toString());\n },\n _string: function(string){\n write('string:' + string.length + ':');\n write(string.toString());\n },\n _function: function(fn){\n write('fn:');\n if (isNativeFunction(fn)) {\n this.dispatch('[native]');\n } else {\n this.dispatch(fn.toString());\n }\n\n if (options.respectFunctionNames !== false) {\n // Make sure we can still distinguish native functions\n // by their name, otherwise String and Function will\n // have the same hash\n this.dispatch(\"function-name:\" + String(fn.name));\n }\n\n if (options.respectFunctionProperties) {\n this._object(fn);\n }\n },\n _number: function(number){\n return write('number:' + number.toString());\n },\n _xml: function(xml){\n return write('xml:' + xml.toString());\n },\n _null: function() {\n return write('Null');\n },\n _undefined: function() {\n return write('Undefined');\n },\n _regexp: function(regex){\n return write('regex:' + regex.toString());\n },\n _uint8array: function(arr){\n write('uint8array:');\n return this.dispatch(Array.prototype.slice.call(arr));\n },\n _uint8clampedarray: function(arr){\n write('uint8clampedarray:');\n return this.dispatch(Array.prototype.slice.call(arr));\n },\n _int8array: function(arr){\n write('uint8array:');\n return this.dispatch(Array.prototype.slice.call(arr));\n },\n _uint16array: function(arr){\n write('uint16array:');\n return this.dispatch(Array.prototype.slice.call(arr));\n },\n _int16array: function(arr){\n write('uint16array:');\n return this.dispatch(Array.prototype.slice.call(arr));\n },\n _uint32array: function(arr){\n write('uint32array:');\n return this.dispatch(Array.prototype.slice.call(arr));\n },\n _int32array: function(arr){\n write('uint32array:');\n return this.dispatch(Array.prototype.slice.call(arr));\n },\n _float32array: function(arr){\n write('float32array:');\n return this.dispatch(Array.prototype.slice.call(arr));\n },\n _float64array: function(arr){\n write('float64array:');\n return this.dispatch(Array.prototype.slice.call(arr));\n },\n _arraybuffer: function(arr){\n write('arraybuffer:');\n return this.dispatch(new Uint8Array(arr));\n },\n _url: function(url) {\n return write('url:' + url.toString(), 'utf8');\n },\n _map: function(map) {\n write('map:');\n var arr = Array.from(map);\n return this._array(arr, options.unorderedSets !== false);\n },\n _set: function(set) {\n write('set:');\n var arr = Array.from(set);\n return this._array(arr, options.unorderedSets !== false);\n },\n _file: function(file) {\n write('file:');\n return this.dispatch([file.name, file.size, file.type, file.lastModfied]);\n },\n _blob: function() {\n if (options.ignoreUnknown) {\n return write('[blob]');\n }\n\n throw Error('Hashing Blob objects is currently not supported\\n' +\n '(see https://github.com/puleos/object-hash/issues/26)\\n' +\n 'Use \"options.replacer\" or \"options.ignoreUnknown\"\\n');\n },\n _domwindow: function() { return write('domwindow'); },\n /* Node.js standard native objects */\n _process: function() { return write('process'); },\n _timer: function() { return write('timer'); },\n _pipe: function() { return write('pipe'); },\n _tcp: function() { return write('tcp'); },\n _udp: function() { return write('udp'); },\n _tty: function() { return write('tty'); },\n _statwatcher: function() { return write('statwatcher'); },\n _securecontext: function() { return write('securecontext'); },\n _connection: function() { return write('connection'); },\n _zlib: function() { return write('zlib'); },\n _context: function() { return write('context'); },\n _nodescript: function() { return write('nodescript'); },\n _httpparser: function() { return write('httpparser'); },\n _dataview: function() { return write('dataview'); },\n _signal: function() { return write('signal'); },\n _fsevent: function() { return write('fsevent'); },\n _tlswrap: function() { return write('tlswrap'); },\n };\n}\n\n// Mini-implementation of stream.PassThrough\n// We are far from having need for the full implementation, and we can\n// make assumptions like \"many writes, then only one final read\"\n// and we can ignore encoding specifics\nfunction PassThrough() {\n return {\n buf: '',\n\n write: function(b) {\n this.buf += b;\n },\n\n end: function(b) {\n this.buf += b;\n },\n\n read: function() {\n return this.buf;\n }\n };\n}\n","var hasMap = typeof Map === 'function' && Map.prototype;\nvar mapSizeDescriptor = Object.getOwnPropertyDescriptor && hasMap ? Object.getOwnPropertyDescriptor(Map.prototype, 'size') : null;\nvar mapSize = hasMap && mapSizeDescriptor && typeof mapSizeDescriptor.get === 'function' ? mapSizeDescriptor.get : null;\nvar mapForEach = hasMap && Map.prototype.forEach;\nvar hasSet = typeof Set === 'function' && Set.prototype;\nvar setSizeDescriptor = Object.getOwnPropertyDescriptor && hasSet ? Object.getOwnPropertyDescriptor(Set.prototype, 'size') : null;\nvar setSize = hasSet && setSizeDescriptor && typeof setSizeDescriptor.get === 'function' ? setSizeDescriptor.get : null;\nvar setForEach = hasSet && Set.prototype.forEach;\nvar hasWeakMap = typeof WeakMap === 'function' && WeakMap.prototype;\nvar weakMapHas = hasWeakMap ? WeakMap.prototype.has : null;\nvar hasWeakSet = typeof WeakSet === 'function' && WeakSet.prototype;\nvar weakSetHas = hasWeakSet ? WeakSet.prototype.has : null;\nvar hasWeakRef = typeof WeakRef === 'function' && WeakRef.prototype;\nvar weakRefDeref = hasWeakRef ? WeakRef.prototype.deref : null;\nvar booleanValueOf = Boolean.prototype.valueOf;\nvar objectToString = Object.prototype.toString;\nvar functionToString = Function.prototype.toString;\nvar match = String.prototype.match;\nvar bigIntValueOf = typeof BigInt === 'function' ? BigInt.prototype.valueOf : null;\nvar gOPS = Object.getOwnPropertySymbols;\nvar symToString = typeof Symbol === 'function' && typeof Symbol.iterator === 'symbol' ? Symbol.prototype.toString : null;\nvar isEnumerable = Object.prototype.propertyIsEnumerable;\n\nvar gPO = (typeof Reflect === 'function' ? Reflect.getPrototypeOf : Object.getPrototypeOf) || (\n [].__proto__ === Array.prototype // eslint-disable-line no-proto\n ? function (O) {\n return O.__proto__; // eslint-disable-line no-proto\n }\n : null\n);\n\nvar inspectCustom = require('./util.inspect').custom;\nvar inspectSymbol = inspectCustom && isSymbol(inspectCustom) ? inspectCustom : null;\nvar toStringTag = typeof Symbol === 'function' && typeof Symbol.toStringTag === 'symbol' ? Symbol.toStringTag : null;\n\nmodule.exports = function inspect_(obj, options, depth, seen) {\n var opts = options || {};\n\n if (has(opts, 'quoteStyle') && (opts.quoteStyle !== 'single' && opts.quoteStyle !== 'double')) {\n throw new TypeError('option \"quoteStyle\" must be \"single\" or \"double\"');\n }\n if (\n has(opts, 'maxStringLength') && (typeof opts.maxStringLength === 'number'\n ? opts.maxStringLength < 0 && opts.maxStringLength !== Infinity\n : opts.maxStringLength !== null\n )\n ) {\n throw new TypeError('option \"maxStringLength\", if provided, must be a positive integer, Infinity, or `null`');\n }\n var customInspect = has(opts, 'customInspect') ? opts.customInspect : true;\n if (typeof customInspect !== 'boolean') {\n throw new TypeError('option \"customInspect\", if provided, must be `true` or `false`');\n }\n\n if (\n has(opts, 'indent')\n && opts.indent !== null\n && opts.indent !== '\\t'\n && !(parseInt(opts.indent, 10) === opts.indent && opts.indent > 0)\n ) {\n throw new TypeError('options \"indent\" must be \"\\\\t\", an integer > 0, or `null`');\n }\n\n if (typeof obj === 'undefined') {\n return 'undefined';\n }\n if (obj === null) {\n return 'null';\n }\n if (typeof obj === 'boolean') {\n return obj ? 'true' : 'false';\n }\n\n if (typeof obj === 'string') {\n return inspectString(obj, opts);\n }\n if (typeof obj === 'number') {\n if (obj === 0) {\n return Infinity / obj > 0 ? '0' : '-0';\n }\n return String(obj);\n }\n if (typeof obj === 'bigint') {\n return String(obj) + 'n';\n }\n\n var maxDepth = typeof opts.depth === 'undefined' ? 5 : opts.depth;\n if (typeof depth === 'undefined') { depth = 0; }\n if (depth >= maxDepth && maxDepth > 0 && typeof obj === 'object') {\n return isArray(obj) ? '[Array]' : '[Object]';\n }\n\n var indent = getIndent(opts, depth);\n\n if (typeof seen === 'undefined') {\n seen = [];\n } else if (indexOf(seen, obj) >= 0) {\n return '[Circular]';\n }\n\n function inspect(value, from, noIndent) {\n if (from) {\n seen = seen.slice();\n seen.push(from);\n }\n if (noIndent) {\n var newOpts = {\n depth: opts.depth\n };\n if (has(opts, 'quoteStyle')) {\n newOpts.quoteStyle = opts.quoteStyle;\n }\n return inspect_(value, newOpts, depth + 1, seen);\n }\n return inspect_(value, opts, depth + 1, seen);\n }\n\n if (typeof obj === 'function') {\n var name = nameOf(obj);\n var keys = arrObjKeys(obj, inspect);\n return '[Function' + (name ? ': ' + name : ' (anonymous)') + ']' + (keys.length > 0 ? ' { ' + keys.join(', ') + ' }' : '');\n }\n if (isSymbol(obj)) {\n var symString = symToString.call(obj);\n return typeof obj === 'object' ? markBoxed(symString) : symString;\n }\n if (isElement(obj)) {\n var s = '<' + String(obj.nodeName).toLowerCase();\n var attrs = obj.attributes || [];\n for (var i = 0; i < attrs.length; i++) {\n s += ' ' + attrs[i].name + '=' + wrapQuotes(quote(attrs[i].value), 'double', opts);\n }\n s += '>';\n if (obj.childNodes && obj.childNodes.length) { s += '...'; }\n s += '';\n return s;\n }\n if (isArray(obj)) {\n if (obj.length === 0) { return '[]'; }\n var xs = arrObjKeys(obj, inspect);\n if (indent && !singleLineValues(xs)) {\n return '[' + indentedJoin(xs, indent) + ']';\n }\n return '[ ' + xs.join(', ') + ' ]';\n }\n if (isError(obj)) {\n var parts = arrObjKeys(obj, inspect);\n if (parts.length === 0) { return '[' + String(obj) + ']'; }\n return '{ [' + String(obj) + '] ' + parts.join(', ') + ' }';\n }\n if (typeof obj === 'object' && customInspect) {\n if (inspectSymbol && typeof obj[inspectSymbol] === 'function') {\n return obj[inspectSymbol]();\n } else if (typeof obj.inspect === 'function') {\n return obj.inspect();\n }\n }\n if (isMap(obj)) {\n var mapParts = [];\n mapForEach.call(obj, function (value, key) {\n mapParts.push(inspect(key, obj, true) + ' => ' + inspect(value, obj));\n });\n return collectionOf('Map', mapSize.call(obj), mapParts, indent);\n }\n if (isSet(obj)) {\n var setParts = [];\n setForEach.call(obj, function (value) {\n setParts.push(inspect(value, obj));\n });\n return collectionOf('Set', setSize.call(obj), setParts, indent);\n }\n if (isWeakMap(obj)) {\n return weakCollectionOf('WeakMap');\n }\n if (isWeakSet(obj)) {\n return weakCollectionOf('WeakSet');\n }\n if (isWeakRef(obj)) {\n return weakCollectionOf('WeakRef');\n }\n if (isNumber(obj)) {\n return markBoxed(inspect(Number(obj)));\n }\n if (isBigInt(obj)) {\n return markBoxed(inspect(bigIntValueOf.call(obj)));\n }\n if (isBoolean(obj)) {\n return markBoxed(booleanValueOf.call(obj));\n }\n if (isString(obj)) {\n return markBoxed(inspect(String(obj)));\n }\n if (!isDate(obj) && !isRegExp(obj)) {\n var ys = arrObjKeys(obj, inspect);\n var isPlainObject = gPO ? gPO(obj) === Object.prototype : obj instanceof Object || obj.constructor === Object;\n var protoTag = obj instanceof Object ? '' : 'null prototype';\n var stringTag = !isPlainObject && toStringTag && Object(obj) === obj && toStringTag in obj ? toStr(obj).slice(8, -1) : protoTag ? 'Object' : '';\n var constructorTag = isPlainObject || typeof obj.constructor !== 'function' ? '' : obj.constructor.name ? obj.constructor.name + ' ' : '';\n var tag = constructorTag + (stringTag || protoTag ? '[' + [].concat(stringTag || [], protoTag || []).join(': ') + '] ' : '');\n if (ys.length === 0) { return tag + '{}'; }\n if (indent) {\n return tag + '{' + indentedJoin(ys, indent) + '}';\n }\n return tag + '{ ' + ys.join(', ') + ' }';\n }\n return String(obj);\n};\n\nfunction wrapQuotes(s, defaultStyle, opts) {\n var quoteChar = (opts.quoteStyle || defaultStyle) === 'double' ? '\"' : \"'\";\n return quoteChar + s + quoteChar;\n}\n\nfunction quote(s) {\n return String(s).replace(/\"/g, '"');\n}\n\nfunction isArray(obj) { return toStr(obj) === '[object Array]' && (!toStringTag || !(typeof obj === 'object' && toStringTag in obj)); }\nfunction isDate(obj) { return toStr(obj) === '[object Date]' && (!toStringTag || !(typeof obj === 'object' && toStringTag in obj)); }\nfunction isRegExp(obj) { return toStr(obj) === '[object RegExp]' && (!toStringTag || !(typeof obj === 'object' && toStringTag in obj)); }\nfunction isError(obj) { return toStr(obj) === '[object Error]' && (!toStringTag || !(typeof obj === 'object' && toStringTag in obj)); }\nfunction isString(obj) { return toStr(obj) === '[object String]' && (!toStringTag || !(typeof obj === 'object' && toStringTag in obj)); }\nfunction isNumber(obj) { return toStr(obj) === '[object Number]' && (!toStringTag || !(typeof obj === 'object' && toStringTag in obj)); }\nfunction isBoolean(obj) { return toStr(obj) === '[object Boolean]' && (!toStringTag || !(typeof obj === 'object' && toStringTag in obj)); }\n\n// Symbol and BigInt do have Symbol.toStringTag by spec, so that can't be used to eliminate false positives\nfunction isSymbol(obj) {\n if (typeof obj === 'symbol') {\n return true;\n }\n if (!obj || typeof obj !== 'object' || !symToString) {\n return false;\n }\n try {\n symToString.call(obj);\n return true;\n } catch (e) {}\n return false;\n}\n\nfunction isBigInt(obj) {\n if (!obj || typeof obj !== 'object' || !bigIntValueOf) {\n return false;\n }\n try {\n bigIntValueOf.call(obj);\n return true;\n } catch (e) {}\n return false;\n}\n\nvar hasOwn = Object.prototype.hasOwnProperty || function (key) { return key in this; };\nfunction has(obj, key) {\n return hasOwn.call(obj, key);\n}\n\nfunction toStr(obj) {\n return objectToString.call(obj);\n}\n\nfunction nameOf(f) {\n if (f.name) { return f.name; }\n var m = match.call(functionToString.call(f), /^function\\s*([\\w$]+)/);\n if (m) { return m[1]; }\n return null;\n}\n\nfunction indexOf(xs, x) {\n if (xs.indexOf) { return xs.indexOf(x); }\n for (var i = 0, l = xs.length; i < l; i++) {\n if (xs[i] === x) { return i; }\n }\n return -1;\n}\n\nfunction isMap(x) {\n if (!mapSize || !x || typeof x !== 'object') {\n return false;\n }\n try {\n mapSize.call(x);\n try {\n setSize.call(x);\n } catch (s) {\n return true;\n }\n return x instanceof Map; // core-js workaround, pre-v2.5.0\n } catch (e) {}\n return false;\n}\n\nfunction isWeakMap(x) {\n if (!weakMapHas || !x || typeof x !== 'object') {\n return false;\n }\n try {\n weakMapHas.call(x, weakMapHas);\n try {\n weakSetHas.call(x, weakSetHas);\n } catch (s) {\n return true;\n }\n return x instanceof WeakMap; // core-js workaround, pre-v2.5.0\n } catch (e) {}\n return false;\n}\n\nfunction isWeakRef(x) {\n if (!weakRefDeref || !x || typeof x !== 'object') {\n return false;\n }\n try {\n weakRefDeref.call(x);\n return true;\n } catch (e) {}\n return false;\n}\n\nfunction isSet(x) {\n if (!setSize || !x || typeof x !== 'object') {\n return false;\n }\n try {\n setSize.call(x);\n try {\n mapSize.call(x);\n } catch (m) {\n return true;\n }\n return x instanceof Set; // core-js workaround, pre-v2.5.0\n } catch (e) {}\n return false;\n}\n\nfunction isWeakSet(x) {\n if (!weakSetHas || !x || typeof x !== 'object') {\n return false;\n }\n try {\n weakSetHas.call(x, weakSetHas);\n try {\n weakMapHas.call(x, weakMapHas);\n } catch (s) {\n return true;\n }\n return x instanceof WeakSet; // core-js workaround, pre-v2.5.0\n } catch (e) {}\n return false;\n}\n\nfunction isElement(x) {\n if (!x || typeof x !== 'object') { return false; }\n if (typeof HTMLElement !== 'undefined' && x instanceof HTMLElement) {\n return true;\n }\n return typeof x.nodeName === 'string' && typeof x.getAttribute === 'function';\n}\n\nfunction inspectString(str, opts) {\n if (str.length > opts.maxStringLength) {\n var remaining = str.length - opts.maxStringLength;\n var trailer = '... ' + remaining + ' more character' + (remaining > 1 ? 's' : '');\n return inspectString(str.slice(0, opts.maxStringLength), opts) + trailer;\n }\n // eslint-disable-next-line no-control-regex\n var s = str.replace(/(['\\\\])/g, '\\\\$1').replace(/[\\x00-\\x1f]/g, lowbyte);\n return wrapQuotes(s, 'single', opts);\n}\n\nfunction lowbyte(c) {\n var n = c.charCodeAt(0);\n var x = {\n 8: 'b',\n 9: 't',\n 10: 'n',\n 12: 'f',\n 13: 'r'\n }[n];\n if (x) { return '\\\\' + x; }\n return '\\\\x' + (n < 0x10 ? '0' : '') + n.toString(16).toUpperCase();\n}\n\nfunction markBoxed(str) {\n return 'Object(' + str + ')';\n}\n\nfunction weakCollectionOf(type) {\n return type + ' { ? }';\n}\n\nfunction collectionOf(type, size, entries, indent) {\n var joinedEntries = indent ? indentedJoin(entries, indent) : entries.join(', ');\n return type + ' (' + size + ') {' + joinedEntries + '}';\n}\n\nfunction singleLineValues(xs) {\n for (var i = 0; i < xs.length; i++) {\n if (indexOf(xs[i], '\\n') >= 0) {\n return false;\n }\n }\n return true;\n}\n\nfunction getIndent(opts, depth) {\n var baseIndent;\n if (opts.indent === '\\t') {\n baseIndent = '\\t';\n } else if (typeof opts.indent === 'number' && opts.indent > 0) {\n baseIndent = Array(opts.indent + 1).join(' ');\n } else {\n return null;\n }\n return {\n base: baseIndent,\n prev: Array(depth + 1).join(baseIndent)\n };\n}\n\nfunction indentedJoin(xs, indent) {\n if (xs.length === 0) { return ''; }\n var lineJoiner = '\\n' + indent.prev + indent.base;\n return lineJoiner + xs.join(',' + lineJoiner) + '\\n' + indent.prev;\n}\n\nfunction arrObjKeys(obj, inspect) {\n var isArr = isArray(obj);\n var xs = [];\n if (isArr) {\n xs.length = obj.length;\n for (var i = 0; i < obj.length; i++) {\n xs[i] = has(obj, i) ? inspect(obj[i], obj) : '';\n }\n }\n for (var key in obj) { // eslint-disable-line no-restricted-syntax\n if (!has(obj, key)) { continue; } // eslint-disable-line no-restricted-syntax, no-continue\n if (isArr && String(Number(key)) === key && key < obj.length) { continue; } // eslint-disable-line no-restricted-syntax, no-continue\n if ((/[^\\w$]/).test(key)) {\n xs.push(inspect(key, obj) + ': ' + inspect(obj[key], obj));\n } else {\n xs.push(key + ': ' + inspect(obj[key], obj));\n }\n }\n if (typeof gOPS === 'function') {\n var syms = gOPS(obj);\n for (var j = 0; j < syms.length; j++) {\n if (isEnumerable.call(obj, syms[j])) {\n xs.push('[' + inspect(syms[j]) + ']: ' + inspect(obj[syms[j]], obj));\n }\n }\n }\n return xs;\n}\n","module.exports = require('util').inspect;\n","const { strict: assert } = require('assert');\nconst { createHash } = require('crypto');\nconst { format } = require('util');\n\nconst shake256 = require('./shake256');\n\nlet encode;\nif (Buffer.isEncoding('base64url')) {\n encode = (input) => input.toString('base64url');\n} else {\n const fromBase64 = (base64) => base64.replace(/=/g, '').replace(/\\+/g, '-').replace(/\\//g, '_');\n encode = (input) => fromBase64(input.toString('base64'));\n}\n\n/** SPECIFICATION\n * Its (_hash) value is the base64url encoding of the left-most half of the hash of the octets of\n * the ASCII representation of the token value, where the hash algorithm used is the hash algorithm\n * used in the alg Header Parameter of the ID Token's JOSE Header. For instance, if the alg is\n * RS256, hash the token value with SHA-256, then take the left-most 128 bits and base64url encode\n * them. The _hash value is a case sensitive string.\n */\n\n/**\n * @name getHash\n * @api private\n *\n * returns the sha length based off the JOSE alg heade value, defaults to sha256\n *\n * @param token {String} token value to generate the hash from\n * @param alg {String} ID Token JOSE header alg value (i.e. RS256, HS384, ES512, PS256)\n * @param [crv] {String} For EdDSA the curve decides what hash algorithm is used. Required for EdDSA\n */\nfunction getHash(alg, crv) {\n switch (alg) {\n case 'HS256':\n case 'RS256':\n case 'PS256':\n case 'ES256':\n case 'ES256K':\n return createHash('sha256');\n\n case 'HS384':\n case 'RS384':\n case 'PS384':\n case 'ES384':\n return createHash('sha384');\n\n case 'HS512':\n case 'RS512':\n case 'PS512':\n case 'ES512':\n return createHash('sha512');\n\n case 'EdDSA':\n switch (crv) {\n case 'Ed25519':\n return createHash('sha512');\n case 'Ed448':\n if (!shake256) {\n throw new TypeError('Ed448 *_hash calculation is not supported in your Node.js runtime version');\n }\n\n return createHash('shake256', { outputLength: 114 });\n default:\n throw new TypeError('unrecognized or invalid EdDSA curve provided');\n }\n\n default:\n throw new TypeError('unrecognized or invalid JWS algorithm provided');\n }\n}\n\nfunction generate(token, alg, crv) {\n const digest = getHash(alg, crv).update(token).digest();\n return encode(digest.slice(0, digest.length / 2));\n}\n\nfunction validate(names, actual, source, alg, crv) {\n if (typeof names.claim !== 'string' || !names.claim) {\n throw new TypeError('names.claim must be a non-empty string');\n }\n\n if (typeof names.source !== 'string' || !names.source) {\n throw new TypeError('names.source must be a non-empty string');\n }\n\n assert(typeof actual === 'string' && actual, `${names.claim} must be a non-empty string`);\n assert(typeof source === 'string' && source, `${names.source} must be a non-empty string`);\n\n let expected;\n let msg;\n try {\n expected = generate(source, alg, crv);\n } catch (err) {\n msg = format('%s could not be validated (%s)', names.claim, err.message);\n }\n\n msg = msg || format('%s mismatch, expected %s, got: %s', names.claim, expected, actual);\n\n assert.equal(expected, actual, msg);\n}\n\nmodule.exports = {\n validate,\n generate,\n};\n","const crypto = require('crypto');\n\nconst [major, minor] = process.version.substr(1).split('.').map((x) => parseInt(x, 10));\nconst xofOutputLength = major > 12 || (major === 12 && minor >= 8);\nconst shake256 = xofOutputLength && crypto.getHashes().includes('shake256');\n\nmodule.exports = shake256;\n","var wrappy = require('wrappy')\nmodule.exports = wrappy(once)\nmodule.exports.strict = wrappy(onceStrict)\n\nonce.proto = once(function () {\n Object.defineProperty(Function.prototype, 'once', {\n value: function () {\n return once(this)\n },\n configurable: true\n })\n\n Object.defineProperty(Function.prototype, 'onceStrict', {\n value: function () {\n return onceStrict(this)\n },\n configurable: true\n })\n})\n\nfunction once (fn) {\n var f = function () {\n if (f.called) return f.value\n f.called = true\n return f.value = fn.apply(this, arguments)\n }\n f.called = false\n return f\n}\n\nfunction onceStrict (fn) {\n var f = function () {\n if (f.called)\n throw new Error(f.onceError)\n f.called = true\n return f.value = fn.apply(this, arguments)\n }\n var name = fn.name || 'Function wrapped with `once`'\n f.onceError = name + \" shouldn't be called more than once\"\n f.called = false\n return f\n}\n","/* eslint-disable max-classes-per-file */\n\nconst { inspect, deprecate } = require('util');\nconst stdhttp = require('http');\nconst crypto = require('crypto');\nconst { strict: assert } = require('assert');\nconst querystring = require('querystring');\nconst url = require('url');\n\nconst { ParseError } = require('got');\nconst jose = require('jose');\nconst base64url = require('base64url');\nconst tokenHash = require('oidc-token-hash');\n\nconst defaults = require('./helpers/defaults');\nconst { assertSigningAlgValuesSupport, assertIssuerConfiguration } = require('./helpers/assert');\nconst pick = require('./helpers/pick');\nconst isPlainObject = require('./helpers/is_plain_object');\nconst processResponse = require('./helpers/process_response');\nconst TokenSet = require('./token_set');\nconst { OPError, RPError } = require('./errors');\nconst now = require('./helpers/unix_timestamp');\nconst { random } = require('./helpers/generators');\nconst request = require('./helpers/request');\nconst {\n CALLBACK_PROPERTIES, CLIENT_DEFAULTS, JWT_CONTENT, CLOCK_TOLERANCE,\n} = require('./helpers/consts');\nconst issuerRegistry = require('./issuer_registry');\nconst instance = require('./helpers/weak_cache');\nconst { authenticatedPost, resolveResponseType, resolveRedirectUri } = require('./helpers/client');\nconst DeviceFlowHandle = require('./device_flow_handle');\n\nconst { deep: defaultsDeep } = defaults;\n\nfunction pickCb(input) {\n return pick(input, ...CALLBACK_PROPERTIES);\n}\n\nfunction authorizationHeaderValue(token, tokenType = 'Bearer') {\n return `${tokenType} ${token}`;\n}\n\nfunction cleanUpClaims(claims) {\n if (Object.keys(claims._claim_names).length === 0) {\n delete claims._claim_names;\n }\n if (Object.keys(claims._claim_sources).length === 0) {\n delete claims._claim_sources;\n }\n}\n\nfunction assignClaim(target, source, sourceName, throwOnMissing = true) {\n return ([claim, inSource]) => {\n if (inSource === sourceName) {\n if (throwOnMissing && source[claim] === undefined) {\n throw new RPError(`expected claim \"${claim}\" in \"${sourceName}\"`);\n } else if (source[claim] !== undefined) {\n target[claim] = source[claim];\n }\n delete target._claim_names[claim];\n }\n };\n}\n\nfunction verifyPresence(payload, jwt, prop) {\n if (payload[prop] === undefined) {\n throw new RPError({\n message: `missing required JWT property ${prop}`,\n jwt,\n });\n }\n}\n\nfunction authorizationParams(params) {\n const authParams = {\n client_id: this.client_id,\n scope: 'openid',\n response_type: resolveResponseType.call(this),\n redirect_uri: resolveRedirectUri.call(this),\n ...params,\n };\n\n Object.entries(authParams).forEach(([key, value]) => {\n if (value === null || value === undefined) {\n delete authParams[key];\n } else if (key === 'claims' && typeof value === 'object') {\n authParams[key] = JSON.stringify(value);\n } else if (key === 'resource' && Array.isArray(value)) {\n authParams[key] = value;\n } else if (typeof value !== 'string') {\n authParams[key] = String(value);\n }\n });\n\n return authParams;\n}\n\nasync function claimJWT(label, jwt) {\n try {\n const { header, payload } = jose.JWT.decode(jwt, { complete: true });\n const { iss } = payload;\n\n if (header.alg === 'none') {\n return payload;\n }\n\n let key;\n if (!iss || iss === this.issuer.issuer) {\n key = await this.issuer.queryKeyStore(header);\n } else if (issuerRegistry.has(iss)) {\n key = await issuerRegistry.get(iss).queryKeyStore(header);\n } else {\n const discovered = await this.issuer.constructor.discover(iss);\n key = await discovered.queryKeyStore(header);\n }\n return jose.JWT.verify(jwt, key);\n } catch (err) {\n if (err instanceof RPError || err instanceof OPError || err.name === 'AggregateError') {\n throw err;\n } else {\n throw new RPError({\n printf: ['failed to validate the %s JWT (%s: %s)', label, err.name, err.message],\n jwt,\n });\n }\n }\n}\n\nfunction getKeystore(jwks) {\n const keystore = jose.JWKS.asKeyStore(jwks);\n if (keystore.all().some((key) => key.type !== 'private')) {\n throw new TypeError('jwks must only contain private keys');\n }\n return keystore;\n}\n\n// if an OP doesnt support client_secret_basic but supports client_secret_post, use it instead\n// this is in place to take care of most common pitfalls when first using discovered Issuers without\n// the support for default values defined by Discovery 1.0\nfunction checkBasicSupport(client, metadata, properties) {\n try {\n const supported = client.issuer.token_endpoint_auth_methods_supported;\n if (!supported.includes(properties.token_endpoint_auth_method)) {\n if (supported.includes('client_secret_post')) {\n properties.token_endpoint_auth_method = 'client_secret_post';\n }\n }\n } catch (err) {}\n}\n\nfunction handleCommonMistakes(client, metadata, properties) {\n if (!metadata.token_endpoint_auth_method) { // if no explicit value was provided\n checkBasicSupport(client, metadata, properties);\n }\n\n // :fp: c'mon people... RTFM\n if (metadata.redirect_uri) {\n if (metadata.redirect_uris) {\n throw new TypeError('provide a redirect_uri or redirect_uris, not both');\n }\n properties.redirect_uris = [metadata.redirect_uri];\n delete properties.redirect_uri;\n }\n\n if (metadata.response_type) {\n if (metadata.response_types) {\n throw new TypeError('provide a response_type or response_types, not both');\n }\n properties.response_types = [metadata.response_type];\n delete properties.response_type;\n }\n}\n\nfunction getDefaultsForEndpoint(endpoint, issuer, properties) {\n if (!issuer[`${endpoint}_endpoint`]) return;\n\n const tokenEndpointAuthMethod = properties.token_endpoint_auth_method;\n const tokenEndpointAuthSigningAlg = properties.token_endpoint_auth_signing_alg;\n\n const eam = `${endpoint}_endpoint_auth_method`;\n const easa = `${endpoint}_endpoint_auth_signing_alg`;\n\n if (properties[eam] === undefined && properties[easa] === undefined) {\n if (tokenEndpointAuthMethod !== undefined) {\n properties[eam] = tokenEndpointAuthMethod;\n }\n if (tokenEndpointAuthSigningAlg !== undefined) {\n properties[easa] = tokenEndpointAuthSigningAlg;\n }\n }\n}\n\nclass BaseClient {}\n\nmodule.exports = (issuer, aadIssValidation = false) => class Client extends BaseClient {\n /**\n * @name constructor\n * @api public\n */\n constructor(metadata = {}, jwks, options) {\n super();\n\n if (typeof metadata.client_id !== 'string' || !metadata.client_id) {\n throw new TypeError('client_id is required');\n }\n\n const properties = { ...CLIENT_DEFAULTS, ...metadata };\n\n handleCommonMistakes(this, metadata, properties);\n\n assertSigningAlgValuesSupport('token', this.issuer, properties);\n\n ['introspection', 'revocation'].forEach((endpoint) => {\n getDefaultsForEndpoint(endpoint, this.issuer, properties);\n assertSigningAlgValuesSupport(endpoint, this.issuer, properties);\n });\n\n Object.entries(properties).forEach(([key, value]) => {\n instance(this).get('metadata').set(key, value);\n if (!this[key]) {\n Object.defineProperty(this, key, {\n get() { return instance(this).get('metadata').get(key); },\n enumerable: true,\n });\n }\n });\n\n if (jwks !== undefined) {\n const keystore = getKeystore.call(this, jwks);\n instance(this).set('keystore', keystore);\n }\n\n if (options !== undefined) {\n instance(this).set('options', options);\n }\n\n this[CLOCK_TOLERANCE] = 0;\n }\n\n /**\n * @name authorizationUrl\n * @api public\n */\n authorizationUrl(params = {}) {\n if (!isPlainObject(params)) {\n throw new TypeError('params must be a plain object');\n }\n assertIssuerConfiguration(this.issuer, 'authorization_endpoint');\n const target = url.parse(this.issuer.authorization_endpoint, true);\n target.search = null;\n target.query = {\n ...target.query,\n ...authorizationParams.call(this, params),\n };\n return url.format(target);\n }\n\n /**\n * @name authorizationPost\n * @api public\n */\n authorizationPost(params = {}) {\n if (!isPlainObject(params)) {\n throw new TypeError('params must be a plain object');\n }\n const inputs = authorizationParams.call(this, params);\n const formInputs = Object.keys(inputs)\n .map((name) => ``).join('\\n');\n\n return `\n\n Requesting Authorization\n\n\n
\n ${formInputs}\n
\n\n`;\n }\n\n /**\n * @name endSessionUrl\n * @api public\n */\n endSessionUrl(params = {}) {\n assertIssuerConfiguration(this.issuer, 'end_session_endpoint');\n\n const {\n 0: postLogout,\n length,\n } = this.post_logout_redirect_uris || [];\n\n const {\n post_logout_redirect_uri = length === 1 ? postLogout : undefined,\n } = params;\n\n let hint = params.id_token_hint;\n\n if (hint instanceof TokenSet) {\n if (!hint.id_token) {\n throw new TypeError('id_token not present in TokenSet');\n }\n hint = hint.id_token;\n }\n\n const target = url.parse(this.issuer.end_session_endpoint, true);\n target.search = null;\n target.query = {\n ...params,\n ...target.query,\n ...{\n post_logout_redirect_uri,\n id_token_hint: hint,\n },\n };\n\n Object.entries(target.query).forEach(([key, value]) => {\n if (value === null || value === undefined) {\n delete target.query[key];\n }\n });\n\n return url.format(target);\n }\n\n /**\n * @name callbackParams\n * @api public\n */\n callbackParams(input) { // eslint-disable-line class-methods-use-this\n const isIncomingMessage = input instanceof stdhttp.IncomingMessage\n || (input && input.method && input.url);\n const isString = typeof input === 'string';\n\n if (!isString && !isIncomingMessage) {\n throw new TypeError('#callbackParams only accepts string urls, http.IncomingMessage or a lookalike');\n }\n\n if (isIncomingMessage) {\n switch (input.method) {\n case 'GET':\n return pickCb(url.parse(input.url, true).query);\n case 'POST':\n if (input.body === undefined) {\n throw new TypeError('incoming message body missing, include a body parser prior to this method call');\n }\n switch (typeof input.body) {\n case 'object':\n case 'string':\n if (Buffer.isBuffer(input.body)) {\n return pickCb(querystring.parse(input.body.toString('utf-8')));\n }\n if (typeof input.body === 'string') {\n return pickCb(querystring.parse(input.body));\n }\n\n return pickCb(input.body);\n default:\n throw new TypeError('invalid IncomingMessage body object');\n }\n default:\n throw new TypeError('invalid IncomingMessage method');\n }\n } else {\n return pickCb(url.parse(input, true).query);\n }\n }\n\n /**\n * @name callback\n * @api public\n */\n async callback(\n redirectUri,\n parameters,\n checks = {},\n { exchangeBody, clientAssertionPayload } = {},\n ) {\n let params = pickCb(parameters);\n\n if (checks.jarm && !('response' in parameters)) {\n throw new RPError({\n message: 'expected a JARM response',\n checks,\n params,\n });\n } else if ('response' in parameters) {\n const decrypted = await this.decryptJARM(params.response);\n params = await this.validateJARM(decrypted);\n }\n\n if (this.default_max_age && !checks.max_age) {\n checks.max_age = this.default_max_age;\n }\n\n if (params.state && !checks.state) {\n throw new TypeError('checks.state argument is missing');\n }\n\n if (!params.state && checks.state) {\n throw new RPError({\n message: 'state missing from the response',\n checks,\n params,\n });\n }\n\n if (checks.state !== params.state) {\n throw new RPError({\n printf: ['state mismatch, expected %s, got: %s', checks.state, params.state],\n checks,\n params,\n });\n }\n\n if (params.error) {\n throw new OPError(params);\n }\n\n const RESPONSE_TYPE_REQUIRED_PARAMS = {\n code: ['code'],\n id_token: ['id_token'],\n token: ['access_token', 'token_type'],\n };\n\n if (checks.response_type) {\n for (const type of checks.response_type.split(' ')) { // eslint-disable-line no-restricted-syntax\n if (type === 'none') {\n if (params.code || params.id_token || params.access_token) {\n throw new RPError({\n message: 'unexpected params encountered for \"none\" response',\n checks,\n params,\n });\n }\n } else {\n for (const param of RESPONSE_TYPE_REQUIRED_PARAMS[type]) { // eslint-disable-line no-restricted-syntax, max-len\n if (!params[param]) {\n throw new RPError({\n message: `${param} missing from response`,\n checks,\n params,\n });\n }\n }\n }\n }\n }\n\n if (params.id_token) {\n const tokenset = new TokenSet(params);\n await this.decryptIdToken(tokenset);\n await this.validateIdToken(tokenset, checks.nonce, 'authorization', checks.max_age, checks.state);\n\n if (!params.code) {\n return tokenset;\n }\n }\n\n if (params.code) {\n const tokenset = await this.grant({\n ...exchangeBody,\n grant_type: 'authorization_code',\n code: params.code,\n redirect_uri: redirectUri,\n code_verifier: checks.code_verifier,\n }, { clientAssertionPayload });\n\n await this.decryptIdToken(tokenset);\n await this.validateIdToken(tokenset, checks.nonce, 'token', checks.max_age);\n\n if (params.session_state) {\n tokenset.session_state = params.session_state;\n }\n\n return tokenset;\n }\n\n return new TokenSet(params);\n }\n\n /**\n * @name oauthCallback\n * @api public\n */\n async oauthCallback(\n redirectUri,\n parameters,\n checks = {},\n { exchangeBody, clientAssertionPayload } = {},\n ) {\n let params = pickCb(parameters);\n\n if (checks.jarm && !('response' in parameters)) {\n throw new RPError({\n message: 'expected a JARM response',\n checks,\n params,\n });\n } else if ('response' in parameters) {\n const decrypted = await this.decryptJARM(params.response);\n params = await this.validateJARM(decrypted);\n }\n\n if (params.state && !checks.state) {\n throw new TypeError('checks.state argument is missing');\n }\n\n if (!params.state && checks.state) {\n throw new RPError({\n message: 'state missing from the response',\n checks,\n params,\n });\n }\n\n if (checks.state !== params.state) {\n throw new RPError({\n printf: ['state mismatch, expected %s, got: %s', checks.state, params.state],\n checks,\n params,\n });\n }\n\n if (params.error) {\n throw new OPError(params);\n }\n\n const RESPONSE_TYPE_REQUIRED_PARAMS = {\n code: ['code'],\n token: ['access_token', 'token_type'],\n };\n\n if (checks.response_type) {\n for (const type of checks.response_type.split(' ')) { // eslint-disable-line no-restricted-syntax\n if (type === 'none') {\n if (params.code || params.id_token || params.access_token) {\n throw new RPError({\n message: 'unexpected params encountered for \"none\" response',\n checks,\n params,\n });\n }\n }\n\n if (RESPONSE_TYPE_REQUIRED_PARAMS[type]) {\n for (const param of RESPONSE_TYPE_REQUIRED_PARAMS[type]) { // eslint-disable-line no-restricted-syntax, max-len\n if (!params[param]) {\n throw new RPError({\n message: `${param} missing from response`,\n checks,\n params,\n });\n }\n }\n }\n }\n }\n\n if (params.code) {\n return this.grant({\n ...exchangeBody,\n grant_type: 'authorization_code',\n code: params.code,\n redirect_uri: redirectUri,\n code_verifier: checks.code_verifier,\n }, { clientAssertionPayload });\n }\n\n return new TokenSet(params);\n }\n\n /**\n * @name decryptIdToken\n * @api private\n */\n async decryptIdToken(token) {\n if (!this.id_token_encrypted_response_alg) {\n return token;\n }\n\n let idToken = token;\n\n if (idToken instanceof TokenSet) {\n if (!idToken.id_token) {\n throw new TypeError('id_token not present in TokenSet');\n }\n idToken = idToken.id_token;\n }\n\n const expectedAlg = this.id_token_encrypted_response_alg;\n const expectedEnc = this.id_token_encrypted_response_enc;\n\n const result = await this.decryptJWE(idToken, expectedAlg, expectedEnc);\n\n if (token instanceof TokenSet) {\n token.id_token = result;\n return token;\n }\n\n return result;\n }\n\n async validateJWTUserinfo(body) {\n const expectedAlg = this.userinfo_signed_response_alg;\n\n return this.validateJWT(body, expectedAlg, []);\n }\n\n /**\n * @name decryptJARM\n * @api private\n */\n async decryptJARM(response) {\n if (!this.authorization_encrypted_response_alg) {\n return response;\n }\n\n const expectedAlg = this.authorization_encrypted_response_alg;\n const expectedEnc = this.authorization_encrypted_response_enc;\n\n return this.decryptJWE(response, expectedAlg, expectedEnc);\n }\n\n /**\n * @name validateJARM\n * @api private\n */\n async validateJARM(response) {\n const expectedAlg = this.authorization_signed_response_alg;\n const { payload } = await this.validateJWT(response, expectedAlg, ['iss', 'exp', 'aud']);\n return pickCb(payload);\n }\n\n /**\n * @name decryptJWTUserinfo\n * @api private\n */\n async decryptJWTUserinfo(body) {\n if (!this.userinfo_encrypted_response_alg) {\n return body;\n }\n\n const expectedAlg = this.userinfo_encrypted_response_alg;\n const expectedEnc = this.userinfo_encrypted_response_enc;\n\n return this.decryptJWE(body, expectedAlg, expectedEnc);\n }\n\n /**\n * @name decryptJWE\n * @api private\n */\n async decryptJWE(jwe, expectedAlg, expectedEnc = 'A128CBC-HS256') {\n const header = JSON.parse(base64url.decode(jwe.split('.')[0]));\n\n if (header.alg !== expectedAlg) {\n throw new RPError({\n printf: ['unexpected JWE alg received, expected %s, got: %s', expectedAlg, header.alg],\n jwt: jwe,\n });\n }\n\n if (header.enc !== expectedEnc) {\n throw new RPError({\n printf: ['unexpected JWE enc received, expected %s, got: %s', expectedEnc, header.enc],\n jwt: jwe,\n });\n }\n\n let keyOrStore;\n\n if (expectedAlg.match(/^(?:RSA|ECDH)/)) {\n keyOrStore = instance(this).get('keystore');\n } else {\n keyOrStore = await this.joseSecret(expectedAlg === 'dir' ? expectedEnc : expectedAlg);\n }\n\n const payload = jose.JWE.decrypt(jwe, keyOrStore);\n return payload.toString('utf8');\n }\n\n /**\n * @name validateIdToken\n * @api private\n */\n async validateIdToken(tokenSet, nonce, returnedBy, maxAge, state) {\n let idToken = tokenSet;\n\n const expectedAlg = this.id_token_signed_response_alg;\n\n const isTokenSet = idToken instanceof TokenSet;\n\n if (isTokenSet) {\n if (!idToken.id_token) {\n throw new TypeError('id_token not present in TokenSet');\n }\n idToken = idToken.id_token;\n }\n\n idToken = String(idToken);\n\n const timestamp = now();\n const { protected: header, payload, key } = await this.validateJWT(idToken, expectedAlg);\n\n if (maxAge || (maxAge !== null && this.require_auth_time)) {\n if (!payload.auth_time) {\n throw new RPError({\n message: 'missing required JWT property auth_time',\n jwt: idToken,\n });\n }\n if (typeof payload.auth_time !== 'number') {\n throw new RPError({\n message: 'JWT auth_time claim must be a JSON numeric value',\n jwt: idToken,\n });\n }\n }\n\n if (maxAge && (payload.auth_time + maxAge < timestamp - this[CLOCK_TOLERANCE])) {\n throw new RPError({\n printf: ['too much time has elapsed since the last End-User authentication, max_age %i, auth_time: %i, now %i', maxAge, payload.auth_time, timestamp - this[CLOCK_TOLERANCE]],\n now: timestamp,\n tolerance: this[CLOCK_TOLERANCE],\n auth_time: payload.auth_time,\n jwt: idToken,\n });\n }\n\n if (nonce !== null && (payload.nonce || nonce !== undefined) && payload.nonce !== nonce) {\n throw new RPError({\n printf: ['nonce mismatch, expected %s, got: %s', nonce, payload.nonce],\n jwt: idToken,\n });\n }\n\n if (returnedBy === 'authorization') {\n if (!payload.at_hash && tokenSet.access_token) {\n throw new RPError({\n message: 'missing required property at_hash',\n jwt: idToken,\n });\n }\n\n if (!payload.c_hash && tokenSet.code) {\n throw new RPError({\n message: 'missing required property c_hash',\n jwt: idToken,\n });\n }\n\n const fapi = this.constructor.name === 'FAPIClient';\n\n if (fapi) {\n if (payload.iat < timestamp - 3600) {\n throw new RPError({\n printf: ['JWT issued too far in the past, now %i, iat %i', timestamp, payload.iat],\n now: timestamp,\n tolerance: this[CLOCK_TOLERANCE],\n iat: payload.iat,\n jwt: idToken,\n });\n }\n\n if (!payload.s_hash && (tokenSet.state || state)) {\n throw new RPError({\n message: 'missing required property s_hash',\n jwt: idToken,\n });\n }\n }\n\n if (payload.s_hash) {\n if (!state) {\n throw new TypeError('cannot verify s_hash, \"checks.state\" property not provided');\n }\n\n try {\n tokenHash.validate({ claim: 's_hash', source: 'state' }, payload.s_hash, state, header.alg, key && key.crv);\n } catch (err) {\n throw new RPError({ message: err.message, jwt: idToken });\n }\n }\n }\n\n if (tokenSet.access_token && payload.at_hash !== undefined) {\n try {\n tokenHash.validate({ claim: 'at_hash', source: 'access_token' }, payload.at_hash, tokenSet.access_token, header.alg, key && key.crv);\n } catch (err) {\n throw new RPError({ message: err.message, jwt: idToken });\n }\n }\n\n if (tokenSet.code && payload.c_hash !== undefined) {\n try {\n tokenHash.validate({ claim: 'c_hash', source: 'code' }, payload.c_hash, tokenSet.code, header.alg, key && key.crv);\n } catch (err) {\n throw new RPError({ message: err.message, jwt: idToken });\n }\n }\n\n return tokenSet;\n }\n\n /**\n * @name validateJWT\n * @api private\n */\n async validateJWT(jwt, expectedAlg, required = ['iss', 'sub', 'aud', 'exp', 'iat']) {\n const isSelfIssued = this.issuer.issuer === 'https://self-issued.me';\n const timestamp = now();\n let header;\n let payload;\n try {\n ({ header, payload } = jose.JWT.decode(jwt, { complete: true }));\n } catch (err) {\n throw new RPError({\n printf: ['failed to decode JWT (%s: %s)', err.name, err.message],\n jwt,\n });\n }\n\n if (header.alg !== expectedAlg) {\n throw new RPError({\n printf: ['unexpected JWT alg received, expected %s, got: %s', expectedAlg, header.alg],\n jwt,\n });\n }\n\n if (isSelfIssued) {\n required = [...required, 'sub_jwk']; // eslint-disable-line no-param-reassign\n }\n\n required.forEach(verifyPresence.bind(undefined, payload, jwt));\n\n if (payload.iss !== undefined) {\n let expectedIss = this.issuer.issuer;\n\n if (aadIssValidation) {\n expectedIss = this.issuer.issuer.replace('{tenantid}', payload.tid);\n }\n\n if (payload.iss !== expectedIss) {\n throw new RPError({\n printf: ['unexpected iss value, expected %s, got: %s', expectedIss, payload.iss],\n jwt,\n });\n }\n }\n\n if (payload.iat !== undefined) {\n if (typeof payload.iat !== 'number') {\n throw new RPError({\n message: 'JWT iat claim must be a JSON numeric value',\n jwt,\n });\n }\n }\n\n if (payload.nbf !== undefined) {\n if (typeof payload.nbf !== 'number') {\n throw new RPError({\n message: 'JWT nbf claim must be a JSON numeric value',\n jwt,\n });\n }\n if (payload.nbf > timestamp + this[CLOCK_TOLERANCE]) {\n throw new RPError({\n printf: ['JWT not active yet, now %i, nbf %i', timestamp + this[CLOCK_TOLERANCE], payload.nbf],\n now: timestamp,\n tolerance: this[CLOCK_TOLERANCE],\n nbf: payload.nbf,\n jwt,\n });\n }\n }\n\n if (payload.exp !== undefined) {\n if (typeof payload.exp !== 'number') {\n throw new RPError({\n message: 'JWT exp claim must be a JSON numeric value',\n jwt,\n });\n }\n if (timestamp - this[CLOCK_TOLERANCE] >= payload.exp) {\n throw new RPError({\n printf: ['JWT expired, now %i, exp %i', timestamp - this[CLOCK_TOLERANCE], payload.exp],\n now: timestamp,\n tolerance: this[CLOCK_TOLERANCE],\n exp: payload.exp,\n jwt,\n });\n }\n }\n\n if (payload.aud !== undefined) {\n if (Array.isArray(payload.aud)) {\n if (payload.aud.length > 1 && !payload.azp) {\n throw new RPError({\n message: 'missing required JWT property azp',\n jwt,\n });\n }\n\n if (!payload.aud.includes(this.client_id)) {\n throw new RPError({\n printf: ['aud is missing the client_id, expected %s to be included in %j', this.client_id, payload.aud],\n jwt,\n });\n }\n } else if (payload.aud !== this.client_id) {\n throw new RPError({\n printf: ['aud mismatch, expected %s, got: %s', this.client_id, payload.aud],\n jwt,\n });\n }\n }\n\n if (payload.azp !== undefined) {\n let { additionalAuthorizedParties } = instance(this).get('options') || {};\n\n if (typeof additionalAuthorizedParties === 'string') {\n additionalAuthorizedParties = [this.client_id, additionalAuthorizedParties];\n } else if (Array.isArray(additionalAuthorizedParties)) {\n additionalAuthorizedParties = [this.client_id, ...additionalAuthorizedParties];\n } else {\n additionalAuthorizedParties = [this.client_id];\n }\n\n if (!additionalAuthorizedParties.includes(payload.azp)) {\n throw new RPError({\n printf: ['azp mismatch, got: %s', payload.azp],\n jwt,\n });\n }\n }\n\n let key;\n\n if (isSelfIssued) {\n try {\n assert(isPlainObject(payload.sub_jwk));\n key = jose.JWK.asKey(payload.sub_jwk);\n assert.equal(key.type, 'public');\n } catch (err) {\n throw new RPError({\n message: 'failed to use sub_jwk claim as an asymmetric JSON Web Key',\n jwt,\n });\n }\n if (key.thumbprint !== payload.sub) {\n throw new RPError({\n message: 'failed to match the subject with sub_jwk',\n jwt,\n });\n }\n } else if (header.alg.startsWith('HS')) {\n key = await this.joseSecret();\n } else if (header.alg !== 'none') {\n key = await this.issuer.queryKeyStore(header);\n }\n\n if (!key && header.alg === 'none') {\n return { protected: header, payload };\n }\n\n try {\n return jose.JWS.verify(jwt, key, { complete: true });\n } catch (err) {\n throw new RPError({\n message: 'failed to validate JWT signature',\n jwt,\n });\n }\n }\n\n /**\n * @name refresh\n * @api public\n */\n async refresh(refreshToken, { exchangeBody, clientAssertionPayload } = {}) {\n let token = refreshToken;\n\n if (token instanceof TokenSet) {\n if (!token.refresh_token) {\n throw new TypeError('refresh_token not present in TokenSet');\n }\n token = token.refresh_token;\n }\n\n const tokenset = await this.grant({\n ...exchangeBody,\n grant_type: 'refresh_token',\n refresh_token: String(token),\n }, { clientAssertionPayload });\n\n if (tokenset.id_token) {\n await this.decryptIdToken(tokenset);\n await this.validateIdToken(tokenset, null, 'token', null);\n\n if (refreshToken instanceof TokenSet && refreshToken.id_token) {\n const expectedSub = refreshToken.claims().sub;\n const actualSub = tokenset.claims().sub;\n if (actualSub !== expectedSub) {\n throw new RPError({\n printf: ['sub mismatch, expected %s, got: %s', expectedSub, actualSub],\n jwt: tokenset.id_token,\n });\n }\n }\n }\n\n return tokenset;\n }\n\n async requestResource(\n resourceUrl,\n accessToken,\n {\n method,\n headers,\n body,\n tokenType = accessToken instanceof TokenSet ? accessToken.token_type : 'Bearer',\n } = {},\n ) {\n if (accessToken instanceof TokenSet) {\n if (!accessToken.access_token) {\n throw new TypeError('access_token not present in TokenSet');\n }\n accessToken = accessToken.access_token; // eslint-disable-line no-param-reassign\n }\n\n const requestOpts = {\n headers: {\n Authorization: authorizationHeaderValue(accessToken, tokenType),\n ...headers,\n },\n body,\n };\n\n const mTLS = !!this.tls_client_certificate_bound_access_tokens;\n\n return request.call(this, {\n ...requestOpts,\n encoding: null,\n method,\n url: resourceUrl,\n }, { mTLS });\n }\n\n /**\n * @name userinfo\n * @api public\n */\n async userinfo(accessToken, {\n verb = 'GET', via = 'header', tokenType, params,\n } = {}) {\n // TODO: in v4.x remove verb in favour of method\n assertIssuerConfiguration(this.issuer, 'userinfo_endpoint');\n const options = {\n tokenType,\n method: String(verb).toUpperCase(),\n };\n\n if (options.method !== 'GET' && options.method !== 'POST') {\n throw new TypeError('#userinfo() verb can only be POST or a GET');\n }\n\n if (via === 'query' && options.method !== 'GET') {\n throw new TypeError('userinfo endpoints will only parse query strings for GET requests');\n } else if (via === 'body' && options.method !== 'POST') {\n throw new TypeError('can only send body on POST');\n }\n\n const jwt = !!(this.userinfo_signed_response_alg\n || this.userinfo_encrypted_response_alg);\n\n if (jwt) {\n options.headers = { Accept: 'application/jwt' };\n } else {\n options.headers = { Accept: 'application/json' };\n }\n\n const mTLS = !!this.tls_client_certificate_bound_access_tokens;\n\n let targetUrl;\n if (mTLS && this.issuer.mtls_endpoint_aliases) {\n targetUrl = this.issuer.mtls_endpoint_aliases.userinfo_endpoint;\n }\n\n targetUrl = new url.URL(targetUrl || this.issuer.userinfo_endpoint);\n\n // when via is not header we clear the Authorization header and add either\n // query string parameters or urlencoded body access_token parameter\n if (via === 'query') {\n options.headers.Authorization = undefined;\n targetUrl.searchParams.append('access_token', accessToken instanceof TokenSet ? accessToken.access_token : accessToken);\n } else if (via === 'body') {\n options.headers.Authorization = undefined;\n options.headers['Content-Type'] = 'application/x-www-form-urlencoded';\n options.body = new url.URLSearchParams();\n options.body.append('access_token', accessToken instanceof TokenSet ? accessToken.access_token : accessToken);\n }\n\n // handle additional parameters, GET via querystring, POST via urlencoded body\n if (params) {\n if (options.method === 'GET') {\n Object.entries(params).forEach(([key, value]) => {\n targetUrl.searchParams.append(key, value);\n });\n } else if (options.body) { // POST && via body\n Object.entries(params).forEach(([key, value]) => {\n options.body.append(key, value);\n });\n } else { // POST && via header\n options.body = new url.URLSearchParams();\n options.headers['Content-Type'] = 'application/x-www-form-urlencoded';\n Object.entries(params).forEach(([key, value]) => {\n options.body.append(key, value);\n });\n }\n }\n\n if (options.body) {\n options.body = options.body.toString();\n }\n\n const response = await this.requestResource(targetUrl, accessToken, options);\n\n let parsed = processResponse(response, { bearer: true });\n\n if (jwt) {\n if (!JWT_CONTENT.test(response.headers['content-type'])) {\n throw new RPError({\n message: 'expected application/jwt response from the userinfo_endpoint',\n response,\n });\n }\n\n const body = response.body.toString();\n const userinfo = await this.decryptJWTUserinfo(body);\n if (!this.userinfo_signed_response_alg) {\n try {\n parsed = JSON.parse(userinfo);\n assert(isPlainObject(parsed));\n } catch (err) {\n throw new RPError({\n message: 'failed to parse userinfo JWE payload as JSON',\n jwt: userinfo,\n });\n }\n } else {\n ({ payload: parsed } = await this.validateJWTUserinfo(userinfo));\n }\n } else {\n try {\n parsed = JSON.parse(response.body);\n } catch (error) {\n const parseError = new ParseError(\n error, response.statusCode, response.request.gotOptions, response.body,\n );\n Object.defineProperty(parseError, 'response', { value: response });\n throw parseError;\n }\n }\n\n if (accessToken instanceof TokenSet && accessToken.id_token) {\n const expectedSub = accessToken.claims().sub;\n if (parsed.sub !== expectedSub) {\n throw new RPError({\n printf: ['userinfo sub mismatch, expected %s, got: %s', expectedSub, parsed.sub],\n body: parsed,\n jwt: accessToken.id_token,\n });\n }\n }\n\n return parsed;\n }\n\n /**\n * @name derivedKey\n * @api private\n */\n async derivedKey(len) {\n const cacheKey = `${len}_key`;\n if (instance(this).has(cacheKey)) {\n return instance(this).get(cacheKey);\n }\n\n const hash = len <= 256 ? 'sha256' : len <= 384 ? 'sha384' : len <= 512 ? 'sha512' : false; // eslint-disable-line no-nested-ternary\n if (!hash) {\n throw new Error('unsupported symmetric encryption key derivation');\n }\n\n const derivedBuffer = crypto.createHash(hash)\n .update(this.client_secret)\n .digest()\n .slice(0, len / 8);\n\n const key = jose.JWK.asKey({ k: base64url.encode(derivedBuffer), kty: 'oct' });\n instance(this).set(cacheKey, key);\n\n return key;\n }\n\n /**\n * @name joseSecret\n * @api private\n */\n async joseSecret(alg) {\n if (!this.client_secret) {\n throw new TypeError('client_secret is required');\n }\n if (/^A(\\d{3})(?:GCM)?KW$/.test(alg)) {\n return this.derivedKey(parseInt(RegExp.$1, 10));\n }\n\n if (/^A(\\d{3})(?:GCM|CBC-HS(\\d{3}))$/.test(alg)) {\n return this.derivedKey(parseInt(RegExp.$2 || RegExp.$1, 10));\n }\n\n if (instance(this).has('jose_secret')) {\n return instance(this).get('jose_secret');\n }\n\n const key = jose.JWK.asKey({ k: base64url.encode(this.client_secret), kty: 'oct' });\n instance(this).set('jose_secret', key);\n\n return key;\n }\n\n /**\n * @name grant\n * @api public\n */\n async grant(body, { clientAssertionPayload } = {}) {\n assertIssuerConfiguration(this.issuer, 'token_endpoint');\n const response = await authenticatedPost.call(\n this,\n 'token',\n {\n form: true,\n body,\n json: true,\n },\n { clientAssertionPayload },\n );\n const responseBody = processResponse(response);\n\n return new TokenSet(responseBody);\n }\n\n /**\n * @name deviceAuthorization\n * @api public\n */\n async deviceAuthorization(params = {}, { exchangeBody, clientAssertionPayload } = {}) {\n assertIssuerConfiguration(this.issuer, 'device_authorization_endpoint');\n assertIssuerConfiguration(this.issuer, 'token_endpoint');\n\n const body = authorizationParams.call(this, {\n client_id: this.client_id,\n redirect_uri: null,\n response_type: null,\n ...params,\n });\n\n const response = await authenticatedPost.call(\n this,\n 'device_authorization',\n {\n form: true,\n body,\n json: true,\n },\n { clientAssertionPayload, endpointAuthMethod: 'token' },\n );\n const responseBody = processResponse(response);\n\n return new DeviceFlowHandle({\n client: this,\n exchangeBody,\n clientAssertionPayload,\n response: responseBody,\n maxAge: params.max_age,\n });\n }\n\n /**\n * @name revoke\n * @api public\n */\n async revoke(token, hint, { revokeBody, clientAssertionPayload } = {}) {\n assertIssuerConfiguration(this.issuer, 'revocation_endpoint');\n if (hint !== undefined && typeof hint !== 'string') {\n throw new TypeError('hint must be a string');\n }\n\n const body = { ...revokeBody, token };\n\n if (hint) {\n body.token_type_hint = hint;\n }\n\n const response = await authenticatedPost.call(\n this,\n 'revocation', {\n body,\n form: true,\n }, { clientAssertionPayload },\n );\n processResponse(response, { body: false });\n }\n\n /**\n * @name introspect\n * @api public\n */\n async introspect(token, hint, { introspectBody, clientAssertionPayload } = {}) {\n assertIssuerConfiguration(this.issuer, 'introspection_endpoint');\n if (hint !== undefined && typeof hint !== 'string') {\n throw new TypeError('hint must be a string');\n }\n\n const body = { ...introspectBody, token };\n if (hint) {\n body.token_type_hint = hint;\n }\n\n const response = await authenticatedPost.call(\n this,\n 'introspection',\n { body, form: true, json: true },\n { clientAssertionPayload },\n );\n\n const responseBody = processResponse(response);\n\n return responseBody;\n }\n\n /**\n * @name fetchDistributedClaims\n * @api public\n */\n async fetchDistributedClaims(claims, tokens = {}) {\n if (!isPlainObject(claims)) {\n throw new TypeError('claims argument must be a plain object');\n }\n\n if (!isPlainObject(claims._claim_sources)) {\n return claims;\n }\n\n if (!isPlainObject(claims._claim_names)) {\n return claims;\n }\n\n const distributedSources = Object.entries(claims._claim_sources)\n .filter(([, value]) => value && value.endpoint);\n\n await Promise.all(distributedSources.map(async ([sourceName, def]) => {\n try {\n const requestOpts = {\n headers: {\n Accept: 'application/jwt',\n Authorization: authorizationHeaderValue(def.access_token || tokens[sourceName]),\n },\n };\n\n const response = await request.call(this, {\n ...requestOpts,\n method: 'GET',\n url: def.endpoint,\n });\n const body = processResponse(response, { bearer: true });\n\n const decoded = await claimJWT.call(this, 'distributed', body);\n delete claims._claim_sources[sourceName];\n Object.entries(claims._claim_names).forEach(\n assignClaim(claims, decoded, sourceName, false),\n );\n } catch (err) {\n err.src = sourceName;\n throw err;\n }\n }));\n\n cleanUpClaims(claims);\n return claims;\n }\n\n /**\n * @name unpackAggregatedClaims\n * @api public\n */\n async unpackAggregatedClaims(claims) {\n if (!isPlainObject(claims)) {\n throw new TypeError('claims argument must be a plain object');\n }\n\n if (!isPlainObject(claims._claim_sources)) {\n return claims;\n }\n\n if (!isPlainObject(claims._claim_names)) {\n return claims;\n }\n\n const aggregatedSources = Object.entries(claims._claim_sources)\n .filter(([, value]) => value && value.JWT);\n\n await Promise.all(aggregatedSources.map(async ([sourceName, def]) => {\n try {\n const decoded = await claimJWT.call(this, 'aggregated', def.JWT);\n delete claims._claim_sources[sourceName];\n Object.entries(claims._claim_names).forEach(assignClaim(claims, decoded, sourceName));\n } catch (err) {\n err.src = sourceName;\n throw err;\n }\n }));\n\n cleanUpClaims(claims);\n return claims;\n }\n\n /**\n * @name register\n * @api public\n */\n static async register(metadata, options = {}) {\n const { initialAccessToken, jwks, ...clientOptions } = options;\n\n assertIssuerConfiguration(this.issuer, 'registration_endpoint');\n\n if (jwks !== undefined && !(metadata.jwks || metadata.jwks_uri)) {\n const keystore = getKeystore.call(this, jwks);\n metadata.jwks = keystore.toJWKS(false);\n }\n\n const response = await request.call(this, {\n headers: initialAccessToken ? {\n Authorization: authorizationHeaderValue(initialAccessToken),\n } : undefined,\n json: true,\n body: metadata,\n url: this.issuer.registration_endpoint,\n method: 'POST',\n });\n const responseBody = processResponse(response, { statusCode: 201, bearer: true });\n\n return new this(responseBody, jwks, clientOptions);\n }\n\n /**\n * @name metadata\n * @api public\n */\n get metadata() {\n const copy = {};\n instance(this).get('metadata').forEach((value, key) => {\n copy[key] = value;\n });\n return copy;\n }\n\n /**\n * @name fromUri\n * @api public\n */\n static async fromUri(registrationClientUri, registrationAccessToken, jwks, clientOptions) {\n const response = await request.call(this, {\n method: 'GET',\n url: registrationClientUri,\n json: true,\n headers: { Authorization: authorizationHeaderValue(registrationAccessToken) },\n });\n const responseBody = processResponse(response, { bearer: true });\n\n return new this(responseBody, jwks, clientOptions);\n }\n\n /**\n * @name requestObject\n * @api public\n */\n async requestObject(requestObject = {}, {\n sign: signingAlgorithm = this.request_object_signing_alg || 'none',\n encrypt: {\n alg: eKeyManagement = this.request_object_encryption_alg,\n enc: eContentEncryption = this.request_object_encryption_enc || 'A128CBC-HS256',\n } = {},\n } = {}) {\n if (!isPlainObject(requestObject)) {\n throw new TypeError('requestObject must be a plain object');\n }\n\n let signed;\n let key;\n\n const header = { alg: signingAlgorithm, typ: 'JWT' };\n const payload = JSON.stringify(defaults({}, requestObject, {\n iss: this.client_id,\n aud: this.issuer.issuer,\n client_id: this.client_id,\n jti: random(),\n iat: now(),\n exp: now() + 300,\n }));\n\n if (signingAlgorithm === 'none') {\n signed = [\n base64url.encode(JSON.stringify(header)),\n base64url.encode(payload),\n '',\n ].join('.');\n } else {\n const symmetric = signingAlgorithm.startsWith('HS');\n if (symmetric) {\n key = await this.joseSecret();\n } else {\n const keystore = instance(this).get('keystore');\n\n if (!keystore) {\n throw new TypeError(`no keystore present for client, cannot sign using alg ${signingAlgorithm}`);\n }\n key = keystore.get({ alg: signingAlgorithm, use: 'sig' });\n if (!key) {\n throw new TypeError(`no key to sign with found for alg ${signingAlgorithm}`);\n }\n }\n\n signed = jose.JWS.sign(payload, key, {\n ...header,\n kid: symmetric ? undefined : key.kid,\n });\n }\n\n if (!eKeyManagement) {\n return signed;\n }\n\n const fields = { alg: eKeyManagement, enc: eContentEncryption, cty: 'JWT' };\n\n if (fields.alg.match(/^(RSA|ECDH)/)) {\n [key] = await this.issuer.queryKeyStore({\n alg: fields.alg,\n enc: fields.enc,\n use: 'enc',\n }, { allowMulti: true });\n } else {\n key = await this.joseSecret(fields.alg === 'dir' ? fields.enc : fields.alg);\n }\n\n return jose.JWE.encrypt(signed, key, {\n ...fields,\n kid: key.kty === 'oct' ? undefined : key.kid,\n });\n }\n\n /**\n * @name issuer\n * @api public\n */\n static get issuer() {\n return issuer;\n }\n\n /**\n * @name issuer\n * @api public\n */\n get issuer() { // eslint-disable-line class-methods-use-this\n return issuer;\n }\n\n /* istanbul ignore next */\n [inspect.custom]() {\n return `${this.constructor.name} ${inspect(this.metadata, {\n depth: Infinity,\n colors: process.stdout.isTTY,\n compact: false,\n sorted: true,\n })}`;\n }\n};\n\n// TODO: remove in 4.x\nBaseClient.prototype.resource = deprecate(\n /* istanbul ignore next */\n async function resource(resourceUrl, accessToken, options) {\n let token = accessToken;\n const opts = {\n verb: 'GET',\n via: 'header',\n ...options,\n };\n\n if (token instanceof TokenSet) {\n if (!token.access_token) {\n throw new TypeError('access_token not present in TokenSet');\n }\n opts.tokenType = opts.tokenType || token.token_type;\n token = token.access_token;\n }\n\n const verb = String(opts.verb).toUpperCase();\n let requestOpts;\n\n switch (opts.via) {\n case 'query':\n if (verb !== 'GET') {\n throw new TypeError('resource servers should only parse query strings for GET requests');\n }\n requestOpts = { query: { access_token: token } };\n break;\n case 'body':\n if (verb !== 'POST') {\n throw new TypeError('can only send body on POST');\n }\n requestOpts = { form: true, body: { access_token: token } };\n break;\n default:\n requestOpts = {\n headers: {\n Authorization: authorizationHeaderValue(token, opts.tokenType),\n },\n };\n }\n\n if (opts.params) {\n if (verb === 'POST') {\n defaultsDeep(requestOpts, { body: opts.params });\n } else {\n defaultsDeep(requestOpts, { query: opts.params });\n }\n }\n\n if (opts.headers) {\n defaultsDeep(requestOpts, { headers: opts.headers });\n }\n\n const mTLS = !!this.tls_client_certificate_bound_access_tokens;\n\n return request.call(this, {\n ...requestOpts,\n encoding: null,\n method: verb,\n url: resourceUrl,\n }, { mTLS });\n }, 'client.resource() is deprecated, use client.requestResource() instead, see docs for API details',\n);\n\nmodule.exports.BaseClient = BaseClient;\n","/* eslint-disable camelcase */\nconst { inspect } = require('util');\n\nconst { RPError, OPError } = require('./errors');\nconst instance = require('./helpers/weak_cache');\nconst now = require('./helpers/unix_timestamp');\nconst { authenticatedPost } = require('./helpers/client');\nconst processResponse = require('./helpers/process_response');\nconst TokenSet = require('./token_set');\n\nclass DeviceFlowHandle {\n constructor({\n client, exchangeBody, clientAssertionPayload, response, maxAge,\n }) {\n ['verification_uri', 'user_code', 'device_code'].forEach((prop) => {\n if (typeof response[prop] !== 'string' || !response[prop]) {\n throw new RPError(`expected ${prop} string to be returned by Device Authorization Response, got %j`, response[prop]);\n }\n });\n\n if (!Number.isSafeInteger(response.expires_in)) {\n throw new RPError('expected expires_in number to be returned by Device Authorization Response, got %j', response.expires_in);\n }\n\n instance(this).expires_at = now() + response.expires_in;\n instance(this).client = client;\n instance(this).maxAge = maxAge;\n instance(this).exchangeBody = exchangeBody;\n instance(this).clientAssertionPayload = clientAssertionPayload;\n instance(this).response = response;\n instance(this).interval = response.interval * 1000 || 5000;\n }\n\n async poll() {\n if (this.expired()) {\n throw new RPError('the device code %j has expired and the device authorization session has concluded', this.device_code);\n }\n\n await new Promise((resolve) => setTimeout(resolve, instance(this).interval));\n\n const response = await authenticatedPost.call(\n instance(this).client,\n 'token',\n {\n form: true,\n body: {\n ...instance(this).exchangeBody,\n grant_type: 'urn:ietf:params:oauth:grant-type:device_code',\n device_code: this.device_code,\n },\n json: true,\n },\n { clientAssertionPayload: instance(this).clientAssertionPayload },\n );\n\n let responseBody;\n try {\n responseBody = processResponse(response);\n } catch (err) {\n switch (err instanceof OPError && err.error) {\n case 'slow_down':\n instance(this).interval += 5000;\n case 'authorization_pending': // eslint-disable-line no-fallthrough\n return this.poll();\n default:\n throw err;\n }\n }\n\n const tokenset = new TokenSet(responseBody);\n\n if ('id_token' in tokenset) {\n await instance(this).client.decryptIdToken(tokenset);\n await instance(this).client.validateIdToken(tokenset, undefined, 'token', instance(this).maxAge);\n }\n\n return tokenset;\n }\n\n get device_code() {\n return instance(this).response.device_code;\n }\n\n get user_code() {\n return instance(this).response.user_code;\n }\n\n get verification_uri() {\n return instance(this).response.verification_uri;\n }\n\n get verification_uri_complete() {\n return instance(this).response.verification_uri_complete;\n }\n\n get expires_in() {\n return Math.max.apply(null, [instance(this).expires_at - now(), 0]);\n }\n\n expired() {\n return this.expires_in === 0;\n }\n\n /* istanbul ignore next */\n [inspect.custom]() {\n return `${this.constructor.name} ${inspect(instance(this).response, {\n depth: Infinity,\n colors: process.stdout.isTTY,\n compact: false,\n sorted: true,\n })}`;\n }\n}\n\nmodule.exports = DeviceFlowHandle;\n","/* eslint-disable camelcase */\nconst { format } = require('util');\n\nconst makeError = require('make-error');\n\nfunction OPError({\n error_description,\n error,\n error_uri,\n session_state,\n state,\n scope,\n}, response) {\n OPError.super.call(this, !error_description ? error : `${error} (${error_description})`);\n\n Object.assign(\n this,\n { error },\n (error_description && { error_description }),\n (error_uri && { error_uri }),\n (state && { state }),\n (scope && { scope }),\n (session_state && { session_state }),\n );\n\n if (response) {\n Object.defineProperty(this, 'response', {\n value: response,\n });\n }\n}\n\nmakeError(OPError);\n\nfunction RPError(...args) {\n if (typeof args[0] === 'string') {\n RPError.super.call(this, format(...args));\n } else {\n const {\n message, printf, response, ...rest\n } = args[0];\n if (printf) {\n RPError.super.call(this, format(...printf));\n } else {\n RPError.super.call(this, message);\n }\n Object.assign(this, rest);\n if (response) {\n Object.defineProperty(this, 'response', {\n value: response,\n });\n }\n }\n}\n\nmakeError(RPError);\n\nmodule.exports = {\n OPError,\n RPError,\n};\n","function assertSigningAlgValuesSupport(endpoint, issuer, properties) {\n if (!issuer[`${endpoint}_endpoint`]) return;\n\n const eam = `${endpoint}_endpoint_auth_method`;\n const easa = `${endpoint}_endpoint_auth_signing_alg`;\n const easavs = `${endpoint}_endpoint_auth_signing_alg_values_supported`;\n\n if (properties[eam] && properties[eam].endsWith('_jwt') && !properties[easa] && !issuer[easavs]) {\n throw new TypeError(`${easavs} must be configured on the issuer if ${easa} is not defined on a client`);\n }\n}\n\nfunction assertIssuerConfiguration(issuer, endpoint) {\n if (!issuer[endpoint]) {\n throw new TypeError(`${endpoint} must be configured on the issuer`);\n }\n}\n\nmodule.exports = {\n assertSigningAlgValuesSupport,\n assertIssuerConfiguration,\n};\n","const jose = require('jose');\n\nconst { assertIssuerConfiguration } = require('./assert');\nconst { random } = require('./generators');\nconst now = require('./unix_timestamp');\nconst request = require('./request');\nconst instance = require('./weak_cache');\nconst merge = require('./merge');\n\nconst formUrlEncode = (value) => encodeURIComponent(value).replace(/%20/g, '+');\n\nasync function clientAssertion(endpoint, payload) {\n let alg = this[`${endpoint}_endpoint_auth_signing_alg`];\n if (!alg) {\n assertIssuerConfiguration(this.issuer, `${endpoint}_endpoint_auth_signing_alg_values_supported`);\n }\n\n if (this[`${endpoint}_endpoint_auth_method`] === 'client_secret_jwt') {\n const key = await this.joseSecret();\n\n if (!alg) {\n const supported = this.issuer[`${endpoint}_endpoint_auth_signing_alg_values_supported`];\n alg = Array.isArray(supported) && supported.find((signAlg) => key.algorithms('sign').has(signAlg));\n }\n\n return jose.JWS.sign(payload, key, { alg, typ: 'JWT' });\n }\n\n const keystore = instance(this).get('keystore');\n\n if (!keystore) {\n throw new TypeError('no client jwks provided for signing a client assertion with');\n }\n\n if (!alg) {\n const algs = new Set();\n\n keystore.all().forEach((key) => {\n key.algorithms('sign').forEach(Set.prototype.add.bind(algs));\n });\n\n const supported = this.issuer[`${endpoint}_endpoint_auth_signing_alg_values_supported`];\n alg = Array.isArray(supported) && supported.find((signAlg) => algs.has(signAlg));\n }\n\n const key = keystore.get({ alg, use: 'sig' });\n if (!key) {\n throw new TypeError(`no key found in client jwks to sign a client assertion with using alg ${alg}`);\n }\n return jose.JWS.sign(payload, key, { alg, typ: 'JWT', kid: key.kid });\n}\n\nasync function authFor(endpoint, { clientAssertionPayload } = {}) {\n const authMethod = this[`${endpoint}_endpoint_auth_method`];\n switch (authMethod) {\n case 'self_signed_tls_client_auth':\n case 'tls_client_auth':\n case 'none':\n return { body: { client_id: this.client_id } };\n case 'client_secret_post':\n if (!this.client_secret) {\n throw new TypeError('client_secret_post client authentication method requires a client_secret');\n }\n return { body: { client_id: this.client_id, client_secret: this.client_secret } };\n case 'private_key_jwt':\n case 'client_secret_jwt': {\n const timestamp = now();\n const assertion = await clientAssertion.call(this, endpoint, {\n iat: timestamp,\n exp: timestamp + 60,\n jti: random(),\n iss: this.client_id,\n sub: this.client_id,\n aud: this.issuer[`${endpoint}_endpoint`], // TODO: in v4.x pass the issuer instead (for now clientAssertionPayload can be used for that)\n ...clientAssertionPayload,\n });\n\n return {\n body: {\n client_id: this.client_id,\n client_assertion: assertion,\n client_assertion_type: 'urn:ietf:params:oauth:client-assertion-type:jwt-bearer',\n },\n };\n }\n default: { // client_secret_basic\n // This is correct behaviour, see https://tools.ietf.org/html/rfc6749#section-2.3.1 and the\n // related appendix. (also https://github.com/panva/node-openid-client/pull/91)\n // > The client identifier is encoded using the\n // > \"application/x-www-form-urlencoded\" encoding algorithm per\n // > Appendix B, and the encoded value is used as the username; the client\n // > password is encoded using the same algorithm and used as the\n // > password.\n if (!this.client_secret) {\n throw new TypeError('client_secret_basic client authentication method requires a client_secret');\n }\n const encoded = `${formUrlEncode(this.client_id)}:${formUrlEncode(this.client_secret)}`;\n const value = Buffer.from(encoded).toString('base64');\n return { headers: { Authorization: `Basic ${value}` } };\n }\n }\n}\n\nfunction resolveResponseType() {\n const { length, 0: value } = this.response_types;\n\n if (length === 1) {\n return value;\n }\n\n return undefined;\n}\n\nfunction resolveRedirectUri() {\n const { length, 0: value } = this.redirect_uris || [];\n\n if (length === 1) {\n return value;\n }\n\n return undefined;\n}\n\nasync function authenticatedPost(endpoint, opts, {\n clientAssertionPayload, endpointAuthMethod = endpoint,\n} = {}) {\n const auth = await authFor.call(this, endpointAuthMethod, { clientAssertionPayload });\n const requestOpts = merge(opts, auth, { form: true });\n\n const mTLS = this[`${endpointAuthMethod}_endpoint_auth_method`].includes('tls_client_auth')\n || (endpoint === 'token' && this.tls_client_certificate_bound_access_tokens);\n\n let targetUrl;\n if (mTLS && this.issuer.mtls_endpoint_aliases) {\n targetUrl = this.issuer.mtls_endpoint_aliases[`${endpoint}_endpoint`];\n }\n\n targetUrl = targetUrl || this.issuer[`${endpoint}_endpoint`];\n\n if ('body' in requestOpts) {\n for (const [key, value] of Object.entries(requestOpts.body)) { // eslint-disable-line no-restricted-syntax, max-len\n if (typeof value === 'undefined') {\n delete requestOpts.body[key];\n }\n }\n }\n\n return request.call(this, {\n ...requestOpts,\n method: 'POST',\n url: targetUrl,\n }, { mTLS });\n}\n\nmodule.exports = {\n resolveResponseType,\n resolveRedirectUri,\n authFor,\n authenticatedPost,\n};\n","const OIDC_DISCOVERY = '/.well-known/openid-configuration';\nconst OAUTH2_DISCOVERY = '/.well-known/oauth-authorization-server';\nconst WEBFINGER = '/.well-known/webfinger';\nconst REL = 'http://openid.net/specs/connect/1.0/issuer';\nconst AAD_MULTITENANT_DISCOVERY = [\n `https://login.microsoftonline.com/common${OIDC_DISCOVERY}`,\n `https://login.microsoftonline.com/common/v2.0${OIDC_DISCOVERY}`,\n `https://login.microsoftonline.com/organizations/v2.0${OIDC_DISCOVERY}`,\n `https://login.microsoftonline.com/consumers/v2.0${OIDC_DISCOVERY}`,\n];\n\nconst CLIENT_DEFAULTS = {\n grant_types: ['authorization_code'],\n id_token_signed_response_alg: 'RS256',\n authorization_signed_response_alg: 'RS256',\n response_types: ['code'],\n token_endpoint_auth_method: 'client_secret_basic',\n};\n\nconst ISSUER_DEFAULTS = {\n claim_types_supported: ['normal'],\n claims_parameter_supported: false,\n grant_types_supported: ['authorization_code', 'implicit'],\n request_parameter_supported: false,\n request_uri_parameter_supported: true,\n require_request_uri_registration: false,\n response_modes_supported: ['query', 'fragment'],\n token_endpoint_auth_methods_supported: ['client_secret_basic'],\n};\n\nconst CALLBACK_PROPERTIES = [\n 'access_token', // 6749\n 'code', // 6749\n 'error', // 6749\n 'error_description', // 6749\n 'error_uri', // 6749\n 'expires_in', // 6749\n 'id_token', // Core 1.0\n 'state', // 6749\n 'token_type', // 6749\n 'session_state', // Session Management\n 'response', // JARM\n];\n\nconst JWT_CONTENT = /^application\\/jwt/;\n\nconst HTTP_OPTIONS = Symbol('openid-client.custom.http-options');\nconst CLOCK_TOLERANCE = Symbol('openid-client.custom.clock-tolerance');\n\nmodule.exports = {\n AAD_MULTITENANT_DISCOVERY,\n CALLBACK_PROPERTIES,\n CLIENT_DEFAULTS,\n CLOCK_TOLERANCE,\n HTTP_OPTIONS,\n ISSUER_DEFAULTS,\n JWT_CONTENT,\n OAUTH2_DISCOVERY,\n OIDC_DISCOVERY,\n REL,\n WEBFINGER,\n};\n","module.exports = (obj) => JSON.parse(JSON.stringify(obj));\n","/* eslint-disable no-restricted-syntax, no-continue */\n\nconst isPlainObject = require('./is_plain_object');\n\nfunction defaults(deep, target, ...sources) {\n for (const source of sources) {\n if (!isPlainObject(source)) {\n continue;\n }\n for (const [key, value] of Object.entries(source)) {\n /* istanbul ignore if */\n if (key === '__proto__' || key === 'constructor') {\n continue;\n }\n if (typeof target[key] === 'undefined' && typeof value !== 'undefined') {\n target[key] = value;\n }\n\n if (deep && isPlainObject(target[key]) && isPlainObject(value)) {\n defaults(true, target[key], value);\n }\n }\n }\n\n return target;\n}\n\nmodule.exports = defaults.bind(undefined, false);\nmodule.exports.deep = defaults.bind(undefined, true);\n","const { createHash, randomBytes } = require('crypto');\n\nconst { encode: base64url } = require('base64url');\n\nconst random = (bytes = 32) => base64url(randomBytes(bytes));\n\nmodule.exports = {\n random,\n state: random,\n nonce: random,\n codeVerifier: random,\n codeChallenge: (codeVerifier) => base64url(createHash('sha256').update(codeVerifier).digest()),\n};\n","const url = require('url');\nconst { strict: assert } = require('assert');\n\nmodule.exports = (target) => {\n try {\n const { protocol } = new url.URL(target);\n assert(protocol.match(/^(https?:)$/));\n return true;\n } catch (err) {\n throw new TypeError('only valid absolute URLs can be requested');\n }\n};\n","module.exports = (a) => !!a && a.constructor === Object;\n","/* eslint-disable no-restricted-syntax, no-param-reassign, no-continue */\n\nconst isPlainObject = require('./is_plain_object');\n\nfunction merge(target, ...sources) {\n for (const source of sources) {\n if (!isPlainObject(source)) {\n continue;\n }\n for (const [key, value] of Object.entries(source)) {\n /* istanbul ignore if */\n if (key === '__proto__' || key === 'constructor') {\n continue;\n }\n if (isPlainObject(target[key]) && isPlainObject(value)) {\n target[key] = merge(target[key], value);\n } else if (typeof value !== 'undefined') {\n target[key] = value;\n }\n }\n }\n\n return target;\n}\n\nmodule.exports = merge;\n","module.exports = function pick(object, ...paths) {\n const obj = {};\n for (const path of paths) { // eslint-disable-line no-restricted-syntax\n if (object[path]) {\n obj[path] = object[path];\n }\n }\n return obj;\n};\n","const { STATUS_CODES } = require('http');\nconst { format } = require('util');\n\nconst { OPError } = require('../errors');\n\nconst REGEXP = /(\\w+)=(\"[^\"]*\")/g;\nconst throwAuthenticateErrors = (response) => {\n const params = {};\n try {\n while ((REGEXP.exec(response.headers['www-authenticate'])) !== null) {\n if (RegExp.$1 && RegExp.$2) {\n params[RegExp.$1] = RegExp.$2.slice(1, -1);\n }\n }\n } catch (err) {}\n\n if (params.error) {\n throw new OPError(params, response);\n }\n};\n\nconst isStandardBodyError = (response) => {\n let result = false;\n try {\n let jsonbody;\n if (typeof response.body !== 'object' || Buffer.isBuffer(response.body)) {\n jsonbody = JSON.parse(response.body);\n } else {\n jsonbody = response.body;\n }\n result = typeof jsonbody.error === 'string' && jsonbody.error.length;\n if (result) response.body = jsonbody;\n } catch (err) {}\n\n return result;\n};\n\nfunction processResponse(response, { statusCode = 200, body = true, bearer = false } = {}) {\n if (response.statusCode !== statusCode) {\n if (bearer) {\n throwAuthenticateErrors(response);\n }\n\n if (isStandardBodyError(response)) {\n throw new OPError(response.body, response);\n }\n\n throw new OPError({\n error: format('expected %i %s, got: %i %s', statusCode, STATUS_CODES[statusCode], response.statusCode, STATUS_CODES[response.statusCode]),\n }, response);\n }\n\n if (body && !response.body) {\n throw new OPError({\n error: format('expected %i %s with body but no body was returned', statusCode, STATUS_CODES[statusCode]),\n }, response);\n }\n\n return response.body;\n}\n\nmodule.exports = processResponse;\n","const Got = require('got');\n\nconst pkg = require('../../package.json');\n\nconst { deep: defaultsDeep } = require('./defaults');\nconst isAbsoluteUrl = require('./is_absolute_url');\nconst { HTTP_OPTIONS } = require('./consts');\n\nlet DEFAULT_HTTP_OPTIONS;\nlet got;\n\nconst setDefaults = (options) => {\n DEFAULT_HTTP_OPTIONS = defaultsDeep({}, options, DEFAULT_HTTP_OPTIONS);\n got = Got.extend(DEFAULT_HTTP_OPTIONS);\n};\n\nsetDefaults({\n followRedirect: false,\n headers: { 'User-Agent': `${pkg.name}/${pkg.version} (${pkg.homepage})` },\n retry: 0,\n timeout: 2500,\n throwHttpErrors: false,\n});\n\nmodule.exports = function request(options, { mTLS = false } = {}) {\n const { url } = options;\n isAbsoluteUrl(url);\n const optsFn = this[HTTP_OPTIONS];\n let opts;\n if (optsFn) {\n opts = optsFn.call(this, defaultsDeep({}, options, DEFAULT_HTTP_OPTIONS));\n } else {\n opts = options;\n }\n\n if (mTLS && (!opts.key || !opts.cert)) {\n throw new TypeError('mutual-TLS certificate and key not set');\n }\n return got(opts);\n};\n\nmodule.exports.setDefaults = setDefaults;\n","module.exports = () => Math.floor(Date.now() / 1000);\n","const privateProps = new WeakMap();\n\nmodule.exports = (ctx) => {\n if (!privateProps.has(ctx)) {\n privateProps.set(ctx, new Map([['metadata', new Map()]]));\n }\n return privateProps.get(ctx);\n};\n","// Credit: https://github.com/rohe/pyoidc/blob/master/src/oic/utils/webfinger.py\n\n// -- Normalization --\n// A string of any other type is interpreted as a URI either the form of scheme\n// \"://\" authority path-abempty [ \"?\" query ] [ \"#\" fragment ] or authority\n// path-abempty [ \"?\" query ] [ \"#\" fragment ] per RFC 3986 [RFC3986] and is\n// normalized according to the following rules:\n//\n// If the user input Identifier does not have an RFC 3986 [RFC3986] scheme\n// portion, the string is interpreted as [userinfo \"@\"] host [\":\" port]\n// path-abempty [ \"?\" query ] [ \"#\" fragment ] per RFC 3986 [RFC3986].\n// If the userinfo component is present and all of the path component, query\n// component, and port component are empty, the acct scheme is assumed. In this\n// case, the normalized URI is formed by prefixing acct: to the string as the\n// scheme. Per the 'acct' URI Scheme [I‑D.ietf‑appsawg‑acct‑uri], if there is an\n// at-sign character ('@') in the userinfo component, it needs to be\n// percent-encoded as described in RFC 3986 [RFC3986].\n// For all other inputs without a scheme portion, the https scheme is assumed,\n// and the normalized URI is formed by prefixing https:// to the string as the\n// scheme.\n// If the resulting URI contains a fragment portion, it MUST be stripped off\n// together with the fragment delimiter character \"#\".\n// The WebFinger [I‑D.ietf‑appsawg‑webfinger] Resource in this case is the\n// resulting URI, and the WebFinger Host is the authority component.\n//\n// Note: Since the definition of authority in RFC 3986 [RFC3986] is\n// [ userinfo \"@\" ] host [ \":\" port ], it is legal to have a user input\n// identifier like userinfo@host:port, e.g., alice@example.com:8080.\n\nconst PORT = /^\\d+$/;\n\nfunction hasScheme(input) {\n if (input.includes('://')) return true;\n\n const authority = input.replace(/(\\/|\\?)/g, '#').split('#')[0];\n if (authority.includes(':')) {\n const index = authority.indexOf(':');\n const hostOrPort = authority.slice(index + 1);\n if (!PORT.test(hostOrPort)) {\n return true;\n }\n }\n\n return false;\n}\n\nfunction acctSchemeAssumed(input) {\n if (!input.includes('@')) return false;\n const parts = input.split('@');\n const host = parts[parts.length - 1];\n return !(host.includes(':') || host.includes('/') || host.includes('?'));\n}\n\nfunction normalize(input) {\n if (typeof input !== 'string') {\n throw new TypeError('input must be a string');\n }\n\n let output;\n if (hasScheme(input)) {\n output = input;\n } else if (acctSchemeAssumed(input)) {\n output = `acct:${input}`;\n } else {\n output = `https://${input}`;\n }\n\n return output.split('#')[0];\n}\n\nmodule.exports = normalize;\n","const Issuer = require('./issuer');\nconst { OPError, RPError } = require('./errors');\nconst Registry = require('./issuer_registry');\nconst Strategy = require('./passport_strategy');\nconst TokenSet = require('./token_set');\nconst { CLOCK_TOLERANCE, HTTP_OPTIONS } = require('./helpers/consts');\nconst generators = require('./helpers/generators');\nconst { setDefaults } = require('./helpers/request');\n\nmodule.exports = {\n Issuer,\n Registry,\n Strategy,\n TokenSet,\n errors: {\n OPError,\n RPError,\n },\n custom: {\n setHttpOptionsDefaults: setDefaults,\n http_options: HTTP_OPTIONS,\n clock_tolerance: CLOCK_TOLERANCE,\n },\n generators,\n};\n","/* eslint-disable max-classes-per-file */\n\nconst { inspect, deprecate } = require('util');\nconst url = require('url');\n\nconst jose = require('jose');\nconst pAny = require('p-any');\nconst LRU = require('lru-cache');\nconst objectHash = require('object-hash');\n\nconst { RPError } = require('./errors');\nconst getClient = require('./client');\nconst registry = require('./issuer_registry');\nconst processResponse = require('./helpers/process_response');\nconst webfingerNormalize = require('./helpers/webfinger_normalize');\nconst instance = require('./helpers/weak_cache');\nconst request = require('./helpers/request');\nconst { assertIssuerConfiguration } = require('./helpers/assert');\nconst {\n ISSUER_DEFAULTS, OIDC_DISCOVERY, OAUTH2_DISCOVERY, WEBFINGER, REL, AAD_MULTITENANT_DISCOVERY,\n} = require('./helpers/consts');\n\nconst AAD_MULTITENANT = Symbol('AAD_MULTITENANT');\n\nclass Issuer {\n /**\n * @name constructor\n * @api public\n */\n constructor(meta = {}) {\n const aadIssValidation = meta[AAD_MULTITENANT];\n delete meta[AAD_MULTITENANT];\n\n ['introspection', 'revocation'].forEach((endpoint) => {\n // if intro/revocation endpoint auth specific meta is missing use the token ones if they\n // are defined\n if (\n meta[`${endpoint}_endpoint`]\n && meta[`${endpoint}_endpoint_auth_methods_supported`] === undefined\n && meta[`${endpoint}_endpoint_auth_signing_alg_values_supported`] === undefined\n ) {\n if (meta.token_endpoint_auth_methods_supported) {\n meta[`${endpoint}_endpoint_auth_methods_supported`] = meta.token_endpoint_auth_methods_supported;\n }\n if (meta.token_endpoint_auth_signing_alg_values_supported) {\n meta[`${endpoint}_endpoint_auth_signing_alg_values_supported`] = meta.token_endpoint_auth_signing_alg_values_supported;\n }\n }\n });\n\n Object.entries(meta).forEach(([key, value]) => {\n instance(this).get('metadata').set(key, value);\n if (!this[key]) {\n Object.defineProperty(this, key, {\n get() { return instance(this).get('metadata').get(key); },\n enumerable: true,\n });\n }\n });\n\n instance(this).set('cache', new LRU({ max: 100 }));\n\n registry.set(this.issuer, this);\n\n Object.defineProperty(this, 'Client', {\n value: getClient(this, aadIssValidation),\n });\n\n Object.defineProperty(this, 'FAPIClient', {\n value: class FAPIClient extends this.Client {},\n });\n }\n\n /**\n * @name keystore\n * @api public\n */\n async keystore(reload = false) {\n assertIssuerConfiguration(this, 'jwks_uri');\n\n const keystore = instance(this).get('keystore');\n const cache = instance(this).get('cache');\n\n if (reload || !keystore) {\n cache.reset();\n const response = await request.call(this, {\n method: 'GET',\n json: true,\n url: this.jwks_uri,\n });\n const jwks = processResponse(response);\n\n const joseKeyStore = jose.JWKS.asKeyStore(jwks, { ignoreErrors: true });\n cache.set('throttle', true, 60 * 1000);\n instance(this).set('keystore', joseKeyStore);\n return joseKeyStore;\n }\n\n return keystore;\n }\n\n /**\n * @name queryKeyStore\n * @api private\n */\n async queryKeyStore({\n kid, kty, alg, use, key_ops: ops,\n }, { allowMulti = false } = {}) {\n const cache = instance(this).get('cache');\n\n const def = {\n kid, kty, alg, use, key_ops: ops,\n };\n\n const defHash = objectHash(def, {\n algorithm: 'sha256',\n ignoreUnknown: true,\n unorderedArrays: true,\n unorderedSets: true,\n });\n\n // refresh keystore on every unknown key but also only upto once every minute\n const freshJwksUri = cache.get(defHash) || cache.get('throttle');\n\n const keystore = await this.keystore(!freshJwksUri);\n const keys = keystore.all(def);\n\n if (keys.length === 0) {\n throw new RPError({\n printf: [\"no valid key found in issuer's jwks_uri for key parameters %j\", def],\n jwks: keystore,\n });\n }\n\n if (!allowMulti && keys.length > 1 && !kid) {\n throw new RPError({\n printf: [\"multiple matching keys found in issuer's jwks_uri for key parameters %j, kid must be provided in this case\", def],\n jwks: keystore,\n });\n }\n\n cache.set(defHash, true);\n\n return new jose.JWKS.KeyStore(keys);\n }\n\n /**\n * @name metadata\n * @api public\n */\n get metadata() {\n const copy = {};\n instance(this).get('metadata').forEach((value, key) => {\n copy[key] = value;\n });\n return copy;\n }\n\n /**\n * @name webfinger\n * @api public\n */\n static async webfinger(input) {\n const resource = webfingerNormalize(input);\n const { host } = url.parse(resource);\n const webfingerUrl = `https://${host}${WEBFINGER}`;\n\n const response = await request.call(this, {\n method: 'GET',\n url: webfingerUrl,\n json: true,\n query: { resource, rel: REL },\n followRedirect: true,\n });\n const body = processResponse(response);\n\n const location = Array.isArray(body.links) && body.links.find((link) => typeof link === 'object' && link.rel === REL && link.href);\n\n if (!location) {\n throw new RPError({\n message: 'no issuer found in webfinger response',\n body,\n });\n }\n\n if (typeof location.href !== 'string' || !location.href.startsWith('https://')) {\n throw new RPError({\n printf: ['invalid issuer location %s', location.href],\n body,\n });\n }\n\n const expectedIssuer = location.href;\n if (registry.has(expectedIssuer)) {\n return registry.get(expectedIssuer);\n }\n\n const issuer = await this.discover(expectedIssuer);\n\n if (issuer.issuer !== expectedIssuer) {\n registry.delete(issuer.issuer);\n throw new RPError('discovered issuer mismatch, expected %s, got: %s', expectedIssuer, issuer.issuer);\n }\n return issuer;\n }\n\n /**\n * @name discover\n * @api public\n */\n static async discover(uri) {\n const parsed = url.parse(uri);\n\n if (parsed.pathname.includes('/.well-known/')) {\n const response = await request.call(this, {\n method: 'GET',\n json: true,\n url: uri,\n });\n const body = processResponse(response);\n return new Issuer({\n ...ISSUER_DEFAULTS,\n ...body,\n [AAD_MULTITENANT]: !!AAD_MULTITENANT_DISCOVERY.find(\n (discoveryURL) => uri.startsWith(discoveryURL),\n ),\n });\n }\n\n const uris = [];\n if (parsed.pathname === '/') {\n uris.push(`${OAUTH2_DISCOVERY}`);\n } else {\n uris.push(`${OAUTH2_DISCOVERY}${parsed.pathname}`);\n }\n if (parsed.pathname.endsWith('/')) {\n uris.push(`${parsed.pathname}${OIDC_DISCOVERY.substring(1)}`);\n } else {\n uris.push(`${parsed.pathname}${OIDC_DISCOVERY}`);\n }\n\n return pAny(uris.map(async (pathname) => {\n const wellKnownUri = url.format({ ...parsed, pathname });\n const response = await request.call(this, {\n method: 'GET',\n json: true,\n url: wellKnownUri,\n });\n const body = processResponse(response);\n return new Issuer({\n ...ISSUER_DEFAULTS,\n ...body,\n [AAD_MULTITENANT]: !!AAD_MULTITENANT_DISCOVERY.find(\n (discoveryURL) => wellKnownUri.startsWith(discoveryURL),\n ),\n });\n }));\n }\n\n /* istanbul ignore next */\n [inspect.custom]() {\n return `${this.constructor.name} ${inspect(this.metadata, {\n depth: Infinity,\n colors: process.stdout.isTTY,\n compact: false,\n sorted: true,\n })}`;\n }\n}\n\n/**\n * @name key\n * @api private\n */\nIssuer.prototype.key = deprecate(async function key({\n kid, kty, alg, use, key_ops: ops,\n}, allowMulti = false) {\n const cache = instance(this).get('cache');\n\n const def = {\n kid, kty, alg, use, key_ops: ops,\n };\n\n const defHash = objectHash(def, {\n algorithm: 'sha256',\n ignoreUnknown: true,\n unorderedArrays: true,\n unorderedSets: true,\n });\n\n // refresh keystore on every unknown key but also only upto once every minute\n const freshJwksUri = cache.get(defHash) || cache.get('throttle');\n\n const keystore = await this.keystore(!freshJwksUri);\n const keys = keystore.all(def);\n\n if (keys.length === 0) {\n throw new RPError({\n printf: [\"no valid key found in issuer's jwks_uri for key parameters %j\", def],\n jwks: keystore,\n });\n }\n if (!allowMulti) {\n if (keys.length !== 1) {\n throw new RPError({\n printf: [\"multiple matching keys found in issuer's jwks_uri for key parameters %j, kid must be provided in this case\", def],\n jwks: keystore,\n });\n }\n cache.set(defHash, true);\n }\n return keys[0];\n}, 'issuer.key is not only a private API, it is also deprecated');\n\nmodule.exports = Issuer;\n","const REGISTRY = new Map();\n\nmodule.exports = REGISTRY;\n","/* eslint-disable no-underscore-dangle */\n\nconst url = require('url');\nconst { format } = require('util');\n\nconst cloneDeep = require('./helpers/deep_clone');\nconst { RPError, OPError } = require('./errors');\nconst { BaseClient } = require('./client');\nconst { random, codeChallenge } = require('./helpers/generators');\nconst pick = require('./helpers/pick');\nconst { resolveResponseType, resolveRedirectUri } = require('./helpers/client');\n\nfunction verified(err, user, info = {}) {\n if (err) {\n this.error(err);\n } else if (!user) {\n this.fail(info);\n } else {\n this.success(user, info);\n }\n}\n\n/**\n * @name constructor\n * @api public\n */\nfunction OpenIDConnectStrategy({\n client,\n params = {},\n passReqToCallback = false,\n sessionKey,\n usePKCE = false,\n} = {}, verify) {\n if (!(client instanceof BaseClient)) {\n throw new TypeError('client must be an instance of openid-client Client');\n }\n\n if (typeof verify !== 'function') {\n throw new TypeError('verify callback must be a function');\n }\n\n if (!client.issuer || !client.issuer.issuer) {\n throw new TypeError('client must have an issuer with an identifier');\n }\n\n this._client = client;\n this._issuer = client.issuer;\n this._verify = verify;\n this._passReqToCallback = passReqToCallback;\n this._usePKCE = usePKCE;\n this._key = sessionKey || `oidc:${url.parse(this._issuer.issuer).hostname}`;\n this._params = cloneDeep(params);\n\n if (this._usePKCE === true) {\n const supportedMethods = this._issuer.code_challenge_methods_supported;\n if (!Array.isArray(supportedMethods)) {\n throw new TypeError('code_challenge_methods_supported is not properly set on issuer');\n }\n if (supportedMethods.includes('S256')) {\n this._usePKCE = 'S256';\n } else if (supportedMethods.includes('plain')) {\n this._usePKCE = 'plain';\n } else {\n throw new TypeError('neither supported code_challenge_method is supported by the issuer');\n }\n } else if (typeof this._usePKCE === 'string' && !['plain', 'S256'].includes(this._usePKCE)) {\n throw new TypeError(`${this._usePKCE} is not valid/implemented PKCE code_challenge_method`);\n }\n\n this.name = url.parse(client.issuer.issuer).hostname;\n\n if (!this._params.response_type) this._params.response_type = resolveResponseType.call(client);\n if (!this._params.redirect_uri) this._params.redirect_uri = resolveRedirectUri.call(client);\n if (!this._params.scope) this._params.scope = 'openid';\n}\n\nOpenIDConnectStrategy.prototype.authenticate = function authenticate(req, options) {\n (async () => {\n const client = this._client;\n if (!req.session) {\n throw new TypeError('authentication requires session support');\n }\n const reqParams = client.callbackParams(req);\n const sessionKey = this._key;\n\n /* start authentication request */\n if (Object.keys(reqParams).length === 0) {\n // provide options object with extra authentication parameters\n const params = {\n state: random(),\n ...this._params,\n ...options,\n };\n\n if (!params.nonce && params.response_type.includes('id_token')) {\n params.nonce = random();\n }\n\n req.session[sessionKey] = pick(params, 'nonce', 'state', 'max_age', 'response_type');\n\n if (this._usePKCE) {\n const verifier = random();\n req.session[sessionKey].code_verifier = verifier;\n\n switch (this._usePKCE) { // eslint-disable-line default-case\n case 'S256':\n params.code_challenge = codeChallenge(verifier);\n params.code_challenge_method = 'S256';\n break;\n case 'plain':\n params.code_challenge = verifier;\n break;\n }\n }\n\n this.redirect(client.authorizationUrl(params));\n return;\n }\n /* end authentication request */\n\n /* start authentication response */\n\n const session = req.session[sessionKey];\n if (Object.keys(session || {}).length === 0) {\n throw new Error(format('did not find expected authorization request details in session, req.session[\"%s\"] is %j', sessionKey, session));\n }\n\n const {\n state, nonce, max_age: maxAge, code_verifier: codeVerifier, response_type: responseType,\n } = session;\n\n try {\n delete req.session[sessionKey];\n } catch (err) {}\n\n const opts = {\n redirect_uri: this._params.redirect_uri,\n ...options,\n };\n\n const checks = {\n state,\n nonce,\n max_age: maxAge,\n code_verifier: codeVerifier,\n response_type: responseType,\n };\n\n const tokenset = await client.callback(opts.redirect_uri, reqParams, checks);\n\n const passReq = this._passReqToCallback;\n const loadUserinfo = this._verify.length > (passReq ? 3 : 2) && client.issuer.userinfo_endpoint;\n\n const args = [tokenset, verified.bind(this)];\n\n if (loadUserinfo) {\n if (!tokenset.access_token) {\n throw new RPError({\n message: 'expected access_token to be returned when asking for userinfo in verify callback',\n tokenset,\n });\n }\n const userinfo = await client.userinfo(tokenset);\n args.splice(1, 0, userinfo);\n }\n\n if (passReq) {\n args.unshift(req);\n }\n\n this._verify(...args);\n /* end authentication response */\n })().catch((error) => {\n if (\n (error instanceof OPError && error.error !== 'server_error' && !error.error.startsWith('invalid'))\n || error instanceof RPError\n ) {\n this.fail(error);\n } else {\n this.error(error);\n }\n });\n};\n\nmodule.exports = OpenIDConnectStrategy;\n","const base64url = require('base64url');\n\nconst now = require('./helpers/unix_timestamp');\n\nclass TokenSet {\n /**\n * @name constructor\n * @api public\n */\n constructor(values) {\n Object.assign(this, values);\n }\n\n /**\n * @name expires_in=\n * @api public\n */\n set expires_in(value) { // eslint-disable-line camelcase\n this.expires_at = now() + Number(value);\n }\n\n /**\n * @name expires_in\n * @api public\n */\n get expires_in() { // eslint-disable-line camelcase\n return Math.max.apply(null, [this.expires_at - now(), 0]);\n }\n\n /**\n * @name expired\n * @api public\n */\n expired() {\n return this.expires_in === 0;\n }\n\n /**\n * @name claims\n * @api public\n */\n claims() {\n if (!this.id_token) {\n throw new TypeError('id_token not present in TokenSet');\n }\n\n return JSON.parse(base64url.decode(this.id_token.split('.')[1]));\n }\n}\n\nmodule.exports = TokenSet;\n","'use strict';\nconst pSome = require('p-some');\nconst PCancelable = require('p-cancelable');\n\nmodule.exports = (iterable, options) => {\n\tconst anyCancelable = pSome(iterable, {...options, count: 1});\n\n\treturn PCancelable.fn(async onCancel => {\n\t\tonCancel(() => {\n\t\t\tanyCancelable.cancel();\n\t\t});\n\n\t\tconst [value] = await anyCancelable;\n\t\treturn value;\n\t})();\n};\n\nmodule.exports.AggregateError = pSome.AggregateError;\n","'use strict';\n\nclass CancelError extends Error {\n\tconstructor(reason) {\n\t\tsuper(reason || 'Promise was canceled');\n\t\tthis.name = 'CancelError';\n\t}\n\n\tget isCanceled() {\n\t\treturn true;\n\t}\n}\n\nclass PCancelable {\n\tstatic fn(userFn) {\n\t\treturn (...arguments_) => {\n\t\t\treturn new PCancelable((resolve, reject, onCancel) => {\n\t\t\t\targuments_.push(onCancel);\n\t\t\t\t// eslint-disable-next-line promise/prefer-await-to-then\n\t\t\t\tuserFn(...arguments_).then(resolve, reject);\n\t\t\t});\n\t\t};\n\t}\n\n\tconstructor(executor) {\n\t\tthis._cancelHandlers = [];\n\t\tthis._isPending = true;\n\t\tthis._isCanceled = false;\n\t\tthis._rejectOnCancel = true;\n\n\t\tthis._promise = new Promise((resolve, reject) => {\n\t\t\tthis._reject = reject;\n\n\t\t\tconst onResolve = value => {\n\t\t\t\tif (!this._isCanceled || !onCancel.shouldReject) {\n\t\t\t\t\tthis._isPending = false;\n\t\t\t\t\tresolve(value);\n\t\t\t\t}\n\t\t\t};\n\n\t\t\tconst onReject = error => {\n\t\t\t\tthis._isPending = false;\n\t\t\t\treject(error);\n\t\t\t};\n\n\t\t\tconst onCancel = handler => {\n\t\t\t\tif (!this._isPending) {\n\t\t\t\t\tthrow new Error('The `onCancel` handler was attached after the promise settled.');\n\t\t\t\t}\n\n\t\t\t\tthis._cancelHandlers.push(handler);\n\t\t\t};\n\n\t\t\tObject.defineProperties(onCancel, {\n\t\t\t\tshouldReject: {\n\t\t\t\t\tget: () => this._rejectOnCancel,\n\t\t\t\t\tset: boolean => {\n\t\t\t\t\t\tthis._rejectOnCancel = boolean;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t});\n\n\t\t\treturn executor(onResolve, onReject, onCancel);\n\t\t});\n\t}\n\n\tthen(onFulfilled, onRejected) {\n\t\t// eslint-disable-next-line promise/prefer-await-to-then\n\t\treturn this._promise.then(onFulfilled, onRejected);\n\t}\n\n\tcatch(onRejected) {\n\t\treturn this._promise.catch(onRejected);\n\t}\n\n\tfinally(onFinally) {\n\t\treturn this._promise.finally(onFinally);\n\t}\n\n\tcancel(reason) {\n\t\tif (!this._isPending || this._isCanceled) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis._isCanceled = true;\n\n\t\tif (this._cancelHandlers.length > 0) {\n\t\t\ttry {\n\t\t\t\tfor (const handler of this._cancelHandlers) {\n\t\t\t\t\thandler();\n\t\t\t\t}\n\t\t\t} catch (error) {\n\t\t\t\tthis._reject(error);\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\n\t\tif (this._rejectOnCancel) {\n\t\t\tthis._reject(new CancelError(reason));\n\t\t}\n\t}\n\n\tget isCanceled() {\n\t\treturn this._isCanceled;\n\t}\n}\n\nObject.setPrototypeOf(PCancelable.prototype, Promise.prototype);\n\nmodule.exports = PCancelable;\nmodule.exports.CancelError = CancelError;\n","'use strict';\nconst AggregateError = require('aggregate-error');\nconst PCancelable = require('p-cancelable');\n\nclass FilterError extends Error { }\n\nconst pSome = (iterable, options) => new PCancelable((resolve, reject, onCancel) => {\n\tconst {\n\t\tcount,\n\t\tfilter = () => true\n\t} = options;\n\n\tif (!Number.isFinite(count)) {\n\t\treject(new TypeError(`Expected a finite number, got ${typeof options.count}`));\n\t\treturn;\n\t}\n\n\tconst values = [];\n\tconst errors = [];\n\tlet elementCount = 0;\n\tlet isSettled = false;\n\n\tconst completed = new Set();\n\tconst maybeSettle = () => {\n\t\tif (values.length === count) {\n\t\t\tresolve(values);\n\t\t\tisSettled = true;\n\t\t}\n\n\t\tif (elementCount - errors.length < count) {\n\t\t\treject(new AggregateError(errors));\n\t\t\tisSettled = true;\n\t\t}\n\n\t\treturn isSettled;\n\t};\n\n\tconst cancelPending = () => {\n\t\tfor (const promise of iterable) {\n\t\t\tif (!completed.has(promise) && typeof promise.cancel === 'function') {\n\t\t\t\tpromise.cancel();\n\t\t\t}\n\t\t}\n\t};\n\n\tonCancel(cancelPending);\n\n\tfor (const element of iterable) {\n\t\telementCount++;\n\n\t\t(async () => {\n\t\t\ttry {\n\t\t\t\tconst value = await element;\n\n\t\t\t\tif (isSettled) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tif (!filter(value)) {\n\t\t\t\t\tthrow new FilterError('Value does not satisfy filter');\n\t\t\t\t}\n\n\t\t\t\tvalues.push(value);\n\t\t\t} catch (error) {\n\t\t\t\terrors.push(error);\n\t\t\t} finally {\n\t\t\t\tcompleted.add(element);\n\n\t\t\t\tif (!isSettled && maybeSettle()) {\n\t\t\t\t\tcancelPending();\n\t\t\t\t}\n\t\t\t}\n\t\t})();\n\t}\n\n\tif (count > elementCount) {\n\t\treject(new RangeError(`Expected input to contain at least ${options.count} items, but contains ${elementCount} items`));\n\t\tcancelPending();\n\t}\n});\n\nmodule.exports = pSome;\nmodule.exports.AggregateError = AggregateError;\nmodule.exports.FilterError = FilterError;\n","'use strict';\n\nfunction posix(path) {\n\treturn path.charAt(0) === '/';\n}\n\nfunction win32(path) {\n\t// https://github.com/nodejs/node/blob/b3fcc245fb25539909ef1d5eaa01dbf92e168633/lib/path.js#L56\n\tvar splitDeviceRe = /^([a-zA-Z]:|[\\\\\\/]{2}[^\\\\\\/]+[\\\\\\/]+[^\\\\\\/]+)?([\\\\\\/])?([\\s\\S]*?)$/;\n\tvar result = splitDeviceRe.exec(path);\n\tvar device = result[1] || '';\n\tvar isUnc = Boolean(device && device.charAt(1) !== ':');\n\n\t// UNC paths are always absolute\n\treturn Boolean(result[2] || isUnc);\n}\n\nmodule.exports = process.platform === 'win32' ? win32 : posix;\nmodule.exports.posix = posix;\nmodule.exports.win32 = win32;\n","// Generated by CoffeeScript 1.12.2\n(function() {\n var getNanoSeconds, hrtime, loadTime, moduleLoadTime, nodeLoadTime, upTime;\n\n if ((typeof performance !== \"undefined\" && performance !== null) && performance.now) {\n module.exports = function() {\n return performance.now();\n };\n } else if ((typeof process !== \"undefined\" && process !== null) && process.hrtime) {\n module.exports = function() {\n return (getNanoSeconds() - nodeLoadTime) / 1e6;\n };\n hrtime = process.hrtime;\n getNanoSeconds = function() {\n var hr;\n hr = hrtime();\n return hr[0] * 1e9 + hr[1];\n };\n moduleLoadTime = getNanoSeconds();\n upTime = process.uptime() * 1e9;\n nodeLoadTime = moduleLoadTime - upTime;\n } else if (Date.now) {\n module.exports = function() {\n return Date.now() - loadTime;\n };\n loadTime = Date.now();\n } else {\n module.exports = function() {\n return new Date().getTime() - loadTime;\n };\n loadTime = new Date().getTime();\n }\n\n}).call(this);\n\n//# sourceMappingURL=performance-now.js.map\n","'use strict';\nmodule.exports = (url, opts) => {\n\tif (typeof url !== 'string') {\n\t\tthrow new TypeError(`Expected \\`url\\` to be of type \\`string\\`, got \\`${typeof url}\\``);\n\t}\n\n\turl = url.trim();\n\topts = Object.assign({https: false}, opts);\n\n\tif (/^\\.*\\/|^(?!localhost)\\w+:/.test(url)) {\n\t\treturn url;\n\t}\n\n\treturn url.replace(/^(?!(?:\\w+:)?\\/\\/)/, opts.https ? 'https://' : 'http://');\n};\n","/*eslint no-var:0, prefer-arrow-callback: 0, object-shorthand: 0 */\n'use strict';\n\n\nvar Punycode = require('punycode');\n\n\nvar internals = {};\n\n\n//\n// Read rules from file.\n//\ninternals.rules = require('./data/rules.json').map(function (rule) {\n\n return {\n rule: rule,\n suffix: rule.replace(/^(\\*\\.|\\!)/, ''),\n punySuffix: -1,\n wildcard: rule.charAt(0) === '*',\n exception: rule.charAt(0) === '!'\n };\n});\n\n\n//\n// Check is given string ends with `suffix`.\n//\ninternals.endsWith = function (str, suffix) {\n\n return str.indexOf(suffix, str.length - suffix.length) !== -1;\n};\n\n\n//\n// Find rule for a given domain.\n//\ninternals.findRule = function (domain) {\n\n var punyDomain = Punycode.toASCII(domain);\n return internals.rules.reduce(function (memo, rule) {\n\n if (rule.punySuffix === -1){\n rule.punySuffix = Punycode.toASCII(rule.suffix);\n }\n if (!internals.endsWith(punyDomain, '.' + rule.punySuffix) && punyDomain !== rule.punySuffix) {\n return memo;\n }\n // This has been commented out as it never seems to run. This is because\n // sub tlds always appear after their parents and we never find a shorter\n // match.\n //if (memo) {\n // var memoSuffix = Punycode.toASCII(memo.suffix);\n // if (memoSuffix.length >= punySuffix.length) {\n // return memo;\n // }\n //}\n return rule;\n }, null);\n};\n\n\n//\n// Error codes and messages.\n//\nexports.errorCodes = {\n DOMAIN_TOO_SHORT: 'Domain name too short.',\n DOMAIN_TOO_LONG: 'Domain name too long. It should be no more than 255 chars.',\n LABEL_STARTS_WITH_DASH: 'Domain name label can not start with a dash.',\n LABEL_ENDS_WITH_DASH: 'Domain name label can not end with a dash.',\n LABEL_TOO_LONG: 'Domain name label should be at most 63 chars long.',\n LABEL_TOO_SHORT: 'Domain name label should be at least 1 character long.',\n LABEL_INVALID_CHARS: 'Domain name label can only contain alphanumeric characters or dashes.'\n};\n\n\n//\n// Validate domain name and throw if not valid.\n//\n// From wikipedia:\n//\n// Hostnames are composed of series of labels concatenated with dots, as are all\n// domain names. Each label must be between 1 and 63 characters long, and the\n// entire hostname (including the delimiting dots) has a maximum of 255 chars.\n//\n// Allowed chars:\n//\n// * `a-z`\n// * `0-9`\n// * `-` but not as a starting or ending character\n// * `.` as a separator for the textual portions of a domain name\n//\n// * http://en.wikipedia.org/wiki/Domain_name\n// * http://en.wikipedia.org/wiki/Hostname\n//\ninternals.validate = function (input) {\n\n // Before we can validate we need to take care of IDNs with unicode chars.\n var ascii = Punycode.toASCII(input);\n\n if (ascii.length < 1) {\n return 'DOMAIN_TOO_SHORT';\n }\n if (ascii.length > 255) {\n return 'DOMAIN_TOO_LONG';\n }\n\n // Check each part's length and allowed chars.\n var labels = ascii.split('.');\n var label;\n\n for (var i = 0; i < labels.length; ++i) {\n label = labels[i];\n if (!label.length) {\n return 'LABEL_TOO_SHORT';\n }\n if (label.length > 63) {\n return 'LABEL_TOO_LONG';\n }\n if (label.charAt(0) === '-') {\n return 'LABEL_STARTS_WITH_DASH';\n }\n if (label.charAt(label.length - 1) === '-') {\n return 'LABEL_ENDS_WITH_DASH';\n }\n if (!/^[a-z0-9\\-]+$/.test(label)) {\n return 'LABEL_INVALID_CHARS';\n }\n }\n};\n\n\n//\n// Public API\n//\n\n\n//\n// Parse domain.\n//\nexports.parse = function (input) {\n\n if (typeof input !== 'string') {\n throw new TypeError('Domain name must be a string.');\n }\n\n // Force domain to lowercase.\n var domain = input.slice(0).toLowerCase();\n\n // Handle FQDN.\n // TODO: Simply remove trailing dot?\n if (domain.charAt(domain.length - 1) === '.') {\n domain = domain.slice(0, domain.length - 1);\n }\n\n // Validate and sanitise input.\n var error = internals.validate(domain);\n if (error) {\n return {\n input: input,\n error: {\n message: exports.errorCodes[error],\n code: error\n }\n };\n }\n\n var parsed = {\n input: input,\n tld: null,\n sld: null,\n domain: null,\n subdomain: null,\n listed: false\n };\n\n var domainParts = domain.split('.');\n\n // Non-Internet TLD\n if (domainParts[domainParts.length - 1] === 'local') {\n return parsed;\n }\n\n var handlePunycode = function () {\n\n if (!/xn--/.test(domain)) {\n return parsed;\n }\n if (parsed.domain) {\n parsed.domain = Punycode.toASCII(parsed.domain);\n }\n if (parsed.subdomain) {\n parsed.subdomain = Punycode.toASCII(parsed.subdomain);\n }\n return parsed;\n };\n\n var rule = internals.findRule(domain);\n\n // Unlisted tld.\n if (!rule) {\n if (domainParts.length < 2) {\n return parsed;\n }\n parsed.tld = domainParts.pop();\n parsed.sld = domainParts.pop();\n parsed.domain = [parsed.sld, parsed.tld].join('.');\n if (domainParts.length) {\n parsed.subdomain = domainParts.pop();\n }\n return handlePunycode();\n }\n\n // At this point we know the public suffix is listed.\n parsed.listed = true;\n\n var tldParts = rule.suffix.split('.');\n var privateParts = domainParts.slice(0, domainParts.length - tldParts.length);\n\n if (rule.exception) {\n privateParts.push(tldParts.shift());\n }\n\n parsed.tld = tldParts.join('.');\n\n if (!privateParts.length) {\n return handlePunycode();\n }\n\n if (rule.wildcard) {\n tldParts.unshift(privateParts.pop());\n parsed.tld = tldParts.join('.');\n }\n\n if (!privateParts.length) {\n return handlePunycode();\n }\n\n parsed.sld = privateParts.pop();\n parsed.domain = [parsed.sld, parsed.tld].join('.');\n\n if (privateParts.length) {\n parsed.subdomain = privateParts.join('.');\n }\n\n return handlePunycode();\n};\n\n\n//\n// Get domain.\n//\nexports.get = function (domain) {\n\n if (!domain) {\n return null;\n }\n return exports.parse(domain).domain || null;\n};\n\n\n//\n// Check whether domain belongs to a known public suffix.\n//\nexports.isValid = function (domain) {\n\n var parsed = exports.parse(domain);\n return Boolean(parsed.domain && parsed.listed);\n};\n","var once = require('once')\nvar eos = require('end-of-stream')\nvar fs = require('fs') // we only need fs to get the ReadStream and WriteStream prototypes\n\nvar noop = function () {}\nvar ancient = /^v?\\.0/.test(process.version)\n\nvar isFn = function (fn) {\n return typeof fn === 'function'\n}\n\nvar isFS = function (stream) {\n if (!ancient) return false // newer node version do not need to care about fs is a special way\n if (!fs) return false // browser\n return (stream instanceof (fs.ReadStream || noop) || stream instanceof (fs.WriteStream || noop)) && isFn(stream.close)\n}\n\nvar isRequest = function (stream) {\n return stream.setHeader && isFn(stream.abort)\n}\n\nvar destroyer = function (stream, reading, writing, callback) {\n callback = once(callback)\n\n var closed = false\n stream.on('close', function () {\n closed = true\n })\n\n eos(stream, {readable: reading, writable: writing}, function (err) {\n if (err) return callback(err)\n closed = true\n callback()\n })\n\n var destroyed = false\n return function (err) {\n if (closed) return\n if (destroyed) return\n destroyed = true\n\n if (isFS(stream)) return stream.close(noop) // use close for fs streams to avoid fd leaks\n if (isRequest(stream)) return stream.abort() // request.destroy just do .end - .abort is what we want\n\n if (isFn(stream.destroy)) return stream.destroy()\n\n callback(err || new Error('stream was destroyed'))\n }\n}\n\nvar call = function (fn) {\n fn()\n}\n\nvar pipe = function (from, to) {\n return from.pipe(to)\n}\n\nvar pump = function () {\n var streams = Array.prototype.slice.call(arguments)\n var callback = isFn(streams[streams.length - 1] || noop) && streams.pop() || noop\n\n if (Array.isArray(streams[0])) streams = streams[0]\n if (streams.length < 2) throw new Error('pump requires two streams per minimum')\n\n var error\n var destroys = streams.map(function (stream, i) {\n var reading = i < streams.length - 1\n var writing = i > 0\n return destroyer(stream, reading, writing, function (err) {\n if (!error) error = err\n if (err) destroys.forEach(call)\n if (reading) return\n destroys.forEach(call)\n callback(error)\n })\n })\n\n return streams.reduce(pipe)\n}\n\nmodule.exports = pump\n","'use strict';\n\nvar replace = String.prototype.replace;\nvar percentTwenties = /%20/g;\n\nvar Format = {\n RFC1738: 'RFC1738',\n RFC3986: 'RFC3986'\n};\n\nmodule.exports = {\n 'default': Format.RFC3986,\n formatters: {\n RFC1738: function (value) {\n return replace.call(value, percentTwenties, '+');\n },\n RFC3986: function (value) {\n return String(value);\n }\n },\n RFC1738: Format.RFC1738,\n RFC3986: Format.RFC3986\n};\n","'use strict';\n\nvar stringify = require('./stringify');\nvar parse = require('./parse');\nvar formats = require('./formats');\n\nmodule.exports = {\n formats: formats,\n parse: parse,\n stringify: stringify\n};\n","'use strict';\n\nvar utils = require('./utils');\n\nvar has = Object.prototype.hasOwnProperty;\nvar isArray = Array.isArray;\n\nvar defaults = {\n allowDots: false,\n allowPrototypes: false,\n allowSparse: false,\n arrayLimit: 20,\n charset: 'utf-8',\n charsetSentinel: false,\n comma: false,\n decoder: utils.decode,\n delimiter: '&',\n depth: 5,\n ignoreQueryPrefix: false,\n interpretNumericEntities: false,\n parameterLimit: 1000,\n parseArrays: true,\n plainObjects: false,\n strictNullHandling: false\n};\n\nvar interpretNumericEntities = function (str) {\n return str.replace(/&#(\\d+);/g, function ($0, numberStr) {\n return String.fromCharCode(parseInt(numberStr, 10));\n });\n};\n\nvar parseArrayValue = function (val, options) {\n if (val && typeof val === 'string' && options.comma && val.indexOf(',') > -1) {\n return val.split(',');\n }\n\n return val;\n};\n\n// This is what browsers will submit when the ✓ character occurs in an\n// application/x-www-form-urlencoded body and the encoding of the page containing\n// the form is iso-8859-1, or when the submitted form has an accept-charset\n// attribute of iso-8859-1. Presumably also with other charsets that do not contain\n// the ✓ character, such as us-ascii.\nvar isoSentinel = 'utf8=%26%2310003%3B'; // encodeURIComponent('✓')\n\n// These are the percent-encoded utf-8 octets representing a checkmark, indicating that the request actually is utf-8 encoded.\nvar charsetSentinel = 'utf8=%E2%9C%93'; // encodeURIComponent('✓')\n\nvar parseValues = function parseQueryStringValues(str, options) {\n var obj = {};\n var cleanStr = options.ignoreQueryPrefix ? str.replace(/^\\?/, '') : str;\n var limit = options.parameterLimit === Infinity ? undefined : options.parameterLimit;\n var parts = cleanStr.split(options.delimiter, limit);\n var skipIndex = -1; // Keep track of where the utf8 sentinel was found\n var i;\n\n var charset = options.charset;\n if (options.charsetSentinel) {\n for (i = 0; i < parts.length; ++i) {\n if (parts[i].indexOf('utf8=') === 0) {\n if (parts[i] === charsetSentinel) {\n charset = 'utf-8';\n } else if (parts[i] === isoSentinel) {\n charset = 'iso-8859-1';\n }\n skipIndex = i;\n i = parts.length; // The eslint settings do not allow break;\n }\n }\n }\n\n for (i = 0; i < parts.length; ++i) {\n if (i === skipIndex) {\n continue;\n }\n var part = parts[i];\n\n var bracketEqualsPos = part.indexOf(']=');\n var pos = bracketEqualsPos === -1 ? part.indexOf('=') : bracketEqualsPos + 1;\n\n var key, val;\n if (pos === -1) {\n key = options.decoder(part, defaults.decoder, charset, 'key');\n val = options.strictNullHandling ? null : '';\n } else {\n key = options.decoder(part.slice(0, pos), defaults.decoder, charset, 'key');\n val = utils.maybeMap(\n parseArrayValue(part.slice(pos + 1), options),\n function (encodedVal) {\n return options.decoder(encodedVal, defaults.decoder, charset, 'value');\n }\n );\n }\n\n if (val && options.interpretNumericEntities && charset === 'iso-8859-1') {\n val = interpretNumericEntities(val);\n }\n\n if (part.indexOf('[]=') > -1) {\n val = isArray(val) ? [val] : val;\n }\n\n if (has.call(obj, key)) {\n obj[key] = utils.combine(obj[key], val);\n } else {\n obj[key] = val;\n }\n }\n\n return obj;\n};\n\nvar parseObject = function (chain, val, options, valuesParsed) {\n var leaf = valuesParsed ? val : parseArrayValue(val, options);\n\n for (var i = chain.length - 1; i >= 0; --i) {\n var obj;\n var root = chain[i];\n\n if (root === '[]' && options.parseArrays) {\n obj = [].concat(leaf);\n } else {\n obj = options.plainObjects ? Object.create(null) : {};\n var cleanRoot = root.charAt(0) === '[' && root.charAt(root.length - 1) === ']' ? root.slice(1, -1) : root;\n var index = parseInt(cleanRoot, 10);\n if (!options.parseArrays && cleanRoot === '') {\n obj = { 0: leaf };\n } else if (\n !isNaN(index)\n && root !== cleanRoot\n && String(index) === cleanRoot\n && index >= 0\n && (options.parseArrays && index <= options.arrayLimit)\n ) {\n obj = [];\n obj[index] = leaf;\n } else {\n obj[cleanRoot] = leaf;\n }\n }\n\n leaf = obj;\n }\n\n return leaf;\n};\n\nvar parseKeys = function parseQueryStringKeys(givenKey, val, options, valuesParsed) {\n if (!givenKey) {\n return;\n }\n\n // Transform dot notation to bracket notation\n var key = options.allowDots ? givenKey.replace(/\\.([^.[]+)/g, '[$1]') : givenKey;\n\n // The regex chunks\n\n var brackets = /(\\[[^[\\]]*])/;\n var child = /(\\[[^[\\]]*])/g;\n\n // Get the parent\n\n var segment = options.depth > 0 && brackets.exec(key);\n var parent = segment ? key.slice(0, segment.index) : key;\n\n // Stash the parent if it exists\n\n var keys = [];\n if (parent) {\n // If we aren't using plain objects, optionally prefix keys that would overwrite object prototype properties\n if (!options.plainObjects && has.call(Object.prototype, parent)) {\n if (!options.allowPrototypes) {\n return;\n }\n }\n\n keys.push(parent);\n }\n\n // Loop through children appending to the array until we hit depth\n\n var i = 0;\n while (options.depth > 0 && (segment = child.exec(key)) !== null && i < options.depth) {\n i += 1;\n if (!options.plainObjects && has.call(Object.prototype, segment[1].slice(1, -1))) {\n if (!options.allowPrototypes) {\n return;\n }\n }\n keys.push(segment[1]);\n }\n\n // If there's a remainder, just add whatever is left\n\n if (segment) {\n keys.push('[' + key.slice(segment.index) + ']');\n }\n\n return parseObject(keys, val, options, valuesParsed);\n};\n\nvar normalizeParseOptions = function normalizeParseOptions(opts) {\n if (!opts) {\n return defaults;\n }\n\n if (opts.decoder !== null && opts.decoder !== undefined && typeof opts.decoder !== 'function') {\n throw new TypeError('Decoder has to be a function.');\n }\n\n if (typeof opts.charset !== 'undefined' && opts.charset !== 'utf-8' && opts.charset !== 'iso-8859-1') {\n throw new TypeError('The charset option must be either utf-8, iso-8859-1, or undefined');\n }\n var charset = typeof opts.charset === 'undefined' ? defaults.charset : opts.charset;\n\n return {\n allowDots: typeof opts.allowDots === 'undefined' ? defaults.allowDots : !!opts.allowDots,\n allowPrototypes: typeof opts.allowPrototypes === 'boolean' ? opts.allowPrototypes : defaults.allowPrototypes,\n allowSparse: typeof opts.allowSparse === 'boolean' ? opts.allowSparse : defaults.allowSparse,\n arrayLimit: typeof opts.arrayLimit === 'number' ? opts.arrayLimit : defaults.arrayLimit,\n charset: charset,\n charsetSentinel: typeof opts.charsetSentinel === 'boolean' ? opts.charsetSentinel : defaults.charsetSentinel,\n comma: typeof opts.comma === 'boolean' ? opts.comma : defaults.comma,\n decoder: typeof opts.decoder === 'function' ? opts.decoder : defaults.decoder,\n delimiter: typeof opts.delimiter === 'string' || utils.isRegExp(opts.delimiter) ? opts.delimiter : defaults.delimiter,\n // eslint-disable-next-line no-implicit-coercion, no-extra-parens\n depth: (typeof opts.depth === 'number' || opts.depth === false) ? +opts.depth : defaults.depth,\n ignoreQueryPrefix: opts.ignoreQueryPrefix === true,\n interpretNumericEntities: typeof opts.interpretNumericEntities === 'boolean' ? opts.interpretNumericEntities : defaults.interpretNumericEntities,\n parameterLimit: typeof opts.parameterLimit === 'number' ? opts.parameterLimit : defaults.parameterLimit,\n parseArrays: opts.parseArrays !== false,\n plainObjects: typeof opts.plainObjects === 'boolean' ? opts.plainObjects : defaults.plainObjects,\n strictNullHandling: typeof opts.strictNullHandling === 'boolean' ? opts.strictNullHandling : defaults.strictNullHandling\n };\n};\n\nmodule.exports = function (str, opts) {\n var options = normalizeParseOptions(opts);\n\n if (str === '' || str === null || typeof str === 'undefined') {\n return options.plainObjects ? Object.create(null) : {};\n }\n\n var tempObj = typeof str === 'string' ? parseValues(str, options) : str;\n var obj = options.plainObjects ? Object.create(null) : {};\n\n // Iterate over the keys and setup the new object\n\n var keys = Object.keys(tempObj);\n for (var i = 0; i < keys.length; ++i) {\n var key = keys[i];\n var newObj = parseKeys(key, tempObj[key], options, typeof str === 'string');\n obj = utils.merge(obj, newObj, options);\n }\n\n if (options.allowSparse === true) {\n return obj;\n }\n\n return utils.compact(obj);\n};\n","'use strict';\n\nvar getSideChannel = require('side-channel');\nvar utils = require('./utils');\nvar formats = require('./formats');\nvar has = Object.prototype.hasOwnProperty;\n\nvar arrayPrefixGenerators = {\n brackets: function brackets(prefix) {\n return prefix + '[]';\n },\n comma: 'comma',\n indices: function indices(prefix, key) {\n return prefix + '[' + key + ']';\n },\n repeat: function repeat(prefix) {\n return prefix;\n }\n};\n\nvar isArray = Array.isArray;\nvar push = Array.prototype.push;\nvar pushToArray = function (arr, valueOrArray) {\n push.apply(arr, isArray(valueOrArray) ? valueOrArray : [valueOrArray]);\n};\n\nvar toISO = Date.prototype.toISOString;\n\nvar defaultFormat = formats['default'];\nvar defaults = {\n addQueryPrefix: false,\n allowDots: false,\n charset: 'utf-8',\n charsetSentinel: false,\n delimiter: '&',\n encode: true,\n encoder: utils.encode,\n encodeValuesOnly: false,\n format: defaultFormat,\n formatter: formats.formatters[defaultFormat],\n // deprecated\n indices: false,\n serializeDate: function serializeDate(date) {\n return toISO.call(date);\n },\n skipNulls: false,\n strictNullHandling: false\n};\n\nvar isNonNullishPrimitive = function isNonNullishPrimitive(v) {\n return typeof v === 'string'\n || typeof v === 'number'\n || typeof v === 'boolean'\n || typeof v === 'symbol'\n || typeof v === 'bigint';\n};\n\nvar stringify = function stringify(\n object,\n prefix,\n generateArrayPrefix,\n strictNullHandling,\n skipNulls,\n encoder,\n filter,\n sort,\n allowDots,\n serializeDate,\n format,\n formatter,\n encodeValuesOnly,\n charset,\n sideChannel\n) {\n var obj = object;\n\n if (sideChannel.has(object)) {\n throw new RangeError('Cyclic object value');\n }\n\n if (typeof filter === 'function') {\n obj = filter(prefix, obj);\n } else if (obj instanceof Date) {\n obj = serializeDate(obj);\n } else if (generateArrayPrefix === 'comma' && isArray(obj)) {\n obj = utils.maybeMap(obj, function (value) {\n if (value instanceof Date) {\n return serializeDate(value);\n }\n return value;\n });\n }\n\n if (obj === null) {\n if (strictNullHandling) {\n return encoder && !encodeValuesOnly ? encoder(prefix, defaults.encoder, charset, 'key', format) : prefix;\n }\n\n obj = '';\n }\n\n if (isNonNullishPrimitive(obj) || utils.isBuffer(obj)) {\n if (encoder) {\n var keyValue = encodeValuesOnly ? prefix : encoder(prefix, defaults.encoder, charset, 'key', format);\n return [formatter(keyValue) + '=' + formatter(encoder(obj, defaults.encoder, charset, 'value', format))];\n }\n return [formatter(prefix) + '=' + formatter(String(obj))];\n }\n\n var values = [];\n\n if (typeof obj === 'undefined') {\n return values;\n }\n\n var objKeys;\n if (generateArrayPrefix === 'comma' && isArray(obj)) {\n // we need to join elements in\n objKeys = [{ value: obj.length > 0 ? obj.join(',') || null : undefined }];\n } else if (isArray(filter)) {\n objKeys = filter;\n } else {\n var keys = Object.keys(obj);\n objKeys = sort ? keys.sort(sort) : keys;\n }\n\n for (var i = 0; i < objKeys.length; ++i) {\n var key = objKeys[i];\n var value = typeof key === 'object' && key.value !== undefined ? key.value : obj[key];\n\n if (skipNulls && value === null) {\n continue;\n }\n\n var keyPrefix = isArray(obj)\n ? typeof generateArrayPrefix === 'function' ? generateArrayPrefix(prefix, key) : prefix\n : prefix + (allowDots ? '.' + key : '[' + key + ']');\n\n sideChannel.set(object, true);\n var valueSideChannel = getSideChannel();\n pushToArray(values, stringify(\n value,\n keyPrefix,\n generateArrayPrefix,\n strictNullHandling,\n skipNulls,\n encoder,\n filter,\n sort,\n allowDots,\n serializeDate,\n format,\n formatter,\n encodeValuesOnly,\n charset,\n valueSideChannel\n ));\n }\n\n return values;\n};\n\nvar normalizeStringifyOptions = function normalizeStringifyOptions(opts) {\n if (!opts) {\n return defaults;\n }\n\n if (opts.encoder !== null && opts.encoder !== undefined && typeof opts.encoder !== 'function') {\n throw new TypeError('Encoder has to be a function.');\n }\n\n var charset = opts.charset || defaults.charset;\n if (typeof opts.charset !== 'undefined' && opts.charset !== 'utf-8' && opts.charset !== 'iso-8859-1') {\n throw new TypeError('The charset option must be either utf-8, iso-8859-1, or undefined');\n }\n\n var format = formats['default'];\n if (typeof opts.format !== 'undefined') {\n if (!has.call(formats.formatters, opts.format)) {\n throw new TypeError('Unknown format option provided.');\n }\n format = opts.format;\n }\n var formatter = formats.formatters[format];\n\n var filter = defaults.filter;\n if (typeof opts.filter === 'function' || isArray(opts.filter)) {\n filter = opts.filter;\n }\n\n return {\n addQueryPrefix: typeof opts.addQueryPrefix === 'boolean' ? opts.addQueryPrefix : defaults.addQueryPrefix,\n allowDots: typeof opts.allowDots === 'undefined' ? defaults.allowDots : !!opts.allowDots,\n charset: charset,\n charsetSentinel: typeof opts.charsetSentinel === 'boolean' ? opts.charsetSentinel : defaults.charsetSentinel,\n delimiter: typeof opts.delimiter === 'undefined' ? defaults.delimiter : opts.delimiter,\n encode: typeof opts.encode === 'boolean' ? opts.encode : defaults.encode,\n encoder: typeof opts.encoder === 'function' ? opts.encoder : defaults.encoder,\n encodeValuesOnly: typeof opts.encodeValuesOnly === 'boolean' ? opts.encodeValuesOnly : defaults.encodeValuesOnly,\n filter: filter,\n format: format,\n formatter: formatter,\n serializeDate: typeof opts.serializeDate === 'function' ? opts.serializeDate : defaults.serializeDate,\n skipNulls: typeof opts.skipNulls === 'boolean' ? opts.skipNulls : defaults.skipNulls,\n sort: typeof opts.sort === 'function' ? opts.sort : null,\n strictNullHandling: typeof opts.strictNullHandling === 'boolean' ? opts.strictNullHandling : defaults.strictNullHandling\n };\n};\n\nmodule.exports = function (object, opts) {\n var obj = object;\n var options = normalizeStringifyOptions(opts);\n\n var objKeys;\n var filter;\n\n if (typeof options.filter === 'function') {\n filter = options.filter;\n obj = filter('', obj);\n } else if (isArray(options.filter)) {\n filter = options.filter;\n objKeys = filter;\n }\n\n var keys = [];\n\n if (typeof obj !== 'object' || obj === null) {\n return '';\n }\n\n var arrayFormat;\n if (opts && opts.arrayFormat in arrayPrefixGenerators) {\n arrayFormat = opts.arrayFormat;\n } else if (opts && 'indices' in opts) {\n arrayFormat = opts.indices ? 'indices' : 'repeat';\n } else {\n arrayFormat = 'indices';\n }\n\n var generateArrayPrefix = arrayPrefixGenerators[arrayFormat];\n\n if (!objKeys) {\n objKeys = Object.keys(obj);\n }\n\n if (options.sort) {\n objKeys.sort(options.sort);\n }\n\n var sideChannel = getSideChannel();\n for (var i = 0; i < objKeys.length; ++i) {\n var key = objKeys[i];\n\n if (options.skipNulls && obj[key] === null) {\n continue;\n }\n pushToArray(keys, stringify(\n obj[key],\n key,\n generateArrayPrefix,\n options.strictNullHandling,\n options.skipNulls,\n options.encode ? options.encoder : null,\n options.filter,\n options.sort,\n options.allowDots,\n options.serializeDate,\n options.format,\n options.formatter,\n options.encodeValuesOnly,\n options.charset,\n sideChannel\n ));\n }\n\n var joined = keys.join(options.delimiter);\n var prefix = options.addQueryPrefix === true ? '?' : '';\n\n if (options.charsetSentinel) {\n if (options.charset === 'iso-8859-1') {\n // encodeURIComponent('✓'), the \"numeric entity\" representation of a checkmark\n prefix += 'utf8=%26%2310003%3B&';\n } else {\n // encodeURIComponent('✓')\n prefix += 'utf8=%E2%9C%93&';\n }\n }\n\n return joined.length > 0 ? prefix + joined : '';\n};\n","'use strict';\n\nvar formats = require('./formats');\n\nvar has = Object.prototype.hasOwnProperty;\nvar isArray = Array.isArray;\n\nvar hexTable = (function () {\n var array = [];\n for (var i = 0; i < 256; ++i) {\n array.push('%' + ((i < 16 ? '0' : '') + i.toString(16)).toUpperCase());\n }\n\n return array;\n}());\n\nvar compactQueue = function compactQueue(queue) {\n while (queue.length > 1) {\n var item = queue.pop();\n var obj = item.obj[item.prop];\n\n if (isArray(obj)) {\n var compacted = [];\n\n for (var j = 0; j < obj.length; ++j) {\n if (typeof obj[j] !== 'undefined') {\n compacted.push(obj[j]);\n }\n }\n\n item.obj[item.prop] = compacted;\n }\n }\n};\n\nvar arrayToObject = function arrayToObject(source, options) {\n var obj = options && options.plainObjects ? Object.create(null) : {};\n for (var i = 0; i < source.length; ++i) {\n if (typeof source[i] !== 'undefined') {\n obj[i] = source[i];\n }\n }\n\n return obj;\n};\n\nvar merge = function merge(target, source, options) {\n /* eslint no-param-reassign: 0 */\n if (!source) {\n return target;\n }\n\n if (typeof source !== 'object') {\n if (isArray(target)) {\n target.push(source);\n } else if (target && typeof target === 'object') {\n if ((options && (options.plainObjects || options.allowPrototypes)) || !has.call(Object.prototype, source)) {\n target[source] = true;\n }\n } else {\n return [target, source];\n }\n\n return target;\n }\n\n if (!target || typeof target !== 'object') {\n return [target].concat(source);\n }\n\n var mergeTarget = target;\n if (isArray(target) && !isArray(source)) {\n mergeTarget = arrayToObject(target, options);\n }\n\n if (isArray(target) && isArray(source)) {\n source.forEach(function (item, i) {\n if (has.call(target, i)) {\n var targetItem = target[i];\n if (targetItem && typeof targetItem === 'object' && item && typeof item === 'object') {\n target[i] = merge(targetItem, item, options);\n } else {\n target.push(item);\n }\n } else {\n target[i] = item;\n }\n });\n return target;\n }\n\n return Object.keys(source).reduce(function (acc, key) {\n var value = source[key];\n\n if (has.call(acc, key)) {\n acc[key] = merge(acc[key], value, options);\n } else {\n acc[key] = value;\n }\n return acc;\n }, mergeTarget);\n};\n\nvar assign = function assignSingleSource(target, source) {\n return Object.keys(source).reduce(function (acc, key) {\n acc[key] = source[key];\n return acc;\n }, target);\n};\n\nvar decode = function (str, decoder, charset) {\n var strWithoutPlus = str.replace(/\\+/g, ' ');\n if (charset === 'iso-8859-1') {\n // unescape never throws, no try...catch needed:\n return strWithoutPlus.replace(/%[0-9a-f]{2}/gi, unescape);\n }\n // utf-8\n try {\n return decodeURIComponent(strWithoutPlus);\n } catch (e) {\n return strWithoutPlus;\n }\n};\n\nvar encode = function encode(str, defaultEncoder, charset, kind, format) {\n // This code was originally written by Brian White (mscdex) for the io.js core querystring library.\n // It has been adapted here for stricter adherence to RFC 3986\n if (str.length === 0) {\n return str;\n }\n\n var string = str;\n if (typeof str === 'symbol') {\n string = Symbol.prototype.toString.call(str);\n } else if (typeof str !== 'string') {\n string = String(str);\n }\n\n if (charset === 'iso-8859-1') {\n return escape(string).replace(/%u[0-9a-f]{4}/gi, function ($0) {\n return '%26%23' + parseInt($0.slice(2), 16) + '%3B';\n });\n }\n\n var out = '';\n for (var i = 0; i < string.length; ++i) {\n var c = string.charCodeAt(i);\n\n if (\n c === 0x2D // -\n || c === 0x2E // .\n || c === 0x5F // _\n || c === 0x7E // ~\n || (c >= 0x30 && c <= 0x39) // 0-9\n || (c >= 0x41 && c <= 0x5A) // a-z\n || (c >= 0x61 && c <= 0x7A) // A-Z\n || (format === formats.RFC1738 && (c === 0x28 || c === 0x29)) // ( )\n ) {\n out += string.charAt(i);\n continue;\n }\n\n if (c < 0x80) {\n out = out + hexTable[c];\n continue;\n }\n\n if (c < 0x800) {\n out = out + (hexTable[0xC0 | (c >> 6)] + hexTable[0x80 | (c & 0x3F)]);\n continue;\n }\n\n if (c < 0xD800 || c >= 0xE000) {\n out = out + (hexTable[0xE0 | (c >> 12)] + hexTable[0x80 | ((c >> 6) & 0x3F)] + hexTable[0x80 | (c & 0x3F)]);\n continue;\n }\n\n i += 1;\n c = 0x10000 + (((c & 0x3FF) << 10) | (string.charCodeAt(i) & 0x3FF));\n out += hexTable[0xF0 | (c >> 18)]\n + hexTable[0x80 | ((c >> 12) & 0x3F)]\n + hexTable[0x80 | ((c >> 6) & 0x3F)]\n + hexTable[0x80 | (c & 0x3F)];\n }\n\n return out;\n};\n\nvar compact = function compact(value) {\n var queue = [{ obj: { o: value }, prop: 'o' }];\n var refs = [];\n\n for (var i = 0; i < queue.length; ++i) {\n var item = queue[i];\n var obj = item.obj[item.prop];\n\n var keys = Object.keys(obj);\n for (var j = 0; j < keys.length; ++j) {\n var key = keys[j];\n var val = obj[key];\n if (typeof val === 'object' && val !== null && refs.indexOf(val) === -1) {\n queue.push({ obj: obj, prop: key });\n refs.push(val);\n }\n }\n }\n\n compactQueue(queue);\n\n return value;\n};\n\nvar isRegExp = function isRegExp(obj) {\n return Object.prototype.toString.call(obj) === '[object RegExp]';\n};\n\nvar isBuffer = function isBuffer(obj) {\n if (!obj || typeof obj !== 'object') {\n return false;\n }\n\n return !!(obj.constructor && obj.constructor.isBuffer && obj.constructor.isBuffer(obj));\n};\n\nvar combine = function combine(a, b) {\n return [].concat(a, b);\n};\n\nvar maybeMap = function maybeMap(val, fn) {\n if (isArray(val)) {\n var mapped = [];\n for (var i = 0; i < val.length; i += 1) {\n mapped.push(fn(val[i]));\n }\n return mapped;\n }\n return fn(val);\n};\n\nmodule.exports = {\n arrayToObject: arrayToObject,\n assign: assign,\n combine: combine,\n compact: compact,\n decode: decode,\n encode: encode,\n isBuffer: isBuffer,\n isRegExp: isRegExp,\n maybeMap: maybeMap,\n merge: merge\n};\n","// Copyright 2010-2012 Mikeal Rogers\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\n'use strict'\n\nvar extend = require('extend')\nvar cookies = require('./lib/cookies')\nvar helpers = require('./lib/helpers')\n\nvar paramsHaveRequestBody = helpers.paramsHaveRequestBody\n\n// organize params for patch, post, put, head, del\nfunction initParams (uri, options, callback) {\n if (typeof options === 'function') {\n callback = options\n }\n\n var params = {}\n if (options !== null && typeof options === 'object') {\n extend(params, options, {uri: uri})\n } else if (typeof uri === 'string') {\n extend(params, {uri: uri})\n } else {\n extend(params, uri)\n }\n\n params.callback = callback || params.callback\n return params\n}\n\nfunction request (uri, options, callback) {\n if (typeof uri === 'undefined') {\n throw new Error('undefined is not a valid uri or options object.')\n }\n\n var params = initParams(uri, options, callback)\n\n if (params.method === 'HEAD' && paramsHaveRequestBody(params)) {\n throw new Error('HTTP HEAD requests MUST NOT include a request body.')\n }\n\n return new request.Request(params)\n}\n\nfunction verbFunc (verb) {\n var method = verb.toUpperCase()\n return function (uri, options, callback) {\n var params = initParams(uri, options, callback)\n params.method = method\n return request(params, params.callback)\n }\n}\n\n// define like this to please codeintel/intellisense IDEs\nrequest.get = verbFunc('get')\nrequest.head = verbFunc('head')\nrequest.options = verbFunc('options')\nrequest.post = verbFunc('post')\nrequest.put = verbFunc('put')\nrequest.patch = verbFunc('patch')\nrequest.del = verbFunc('delete')\nrequest['delete'] = verbFunc('delete')\n\nrequest.jar = function (store) {\n return cookies.jar(store)\n}\n\nrequest.cookie = function (str) {\n return cookies.parse(str)\n}\n\nfunction wrapRequestMethod (method, options, requester, verb) {\n return function (uri, opts, callback) {\n var params = initParams(uri, opts, callback)\n\n var target = {}\n extend(true, target, options, params)\n\n target.pool = params.pool || options.pool\n\n if (verb) {\n target.method = verb.toUpperCase()\n }\n\n if (typeof requester === 'function') {\n method = requester\n }\n\n return method(target, target.callback)\n }\n}\n\nrequest.defaults = function (options, requester) {\n var self = this\n\n options = options || {}\n\n if (typeof options === 'function') {\n requester = options\n options = {}\n }\n\n var defaults = wrapRequestMethod(self, options, requester)\n\n var verbs = ['get', 'head', 'post', 'put', 'patch', 'del', 'delete']\n verbs.forEach(function (verb) {\n defaults[verb] = wrapRequestMethod(self[verb], options, requester, verb)\n })\n\n defaults.cookie = wrapRequestMethod(self.cookie, options, requester)\n defaults.jar = self.jar\n defaults.defaults = self.defaults\n return defaults\n}\n\nrequest.forever = function (agentOptions, optionsArg) {\n var options = {}\n if (optionsArg) {\n extend(options, optionsArg)\n }\n if (agentOptions) {\n options.agentOptions = agentOptions\n }\n\n options.forever = true\n return request.defaults(options)\n}\n\n// Exports\n\nmodule.exports = request\nrequest.Request = require('./request')\nrequest.initParams = initParams\n\n// Backwards compatibility for request.debug\nObject.defineProperty(request, 'debug', {\n enumerable: true,\n get: function () {\n return request.Request.debug\n },\n set: function (debug) {\n request.Request.debug = debug\n }\n})\n","'use strict'\n\nvar caseless = require('caseless')\nvar uuid = require('uuid/v4')\nvar helpers = require('./helpers')\n\nvar md5 = helpers.md5\nvar toBase64 = helpers.toBase64\n\nfunction Auth (request) {\n // define all public properties here\n this.request = request\n this.hasAuth = false\n this.sentAuth = false\n this.bearerToken = null\n this.user = null\n this.pass = null\n}\n\nAuth.prototype.basic = function (user, pass, sendImmediately) {\n var self = this\n if (typeof user !== 'string' || (pass !== undefined && typeof pass !== 'string')) {\n self.request.emit('error', new Error('auth() received invalid user or password'))\n }\n self.user = user\n self.pass = pass\n self.hasAuth = true\n var header = user + ':' + (pass || '')\n if (sendImmediately || typeof sendImmediately === 'undefined') {\n var authHeader = 'Basic ' + toBase64(header)\n self.sentAuth = true\n return authHeader\n }\n}\n\nAuth.prototype.bearer = function (bearer, sendImmediately) {\n var self = this\n self.bearerToken = bearer\n self.hasAuth = true\n if (sendImmediately || typeof sendImmediately === 'undefined') {\n if (typeof bearer === 'function') {\n bearer = bearer()\n }\n var authHeader = 'Bearer ' + (bearer || '')\n self.sentAuth = true\n return authHeader\n }\n}\n\nAuth.prototype.digest = function (method, path, authHeader) {\n // TODO: More complete implementation of RFC 2617.\n // - handle challenge.domain\n // - support qop=\"auth-int\" only\n // - handle Authentication-Info (not necessarily?)\n // - check challenge.stale (not necessarily?)\n // - increase nc (not necessarily?)\n // For reference:\n // http://tools.ietf.org/html/rfc2617#section-3\n // https://github.com/bagder/curl/blob/master/lib/http_digest.c\n\n var self = this\n\n var challenge = {}\n var re = /([a-z0-9_-]+)=(?:\"([^\"]+)\"|([a-z0-9_-]+))/gi\n while (true) {\n var match = re.exec(authHeader)\n if (!match) {\n break\n }\n challenge[match[1]] = match[2] || match[3]\n }\n\n /**\n * RFC 2617: handle both MD5 and MD5-sess algorithms.\n *\n * If the algorithm directive's value is \"MD5\" or unspecified, then HA1 is\n * HA1=MD5(username:realm:password)\n * If the algorithm directive's value is \"MD5-sess\", then HA1 is\n * HA1=MD5(MD5(username:realm:password):nonce:cnonce)\n */\n var ha1Compute = function (algorithm, user, realm, pass, nonce, cnonce) {\n var ha1 = md5(user + ':' + realm + ':' + pass)\n if (algorithm && algorithm.toLowerCase() === 'md5-sess') {\n return md5(ha1 + ':' + nonce + ':' + cnonce)\n } else {\n return ha1\n }\n }\n\n var qop = /(^|,)\\s*auth\\s*($|,)/.test(challenge.qop) && 'auth'\n var nc = qop && '00000001'\n var cnonce = qop && uuid().replace(/-/g, '')\n var ha1 = ha1Compute(challenge.algorithm, self.user, challenge.realm, self.pass, challenge.nonce, cnonce)\n var ha2 = md5(method + ':' + path)\n var digestResponse = qop\n ? md5(ha1 + ':' + challenge.nonce + ':' + nc + ':' + cnonce + ':' + qop + ':' + ha2)\n : md5(ha1 + ':' + challenge.nonce + ':' + ha2)\n var authValues = {\n username: self.user,\n realm: challenge.realm,\n nonce: challenge.nonce,\n uri: path,\n qop: qop,\n response: digestResponse,\n nc: nc,\n cnonce: cnonce,\n algorithm: challenge.algorithm,\n opaque: challenge.opaque\n }\n\n authHeader = []\n for (var k in authValues) {\n if (authValues[k]) {\n if (k === 'qop' || k === 'nc' || k === 'algorithm') {\n authHeader.push(k + '=' + authValues[k])\n } else {\n authHeader.push(k + '=\"' + authValues[k] + '\"')\n }\n }\n }\n authHeader = 'Digest ' + authHeader.join(', ')\n self.sentAuth = true\n return authHeader\n}\n\nAuth.prototype.onRequest = function (user, pass, sendImmediately, bearer) {\n var self = this\n var request = self.request\n\n var authHeader\n if (bearer === undefined && user === undefined) {\n self.request.emit('error', new Error('no auth mechanism defined'))\n } else if (bearer !== undefined) {\n authHeader = self.bearer(bearer, sendImmediately)\n } else {\n authHeader = self.basic(user, pass, sendImmediately)\n }\n if (authHeader) {\n request.setHeader('authorization', authHeader)\n }\n}\n\nAuth.prototype.onResponse = function (response) {\n var self = this\n var request = self.request\n\n if (!self.hasAuth || self.sentAuth) { return null }\n\n var c = caseless(response.headers)\n\n var authHeader = c.get('www-authenticate')\n var authVerb = authHeader && authHeader.split(' ')[0].toLowerCase()\n request.debug('reauth', authVerb)\n\n switch (authVerb) {\n case 'basic':\n return self.basic(self.user, self.pass, true)\n\n case 'bearer':\n return self.bearer(self.bearerToken, true)\n\n case 'digest':\n return self.digest(request.method, request.path, authHeader)\n }\n}\n\nexports.Auth = Auth\n","'use strict'\n\nvar tough = require('tough-cookie')\n\nvar Cookie = tough.Cookie\nvar CookieJar = tough.CookieJar\n\nexports.parse = function (str) {\n if (str && str.uri) {\n str = str.uri\n }\n if (typeof str !== 'string') {\n throw new Error('The cookie function only accepts STRING as param')\n }\n return Cookie.parse(str, {loose: true})\n}\n\n// Adapt the sometimes-Async api of tough.CookieJar to our requirements\nfunction RequestJar (store) {\n var self = this\n self._jar = new CookieJar(store, {looseMode: true})\n}\nRequestJar.prototype.setCookie = function (cookieOrStr, uri, options) {\n var self = this\n return self._jar.setCookieSync(cookieOrStr, uri, options || {})\n}\nRequestJar.prototype.getCookieString = function (uri) {\n var self = this\n return self._jar.getCookieStringSync(uri)\n}\nRequestJar.prototype.getCookies = function (uri) {\n var self = this\n return self._jar.getCookiesSync(uri)\n}\n\nexports.jar = function (store) {\n return new RequestJar(store)\n}\n","'use strict'\n\nfunction formatHostname (hostname) {\n // canonicalize the hostname, so that 'oogle.com' won't match 'google.com'\n return hostname.replace(/^\\.*/, '.').toLowerCase()\n}\n\nfunction parseNoProxyZone (zone) {\n zone = zone.trim().toLowerCase()\n\n var zoneParts = zone.split(':', 2)\n var zoneHost = formatHostname(zoneParts[0])\n var zonePort = zoneParts[1]\n var hasPort = zone.indexOf(':') > -1\n\n return {hostname: zoneHost, port: zonePort, hasPort: hasPort}\n}\n\nfunction uriInNoProxy (uri, noProxy) {\n var port = uri.port || (uri.protocol === 'https:' ? '443' : '80')\n var hostname = formatHostname(uri.hostname)\n var noProxyList = noProxy.split(',')\n\n // iterate through the noProxyList until it finds a match.\n return noProxyList.map(parseNoProxyZone).some(function (noProxyZone) {\n var isMatchedAt = hostname.indexOf(noProxyZone.hostname)\n var hostnameMatched = (\n isMatchedAt > -1 &&\n (isMatchedAt === hostname.length - noProxyZone.hostname.length)\n )\n\n if (noProxyZone.hasPort) {\n return (port === noProxyZone.port) && hostnameMatched\n }\n\n return hostnameMatched\n })\n}\n\nfunction getProxyFromURI (uri) {\n // Decide the proper request proxy to use based on the request URI object and the\n // environmental variables (NO_PROXY, HTTP_PROXY, etc.)\n // respect NO_PROXY environment variables (see: https://lynx.invisible-island.net/lynx2.8.7/breakout/lynx_help/keystrokes/environments.html)\n\n var noProxy = process.env.NO_PROXY || process.env.no_proxy || ''\n\n // if the noProxy is a wildcard then return null\n\n if (noProxy === '*') {\n return null\n }\n\n // if the noProxy is not empty and the uri is found return null\n\n if (noProxy !== '' && uriInNoProxy(uri, noProxy)) {\n return null\n }\n\n // Check for HTTP or HTTPS Proxy in environment Else default to null\n\n if (uri.protocol === 'http:') {\n return process.env.HTTP_PROXY ||\n process.env.http_proxy || null\n }\n\n if (uri.protocol === 'https:') {\n return process.env.HTTPS_PROXY ||\n process.env.https_proxy ||\n process.env.HTTP_PROXY ||\n process.env.http_proxy || null\n }\n\n // if none of that works, return null\n // (What uri protocol are you using then?)\n\n return null\n}\n\nmodule.exports = getProxyFromURI\n","'use strict'\n\nvar fs = require('fs')\nvar qs = require('querystring')\nvar validate = require('har-validator')\nvar extend = require('extend')\n\nfunction Har (request) {\n this.request = request\n}\n\nHar.prototype.reducer = function (obj, pair) {\n // new property ?\n if (obj[pair.name] === undefined) {\n obj[pair.name] = pair.value\n return obj\n }\n\n // existing? convert to array\n var arr = [\n obj[pair.name],\n pair.value\n ]\n\n obj[pair.name] = arr\n\n return obj\n}\n\nHar.prototype.prep = function (data) {\n // construct utility properties\n data.queryObj = {}\n data.headersObj = {}\n data.postData.jsonObj = false\n data.postData.paramsObj = false\n\n // construct query objects\n if (data.queryString && data.queryString.length) {\n data.queryObj = data.queryString.reduce(this.reducer, {})\n }\n\n // construct headers objects\n if (data.headers && data.headers.length) {\n // loweCase header keys\n data.headersObj = data.headers.reduceRight(function (headers, header) {\n headers[header.name] = header.value\n return headers\n }, {})\n }\n\n // construct Cookie header\n if (data.cookies && data.cookies.length) {\n var cookies = data.cookies.map(function (cookie) {\n return cookie.name + '=' + cookie.value\n })\n\n if (cookies.length) {\n data.headersObj.cookie = cookies.join('; ')\n }\n }\n\n // prep body\n function some (arr) {\n return arr.some(function (type) {\n return data.postData.mimeType.indexOf(type) === 0\n })\n }\n\n if (some([\n 'multipart/mixed',\n 'multipart/related',\n 'multipart/form-data',\n 'multipart/alternative'])) {\n // reset values\n data.postData.mimeType = 'multipart/form-data'\n } else if (some([\n 'application/x-www-form-urlencoded'])) {\n if (!data.postData.params) {\n data.postData.text = ''\n } else {\n data.postData.paramsObj = data.postData.params.reduce(this.reducer, {})\n\n // always overwrite\n data.postData.text = qs.stringify(data.postData.paramsObj)\n }\n } else if (some([\n 'text/json',\n 'text/x-json',\n 'application/json',\n 'application/x-json'])) {\n data.postData.mimeType = 'application/json'\n\n if (data.postData.text) {\n try {\n data.postData.jsonObj = JSON.parse(data.postData.text)\n } catch (e) {\n this.request.debug(e)\n\n // force back to text/plain\n data.postData.mimeType = 'text/plain'\n }\n }\n }\n\n return data\n}\n\nHar.prototype.options = function (options) {\n // skip if no har property defined\n if (!options.har) {\n return options\n }\n\n var har = {}\n extend(har, options.har)\n\n // only process the first entry\n if (har.log && har.log.entries) {\n har = har.log.entries[0]\n }\n\n // add optional properties to make validation successful\n har.url = har.url || options.url || options.uri || options.baseUrl || '/'\n har.httpVersion = har.httpVersion || 'HTTP/1.1'\n har.queryString = har.queryString || []\n har.headers = har.headers || []\n har.cookies = har.cookies || []\n har.postData = har.postData || {}\n har.postData.mimeType = har.postData.mimeType || 'application/octet-stream'\n\n har.bodySize = 0\n har.headersSize = 0\n har.postData.size = 0\n\n if (!validate.request(har)) {\n return options\n }\n\n // clean up and get some utility properties\n var req = this.prep(har)\n\n // construct new options\n if (req.url) {\n options.url = req.url\n }\n\n if (req.method) {\n options.method = req.method\n }\n\n if (Object.keys(req.queryObj).length) {\n options.qs = req.queryObj\n }\n\n if (Object.keys(req.headersObj).length) {\n options.headers = req.headersObj\n }\n\n function test (type) {\n return req.postData.mimeType.indexOf(type) === 0\n }\n if (test('application/x-www-form-urlencoded')) {\n options.form = req.postData.paramsObj\n } else if (test('application/json')) {\n if (req.postData.jsonObj) {\n options.body = req.postData.jsonObj\n options.json = true\n }\n } else if (test('multipart/form-data')) {\n options.formData = {}\n\n req.postData.params.forEach(function (param) {\n var attachment = {}\n\n if (!param.fileName && !param.contentType) {\n options.formData[param.name] = param.value\n return\n }\n\n // attempt to read from disk!\n if (param.fileName && !param.value) {\n attachment.value = fs.createReadStream(param.fileName)\n } else if (param.value) {\n attachment.value = param.value\n }\n\n if (param.fileName) {\n attachment.options = {\n filename: param.fileName,\n contentType: param.contentType ? param.contentType : null\n }\n }\n\n options.formData[param.name] = attachment\n })\n } else {\n if (req.postData.text) {\n options.body = req.postData.text\n }\n }\n\n return options\n}\n\nexports.Har = Har\n","'use strict'\n\nvar crypto = require('crypto')\n\nfunction randomString (size) {\n var bits = (size + 1) * 6\n var buffer = crypto.randomBytes(Math.ceil(bits / 8))\n var string = buffer.toString('base64').replace(/\\+/g, '-').replace(/\\//g, '_').replace(/=/g, '')\n return string.slice(0, size)\n}\n\nfunction calculatePayloadHash (payload, algorithm, contentType) {\n var hash = crypto.createHash(algorithm)\n hash.update('hawk.1.payload\\n')\n hash.update((contentType ? contentType.split(';')[0].trim().toLowerCase() : '') + '\\n')\n hash.update(payload || '')\n hash.update('\\n')\n return hash.digest('base64')\n}\n\nexports.calculateMac = function (credentials, opts) {\n var normalized = 'hawk.1.header\\n' +\n opts.ts + '\\n' +\n opts.nonce + '\\n' +\n (opts.method || '').toUpperCase() + '\\n' +\n opts.resource + '\\n' +\n opts.host.toLowerCase() + '\\n' +\n opts.port + '\\n' +\n (opts.hash || '') + '\\n'\n\n if (opts.ext) {\n normalized = normalized + opts.ext.replace('\\\\', '\\\\\\\\').replace('\\n', '\\\\n')\n }\n\n normalized = normalized + '\\n'\n\n if (opts.app) {\n normalized = normalized + opts.app + '\\n' + (opts.dlg || '') + '\\n'\n }\n\n var hmac = crypto.createHmac(credentials.algorithm, credentials.key).update(normalized)\n var digest = hmac.digest('base64')\n return digest\n}\n\nexports.header = function (uri, method, opts) {\n var timestamp = opts.timestamp || Math.floor((Date.now() + (opts.localtimeOffsetMsec || 0)) / 1000)\n var credentials = opts.credentials\n if (!credentials || !credentials.id || !credentials.key || !credentials.algorithm) {\n return ''\n }\n\n if (['sha1', 'sha256'].indexOf(credentials.algorithm) === -1) {\n return ''\n }\n\n var artifacts = {\n ts: timestamp,\n nonce: opts.nonce || randomString(6),\n method: method,\n resource: uri.pathname + (uri.search || ''),\n host: uri.hostname,\n port: uri.port || (uri.protocol === 'http:' ? 80 : 443),\n hash: opts.hash,\n ext: opts.ext,\n app: opts.app,\n dlg: opts.dlg\n }\n\n if (!artifacts.hash && (opts.payload || opts.payload === '')) {\n artifacts.hash = calculatePayloadHash(opts.payload, credentials.algorithm, opts.contentType)\n }\n\n var mac = exports.calculateMac(credentials, artifacts)\n\n var hasExt = artifacts.ext !== null && artifacts.ext !== undefined && artifacts.ext !== ''\n var header = 'Hawk id=\"' + credentials.id +\n '\", ts=\"' + artifacts.ts +\n '\", nonce=\"' + artifacts.nonce +\n (artifacts.hash ? '\", hash=\"' + artifacts.hash : '') +\n (hasExt ? '\", ext=\"' + artifacts.ext.replace(/\\\\/g, '\\\\\\\\').replace(/\"/g, '\\\\\"') : '') +\n '\", mac=\"' + mac + '\"'\n\n if (artifacts.app) {\n header = header + ', app=\"' + artifacts.app + (artifacts.dlg ? '\", dlg=\"' + artifacts.dlg : '') + '\"'\n }\n\n return header\n}\n","'use strict'\n\nvar jsonSafeStringify = require('json-stringify-safe')\nvar crypto = require('crypto')\nvar Buffer = require('safe-buffer').Buffer\n\nvar defer = typeof setImmediate === 'undefined'\n ? process.nextTick\n : setImmediate\n\nfunction paramsHaveRequestBody (params) {\n return (\n params.body ||\n params.requestBodyStream ||\n (params.json && typeof params.json !== 'boolean') ||\n params.multipart\n )\n}\n\nfunction safeStringify (obj, replacer) {\n var ret\n try {\n ret = JSON.stringify(obj, replacer)\n } catch (e) {\n ret = jsonSafeStringify(obj, replacer)\n }\n return ret\n}\n\nfunction md5 (str) {\n return crypto.createHash('md5').update(str).digest('hex')\n}\n\nfunction isReadStream (rs) {\n return rs.readable && rs.path && rs.mode\n}\n\nfunction toBase64 (str) {\n return Buffer.from(str || '', 'utf8').toString('base64')\n}\n\nfunction copy (obj) {\n var o = {}\n Object.keys(obj).forEach(function (i) {\n o[i] = obj[i]\n })\n return o\n}\n\nfunction version () {\n var numbers = process.version.replace('v', '').split('.')\n return {\n major: parseInt(numbers[0], 10),\n minor: parseInt(numbers[1], 10),\n patch: parseInt(numbers[2], 10)\n }\n}\n\nexports.paramsHaveRequestBody = paramsHaveRequestBody\nexports.safeStringify = safeStringify\nexports.md5 = md5\nexports.isReadStream = isReadStream\nexports.toBase64 = toBase64\nexports.copy = copy\nexports.version = version\nexports.defer = defer\n","'use strict'\n\nvar uuid = require('uuid/v4')\nvar CombinedStream = require('combined-stream')\nvar isstream = require('isstream')\nvar Buffer = require('safe-buffer').Buffer\n\nfunction Multipart (request) {\n this.request = request\n this.boundary = uuid()\n this.chunked = false\n this.body = null\n}\n\nMultipart.prototype.isChunked = function (options) {\n var self = this\n var chunked = false\n var parts = options.data || options\n\n if (!parts.forEach) {\n self.request.emit('error', new Error('Argument error, options.multipart.'))\n }\n\n if (options.chunked !== undefined) {\n chunked = options.chunked\n }\n\n if (self.request.getHeader('transfer-encoding') === 'chunked') {\n chunked = true\n }\n\n if (!chunked) {\n parts.forEach(function (part) {\n if (typeof part.body === 'undefined') {\n self.request.emit('error', new Error('Body attribute missing in multipart.'))\n }\n if (isstream(part.body)) {\n chunked = true\n }\n })\n }\n\n return chunked\n}\n\nMultipart.prototype.setHeaders = function (chunked) {\n var self = this\n\n if (chunked && !self.request.hasHeader('transfer-encoding')) {\n self.request.setHeader('transfer-encoding', 'chunked')\n }\n\n var header = self.request.getHeader('content-type')\n\n if (!header || header.indexOf('multipart') === -1) {\n self.request.setHeader('content-type', 'multipart/related; boundary=' + self.boundary)\n } else {\n if (header.indexOf('boundary') !== -1) {\n self.boundary = header.replace(/.*boundary=([^\\s;]+).*/, '$1')\n } else {\n self.request.setHeader('content-type', header + '; boundary=' + self.boundary)\n }\n }\n}\n\nMultipart.prototype.build = function (parts, chunked) {\n var self = this\n var body = chunked ? new CombinedStream() : []\n\n function add (part) {\n if (typeof part === 'number') {\n part = part.toString()\n }\n return chunked ? body.append(part) : body.push(Buffer.from(part))\n }\n\n if (self.request.preambleCRLF) {\n add('\\r\\n')\n }\n\n parts.forEach(function (part) {\n var preamble = '--' + self.boundary + '\\r\\n'\n Object.keys(part).forEach(function (key) {\n if (key === 'body') { return }\n preamble += key + ': ' + part[key] + '\\r\\n'\n })\n preamble += '\\r\\n'\n add(preamble)\n add(part.body)\n add('\\r\\n')\n })\n add('--' + self.boundary + '--')\n\n if (self.request.postambleCRLF) {\n add('\\r\\n')\n }\n\n return body\n}\n\nMultipart.prototype.onRequest = function (options) {\n var self = this\n\n var chunked = self.isChunked(options)\n var parts = options.data || options\n\n self.setHeaders(chunked)\n self.chunked = chunked\n self.body = self.build(parts, chunked)\n}\n\nexports.Multipart = Multipart\n","'use strict'\n\nvar url = require('url')\nvar qs = require('qs')\nvar caseless = require('caseless')\nvar uuid = require('uuid/v4')\nvar oauth = require('oauth-sign')\nvar crypto = require('crypto')\nvar Buffer = require('safe-buffer').Buffer\n\nfunction OAuth (request) {\n this.request = request\n this.params = null\n}\n\nOAuth.prototype.buildParams = function (_oauth, uri, method, query, form, qsLib) {\n var oa = {}\n for (var i in _oauth) {\n oa['oauth_' + i] = _oauth[i]\n }\n if (!oa.oauth_version) {\n oa.oauth_version = '1.0'\n }\n if (!oa.oauth_timestamp) {\n oa.oauth_timestamp = Math.floor(Date.now() / 1000).toString()\n }\n if (!oa.oauth_nonce) {\n oa.oauth_nonce = uuid().replace(/-/g, '')\n }\n if (!oa.oauth_signature_method) {\n oa.oauth_signature_method = 'HMAC-SHA1'\n }\n\n var consumer_secret_or_private_key = oa.oauth_consumer_secret || oa.oauth_private_key // eslint-disable-line camelcase\n delete oa.oauth_consumer_secret\n delete oa.oauth_private_key\n\n var token_secret = oa.oauth_token_secret // eslint-disable-line camelcase\n delete oa.oauth_token_secret\n\n var realm = oa.oauth_realm\n delete oa.oauth_realm\n delete oa.oauth_transport_method\n\n var baseurl = uri.protocol + '//' + uri.host + uri.pathname\n var params = qsLib.parse([].concat(query, form, qsLib.stringify(oa)).join('&'))\n\n oa.oauth_signature = oauth.sign(\n oa.oauth_signature_method,\n method,\n baseurl,\n params,\n consumer_secret_or_private_key, // eslint-disable-line camelcase\n token_secret // eslint-disable-line camelcase\n )\n\n if (realm) {\n oa.realm = realm\n }\n\n return oa\n}\n\nOAuth.prototype.buildBodyHash = function (_oauth, body) {\n if (['HMAC-SHA1', 'RSA-SHA1'].indexOf(_oauth.signature_method || 'HMAC-SHA1') < 0) {\n this.request.emit('error', new Error('oauth: ' + _oauth.signature_method +\n ' signature_method not supported with body_hash signing.'))\n }\n\n var shasum = crypto.createHash('sha1')\n shasum.update(body || '')\n var sha1 = shasum.digest('hex')\n\n return Buffer.from(sha1, 'hex').toString('base64')\n}\n\nOAuth.prototype.concatParams = function (oa, sep, wrap) {\n wrap = wrap || ''\n\n var params = Object.keys(oa).filter(function (i) {\n return i !== 'realm' && i !== 'oauth_signature'\n }).sort()\n\n if (oa.realm) {\n params.splice(0, 0, 'realm')\n }\n params.push('oauth_signature')\n\n return params.map(function (i) {\n return i + '=' + wrap + oauth.rfc3986(oa[i]) + wrap\n }).join(sep)\n}\n\nOAuth.prototype.onRequest = function (_oauth) {\n var self = this\n self.params = _oauth\n\n var uri = self.request.uri || {}\n var method = self.request.method || ''\n var headers = caseless(self.request.headers)\n var body = self.request.body || ''\n var qsLib = self.request.qsLib || qs\n\n var form\n var query\n var contentType = headers.get('content-type') || ''\n var formContentType = 'application/x-www-form-urlencoded'\n var transport = _oauth.transport_method || 'header'\n\n if (contentType.slice(0, formContentType.length) === formContentType) {\n contentType = formContentType\n form = body\n }\n if (uri.query) {\n query = uri.query\n }\n if (transport === 'body' && (method !== 'POST' || contentType !== formContentType)) {\n self.request.emit('error', new Error('oauth: transport_method of body requires POST ' +\n 'and content-type ' + formContentType))\n }\n\n if (!form && typeof _oauth.body_hash === 'boolean') {\n _oauth.body_hash = self.buildBodyHash(_oauth, self.request.body.toString())\n }\n\n var oa = self.buildParams(_oauth, uri, method, query, form, qsLib)\n\n switch (transport) {\n case 'header':\n self.request.setHeader('Authorization', 'OAuth ' + self.concatParams(oa, ',', '\"'))\n break\n\n case 'query':\n var href = self.request.uri.href += (query ? '&' : '?') + self.concatParams(oa, '&')\n self.request.uri = url.parse(href)\n self.request.path = self.request.uri.path\n break\n\n case 'body':\n self.request.body = (form ? form + '&' : '') + self.concatParams(oa, '&')\n break\n\n default:\n self.request.emit('error', new Error('oauth: transport_method invalid'))\n }\n}\n\nexports.OAuth = OAuth\n","'use strict'\n\nvar qs = require('qs')\nvar querystring = require('querystring')\n\nfunction Querystring (request) {\n this.request = request\n this.lib = null\n this.useQuerystring = null\n this.parseOptions = null\n this.stringifyOptions = null\n}\n\nQuerystring.prototype.init = function (options) {\n if (this.lib) { return }\n\n this.useQuerystring = options.useQuerystring\n this.lib = (this.useQuerystring ? querystring : qs)\n\n this.parseOptions = options.qsParseOptions || {}\n this.stringifyOptions = options.qsStringifyOptions || {}\n}\n\nQuerystring.prototype.stringify = function (obj) {\n return (this.useQuerystring)\n ? this.rfc3986(this.lib.stringify(obj,\n this.stringifyOptions.sep || null,\n this.stringifyOptions.eq || null,\n this.stringifyOptions))\n : this.lib.stringify(obj, this.stringifyOptions)\n}\n\nQuerystring.prototype.parse = function (str) {\n return (this.useQuerystring)\n ? this.lib.parse(str,\n this.parseOptions.sep || null,\n this.parseOptions.eq || null,\n this.parseOptions)\n : this.lib.parse(str, this.parseOptions)\n}\n\nQuerystring.prototype.rfc3986 = function (str) {\n return str.replace(/[!'()*]/g, function (c) {\n return '%' + c.charCodeAt(0).toString(16).toUpperCase()\n })\n}\n\nQuerystring.prototype.unescape = querystring.unescape\n\nexports.Querystring = Querystring\n","'use strict'\n\nvar url = require('url')\nvar isUrl = /^https?:/\n\nfunction Redirect (request) {\n this.request = request\n this.followRedirect = true\n this.followRedirects = true\n this.followAllRedirects = false\n this.followOriginalHttpMethod = false\n this.allowRedirect = function () { return true }\n this.maxRedirects = 10\n this.redirects = []\n this.redirectsFollowed = 0\n this.removeRefererHeader = false\n}\n\nRedirect.prototype.onRequest = function (options) {\n var self = this\n\n if (options.maxRedirects !== undefined) {\n self.maxRedirects = options.maxRedirects\n }\n if (typeof options.followRedirect === 'function') {\n self.allowRedirect = options.followRedirect\n }\n if (options.followRedirect !== undefined) {\n self.followRedirects = !!options.followRedirect\n }\n if (options.followAllRedirects !== undefined) {\n self.followAllRedirects = options.followAllRedirects\n }\n if (self.followRedirects || self.followAllRedirects) {\n self.redirects = self.redirects || []\n }\n if (options.removeRefererHeader !== undefined) {\n self.removeRefererHeader = options.removeRefererHeader\n }\n if (options.followOriginalHttpMethod !== undefined) {\n self.followOriginalHttpMethod = options.followOriginalHttpMethod\n }\n}\n\nRedirect.prototype.redirectTo = function (response) {\n var self = this\n var request = self.request\n\n var redirectTo = null\n if (response.statusCode >= 300 && response.statusCode < 400 && response.caseless.has('location')) {\n var location = response.caseless.get('location')\n request.debug('redirect', location)\n\n if (self.followAllRedirects) {\n redirectTo = location\n } else if (self.followRedirects) {\n switch (request.method) {\n case 'PATCH':\n case 'PUT':\n case 'POST':\n case 'DELETE':\n // Do not follow redirects\n break\n default:\n redirectTo = location\n break\n }\n }\n } else if (response.statusCode === 401) {\n var authHeader = request._auth.onResponse(response)\n if (authHeader) {\n request.setHeader('authorization', authHeader)\n redirectTo = request.uri\n }\n }\n return redirectTo\n}\n\nRedirect.prototype.onResponse = function (response) {\n var self = this\n var request = self.request\n\n var redirectTo = self.redirectTo(response)\n if (!redirectTo || !self.allowRedirect.call(request, response)) {\n return false\n }\n\n request.debug('redirect to', redirectTo)\n\n // ignore any potential response body. it cannot possibly be useful\n // to us at this point.\n // response.resume should be defined, but check anyway before calling. Workaround for browserify.\n if (response.resume) {\n response.resume()\n }\n\n if (self.redirectsFollowed >= self.maxRedirects) {\n request.emit('error', new Error('Exceeded maxRedirects. Probably stuck in a redirect loop ' + request.uri.href))\n return false\n }\n self.redirectsFollowed += 1\n\n if (!isUrl.test(redirectTo)) {\n redirectTo = url.resolve(request.uri.href, redirectTo)\n }\n\n var uriPrev = request.uri\n request.uri = url.parse(redirectTo)\n\n // handle the case where we change protocol from https to http or vice versa\n if (request.uri.protocol !== uriPrev.protocol) {\n delete request.agent\n }\n\n self.redirects.push({ statusCode: response.statusCode, redirectUri: redirectTo })\n\n if (self.followAllRedirects && request.method !== 'HEAD' &&\n response.statusCode !== 401 && response.statusCode !== 307) {\n request.method = self.followOriginalHttpMethod ? request.method : 'GET'\n }\n // request.method = 'GET' // Force all redirects to use GET || commented out fixes #215\n delete request.src\n delete request.req\n delete request._started\n if (response.statusCode !== 401 && response.statusCode !== 307) {\n // Remove parameters from the previous response, unless this is the second request\n // for a server that requires digest authentication.\n delete request.body\n delete request._form\n if (request.headers) {\n request.removeHeader('host')\n request.removeHeader('content-type')\n request.removeHeader('content-length')\n if (request.uri.hostname !== request.originalHost.split(':')[0]) {\n // Remove authorization if changing hostnames (but not if just\n // changing ports or protocols). This matches the behavior of curl:\n // https://github.com/bagder/curl/blob/6beb0eee/lib/http.c#L710\n request.removeHeader('authorization')\n }\n }\n }\n\n if (!self.removeRefererHeader) {\n request.setHeader('referer', uriPrev.href)\n }\n\n request.emit('redirect')\n\n request.init()\n\n return true\n}\n\nexports.Redirect = Redirect\n","'use strict'\n\nvar url = require('url')\nvar tunnel = require('tunnel-agent')\n\nvar defaultProxyHeaderWhiteList = [\n 'accept',\n 'accept-charset',\n 'accept-encoding',\n 'accept-language',\n 'accept-ranges',\n 'cache-control',\n 'content-encoding',\n 'content-language',\n 'content-location',\n 'content-md5',\n 'content-range',\n 'content-type',\n 'connection',\n 'date',\n 'expect',\n 'max-forwards',\n 'pragma',\n 'referer',\n 'te',\n 'user-agent',\n 'via'\n]\n\nvar defaultProxyHeaderExclusiveList = [\n 'proxy-authorization'\n]\n\nfunction constructProxyHost (uriObject) {\n var port = uriObject.port\n var protocol = uriObject.protocol\n var proxyHost = uriObject.hostname + ':'\n\n if (port) {\n proxyHost += port\n } else if (protocol === 'https:') {\n proxyHost += '443'\n } else {\n proxyHost += '80'\n }\n\n return proxyHost\n}\n\nfunction constructProxyHeaderWhiteList (headers, proxyHeaderWhiteList) {\n var whiteList = proxyHeaderWhiteList\n .reduce(function (set, header) {\n set[header.toLowerCase()] = true\n return set\n }, {})\n\n return Object.keys(headers)\n .filter(function (header) {\n return whiteList[header.toLowerCase()]\n })\n .reduce(function (set, header) {\n set[header] = headers[header]\n return set\n }, {})\n}\n\nfunction constructTunnelOptions (request, proxyHeaders) {\n var proxy = request.proxy\n\n var tunnelOptions = {\n proxy: {\n host: proxy.hostname,\n port: +proxy.port,\n proxyAuth: proxy.auth,\n headers: proxyHeaders\n },\n headers: request.headers,\n ca: request.ca,\n cert: request.cert,\n key: request.key,\n passphrase: request.passphrase,\n pfx: request.pfx,\n ciphers: request.ciphers,\n rejectUnauthorized: request.rejectUnauthorized,\n secureOptions: request.secureOptions,\n secureProtocol: request.secureProtocol\n }\n\n return tunnelOptions\n}\n\nfunction constructTunnelFnName (uri, proxy) {\n var uriProtocol = (uri.protocol === 'https:' ? 'https' : 'http')\n var proxyProtocol = (proxy.protocol === 'https:' ? 'Https' : 'Http')\n return [uriProtocol, proxyProtocol].join('Over')\n}\n\nfunction getTunnelFn (request) {\n var uri = request.uri\n var proxy = request.proxy\n var tunnelFnName = constructTunnelFnName(uri, proxy)\n return tunnel[tunnelFnName]\n}\n\nfunction Tunnel (request) {\n this.request = request\n this.proxyHeaderWhiteList = defaultProxyHeaderWhiteList\n this.proxyHeaderExclusiveList = []\n if (typeof request.tunnel !== 'undefined') {\n this.tunnelOverride = request.tunnel\n }\n}\n\nTunnel.prototype.isEnabled = function () {\n var self = this\n var request = self.request\n // Tunnel HTTPS by default. Allow the user to override this setting.\n\n // If self.tunnelOverride is set (the user specified a value), use it.\n if (typeof self.tunnelOverride !== 'undefined') {\n return self.tunnelOverride\n }\n\n // If the destination is HTTPS, tunnel.\n if (request.uri.protocol === 'https:') {\n return true\n }\n\n // Otherwise, do not use tunnel.\n return false\n}\n\nTunnel.prototype.setup = function (options) {\n var self = this\n var request = self.request\n\n options = options || {}\n\n if (typeof request.proxy === 'string') {\n request.proxy = url.parse(request.proxy)\n }\n\n if (!request.proxy || !request.tunnel) {\n return false\n }\n\n // Setup Proxy Header Exclusive List and White List\n if (options.proxyHeaderWhiteList) {\n self.proxyHeaderWhiteList = options.proxyHeaderWhiteList\n }\n if (options.proxyHeaderExclusiveList) {\n self.proxyHeaderExclusiveList = options.proxyHeaderExclusiveList\n }\n\n var proxyHeaderExclusiveList = self.proxyHeaderExclusiveList.concat(defaultProxyHeaderExclusiveList)\n var proxyHeaderWhiteList = self.proxyHeaderWhiteList.concat(proxyHeaderExclusiveList)\n\n // Setup Proxy Headers and Proxy Headers Host\n // Only send the Proxy White Listed Header names\n var proxyHeaders = constructProxyHeaderWhiteList(request.headers, proxyHeaderWhiteList)\n proxyHeaders.host = constructProxyHost(request.uri)\n\n proxyHeaderExclusiveList.forEach(request.removeHeader, request)\n\n // Set Agent from Tunnel Data\n var tunnelFn = getTunnelFn(request)\n var tunnelOptions = constructTunnelOptions(request, proxyHeaders)\n request.agent = tunnelFn(tunnelOptions)\n\n return true\n}\n\nTunnel.defaultProxyHeaderWhiteList = defaultProxyHeaderWhiteList\nTunnel.defaultProxyHeaderExclusiveList = defaultProxyHeaderExclusiveList\nexports.Tunnel = Tunnel\n","var CombinedStream = require('combined-stream');\nvar util = require('util');\nvar path = require('path');\nvar http = require('http');\nvar https = require('https');\nvar parseUrl = require('url').parse;\nvar fs = require('fs');\nvar mime = require('mime-types');\nvar asynckit = require('asynckit');\nvar populate = require('./populate.js');\n\n// Public API\nmodule.exports = FormData;\n\n// make it a Stream\nutil.inherits(FormData, CombinedStream);\n\n/**\n * Create readable \"multipart/form-data\" streams.\n * Can be used to submit forms\n * and file uploads to other web applications.\n *\n * @constructor\n * @param {Object} options - Properties to be added/overriden for FormData and CombinedStream\n */\nfunction FormData(options) {\n if (!(this instanceof FormData)) {\n return new FormData();\n }\n\n this._overheadLength = 0;\n this._valueLength = 0;\n this._valuesToMeasure = [];\n\n CombinedStream.call(this);\n\n options = options || {};\n for (var option in options) {\n this[option] = options[option];\n }\n}\n\nFormData.LINE_BREAK = '\\r\\n';\nFormData.DEFAULT_CONTENT_TYPE = 'application/octet-stream';\n\nFormData.prototype.append = function(field, value, options) {\n\n options = options || {};\n\n // allow filename as single option\n if (typeof options == 'string') {\n options = {filename: options};\n }\n\n var append = CombinedStream.prototype.append.bind(this);\n\n // all that streamy business can't handle numbers\n if (typeof value == 'number') {\n value = '' + value;\n }\n\n // https://github.com/felixge/node-form-data/issues/38\n if (util.isArray(value)) {\n // Please convert your array into string\n // the way web server expects it\n this._error(new Error('Arrays are not supported.'));\n return;\n }\n\n var header = this._multiPartHeader(field, value, options);\n var footer = this._multiPartFooter();\n\n append(header);\n append(value);\n append(footer);\n\n // pass along options.knownLength\n this._trackLength(header, value, options);\n};\n\nFormData.prototype._trackLength = function(header, value, options) {\n var valueLength = 0;\n\n // used w/ getLengthSync(), when length is known.\n // e.g. for streaming directly from a remote server,\n // w/ a known file a size, and not wanting to wait for\n // incoming file to finish to get its size.\n if (options.knownLength != null) {\n valueLength += +options.knownLength;\n } else if (Buffer.isBuffer(value)) {\n valueLength = value.length;\n } else if (typeof value === 'string') {\n valueLength = Buffer.byteLength(value);\n }\n\n this._valueLength += valueLength;\n\n // @check why add CRLF? does this account for custom/multiple CRLFs?\n this._overheadLength +=\n Buffer.byteLength(header) +\n FormData.LINE_BREAK.length;\n\n // empty or either doesn't have path or not an http response\n if (!value || ( !value.path && !(value.readable && value.hasOwnProperty('httpVersion')) )) {\n return;\n }\n\n // no need to bother with the length\n if (!options.knownLength) {\n this._valuesToMeasure.push(value);\n }\n};\n\nFormData.prototype._lengthRetriever = function(value, callback) {\n\n if (value.hasOwnProperty('fd')) {\n\n // take read range into a account\n // `end` = Infinity –> read file till the end\n //\n // TODO: Looks like there is bug in Node fs.createReadStream\n // it doesn't respect `end` options without `start` options\n // Fix it when node fixes it.\n // https://github.com/joyent/node/issues/7819\n if (value.end != undefined && value.end != Infinity && value.start != undefined) {\n\n // when end specified\n // no need to calculate range\n // inclusive, starts with 0\n callback(null, value.end + 1 - (value.start ? value.start : 0));\n\n // not that fast snoopy\n } else {\n // still need to fetch file size from fs\n fs.stat(value.path, function(err, stat) {\n\n var fileSize;\n\n if (err) {\n callback(err);\n return;\n }\n\n // update final size based on the range options\n fileSize = stat.size - (value.start ? value.start : 0);\n callback(null, fileSize);\n });\n }\n\n // or http response\n } else if (value.hasOwnProperty('httpVersion')) {\n callback(null, +value.headers['content-length']);\n\n // or request stream http://github.com/mikeal/request\n } else if (value.hasOwnProperty('httpModule')) {\n // wait till response come back\n value.on('response', function(response) {\n value.pause();\n callback(null, +response.headers['content-length']);\n });\n value.resume();\n\n // something else\n } else {\n callback('Unknown stream');\n }\n};\n\nFormData.prototype._multiPartHeader = function(field, value, options) {\n // custom header specified (as string)?\n // it becomes responsible for boundary\n // (e.g. to handle extra CRLFs on .NET servers)\n if (typeof options.header == 'string') {\n return options.header;\n }\n\n var contentDisposition = this._getContentDisposition(value, options);\n var contentType = this._getContentType(value, options);\n\n var contents = '';\n var headers = {\n // add custom disposition as third element or keep it two elements if not\n 'Content-Disposition': ['form-data', 'name=\"' + field + '\"'].concat(contentDisposition || []),\n // if no content type. allow it to be empty array\n 'Content-Type': [].concat(contentType || [])\n };\n\n // allow custom headers.\n if (typeof options.header == 'object') {\n populate(headers, options.header);\n }\n\n var header;\n for (var prop in headers) {\n if (!headers.hasOwnProperty(prop)) continue;\n header = headers[prop];\n\n // skip nullish headers.\n if (header == null) {\n continue;\n }\n\n // convert all headers to arrays.\n if (!Array.isArray(header)) {\n header = [header];\n }\n\n // add non-empty headers.\n if (header.length) {\n contents += prop + ': ' + header.join('; ') + FormData.LINE_BREAK;\n }\n }\n\n return '--' + this.getBoundary() + FormData.LINE_BREAK + contents + FormData.LINE_BREAK;\n};\n\nFormData.prototype._getContentDisposition = function(value, options) {\n\n var filename\n , contentDisposition\n ;\n\n if (typeof options.filepath === 'string') {\n // custom filepath for relative paths\n filename = path.normalize(options.filepath).replace(/\\\\/g, '/');\n } else if (options.filename || value.name || value.path) {\n // custom filename take precedence\n // formidable and the browser add a name property\n // fs- and request- streams have path property\n filename = path.basename(options.filename || value.name || value.path);\n } else if (value.readable && value.hasOwnProperty('httpVersion')) {\n // or try http response\n filename = path.basename(value.client._httpMessage.path);\n }\n\n if (filename) {\n contentDisposition = 'filename=\"' + filename + '\"';\n }\n\n return contentDisposition;\n};\n\nFormData.prototype._getContentType = function(value, options) {\n\n // use custom content-type above all\n var contentType = options.contentType;\n\n // or try `name` from formidable, browser\n if (!contentType && value.name) {\n contentType = mime.lookup(value.name);\n }\n\n // or try `path` from fs-, request- streams\n if (!contentType && value.path) {\n contentType = mime.lookup(value.path);\n }\n\n // or if it's http-reponse\n if (!contentType && value.readable && value.hasOwnProperty('httpVersion')) {\n contentType = value.headers['content-type'];\n }\n\n // or guess it from the filepath or filename\n if (!contentType && (options.filepath || options.filename)) {\n contentType = mime.lookup(options.filepath || options.filename);\n }\n\n // fallback to the default content type if `value` is not simple value\n if (!contentType && typeof value == 'object') {\n contentType = FormData.DEFAULT_CONTENT_TYPE;\n }\n\n return contentType;\n};\n\nFormData.prototype._multiPartFooter = function() {\n return function(next) {\n var footer = FormData.LINE_BREAK;\n\n var lastPart = (this._streams.length === 0);\n if (lastPart) {\n footer += this._lastBoundary();\n }\n\n next(footer);\n }.bind(this);\n};\n\nFormData.prototype._lastBoundary = function() {\n return '--' + this.getBoundary() + '--' + FormData.LINE_BREAK;\n};\n\nFormData.prototype.getHeaders = function(userHeaders) {\n var header;\n var formHeaders = {\n 'content-type': 'multipart/form-data; boundary=' + this.getBoundary()\n };\n\n for (header in userHeaders) {\n if (userHeaders.hasOwnProperty(header)) {\n formHeaders[header.toLowerCase()] = userHeaders[header];\n }\n }\n\n return formHeaders;\n};\n\nFormData.prototype.getBoundary = function() {\n if (!this._boundary) {\n this._generateBoundary();\n }\n\n return this._boundary;\n};\n\nFormData.prototype._generateBoundary = function() {\n // This generates a 50 character boundary similar to those used by Firefox.\n // They are optimized for boyer-moore parsing.\n var boundary = '--------------------------';\n for (var i = 0; i < 24; i++) {\n boundary += Math.floor(Math.random() * 10).toString(16);\n }\n\n this._boundary = boundary;\n};\n\n// Note: getLengthSync DOESN'T calculate streams length\n// As workaround one can calculate file size manually\n// and add it as knownLength option\nFormData.prototype.getLengthSync = function() {\n var knownLength = this._overheadLength + this._valueLength;\n\n // Don't get confused, there are 3 \"internal\" streams for each keyval pair\n // so it basically checks if there is any value added to the form\n if (this._streams.length) {\n knownLength += this._lastBoundary().length;\n }\n\n // https://github.com/form-data/form-data/issues/40\n if (!this.hasKnownLength()) {\n // Some async length retrievers are present\n // therefore synchronous length calculation is false.\n // Please use getLength(callback) to get proper length\n this._error(new Error('Cannot calculate proper length in synchronous way.'));\n }\n\n return knownLength;\n};\n\n// Public API to check if length of added values is known\n// https://github.com/form-data/form-data/issues/196\n// https://github.com/form-data/form-data/issues/262\nFormData.prototype.hasKnownLength = function() {\n var hasKnownLength = true;\n\n if (this._valuesToMeasure.length) {\n hasKnownLength = false;\n }\n\n return hasKnownLength;\n};\n\nFormData.prototype.getLength = function(cb) {\n var knownLength = this._overheadLength + this._valueLength;\n\n if (this._streams.length) {\n knownLength += this._lastBoundary().length;\n }\n\n if (!this._valuesToMeasure.length) {\n process.nextTick(cb.bind(this, null, knownLength));\n return;\n }\n\n asynckit.parallel(this._valuesToMeasure, this._lengthRetriever, function(err, values) {\n if (err) {\n cb(err);\n return;\n }\n\n values.forEach(function(length) {\n knownLength += length;\n });\n\n cb(null, knownLength);\n });\n};\n\nFormData.prototype.submit = function(params, cb) {\n var request\n , options\n , defaults = {method: 'post'}\n ;\n\n // parse provided url if it's string\n // or treat it as options object\n if (typeof params == 'string') {\n\n params = parseUrl(params);\n options = populate({\n port: params.port,\n path: params.pathname,\n host: params.hostname,\n protocol: params.protocol\n }, defaults);\n\n // use custom params\n } else {\n\n options = populate(params, defaults);\n // if no port provided use default one\n if (!options.port) {\n options.port = options.protocol == 'https:' ? 443 : 80;\n }\n }\n\n // put that good code in getHeaders to some use\n options.headers = this.getHeaders(params.headers);\n\n // https if specified, fallback to http in any other case\n if (options.protocol == 'https:') {\n request = https.request(options);\n } else {\n request = http.request(options);\n }\n\n // get content length and fire away\n this.getLength(function(err, length) {\n if (err) {\n this._error(err);\n return;\n }\n\n // add content length\n request.setHeader('Content-Length', length);\n\n this.pipe(request);\n if (cb) {\n request.on('error', cb);\n request.on('response', cb.bind(this, null));\n }\n }.bind(this));\n\n return request;\n};\n\nFormData.prototype._error = function(err) {\n if (!this.error) {\n this.error = err;\n this.pause();\n this.emit('error', err);\n }\n};\n\nFormData.prototype.toString = function () {\n return '[object FormData]';\n};\n","// populates missing values\nmodule.exports = function(dst, src) {\n\n Object.keys(src).forEach(function(prop)\n {\n dst[prop] = dst[prop] || src[prop];\n });\n\n return dst;\n};\n","'use strict';\n\nvar replace = String.prototype.replace;\nvar percentTwenties = /%20/g;\n\nmodule.exports = {\n 'default': 'RFC3986',\n formatters: {\n RFC1738: function (value) {\n return replace.call(value, percentTwenties, '+');\n },\n RFC3986: function (value) {\n return value;\n }\n },\n RFC1738: 'RFC1738',\n RFC3986: 'RFC3986'\n};\n","'use strict';\n\nvar stringify = require('./stringify');\nvar parse = require('./parse');\nvar formats = require('./formats');\n\nmodule.exports = {\n formats: formats,\n parse: parse,\n stringify: stringify\n};\n","'use strict';\n\nvar utils = require('./utils');\n\nvar has = Object.prototype.hasOwnProperty;\n\nvar defaults = {\n allowDots: false,\n allowPrototypes: false,\n arrayLimit: 20,\n decoder: utils.decode,\n delimiter: '&',\n depth: 5,\n parameterLimit: 1000,\n plainObjects: false,\n strictNullHandling: false\n};\n\nvar parseValues = function parseQueryStringValues(str, options) {\n var obj = {};\n var cleanStr = options.ignoreQueryPrefix ? str.replace(/^\\?/, '') : str;\n var limit = options.parameterLimit === Infinity ? undefined : options.parameterLimit;\n var parts = cleanStr.split(options.delimiter, limit);\n\n for (var i = 0; i < parts.length; ++i) {\n var part = parts[i];\n\n var bracketEqualsPos = part.indexOf(']=');\n var pos = bracketEqualsPos === -1 ? part.indexOf('=') : bracketEqualsPos + 1;\n\n var key, val;\n if (pos === -1) {\n key = options.decoder(part, defaults.decoder);\n val = options.strictNullHandling ? null : '';\n } else {\n key = options.decoder(part.slice(0, pos), defaults.decoder);\n val = options.decoder(part.slice(pos + 1), defaults.decoder);\n }\n if (has.call(obj, key)) {\n obj[key] = [].concat(obj[key]).concat(val);\n } else {\n obj[key] = val;\n }\n }\n\n return obj;\n};\n\nvar parseObject = function (chain, val, options) {\n var leaf = val;\n\n for (var i = chain.length - 1; i >= 0; --i) {\n var obj;\n var root = chain[i];\n\n if (root === '[]') {\n obj = [];\n obj = obj.concat(leaf);\n } else {\n obj = options.plainObjects ? Object.create(null) : {};\n var cleanRoot = root.charAt(0) === '[' && root.charAt(root.length - 1) === ']' ? root.slice(1, -1) : root;\n var index = parseInt(cleanRoot, 10);\n if (\n !isNaN(index)\n && root !== cleanRoot\n && String(index) === cleanRoot\n && index >= 0\n && (options.parseArrays && index <= options.arrayLimit)\n ) {\n obj = [];\n obj[index] = leaf;\n } else {\n obj[cleanRoot] = leaf;\n }\n }\n\n leaf = obj;\n }\n\n return leaf;\n};\n\nvar parseKeys = function parseQueryStringKeys(givenKey, val, options) {\n if (!givenKey) {\n return;\n }\n\n // Transform dot notation to bracket notation\n var key = options.allowDots ? givenKey.replace(/\\.([^.[]+)/g, '[$1]') : givenKey;\n\n // The regex chunks\n\n var brackets = /(\\[[^[\\]]*])/;\n var child = /(\\[[^[\\]]*])/g;\n\n // Get the parent\n\n var segment = brackets.exec(key);\n var parent = segment ? key.slice(0, segment.index) : key;\n\n // Stash the parent if it exists\n\n var keys = [];\n if (parent) {\n // If we aren't using plain objects, optionally prefix keys\n // that would overwrite object prototype properties\n if (!options.plainObjects && has.call(Object.prototype, parent)) {\n if (!options.allowPrototypes) {\n return;\n }\n }\n\n keys.push(parent);\n }\n\n // Loop through children appending to the array until we hit depth\n\n var i = 0;\n while ((segment = child.exec(key)) !== null && i < options.depth) {\n i += 1;\n if (!options.plainObjects && has.call(Object.prototype, segment[1].slice(1, -1))) {\n if (!options.allowPrototypes) {\n return;\n }\n }\n keys.push(segment[1]);\n }\n\n // If there's a remainder, just add whatever is left\n\n if (segment) {\n keys.push('[' + key.slice(segment.index) + ']');\n }\n\n return parseObject(keys, val, options);\n};\n\nmodule.exports = function (str, opts) {\n var options = opts ? utils.assign({}, opts) : {};\n\n if (options.decoder !== null && options.decoder !== undefined && typeof options.decoder !== 'function') {\n throw new TypeError('Decoder has to be a function.');\n }\n\n options.ignoreQueryPrefix = options.ignoreQueryPrefix === true;\n options.delimiter = typeof options.delimiter === 'string' || utils.isRegExp(options.delimiter) ? options.delimiter : defaults.delimiter;\n options.depth = typeof options.depth === 'number' ? options.depth : defaults.depth;\n options.arrayLimit = typeof options.arrayLimit === 'number' ? options.arrayLimit : defaults.arrayLimit;\n options.parseArrays = options.parseArrays !== false;\n options.decoder = typeof options.decoder === 'function' ? options.decoder : defaults.decoder;\n options.allowDots = typeof options.allowDots === 'boolean' ? options.allowDots : defaults.allowDots;\n options.plainObjects = typeof options.plainObjects === 'boolean' ? options.plainObjects : defaults.plainObjects;\n options.allowPrototypes = typeof options.allowPrototypes === 'boolean' ? options.allowPrototypes : defaults.allowPrototypes;\n options.parameterLimit = typeof options.parameterLimit === 'number' ? options.parameterLimit : defaults.parameterLimit;\n options.strictNullHandling = typeof options.strictNullHandling === 'boolean' ? options.strictNullHandling : defaults.strictNullHandling;\n\n if (str === '' || str === null || typeof str === 'undefined') {\n return options.plainObjects ? Object.create(null) : {};\n }\n\n var tempObj = typeof str === 'string' ? parseValues(str, options) : str;\n var obj = options.plainObjects ? Object.create(null) : {};\n\n // Iterate over the keys and setup the new object\n\n var keys = Object.keys(tempObj);\n for (var i = 0; i < keys.length; ++i) {\n var key = keys[i];\n var newObj = parseKeys(key, tempObj[key], options);\n obj = utils.merge(obj, newObj, options);\n }\n\n return utils.compact(obj);\n};\n","'use strict';\n\nvar utils = require('./utils');\nvar formats = require('./formats');\n\nvar arrayPrefixGenerators = {\n brackets: function brackets(prefix) { // eslint-disable-line func-name-matching\n return prefix + '[]';\n },\n indices: function indices(prefix, key) { // eslint-disable-line func-name-matching\n return prefix + '[' + key + ']';\n },\n repeat: function repeat(prefix) { // eslint-disable-line func-name-matching\n return prefix;\n }\n};\n\nvar toISO = Date.prototype.toISOString;\n\nvar defaults = {\n delimiter: '&',\n encode: true,\n encoder: utils.encode,\n encodeValuesOnly: false,\n serializeDate: function serializeDate(date) { // eslint-disable-line func-name-matching\n return toISO.call(date);\n },\n skipNulls: false,\n strictNullHandling: false\n};\n\nvar stringify = function stringify( // eslint-disable-line func-name-matching\n object,\n prefix,\n generateArrayPrefix,\n strictNullHandling,\n skipNulls,\n encoder,\n filter,\n sort,\n allowDots,\n serializeDate,\n formatter,\n encodeValuesOnly\n) {\n var obj = object;\n if (typeof filter === 'function') {\n obj = filter(prefix, obj);\n } else if (obj instanceof Date) {\n obj = serializeDate(obj);\n } else if (obj === null) {\n if (strictNullHandling) {\n return encoder && !encodeValuesOnly ? encoder(prefix, defaults.encoder) : prefix;\n }\n\n obj = '';\n }\n\n if (typeof obj === 'string' || typeof obj === 'number' || typeof obj === 'boolean' || utils.isBuffer(obj)) {\n if (encoder) {\n var keyValue = encodeValuesOnly ? prefix : encoder(prefix, defaults.encoder);\n return [formatter(keyValue) + '=' + formatter(encoder(obj, defaults.encoder))];\n }\n return [formatter(prefix) + '=' + formatter(String(obj))];\n }\n\n var values = [];\n\n if (typeof obj === 'undefined') {\n return values;\n }\n\n var objKeys;\n if (Array.isArray(filter)) {\n objKeys = filter;\n } else {\n var keys = Object.keys(obj);\n objKeys = sort ? keys.sort(sort) : keys;\n }\n\n for (var i = 0; i < objKeys.length; ++i) {\n var key = objKeys[i];\n\n if (skipNulls && obj[key] === null) {\n continue;\n }\n\n if (Array.isArray(obj)) {\n values = values.concat(stringify(\n obj[key],\n generateArrayPrefix(prefix, key),\n generateArrayPrefix,\n strictNullHandling,\n skipNulls,\n encoder,\n filter,\n sort,\n allowDots,\n serializeDate,\n formatter,\n encodeValuesOnly\n ));\n } else {\n values = values.concat(stringify(\n obj[key],\n prefix + (allowDots ? '.' + key : '[' + key + ']'),\n generateArrayPrefix,\n strictNullHandling,\n skipNulls,\n encoder,\n filter,\n sort,\n allowDots,\n serializeDate,\n formatter,\n encodeValuesOnly\n ));\n }\n }\n\n return values;\n};\n\nmodule.exports = function (object, opts) {\n var obj = object;\n var options = opts ? utils.assign({}, opts) : {};\n\n if (options.encoder !== null && options.encoder !== undefined && typeof options.encoder !== 'function') {\n throw new TypeError('Encoder has to be a function.');\n }\n\n var delimiter = typeof options.delimiter === 'undefined' ? defaults.delimiter : options.delimiter;\n var strictNullHandling = typeof options.strictNullHandling === 'boolean' ? options.strictNullHandling : defaults.strictNullHandling;\n var skipNulls = typeof options.skipNulls === 'boolean' ? options.skipNulls : defaults.skipNulls;\n var encode = typeof options.encode === 'boolean' ? options.encode : defaults.encode;\n var encoder = typeof options.encoder === 'function' ? options.encoder : defaults.encoder;\n var sort = typeof options.sort === 'function' ? options.sort : null;\n var allowDots = typeof options.allowDots === 'undefined' ? false : options.allowDots;\n var serializeDate = typeof options.serializeDate === 'function' ? options.serializeDate : defaults.serializeDate;\n var encodeValuesOnly = typeof options.encodeValuesOnly === 'boolean' ? options.encodeValuesOnly : defaults.encodeValuesOnly;\n if (typeof options.format === 'undefined') {\n options.format = formats['default'];\n } else if (!Object.prototype.hasOwnProperty.call(formats.formatters, options.format)) {\n throw new TypeError('Unknown format option provided.');\n }\n var formatter = formats.formatters[options.format];\n var objKeys;\n var filter;\n\n if (typeof options.filter === 'function') {\n filter = options.filter;\n obj = filter('', obj);\n } else if (Array.isArray(options.filter)) {\n filter = options.filter;\n objKeys = filter;\n }\n\n var keys = [];\n\n if (typeof obj !== 'object' || obj === null) {\n return '';\n }\n\n var arrayFormat;\n if (options.arrayFormat in arrayPrefixGenerators) {\n arrayFormat = options.arrayFormat;\n } else if ('indices' in options) {\n arrayFormat = options.indices ? 'indices' : 'repeat';\n } else {\n arrayFormat = 'indices';\n }\n\n var generateArrayPrefix = arrayPrefixGenerators[arrayFormat];\n\n if (!objKeys) {\n objKeys = Object.keys(obj);\n }\n\n if (sort) {\n objKeys.sort(sort);\n }\n\n for (var i = 0; i < objKeys.length; ++i) {\n var key = objKeys[i];\n\n if (skipNulls && obj[key] === null) {\n continue;\n }\n\n keys = keys.concat(stringify(\n obj[key],\n key,\n generateArrayPrefix,\n strictNullHandling,\n skipNulls,\n encode ? encoder : null,\n filter,\n sort,\n allowDots,\n serializeDate,\n formatter,\n encodeValuesOnly\n ));\n }\n\n var joined = keys.join(delimiter);\n var prefix = options.addQueryPrefix === true ? '?' : '';\n\n return joined.length > 0 ? prefix + joined : '';\n};\n","'use strict';\n\nvar has = Object.prototype.hasOwnProperty;\n\nvar hexTable = (function () {\n var array = [];\n for (var i = 0; i < 256; ++i) {\n array.push('%' + ((i < 16 ? '0' : '') + i.toString(16)).toUpperCase());\n }\n\n return array;\n}());\n\nvar compactQueue = function compactQueue(queue) {\n var obj;\n\n while (queue.length) {\n var item = queue.pop();\n obj = item.obj[item.prop];\n\n if (Array.isArray(obj)) {\n var compacted = [];\n\n for (var j = 0; j < obj.length; ++j) {\n if (typeof obj[j] !== 'undefined') {\n compacted.push(obj[j]);\n }\n }\n\n item.obj[item.prop] = compacted;\n }\n }\n\n return obj;\n};\n\nvar arrayToObject = function arrayToObject(source, options) {\n var obj = options && options.plainObjects ? Object.create(null) : {};\n for (var i = 0; i < source.length; ++i) {\n if (typeof source[i] !== 'undefined') {\n obj[i] = source[i];\n }\n }\n\n return obj;\n};\n\nvar merge = function merge(target, source, options) {\n if (!source) {\n return target;\n }\n\n if (typeof source !== 'object') {\n if (Array.isArray(target)) {\n target.push(source);\n } else if (typeof target === 'object') {\n if (options.plainObjects || options.allowPrototypes || !has.call(Object.prototype, source)) {\n target[source] = true;\n }\n } else {\n return [target, source];\n }\n\n return target;\n }\n\n if (typeof target !== 'object') {\n return [target].concat(source);\n }\n\n var mergeTarget = target;\n if (Array.isArray(target) && !Array.isArray(source)) {\n mergeTarget = arrayToObject(target, options);\n }\n\n if (Array.isArray(target) && Array.isArray(source)) {\n source.forEach(function (item, i) {\n if (has.call(target, i)) {\n if (target[i] && typeof target[i] === 'object') {\n target[i] = merge(target[i], item, options);\n } else {\n target.push(item);\n }\n } else {\n target[i] = item;\n }\n });\n return target;\n }\n\n return Object.keys(source).reduce(function (acc, key) {\n var value = source[key];\n\n if (has.call(acc, key)) {\n acc[key] = merge(acc[key], value, options);\n } else {\n acc[key] = value;\n }\n return acc;\n }, mergeTarget);\n};\n\nvar assign = function assignSingleSource(target, source) {\n return Object.keys(source).reduce(function (acc, key) {\n acc[key] = source[key];\n return acc;\n }, target);\n};\n\nvar decode = function (str) {\n try {\n return decodeURIComponent(str.replace(/\\+/g, ' '));\n } catch (e) {\n return str;\n }\n};\n\nvar encode = function encode(str) {\n // This code was originally written by Brian White (mscdex) for the io.js core querystring library.\n // It has been adapted here for stricter adherence to RFC 3986\n if (str.length === 0) {\n return str;\n }\n\n var string = typeof str === 'string' ? str : String(str);\n\n var out = '';\n for (var i = 0; i < string.length; ++i) {\n var c = string.charCodeAt(i);\n\n if (\n c === 0x2D // -\n || c === 0x2E // .\n || c === 0x5F // _\n || c === 0x7E // ~\n || (c >= 0x30 && c <= 0x39) // 0-9\n || (c >= 0x41 && c <= 0x5A) // a-z\n || (c >= 0x61 && c <= 0x7A) // A-Z\n ) {\n out += string.charAt(i);\n continue;\n }\n\n if (c < 0x80) {\n out = out + hexTable[c];\n continue;\n }\n\n if (c < 0x800) {\n out = out + (hexTable[0xC0 | (c >> 6)] + hexTable[0x80 | (c & 0x3F)]);\n continue;\n }\n\n if (c < 0xD800 || c >= 0xE000) {\n out = out + (hexTable[0xE0 | (c >> 12)] + hexTable[0x80 | ((c >> 6) & 0x3F)] + hexTable[0x80 | (c & 0x3F)]);\n continue;\n }\n\n i += 1;\n c = 0x10000 + (((c & 0x3FF) << 10) | (string.charCodeAt(i) & 0x3FF));\n out += hexTable[0xF0 | (c >> 18)]\n + hexTable[0x80 | ((c >> 12) & 0x3F)]\n + hexTable[0x80 | ((c >> 6) & 0x3F)]\n + hexTable[0x80 | (c & 0x3F)];\n }\n\n return out;\n};\n\nvar compact = function compact(value) {\n var queue = [{ obj: { o: value }, prop: 'o' }];\n var refs = [];\n\n for (var i = 0; i < queue.length; ++i) {\n var item = queue[i];\n var obj = item.obj[item.prop];\n\n var keys = Object.keys(obj);\n for (var j = 0; j < keys.length; ++j) {\n var key = keys[j];\n var val = obj[key];\n if (typeof val === 'object' && val !== null && refs.indexOf(val) === -1) {\n queue.push({ obj: obj, prop: key });\n refs.push(val);\n }\n }\n }\n\n return compactQueue(queue);\n};\n\nvar isRegExp = function isRegExp(obj) {\n return Object.prototype.toString.call(obj) === '[object RegExp]';\n};\n\nvar isBuffer = function isBuffer(obj) {\n if (obj === null || typeof obj === 'undefined') {\n return false;\n }\n\n return !!(obj.constructor && obj.constructor.isBuffer && obj.constructor.isBuffer(obj));\n};\n\nmodule.exports = {\n arrayToObject: arrayToObject,\n assign: assign,\n compact: compact,\n decode: decode,\n encode: encode,\n isBuffer: isBuffer,\n isRegExp: isRegExp,\n merge: merge\n};\n","/**\n * Convert array of 16 byte values to UUID string format of the form:\n * XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX\n */\nvar byteToHex = [];\nfor (var i = 0; i < 256; ++i) {\n byteToHex[i] = (i + 0x100).toString(16).substr(1);\n}\n\nfunction bytesToUuid(buf, offset) {\n var i = offset || 0;\n var bth = byteToHex;\n // join used to fix memory issue caused by concatenation: https://bugs.chromium.org/p/v8/issues/detail?id=3175#c4\n return ([\n bth[buf[i++]], bth[buf[i++]],\n bth[buf[i++]], bth[buf[i++]], '-',\n bth[buf[i++]], bth[buf[i++]], '-',\n bth[buf[i++]], bth[buf[i++]], '-',\n bth[buf[i++]], bth[buf[i++]], '-',\n bth[buf[i++]], bth[buf[i++]],\n bth[buf[i++]], bth[buf[i++]],\n bth[buf[i++]], bth[buf[i++]]\n ]).join('');\n}\n\nmodule.exports = bytesToUuid;\n","// Unique ID creation requires a high quality random # generator. In node.js\n// this is pretty straight-forward - we use the crypto API.\n\nvar crypto = require('crypto');\n\nmodule.exports = function nodeRNG() {\n return crypto.randomBytes(16);\n};\n","var rng = require('./lib/rng');\nvar bytesToUuid = require('./lib/bytesToUuid');\n\nfunction v4(options, buf, offset) {\n var i = buf && offset || 0;\n\n if (typeof(options) == 'string') {\n buf = options === 'binary' ? new Array(16) : null;\n options = null;\n }\n options = options || {};\n\n var rnds = options.random || (options.rng || rng)();\n\n // Per 4.4, set bits for version and `clock_seq_hi_and_reserved`\n rnds[6] = (rnds[6] & 0x0f) | 0x40;\n rnds[8] = (rnds[8] & 0x3f) | 0x80;\n\n // Copy bytes to buffer, if provided\n if (buf) {\n for (var ii = 0; ii < 16; ++ii) {\n buf[i + ii] = rnds[ii];\n }\n }\n\n return buf || bytesToUuid(rnds);\n}\n\nmodule.exports = v4;\n","'use strict'\n\nvar http = require('http')\nvar https = require('https')\nvar url = require('url')\nvar util = require('util')\nvar stream = require('stream')\nvar zlib = require('zlib')\nvar aws2 = require('aws-sign2')\nvar aws4 = require('aws4')\nvar httpSignature = require('http-signature')\nvar mime = require('mime-types')\nvar caseless = require('caseless')\nvar ForeverAgent = require('forever-agent')\nvar FormData = require('form-data')\nvar extend = require('extend')\nvar isstream = require('isstream')\nvar isTypedArray = require('is-typedarray').strict\nvar helpers = require('./lib/helpers')\nvar cookies = require('./lib/cookies')\nvar getProxyFromURI = require('./lib/getProxyFromURI')\nvar Querystring = require('./lib/querystring').Querystring\nvar Har = require('./lib/har').Har\nvar Auth = require('./lib/auth').Auth\nvar OAuth = require('./lib/oauth').OAuth\nvar hawk = require('./lib/hawk')\nvar Multipart = require('./lib/multipart').Multipart\nvar Redirect = require('./lib/redirect').Redirect\nvar Tunnel = require('./lib/tunnel').Tunnel\nvar now = require('performance-now')\nvar Buffer = require('safe-buffer').Buffer\n\nvar safeStringify = helpers.safeStringify\nvar isReadStream = helpers.isReadStream\nvar toBase64 = helpers.toBase64\nvar defer = helpers.defer\nvar copy = helpers.copy\nvar version = helpers.version\nvar globalCookieJar = cookies.jar()\n\nvar globalPool = {}\n\nfunction filterForNonReserved (reserved, options) {\n // Filter out properties that are not reserved.\n // Reserved values are passed in at call site.\n\n var object = {}\n for (var i in options) {\n var notReserved = (reserved.indexOf(i) === -1)\n if (notReserved) {\n object[i] = options[i]\n }\n }\n return object\n}\n\nfunction filterOutReservedFunctions (reserved, options) {\n // Filter out properties that are functions and are reserved.\n // Reserved values are passed in at call site.\n\n var object = {}\n for (var i in options) {\n var isReserved = !(reserved.indexOf(i) === -1)\n var isFunction = (typeof options[i] === 'function')\n if (!(isReserved && isFunction)) {\n object[i] = options[i]\n }\n }\n return object\n}\n\n// Return a simpler request object to allow serialization\nfunction requestToJSON () {\n var self = this\n return {\n uri: self.uri,\n method: self.method,\n headers: self.headers\n }\n}\n\n// Return a simpler response object to allow serialization\nfunction responseToJSON () {\n var self = this\n return {\n statusCode: self.statusCode,\n body: self.body,\n headers: self.headers,\n request: requestToJSON.call(self.request)\n }\n}\n\nfunction Request (options) {\n // if given the method property in options, set property explicitMethod to true\n\n // extend the Request instance with any non-reserved properties\n // remove any reserved functions from the options object\n // set Request instance to be readable and writable\n // call init\n\n var self = this\n\n // start with HAR, then override with additional options\n if (options.har) {\n self._har = new Har(self)\n options = self._har.options(options)\n }\n\n stream.Stream.call(self)\n var reserved = Object.keys(Request.prototype)\n var nonReserved = filterForNonReserved(reserved, options)\n\n extend(self, nonReserved)\n options = filterOutReservedFunctions(reserved, options)\n\n self.readable = true\n self.writable = true\n if (options.method) {\n self.explicitMethod = true\n }\n self._qs = new Querystring(self)\n self._auth = new Auth(self)\n self._oauth = new OAuth(self)\n self._multipart = new Multipart(self)\n self._redirect = new Redirect(self)\n self._tunnel = new Tunnel(self)\n self.init(options)\n}\n\nutil.inherits(Request, stream.Stream)\n\n// Debugging\nRequest.debug = process.env.NODE_DEBUG && /\\brequest\\b/.test(process.env.NODE_DEBUG)\nfunction debug () {\n if (Request.debug) {\n console.error('REQUEST %s', util.format.apply(util, arguments))\n }\n}\nRequest.prototype.debug = debug\n\nRequest.prototype.init = function (options) {\n // init() contains all the code to setup the request object.\n // the actual outgoing request is not started until start() is called\n // this function is called from both the constructor and on redirect.\n var self = this\n if (!options) {\n options = {}\n }\n self.headers = self.headers ? copy(self.headers) : {}\n\n // Delete headers with value undefined since they break\n // ClientRequest.OutgoingMessage.setHeader in node 0.12\n for (var headerName in self.headers) {\n if (typeof self.headers[headerName] === 'undefined') {\n delete self.headers[headerName]\n }\n }\n\n caseless.httpify(self, self.headers)\n\n if (!self.method) {\n self.method = options.method || 'GET'\n }\n if (!self.localAddress) {\n self.localAddress = options.localAddress\n }\n\n self._qs.init(options)\n\n debug(options)\n if (!self.pool && self.pool !== false) {\n self.pool = globalPool\n }\n self.dests = self.dests || []\n self.__isRequestRequest = true\n\n // Protect against double callback\n if (!self._callback && self.callback) {\n self._callback = self.callback\n self.callback = function () {\n if (self._callbackCalled) {\n return // Print a warning maybe?\n }\n self._callbackCalled = true\n self._callback.apply(self, arguments)\n }\n self.on('error', self.callback.bind())\n self.on('complete', self.callback.bind(self, null))\n }\n\n // People use this property instead all the time, so support it\n if (!self.uri && self.url) {\n self.uri = self.url\n delete self.url\n }\n\n // If there's a baseUrl, then use it as the base URL (i.e. uri must be\n // specified as a relative path and is appended to baseUrl).\n if (self.baseUrl) {\n if (typeof self.baseUrl !== 'string') {\n return self.emit('error', new Error('options.baseUrl must be a string'))\n }\n\n if (typeof self.uri !== 'string') {\n return self.emit('error', new Error('options.uri must be a string when using options.baseUrl'))\n }\n\n if (self.uri.indexOf('//') === 0 || self.uri.indexOf('://') !== -1) {\n return self.emit('error', new Error('options.uri must be a path when using options.baseUrl'))\n }\n\n // Handle all cases to make sure that there's only one slash between\n // baseUrl and uri.\n var baseUrlEndsWithSlash = self.baseUrl.lastIndexOf('/') === self.baseUrl.length - 1\n var uriStartsWithSlash = self.uri.indexOf('/') === 0\n\n if (baseUrlEndsWithSlash && uriStartsWithSlash) {\n self.uri = self.baseUrl + self.uri.slice(1)\n } else if (baseUrlEndsWithSlash || uriStartsWithSlash) {\n self.uri = self.baseUrl + self.uri\n } else if (self.uri === '') {\n self.uri = self.baseUrl\n } else {\n self.uri = self.baseUrl + '/' + self.uri\n }\n delete self.baseUrl\n }\n\n // A URI is needed by this point, emit error if we haven't been able to get one\n if (!self.uri) {\n return self.emit('error', new Error('options.uri is a required argument'))\n }\n\n // If a string URI/URL was given, parse it into a URL object\n if (typeof self.uri === 'string') {\n self.uri = url.parse(self.uri)\n }\n\n // Some URL objects are not from a URL parsed string and need href added\n if (!self.uri.href) {\n self.uri.href = url.format(self.uri)\n }\n\n // DEPRECATED: Warning for users of the old Unix Sockets URL Scheme\n if (self.uri.protocol === 'unix:') {\n return self.emit('error', new Error('`unix://` URL scheme is no longer supported. Please use the format `http://unix:SOCKET:PATH`'))\n }\n\n // Support Unix Sockets\n if (self.uri.host === 'unix') {\n self.enableUnixSocket()\n }\n\n if (self.strictSSL === false) {\n self.rejectUnauthorized = false\n }\n\n if (!self.uri.pathname) { self.uri.pathname = '/' }\n\n if (!(self.uri.host || (self.uri.hostname && self.uri.port)) && !self.uri.isUnix) {\n // Invalid URI: it may generate lot of bad errors, like 'TypeError: Cannot call method `indexOf` of undefined' in CookieJar\n // Detect and reject it as soon as possible\n var faultyUri = url.format(self.uri)\n var message = 'Invalid URI \"' + faultyUri + '\"'\n if (Object.keys(options).length === 0) {\n // No option ? This can be the sign of a redirect\n // As this is a case where the user cannot do anything (they didn't call request directly with this URL)\n // they should be warned that it can be caused by a redirection (can save some hair)\n message += '. This can be caused by a crappy redirection.'\n }\n // This error was fatal\n self.abort()\n return self.emit('error', new Error(message))\n }\n\n if (!self.hasOwnProperty('proxy')) {\n self.proxy = getProxyFromURI(self.uri)\n }\n\n self.tunnel = self._tunnel.isEnabled()\n if (self.proxy) {\n self._tunnel.setup(options)\n }\n\n self._redirect.onRequest(options)\n\n self.setHost = false\n if (!self.hasHeader('host')) {\n var hostHeaderName = self.originalHostHeaderName || 'host'\n self.setHeader(hostHeaderName, self.uri.host)\n // Drop :port suffix from Host header if known protocol.\n if (self.uri.port) {\n if ((self.uri.port === '80' && self.uri.protocol === 'http:') ||\n (self.uri.port === '443' && self.uri.protocol === 'https:')) {\n self.setHeader(hostHeaderName, self.uri.hostname)\n }\n }\n self.setHost = true\n }\n\n self.jar(self._jar || options.jar)\n\n if (!self.uri.port) {\n if (self.uri.protocol === 'http:') { self.uri.port = 80 } else if (self.uri.protocol === 'https:') { self.uri.port = 443 }\n }\n\n if (self.proxy && !self.tunnel) {\n self.port = self.proxy.port\n self.host = self.proxy.hostname\n } else {\n self.port = self.uri.port\n self.host = self.uri.hostname\n }\n\n if (options.form) {\n self.form(options.form)\n }\n\n if (options.formData) {\n var formData = options.formData\n var requestForm = self.form()\n var appendFormValue = function (key, value) {\n if (value && value.hasOwnProperty('value') && value.hasOwnProperty('options')) {\n requestForm.append(key, value.value, value.options)\n } else {\n requestForm.append(key, value)\n }\n }\n for (var formKey in formData) {\n if (formData.hasOwnProperty(formKey)) {\n var formValue = formData[formKey]\n if (formValue instanceof Array) {\n for (var j = 0; j < formValue.length; j++) {\n appendFormValue(formKey, formValue[j])\n }\n } else {\n appendFormValue(formKey, formValue)\n }\n }\n }\n }\n\n if (options.qs) {\n self.qs(options.qs)\n }\n\n if (self.uri.path) {\n self.path = self.uri.path\n } else {\n self.path = self.uri.pathname + (self.uri.search || '')\n }\n\n if (self.path.length === 0) {\n self.path = '/'\n }\n\n // Auth must happen last in case signing is dependent on other headers\n if (options.aws) {\n self.aws(options.aws)\n }\n\n if (options.hawk) {\n self.hawk(options.hawk)\n }\n\n if (options.httpSignature) {\n self.httpSignature(options.httpSignature)\n }\n\n if (options.auth) {\n if (Object.prototype.hasOwnProperty.call(options.auth, 'username')) {\n options.auth.user = options.auth.username\n }\n if (Object.prototype.hasOwnProperty.call(options.auth, 'password')) {\n options.auth.pass = options.auth.password\n }\n\n self.auth(\n options.auth.user,\n options.auth.pass,\n options.auth.sendImmediately,\n options.auth.bearer\n )\n }\n\n if (self.gzip && !self.hasHeader('accept-encoding')) {\n self.setHeader('accept-encoding', 'gzip, deflate')\n }\n\n if (self.uri.auth && !self.hasHeader('authorization')) {\n var uriAuthPieces = self.uri.auth.split(':').map(function (item) { return self._qs.unescape(item) })\n self.auth(uriAuthPieces[0], uriAuthPieces.slice(1).join(':'), true)\n }\n\n if (!self.tunnel && self.proxy && self.proxy.auth && !self.hasHeader('proxy-authorization')) {\n var proxyAuthPieces = self.proxy.auth.split(':').map(function (item) { return self._qs.unescape(item) })\n var authHeader = 'Basic ' + toBase64(proxyAuthPieces.join(':'))\n self.setHeader('proxy-authorization', authHeader)\n }\n\n if (self.proxy && !self.tunnel) {\n self.path = (self.uri.protocol + '//' + self.uri.host + self.path)\n }\n\n if (options.json) {\n self.json(options.json)\n }\n if (options.multipart) {\n self.multipart(options.multipart)\n }\n\n if (options.time) {\n self.timing = true\n\n // NOTE: elapsedTime is deprecated in favor of .timings\n self.elapsedTime = self.elapsedTime || 0\n }\n\n function setContentLength () {\n if (isTypedArray(self.body)) {\n self.body = Buffer.from(self.body)\n }\n\n if (!self.hasHeader('content-length')) {\n var length\n if (typeof self.body === 'string') {\n length = Buffer.byteLength(self.body)\n } else if (Array.isArray(self.body)) {\n length = self.body.reduce(function (a, b) { return a + b.length }, 0)\n } else {\n length = self.body.length\n }\n\n if (length) {\n self.setHeader('content-length', length)\n } else {\n self.emit('error', new Error('Argument error, options.body.'))\n }\n }\n }\n if (self.body && !isstream(self.body)) {\n setContentLength()\n }\n\n if (options.oauth) {\n self.oauth(options.oauth)\n } else if (self._oauth.params && self.hasHeader('authorization')) {\n self.oauth(self._oauth.params)\n }\n\n var protocol = self.proxy && !self.tunnel ? self.proxy.protocol : self.uri.protocol\n var defaultModules = {'http:': http, 'https:': https}\n var httpModules = self.httpModules || {}\n\n self.httpModule = httpModules[protocol] || defaultModules[protocol]\n\n if (!self.httpModule) {\n return self.emit('error', new Error('Invalid protocol: ' + protocol))\n }\n\n if (options.ca) {\n self.ca = options.ca\n }\n\n if (!self.agent) {\n if (options.agentOptions) {\n self.agentOptions = options.agentOptions\n }\n\n if (options.agentClass) {\n self.agentClass = options.agentClass\n } else if (options.forever) {\n var v = version()\n // use ForeverAgent in node 0.10- only\n if (v.major === 0 && v.minor <= 10) {\n self.agentClass = protocol === 'http:' ? ForeverAgent : ForeverAgent.SSL\n } else {\n self.agentClass = self.httpModule.Agent\n self.agentOptions = self.agentOptions || {}\n self.agentOptions.keepAlive = true\n }\n } else {\n self.agentClass = self.httpModule.Agent\n }\n }\n\n if (self.pool === false) {\n self.agent = false\n } else {\n self.agent = self.agent || self.getNewAgent()\n }\n\n self.on('pipe', function (src) {\n if (self.ntick && self._started) {\n self.emit('error', new Error('You cannot pipe to this stream after the outbound request has started.'))\n }\n self.src = src\n if (isReadStream(src)) {\n if (!self.hasHeader('content-type')) {\n self.setHeader('content-type', mime.lookup(src.path))\n }\n } else {\n if (src.headers) {\n for (var i in src.headers) {\n if (!self.hasHeader(i)) {\n self.setHeader(i, src.headers[i])\n }\n }\n }\n if (self._json && !self.hasHeader('content-type')) {\n self.setHeader('content-type', 'application/json')\n }\n if (src.method && !self.explicitMethod) {\n self.method = src.method\n }\n }\n\n // self.on('pipe', function () {\n // console.error('You have already piped to this stream. Pipeing twice is likely to break the request.')\n // })\n })\n\n defer(function () {\n if (self._aborted) {\n return\n }\n\n var end = function () {\n if (self._form) {\n if (!self._auth.hasAuth) {\n self._form.pipe(self)\n } else if (self._auth.hasAuth && self._auth.sentAuth) {\n self._form.pipe(self)\n }\n }\n if (self._multipart && self._multipart.chunked) {\n self._multipart.body.pipe(self)\n }\n if (self.body) {\n if (isstream(self.body)) {\n self.body.pipe(self)\n } else {\n setContentLength()\n if (Array.isArray(self.body)) {\n self.body.forEach(function (part) {\n self.write(part)\n })\n } else {\n self.write(self.body)\n }\n self.end()\n }\n } else if (self.requestBodyStream) {\n console.warn('options.requestBodyStream is deprecated, please pass the request object to stream.pipe.')\n self.requestBodyStream.pipe(self)\n } else if (!self.src) {\n if (self._auth.hasAuth && !self._auth.sentAuth) {\n self.end()\n return\n }\n if (self.method !== 'GET' && typeof self.method !== 'undefined') {\n self.setHeader('content-length', 0)\n }\n self.end()\n }\n }\n\n if (self._form && !self.hasHeader('content-length')) {\n // Before ending the request, we had to compute the length of the whole form, asyncly\n self.setHeader(self._form.getHeaders(), true)\n self._form.getLength(function (err, length) {\n if (!err && !isNaN(length)) {\n self.setHeader('content-length', length)\n }\n end()\n })\n } else {\n end()\n }\n\n self.ntick = true\n })\n}\n\nRequest.prototype.getNewAgent = function () {\n var self = this\n var Agent = self.agentClass\n var options = {}\n if (self.agentOptions) {\n for (var i in self.agentOptions) {\n options[i] = self.agentOptions[i]\n }\n }\n if (self.ca) {\n options.ca = self.ca\n }\n if (self.ciphers) {\n options.ciphers = self.ciphers\n }\n if (self.secureProtocol) {\n options.secureProtocol = self.secureProtocol\n }\n if (self.secureOptions) {\n options.secureOptions = self.secureOptions\n }\n if (typeof self.rejectUnauthorized !== 'undefined') {\n options.rejectUnauthorized = self.rejectUnauthorized\n }\n\n if (self.cert && self.key) {\n options.key = self.key\n options.cert = self.cert\n }\n\n if (self.pfx) {\n options.pfx = self.pfx\n }\n\n if (self.passphrase) {\n options.passphrase = self.passphrase\n }\n\n var poolKey = ''\n\n // different types of agents are in different pools\n if (Agent !== self.httpModule.Agent) {\n poolKey += Agent.name\n }\n\n // ca option is only relevant if proxy or destination are https\n var proxy = self.proxy\n if (typeof proxy === 'string') {\n proxy = url.parse(proxy)\n }\n var isHttps = (proxy && proxy.protocol === 'https:') || this.uri.protocol === 'https:'\n\n if (isHttps) {\n if (options.ca) {\n if (poolKey) {\n poolKey += ':'\n }\n poolKey += options.ca\n }\n\n if (typeof options.rejectUnauthorized !== 'undefined') {\n if (poolKey) {\n poolKey += ':'\n }\n poolKey += options.rejectUnauthorized\n }\n\n if (options.cert) {\n if (poolKey) {\n poolKey += ':'\n }\n poolKey += options.cert.toString('ascii') + options.key.toString('ascii')\n }\n\n if (options.pfx) {\n if (poolKey) {\n poolKey += ':'\n }\n poolKey += options.pfx.toString('ascii')\n }\n\n if (options.ciphers) {\n if (poolKey) {\n poolKey += ':'\n }\n poolKey += options.ciphers\n }\n\n if (options.secureProtocol) {\n if (poolKey) {\n poolKey += ':'\n }\n poolKey += options.secureProtocol\n }\n\n if (options.secureOptions) {\n if (poolKey) {\n poolKey += ':'\n }\n poolKey += options.secureOptions\n }\n }\n\n if (self.pool === globalPool && !poolKey && Object.keys(options).length === 0 && self.httpModule.globalAgent) {\n // not doing anything special. Use the globalAgent\n return self.httpModule.globalAgent\n }\n\n // we're using a stored agent. Make sure it's protocol-specific\n poolKey = self.uri.protocol + poolKey\n\n // generate a new agent for this setting if none yet exists\n if (!self.pool[poolKey]) {\n self.pool[poolKey] = new Agent(options)\n // properly set maxSockets on new agents\n if (self.pool.maxSockets) {\n self.pool[poolKey].maxSockets = self.pool.maxSockets\n }\n }\n\n return self.pool[poolKey]\n}\n\nRequest.prototype.start = function () {\n // start() is called once we are ready to send the outgoing HTTP request.\n // this is usually called on the first write(), end() or on nextTick()\n var self = this\n\n if (self.timing) {\n // All timings will be relative to this request's startTime. In order to do this,\n // we need to capture the wall-clock start time (via Date), immediately followed\n // by the high-resolution timer (via now()). While these two won't be set\n // at the _exact_ same time, they should be close enough to be able to calculate\n // high-resolution, monotonically non-decreasing timestamps relative to startTime.\n var startTime = new Date().getTime()\n var startTimeNow = now()\n }\n\n if (self._aborted) {\n return\n }\n\n self._started = true\n self.method = self.method || 'GET'\n self.href = self.uri.href\n\n if (self.src && self.src.stat && self.src.stat.size && !self.hasHeader('content-length')) {\n self.setHeader('content-length', self.src.stat.size)\n }\n if (self._aws) {\n self.aws(self._aws, true)\n }\n\n // We have a method named auth, which is completely different from the http.request\n // auth option. If we don't remove it, we're gonna have a bad time.\n var reqOptions = copy(self)\n delete reqOptions.auth\n\n debug('make request', self.uri.href)\n\n // node v6.8.0 now supports a `timeout` value in `http.request()`, but we\n // should delete it for now since we handle timeouts manually for better\n // consistency with node versions before v6.8.0\n delete reqOptions.timeout\n\n try {\n self.req = self.httpModule.request(reqOptions)\n } catch (err) {\n self.emit('error', err)\n return\n }\n\n if (self.timing) {\n self.startTime = startTime\n self.startTimeNow = startTimeNow\n\n // Timing values will all be relative to startTime (by comparing to startTimeNow\n // so we have an accurate clock)\n self.timings = {}\n }\n\n var timeout\n if (self.timeout && !self.timeoutTimer) {\n if (self.timeout < 0) {\n timeout = 0\n } else if (typeof self.timeout === 'number' && isFinite(self.timeout)) {\n timeout = self.timeout\n }\n }\n\n self.req.on('response', self.onRequestResponse.bind(self))\n self.req.on('error', self.onRequestError.bind(self))\n self.req.on('drain', function () {\n self.emit('drain')\n })\n\n self.req.on('socket', function (socket) {\n // `._connecting` was the old property which was made public in node v6.1.0\n var isConnecting = socket._connecting || socket.connecting\n if (self.timing) {\n self.timings.socket = now() - self.startTimeNow\n\n if (isConnecting) {\n var onLookupTiming = function () {\n self.timings.lookup = now() - self.startTimeNow\n }\n\n var onConnectTiming = function () {\n self.timings.connect = now() - self.startTimeNow\n }\n\n socket.once('lookup', onLookupTiming)\n socket.once('connect', onConnectTiming)\n\n // clean up timing event listeners if needed on error\n self.req.once('error', function () {\n socket.removeListener('lookup', onLookupTiming)\n socket.removeListener('connect', onConnectTiming)\n })\n }\n }\n\n var setReqTimeout = function () {\n // This timeout sets the amount of time to wait *between* bytes sent\n // from the server once connected.\n //\n // In particular, it's useful for erroring if the server fails to send\n // data halfway through streaming a response.\n self.req.setTimeout(timeout, function () {\n if (self.req) {\n self.abort()\n var e = new Error('ESOCKETTIMEDOUT')\n e.code = 'ESOCKETTIMEDOUT'\n e.connect = false\n self.emit('error', e)\n }\n })\n }\n if (timeout !== undefined) {\n // Only start the connection timer if we're actually connecting a new\n // socket, otherwise if we're already connected (because this is a\n // keep-alive connection) do not bother. This is important since we won't\n // get a 'connect' event for an already connected socket.\n if (isConnecting) {\n var onReqSockConnect = function () {\n socket.removeListener('connect', onReqSockConnect)\n self.clearTimeout()\n setReqTimeout()\n }\n\n socket.on('connect', onReqSockConnect)\n\n self.req.on('error', function (err) { // eslint-disable-line handle-callback-err\n socket.removeListener('connect', onReqSockConnect)\n })\n\n // Set a timeout in memory - this block will throw if the server takes more\n // than `timeout` to write the HTTP status and headers (corresponding to\n // the on('response') event on the client). NB: this measures wall-clock\n // time, not the time between bytes sent by the server.\n self.timeoutTimer = setTimeout(function () {\n socket.removeListener('connect', onReqSockConnect)\n self.abort()\n var e = new Error('ETIMEDOUT')\n e.code = 'ETIMEDOUT'\n e.connect = true\n self.emit('error', e)\n }, timeout)\n } else {\n // We're already connected\n setReqTimeout()\n }\n }\n self.emit('socket', socket)\n })\n\n self.emit('request', self.req)\n}\n\nRequest.prototype.onRequestError = function (error) {\n var self = this\n if (self._aborted) {\n return\n }\n if (self.req && self.req._reusedSocket && error.code === 'ECONNRESET' &&\n self.agent.addRequestNoreuse) {\n self.agent = { addRequest: self.agent.addRequestNoreuse.bind(self.agent) }\n self.start()\n self.req.end()\n return\n }\n self.clearTimeout()\n self.emit('error', error)\n}\n\nRequest.prototype.onRequestResponse = function (response) {\n var self = this\n\n if (self.timing) {\n self.timings.response = now() - self.startTimeNow\n }\n\n debug('onRequestResponse', self.uri.href, response.statusCode, response.headers)\n response.on('end', function () {\n if (self.timing) {\n self.timings.end = now() - self.startTimeNow\n response.timingStart = self.startTime\n\n // fill in the blanks for any periods that didn't trigger, such as\n // no lookup or connect due to keep alive\n if (!self.timings.socket) {\n self.timings.socket = 0\n }\n if (!self.timings.lookup) {\n self.timings.lookup = self.timings.socket\n }\n if (!self.timings.connect) {\n self.timings.connect = self.timings.lookup\n }\n if (!self.timings.response) {\n self.timings.response = self.timings.connect\n }\n\n debug('elapsed time', self.timings.end)\n\n // elapsedTime includes all redirects\n self.elapsedTime += Math.round(self.timings.end)\n\n // NOTE: elapsedTime is deprecated in favor of .timings\n response.elapsedTime = self.elapsedTime\n\n // timings is just for the final fetch\n response.timings = self.timings\n\n // pre-calculate phase timings as well\n response.timingPhases = {\n wait: self.timings.socket,\n dns: self.timings.lookup - self.timings.socket,\n tcp: self.timings.connect - self.timings.lookup,\n firstByte: self.timings.response - self.timings.connect,\n download: self.timings.end - self.timings.response,\n total: self.timings.end\n }\n }\n debug('response end', self.uri.href, response.statusCode, response.headers)\n })\n\n if (self._aborted) {\n debug('aborted', self.uri.href)\n response.resume()\n return\n }\n\n self.response = response\n response.request = self\n response.toJSON = responseToJSON\n\n // XXX This is different on 0.10, because SSL is strict by default\n if (self.httpModule === https &&\n self.strictSSL && (!response.hasOwnProperty('socket') ||\n !response.socket.authorized)) {\n debug('strict ssl error', self.uri.href)\n var sslErr = response.hasOwnProperty('socket') ? response.socket.authorizationError : self.uri.href + ' does not support SSL'\n self.emit('error', new Error('SSL Error: ' + sslErr))\n return\n }\n\n // Save the original host before any redirect (if it changes, we need to\n // remove any authorization headers). Also remember the case of the header\n // name because lots of broken servers expect Host instead of host and we\n // want the caller to be able to specify this.\n self.originalHost = self.getHeader('host')\n if (!self.originalHostHeaderName) {\n self.originalHostHeaderName = self.hasHeader('host')\n }\n if (self.setHost) {\n self.removeHeader('host')\n }\n self.clearTimeout()\n\n var targetCookieJar = (self._jar && self._jar.setCookie) ? self._jar : globalCookieJar\n var addCookie = function (cookie) {\n // set the cookie if it's domain in the href's domain.\n try {\n targetCookieJar.setCookie(cookie, self.uri.href, {ignoreError: true})\n } catch (e) {\n self.emit('error', e)\n }\n }\n\n response.caseless = caseless(response.headers)\n\n if (response.caseless.has('set-cookie') && (!self._disableCookies)) {\n var headerName = response.caseless.has('set-cookie')\n if (Array.isArray(response.headers[headerName])) {\n response.headers[headerName].forEach(addCookie)\n } else {\n addCookie(response.headers[headerName])\n }\n }\n\n if (self._redirect.onResponse(response)) {\n return // Ignore the rest of the response\n } else {\n // Be a good stream and emit end when the response is finished.\n // Hack to emit end on close because of a core bug that never fires end\n response.on('close', function () {\n if (!self._ended) {\n self.response.emit('end')\n }\n })\n\n response.once('end', function () {\n self._ended = true\n })\n\n var noBody = function (code) {\n return (\n self.method === 'HEAD' ||\n // Informational\n (code >= 100 && code < 200) ||\n // No Content\n code === 204 ||\n // Not Modified\n code === 304\n )\n }\n\n var responseContent\n if (self.gzip && !noBody(response.statusCode)) {\n var contentEncoding = response.headers['content-encoding'] || 'identity'\n contentEncoding = contentEncoding.trim().toLowerCase()\n\n // Be more lenient with decoding compressed responses, since (very rarely)\n // servers send slightly invalid gzip responses that are still accepted\n // by common browsers.\n // Always using Z_SYNC_FLUSH is what cURL does.\n var zlibOptions = {\n flush: zlib.Z_SYNC_FLUSH,\n finishFlush: zlib.Z_SYNC_FLUSH\n }\n\n if (contentEncoding === 'gzip') {\n responseContent = zlib.createGunzip(zlibOptions)\n response.pipe(responseContent)\n } else if (contentEncoding === 'deflate') {\n responseContent = zlib.createInflate(zlibOptions)\n response.pipe(responseContent)\n } else {\n // Since previous versions didn't check for Content-Encoding header,\n // ignore any invalid values to preserve backwards-compatibility\n if (contentEncoding !== 'identity') {\n debug('ignoring unrecognized Content-Encoding ' + contentEncoding)\n }\n responseContent = response\n }\n } else {\n responseContent = response\n }\n\n if (self.encoding) {\n if (self.dests.length !== 0) {\n console.error('Ignoring encoding parameter as this stream is being piped to another stream which makes the encoding option invalid.')\n } else {\n responseContent.setEncoding(self.encoding)\n }\n }\n\n if (self._paused) {\n responseContent.pause()\n }\n\n self.responseContent = responseContent\n\n self.emit('response', response)\n\n self.dests.forEach(function (dest) {\n self.pipeDest(dest)\n })\n\n responseContent.on('data', function (chunk) {\n if (self.timing && !self.responseStarted) {\n self.responseStartTime = (new Date()).getTime()\n\n // NOTE: responseStartTime is deprecated in favor of .timings\n response.responseStartTime = self.responseStartTime\n }\n self._destdata = true\n self.emit('data', chunk)\n })\n responseContent.once('end', function (chunk) {\n self.emit('end', chunk)\n })\n responseContent.on('error', function (error) {\n self.emit('error', error)\n })\n responseContent.on('close', function () { self.emit('close') })\n\n if (self.callback) {\n self.readResponseBody(response)\n } else { // if no callback\n self.on('end', function () {\n if (self._aborted) {\n debug('aborted', self.uri.href)\n return\n }\n self.emit('complete', response)\n })\n }\n }\n debug('finish init function', self.uri.href)\n}\n\nRequest.prototype.readResponseBody = function (response) {\n var self = this\n debug(\"reading response's body\")\n var buffers = []\n var bufferLength = 0\n var strings = []\n\n self.on('data', function (chunk) {\n if (!Buffer.isBuffer(chunk)) {\n strings.push(chunk)\n } else if (chunk.length) {\n bufferLength += chunk.length\n buffers.push(chunk)\n }\n })\n self.on('end', function () {\n debug('end event', self.uri.href)\n if (self._aborted) {\n debug('aborted', self.uri.href)\n // `buffer` is defined in the parent scope and used in a closure it exists for the life of the request.\n // This can lead to leaky behavior if the user retains a reference to the request object.\n buffers = []\n bufferLength = 0\n return\n }\n\n if (bufferLength) {\n debug('has body', self.uri.href, bufferLength)\n response.body = Buffer.concat(buffers, bufferLength)\n if (self.encoding !== null) {\n response.body = response.body.toString(self.encoding)\n }\n // `buffer` is defined in the parent scope and used in a closure it exists for the life of the Request.\n // This can lead to leaky behavior if the user retains a reference to the request object.\n buffers = []\n bufferLength = 0\n } else if (strings.length) {\n // The UTF8 BOM [0xEF,0xBB,0xBF] is converted to [0xFE,0xFF] in the JS UTC16/UCS2 representation.\n // Strip this value out when the encoding is set to 'utf8', as upstream consumers won't expect it and it breaks JSON.parse().\n if (self.encoding === 'utf8' && strings[0].length > 0 && strings[0][0] === '\\uFEFF') {\n strings[0] = strings[0].substring(1)\n }\n response.body = strings.join('')\n }\n\n if (self._json) {\n try {\n response.body = JSON.parse(response.body, self._jsonReviver)\n } catch (e) {\n debug('invalid JSON received', self.uri.href)\n }\n }\n debug('emitting complete', self.uri.href)\n if (typeof response.body === 'undefined' && !self._json) {\n response.body = self.encoding === null ? Buffer.alloc(0) : ''\n }\n self.emit('complete', response, response.body)\n })\n}\n\nRequest.prototype.abort = function () {\n var self = this\n self._aborted = true\n\n if (self.req) {\n self.req.abort()\n } else if (self.response) {\n self.response.destroy()\n }\n\n self.clearTimeout()\n self.emit('abort')\n}\n\nRequest.prototype.pipeDest = function (dest) {\n var self = this\n var response = self.response\n // Called after the response is received\n if (dest.headers && !dest.headersSent) {\n if (response.caseless.has('content-type')) {\n var ctname = response.caseless.has('content-type')\n if (dest.setHeader) {\n dest.setHeader(ctname, response.headers[ctname])\n } else {\n dest.headers[ctname] = response.headers[ctname]\n }\n }\n\n if (response.caseless.has('content-length')) {\n var clname = response.caseless.has('content-length')\n if (dest.setHeader) {\n dest.setHeader(clname, response.headers[clname])\n } else {\n dest.headers[clname] = response.headers[clname]\n }\n }\n }\n if (dest.setHeader && !dest.headersSent) {\n for (var i in response.headers) {\n // If the response content is being decoded, the Content-Encoding header\n // of the response doesn't represent the piped content, so don't pass it.\n if (!self.gzip || i !== 'content-encoding') {\n dest.setHeader(i, response.headers[i])\n }\n }\n dest.statusCode = response.statusCode\n }\n if (self.pipefilter) {\n self.pipefilter(response, dest)\n }\n}\n\nRequest.prototype.qs = function (q, clobber) {\n var self = this\n var base\n if (!clobber && self.uri.query) {\n base = self._qs.parse(self.uri.query)\n } else {\n base = {}\n }\n\n for (var i in q) {\n base[i] = q[i]\n }\n\n var qs = self._qs.stringify(base)\n\n if (qs === '') {\n return self\n }\n\n self.uri = url.parse(self.uri.href.split('?')[0] + '?' + qs)\n self.url = self.uri\n self.path = self.uri.path\n\n if (self.uri.host === 'unix') {\n self.enableUnixSocket()\n }\n\n return self\n}\nRequest.prototype.form = function (form) {\n var self = this\n if (form) {\n if (!/^application\\/x-www-form-urlencoded\\b/.test(self.getHeader('content-type'))) {\n self.setHeader('content-type', 'application/x-www-form-urlencoded')\n }\n self.body = (typeof form === 'string')\n ? self._qs.rfc3986(form.toString('utf8'))\n : self._qs.stringify(form).toString('utf8')\n return self\n }\n // create form-data object\n self._form = new FormData()\n self._form.on('error', function (err) {\n err.message = 'form-data: ' + err.message\n self.emit('error', err)\n self.abort()\n })\n return self._form\n}\nRequest.prototype.multipart = function (multipart) {\n var self = this\n\n self._multipart.onRequest(multipart)\n\n if (!self._multipart.chunked) {\n self.body = self._multipart.body\n }\n\n return self\n}\nRequest.prototype.json = function (val) {\n var self = this\n\n if (!self.hasHeader('accept')) {\n self.setHeader('accept', 'application/json')\n }\n\n if (typeof self.jsonReplacer === 'function') {\n self._jsonReplacer = self.jsonReplacer\n }\n\n self._json = true\n if (typeof val === 'boolean') {\n if (self.body !== undefined) {\n if (!/^application\\/x-www-form-urlencoded\\b/.test(self.getHeader('content-type'))) {\n self.body = safeStringify(self.body, self._jsonReplacer)\n } else {\n self.body = self._qs.rfc3986(self.body)\n }\n if (!self.hasHeader('content-type')) {\n self.setHeader('content-type', 'application/json')\n }\n }\n } else {\n self.body = safeStringify(val, self._jsonReplacer)\n if (!self.hasHeader('content-type')) {\n self.setHeader('content-type', 'application/json')\n }\n }\n\n if (typeof self.jsonReviver === 'function') {\n self._jsonReviver = self.jsonReviver\n }\n\n return self\n}\nRequest.prototype.getHeader = function (name, headers) {\n var self = this\n var result, re, match\n if (!headers) {\n headers = self.headers\n }\n Object.keys(headers).forEach(function (key) {\n if (key.length !== name.length) {\n return\n }\n re = new RegExp(name, 'i')\n match = key.match(re)\n if (match) {\n result = headers[key]\n }\n })\n return result\n}\nRequest.prototype.enableUnixSocket = function () {\n // Get the socket & request paths from the URL\n var unixParts = this.uri.path.split(':')\n var host = unixParts[0]\n var path = unixParts[1]\n // Apply unix properties to request\n this.socketPath = host\n this.uri.pathname = path\n this.uri.path = path\n this.uri.host = host\n this.uri.hostname = host\n this.uri.isUnix = true\n}\n\nRequest.prototype.auth = function (user, pass, sendImmediately, bearer) {\n var self = this\n\n self._auth.onRequest(user, pass, sendImmediately, bearer)\n\n return self\n}\nRequest.prototype.aws = function (opts, now) {\n var self = this\n\n if (!now) {\n self._aws = opts\n return self\n }\n\n if (opts.sign_version === 4 || opts.sign_version === '4') {\n // use aws4\n var options = {\n host: self.uri.host,\n path: self.uri.path,\n method: self.method,\n headers: self.headers,\n body: self.body\n }\n if (opts.service) {\n options.service = opts.service\n }\n var signRes = aws4.sign(options, {\n accessKeyId: opts.key,\n secretAccessKey: opts.secret,\n sessionToken: opts.session\n })\n self.setHeader('authorization', signRes.headers.Authorization)\n self.setHeader('x-amz-date', signRes.headers['X-Amz-Date'])\n if (signRes.headers['X-Amz-Security-Token']) {\n self.setHeader('x-amz-security-token', signRes.headers['X-Amz-Security-Token'])\n }\n } else {\n // default: use aws-sign2\n var date = new Date()\n self.setHeader('date', date.toUTCString())\n var auth = {\n key: opts.key,\n secret: opts.secret,\n verb: self.method.toUpperCase(),\n date: date,\n contentType: self.getHeader('content-type') || '',\n md5: self.getHeader('content-md5') || '',\n amazonHeaders: aws2.canonicalizeHeaders(self.headers)\n }\n var path = self.uri.path\n if (opts.bucket && path) {\n auth.resource = '/' + opts.bucket + path\n } else if (opts.bucket && !path) {\n auth.resource = '/' + opts.bucket\n } else if (!opts.bucket && path) {\n auth.resource = path\n } else if (!opts.bucket && !path) {\n auth.resource = '/'\n }\n auth.resource = aws2.canonicalizeResource(auth.resource)\n self.setHeader('authorization', aws2.authorization(auth))\n }\n\n return self\n}\nRequest.prototype.httpSignature = function (opts) {\n var self = this\n httpSignature.signRequest({\n getHeader: function (header) {\n return self.getHeader(header, self.headers)\n },\n setHeader: function (header, value) {\n self.setHeader(header, value)\n },\n method: self.method,\n path: self.path\n }, opts)\n debug('httpSignature authorization', self.getHeader('authorization'))\n\n return self\n}\nRequest.prototype.hawk = function (opts) {\n var self = this\n self.setHeader('Authorization', hawk.header(self.uri, self.method, opts))\n}\nRequest.prototype.oauth = function (_oauth) {\n var self = this\n\n self._oauth.onRequest(_oauth)\n\n return self\n}\n\nRequest.prototype.jar = function (jar) {\n var self = this\n var cookies\n\n if (self._redirect.redirectsFollowed === 0) {\n self.originalCookieHeader = self.getHeader('cookie')\n }\n\n if (!jar) {\n // disable cookies\n cookies = false\n self._disableCookies = true\n } else {\n var targetCookieJar = jar.getCookieString ? jar : globalCookieJar\n var urihref = self.uri.href\n // fetch cookie in the Specified host\n if (targetCookieJar) {\n cookies = targetCookieJar.getCookieString(urihref)\n }\n }\n\n // if need cookie and cookie is not empty\n if (cookies && cookies.length) {\n if (self.originalCookieHeader) {\n // Don't overwrite existing Cookie header\n self.setHeader('cookie', self.originalCookieHeader + '; ' + cookies)\n } else {\n self.setHeader('cookie', cookies)\n }\n }\n self._jar = jar\n return self\n}\n\n// Stream API\nRequest.prototype.pipe = function (dest, opts) {\n var self = this\n\n if (self.response) {\n if (self._destdata) {\n self.emit('error', new Error('You cannot pipe after data has been emitted from the response.'))\n } else if (self._ended) {\n self.emit('error', new Error('You cannot pipe after the response has been ended.'))\n } else {\n stream.Stream.prototype.pipe.call(self, dest, opts)\n self.pipeDest(dest)\n return dest\n }\n } else {\n self.dests.push(dest)\n stream.Stream.prototype.pipe.call(self, dest, opts)\n return dest\n }\n}\nRequest.prototype.write = function () {\n var self = this\n if (self._aborted) { return }\n\n if (!self._started) {\n self.start()\n }\n if (self.req) {\n return self.req.write.apply(self.req, arguments)\n }\n}\nRequest.prototype.end = function (chunk) {\n var self = this\n if (self._aborted) { return }\n\n if (chunk) {\n self.write(chunk)\n }\n if (!self._started) {\n self.start()\n }\n if (self.req) {\n self.req.end()\n }\n}\nRequest.prototype.pause = function () {\n var self = this\n if (!self.responseContent) {\n self._paused = true\n } else {\n self.responseContent.pause.apply(self.responseContent, arguments)\n }\n}\nRequest.prototype.resume = function () {\n var self = this\n if (!self.responseContent) {\n self._paused = false\n } else {\n self.responseContent.resume.apply(self.responseContent, arguments)\n }\n}\nRequest.prototype.destroy = function () {\n var self = this\n this.clearTimeout()\n if (!self._ended) {\n self.end()\n } else if (self.response) {\n self.response.destroy()\n }\n}\n\nRequest.prototype.clearTimeout = function () {\n if (this.timeoutTimer) {\n clearTimeout(this.timeoutTimer)\n this.timeoutTimer = null\n }\n}\n\nRequest.defaultProxyHeaderWhiteList =\n Tunnel.defaultProxyHeaderWhiteList.slice()\n\nRequest.defaultProxyHeaderExclusiveList =\n Tunnel.defaultProxyHeaderExclusiveList.slice()\n\n// Exports\n\nRequest.prototype.toJSON = requestToJSON\nmodule.exports = Request\n","'use strict';\n\nconst Readable = require('stream').Readable;\nconst lowercaseKeys = require('lowercase-keys');\n\nclass Response extends Readable {\n\tconstructor(statusCode, headers, body, url) {\n\t\tif (typeof statusCode !== 'number') {\n\t\t\tthrow new TypeError('Argument `statusCode` should be a number');\n\t\t}\n\t\tif (typeof headers !== 'object') {\n\t\t\tthrow new TypeError('Argument `headers` should be an object');\n\t\t}\n\t\tif (!(body instanceof Buffer)) {\n\t\t\tthrow new TypeError('Argument `body` should be a buffer');\n\t\t}\n\t\tif (typeof url !== 'string') {\n\t\t\tthrow new TypeError('Argument `url` should be a string');\n\t\t}\n\n\t\tsuper();\n\t\tthis.statusCode = statusCode;\n\t\tthis.headers = lowercaseKeys(headers);\n\t\tthis.body = body;\n\t\tthis.url = url;\n\t}\n\n\t_read() {\n\t\tthis.push(this.body);\n\t\tthis.push(null);\n\t}\n}\n\nmodule.exports = Response;\n","/*! safe-buffer. MIT License. Feross Aboukhadijeh */\n/* eslint-disable node/no-deprecated-api */\nvar buffer = require('buffer')\nvar Buffer = buffer.Buffer\n\n// alternative to using Object.keys for old browsers\nfunction copyProps (src, dst) {\n for (var key in src) {\n dst[key] = src[key]\n }\n}\nif (Buffer.from && Buffer.alloc && Buffer.allocUnsafe && Buffer.allocUnsafeSlow) {\n module.exports = buffer\n} else {\n // Copy properties from require('buffer')\n copyProps(buffer, exports)\n exports.Buffer = SafeBuffer\n}\n\nfunction SafeBuffer (arg, encodingOrOffset, length) {\n return Buffer(arg, encodingOrOffset, length)\n}\n\nSafeBuffer.prototype = Object.create(Buffer.prototype)\n\n// Copy static methods from Buffer\ncopyProps(Buffer, SafeBuffer)\n\nSafeBuffer.from = function (arg, encodingOrOffset, length) {\n if (typeof arg === 'number') {\n throw new TypeError('Argument must not be a number')\n }\n return Buffer(arg, encodingOrOffset, length)\n}\n\nSafeBuffer.alloc = function (size, fill, encoding) {\n if (typeof size !== 'number') {\n throw new TypeError('Argument must be a number')\n }\n var buf = Buffer(size)\n if (fill !== undefined) {\n if (typeof encoding === 'string') {\n buf.fill(fill, encoding)\n } else {\n buf.fill(fill)\n }\n } else {\n buf.fill(0)\n }\n return buf\n}\n\nSafeBuffer.allocUnsafe = function (size) {\n if (typeof size !== 'number') {\n throw new TypeError('Argument must be a number')\n }\n return Buffer(size)\n}\n\nSafeBuffer.allocUnsafeSlow = function (size) {\n if (typeof size !== 'number') {\n throw new TypeError('Argument must be a number')\n }\n return buffer.SlowBuffer(size)\n}\n","/* eslint-disable node/no-deprecated-api */\n\n'use strict'\n\nvar buffer = require('buffer')\nvar Buffer = buffer.Buffer\n\nvar safer = {}\n\nvar key\n\nfor (key in buffer) {\n if (!buffer.hasOwnProperty(key)) continue\n if (key === 'SlowBuffer' || key === 'Buffer') continue\n safer[key] = buffer[key]\n}\n\nvar Safer = safer.Buffer = {}\nfor (key in Buffer) {\n if (!Buffer.hasOwnProperty(key)) continue\n if (key === 'allocUnsafe' || key === 'allocUnsafeSlow') continue\n Safer[key] = Buffer[key]\n}\n\nsafer.Buffer.prototype = Buffer.prototype\n\nif (!Safer.from || Safer.from === Uint8Array.from) {\n Safer.from = function (value, encodingOrOffset, length) {\n if (typeof value === 'number') {\n throw new TypeError('The \"value\" argument must not be of type number. Received type ' + typeof value)\n }\n if (value && typeof value.length === 'undefined') {\n throw new TypeError('The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type ' + typeof value)\n }\n return Buffer(value, encodingOrOffset, length)\n }\n}\n\nif (!Safer.alloc) {\n Safer.alloc = function (size, fill, encoding) {\n if (typeof size !== 'number') {\n throw new TypeError('The \"size\" argument must be of type number. Received type ' + typeof size)\n }\n if (size < 0 || size >= 2 * (1 << 30)) {\n throw new RangeError('The value \"' + size + '\" is invalid for option \"size\"')\n }\n var buf = Buffer(size)\n if (!fill || fill.length === 0) {\n buf.fill(0)\n } else if (typeof encoding === 'string') {\n buf.fill(fill, encoding)\n } else {\n buf.fill(fill)\n }\n return buf\n }\n}\n\nif (!safer.kStringMaxLength) {\n try {\n safer.kStringMaxLength = process.binding('buffer').kStringMaxLength\n } catch (e) {\n // we can't determine kStringMaxLength in environments where process.binding\n // is unsupported, so let's not set it\n }\n}\n\nif (!safer.constants) {\n safer.constants = {\n MAX_LENGTH: safer.kMaxLength\n }\n if (safer.kStringMaxLength) {\n safer.constants.MAX_STRING_LENGTH = safer.kStringMaxLength\n }\n}\n\nmodule.exports = safer\n","const ANY = Symbol('SemVer ANY')\n// hoisted class for cyclic dependency\nclass Comparator {\n static get ANY () {\n return ANY\n }\n constructor (comp, options) {\n options = parseOptions(options)\n\n if (comp instanceof Comparator) {\n if (comp.loose === !!options.loose) {\n return comp\n } else {\n comp = comp.value\n }\n }\n\n debug('comparator', comp, options)\n this.options = options\n this.loose = !!options.loose\n this.parse(comp)\n\n if (this.semver === ANY) {\n this.value = ''\n } else {\n this.value = this.operator + this.semver.version\n }\n\n debug('comp', this)\n }\n\n parse (comp) {\n const r = this.options.loose ? re[t.COMPARATORLOOSE] : re[t.COMPARATOR]\n const m = comp.match(r)\n\n if (!m) {\n throw new TypeError(`Invalid comparator: ${comp}`)\n }\n\n this.operator = m[1] !== undefined ? m[1] : ''\n if (this.operator === '=') {\n this.operator = ''\n }\n\n // if it literally is just '>' or '' then allow anything.\n if (!m[2]) {\n this.semver = ANY\n } else {\n this.semver = new SemVer(m[2], this.options.loose)\n }\n }\n\n toString () {\n return this.value\n }\n\n test (version) {\n debug('Comparator.test', version, this.options.loose)\n\n if (this.semver === ANY || version === ANY) {\n return true\n }\n\n if (typeof version === 'string') {\n try {\n version = new SemVer(version, this.options)\n } catch (er) {\n return false\n }\n }\n\n return cmp(version, this.operator, this.semver, this.options)\n }\n\n intersects (comp, options) {\n if (!(comp instanceof Comparator)) {\n throw new TypeError('a Comparator is required')\n }\n\n if (!options || typeof options !== 'object') {\n options = {\n loose: !!options,\n includePrerelease: false\n }\n }\n\n if (this.operator === '') {\n if (this.value === '') {\n return true\n }\n return new Range(comp.value, options).test(this.value)\n } else if (comp.operator === '') {\n if (comp.value === '') {\n return true\n }\n return new Range(this.value, options).test(comp.semver)\n }\n\n const sameDirectionIncreasing =\n (this.operator === '>=' || this.operator === '>') &&\n (comp.operator === '>=' || comp.operator === '>')\n const sameDirectionDecreasing =\n (this.operator === '<=' || this.operator === '<') &&\n (comp.operator === '<=' || comp.operator === '<')\n const sameSemVer = this.semver.version === comp.semver.version\n const differentDirectionsInclusive =\n (this.operator === '>=' || this.operator === '<=') &&\n (comp.operator === '>=' || comp.operator === '<=')\n const oppositeDirectionsLessThan =\n cmp(this.semver, '<', comp.semver, options) &&\n (this.operator === '>=' || this.operator === '>') &&\n (comp.operator === '<=' || comp.operator === '<')\n const oppositeDirectionsGreaterThan =\n cmp(this.semver, '>', comp.semver, options) &&\n (this.operator === '<=' || this.operator === '<') &&\n (comp.operator === '>=' || comp.operator === '>')\n\n return (\n sameDirectionIncreasing ||\n sameDirectionDecreasing ||\n (sameSemVer && differentDirectionsInclusive) ||\n oppositeDirectionsLessThan ||\n oppositeDirectionsGreaterThan\n )\n }\n}\n\nmodule.exports = Comparator\n\nconst parseOptions = require('../internal/parse-options')\nconst {re, t} = require('../internal/re')\nconst cmp = require('../functions/cmp')\nconst debug = require('../internal/debug')\nconst SemVer = require('./semver')\nconst Range = require('./range')\n","// hoisted class for cyclic dependency\nclass Range {\n constructor (range, options) {\n options = parseOptions(options)\n\n if (range instanceof Range) {\n if (\n range.loose === !!options.loose &&\n range.includePrerelease === !!options.includePrerelease\n ) {\n return range\n } else {\n return new Range(range.raw, options)\n }\n }\n\n if (range instanceof Comparator) {\n // just put it in the set and return\n this.raw = range.value\n this.set = [[range]]\n this.format()\n return this\n }\n\n this.options = options\n this.loose = !!options.loose\n this.includePrerelease = !!options.includePrerelease\n\n // First, split based on boolean or ||\n this.raw = range\n this.set = range\n .split(/\\s*\\|\\|\\s*/)\n // map the range to a 2d array of comparators\n .map(range => this.parseRange(range.trim()))\n // throw out any comparator lists that are empty\n // this generally means that it was not a valid range, which is allowed\n // in loose mode, but will still throw if the WHOLE range is invalid.\n .filter(c => c.length)\n\n if (!this.set.length) {\n throw new TypeError(`Invalid SemVer Range: ${range}`)\n }\n\n // if we have any that are not the null set, throw out null sets.\n if (this.set.length > 1) {\n // keep the first one, in case they're all null sets\n const first = this.set[0]\n this.set = this.set.filter(c => !isNullSet(c[0]))\n if (this.set.length === 0)\n this.set = [first]\n else if (this.set.length > 1) {\n // if we have any that are *, then the range is just *\n for (const c of this.set) {\n if (c.length === 1 && isAny(c[0])) {\n this.set = [c]\n break\n }\n }\n }\n }\n\n this.format()\n }\n\n format () {\n this.range = this.set\n .map((comps) => {\n return comps.join(' ').trim()\n })\n .join('||')\n .trim()\n return this.range\n }\n\n toString () {\n return this.range\n }\n\n parseRange (range) {\n range = range.trim()\n\n // memoize range parsing for performance.\n // this is a very hot path, and fully deterministic.\n const memoOpts = Object.keys(this.options).join(',')\n const memoKey = `parseRange:${memoOpts}:${range}`\n const cached = cache.get(memoKey)\n if (cached)\n return cached\n\n const loose = this.options.loose\n // `1.2.3 - 1.2.4` => `>=1.2.3 <=1.2.4`\n const hr = loose ? re[t.HYPHENRANGELOOSE] : re[t.HYPHENRANGE]\n range = range.replace(hr, hyphenReplace(this.options.includePrerelease))\n debug('hyphen replace', range)\n // `> 1.2.3 < 1.2.5` => `>1.2.3 <1.2.5`\n range = range.replace(re[t.COMPARATORTRIM], comparatorTrimReplace)\n debug('comparator trim', range, re[t.COMPARATORTRIM])\n\n // `~ 1.2.3` => `~1.2.3`\n range = range.replace(re[t.TILDETRIM], tildeTrimReplace)\n\n // `^ 1.2.3` => `^1.2.3`\n range = range.replace(re[t.CARETTRIM], caretTrimReplace)\n\n // normalize spaces\n range = range.split(/\\s+/).join(' ')\n\n // At this point, the range is completely trimmed and\n // ready to be split into comparators.\n\n const compRe = loose ? re[t.COMPARATORLOOSE] : re[t.COMPARATOR]\n const rangeList = range\n .split(' ')\n .map(comp => parseComparator(comp, this.options))\n .join(' ')\n .split(/\\s+/)\n // >=0.0.0 is equivalent to *\n .map(comp => replaceGTE0(comp, this.options))\n // in loose mode, throw out any that are not valid comparators\n .filter(this.options.loose ? comp => !!comp.match(compRe) : () => true)\n .map(comp => new Comparator(comp, this.options))\n\n // if any comparators are the null set, then replace with JUST null set\n // if more than one comparator, remove any * comparators\n // also, don't include the same comparator more than once\n const l = rangeList.length\n const rangeMap = new Map()\n for (const comp of rangeList) {\n if (isNullSet(comp))\n return [comp]\n rangeMap.set(comp.value, comp)\n }\n if (rangeMap.size > 1 && rangeMap.has(''))\n rangeMap.delete('')\n\n const result = [...rangeMap.values()]\n cache.set(memoKey, result)\n return result\n }\n\n intersects (range, options) {\n if (!(range instanceof Range)) {\n throw new TypeError('a Range is required')\n }\n\n return this.set.some((thisComparators) => {\n return (\n isSatisfiable(thisComparators, options) &&\n range.set.some((rangeComparators) => {\n return (\n isSatisfiable(rangeComparators, options) &&\n thisComparators.every((thisComparator) => {\n return rangeComparators.every((rangeComparator) => {\n return thisComparator.intersects(rangeComparator, options)\n })\n })\n )\n })\n )\n })\n }\n\n // if ANY of the sets match ALL of its comparators, then pass\n test (version) {\n if (!version) {\n return false\n }\n\n if (typeof version === 'string') {\n try {\n version = new SemVer(version, this.options)\n } catch (er) {\n return false\n }\n }\n\n for (let i = 0; i < this.set.length; i++) {\n if (testSet(this.set[i], version, this.options)) {\n return true\n }\n }\n return false\n }\n}\nmodule.exports = Range\n\nconst LRU = require('lru-cache')\nconst cache = new LRU({ max: 1000 })\n\nconst parseOptions = require('../internal/parse-options')\nconst Comparator = require('./comparator')\nconst debug = require('../internal/debug')\nconst SemVer = require('./semver')\nconst {\n re,\n t,\n comparatorTrimReplace,\n tildeTrimReplace,\n caretTrimReplace\n} = require('../internal/re')\n\nconst isNullSet = c => c.value === '<0.0.0-0'\nconst isAny = c => c.value === ''\n\n// take a set of comparators and determine whether there\n// exists a version which can satisfy it\nconst isSatisfiable = (comparators, options) => {\n let result = true\n const remainingComparators = comparators.slice()\n let testComparator = remainingComparators.pop()\n\n while (result && remainingComparators.length) {\n result = remainingComparators.every((otherComparator) => {\n return testComparator.intersects(otherComparator, options)\n })\n\n testComparator = remainingComparators.pop()\n }\n\n return result\n}\n\n// comprised of xranges, tildes, stars, and gtlt's at this point.\n// already replaced the hyphen ranges\n// turn into a set of JUST comparators.\nconst parseComparator = (comp, options) => {\n debug('comp', comp, options)\n comp = replaceCarets(comp, options)\n debug('caret', comp)\n comp = replaceTildes(comp, options)\n debug('tildes', comp)\n comp = replaceXRanges(comp, options)\n debug('xrange', comp)\n comp = replaceStars(comp, options)\n debug('stars', comp)\n return comp\n}\n\nconst isX = id => !id || id.toLowerCase() === 'x' || id === '*'\n\n// ~, ~> --> * (any, kinda silly)\n// ~2, ~2.x, ~2.x.x, ~>2, ~>2.x ~>2.x.x --> >=2.0.0 <3.0.0-0\n// ~2.0, ~2.0.x, ~>2.0, ~>2.0.x --> >=2.0.0 <2.1.0-0\n// ~1.2, ~1.2.x, ~>1.2, ~>1.2.x --> >=1.2.0 <1.3.0-0\n// ~1.2.3, ~>1.2.3 --> >=1.2.3 <1.3.0-0\n// ~1.2.0, ~>1.2.0 --> >=1.2.0 <1.3.0-0\nconst replaceTildes = (comp, options) =>\n comp.trim().split(/\\s+/).map((comp) => {\n return replaceTilde(comp, options)\n }).join(' ')\n\nconst replaceTilde = (comp, options) => {\n const r = options.loose ? re[t.TILDELOOSE] : re[t.TILDE]\n return comp.replace(r, (_, M, m, p, pr) => {\n debug('tilde', comp, _, M, m, p, pr)\n let ret\n\n if (isX(M)) {\n ret = ''\n } else if (isX(m)) {\n ret = `>=${M}.0.0 <${+M + 1}.0.0-0`\n } else if (isX(p)) {\n // ~1.2 == >=1.2.0 <1.3.0-0\n ret = `>=${M}.${m}.0 <${M}.${+m + 1}.0-0`\n } else if (pr) {\n debug('replaceTilde pr', pr)\n ret = `>=${M}.${m}.${p}-${pr\n } <${M}.${+m + 1}.0-0`\n } else {\n // ~1.2.3 == >=1.2.3 <1.3.0-0\n ret = `>=${M}.${m}.${p\n } <${M}.${+m + 1}.0-0`\n }\n\n debug('tilde return', ret)\n return ret\n })\n}\n\n// ^ --> * (any, kinda silly)\n// ^2, ^2.x, ^2.x.x --> >=2.0.0 <3.0.0-0\n// ^2.0, ^2.0.x --> >=2.0.0 <3.0.0-0\n// ^1.2, ^1.2.x --> >=1.2.0 <2.0.0-0\n// ^1.2.3 --> >=1.2.3 <2.0.0-0\n// ^1.2.0 --> >=1.2.0 <2.0.0-0\nconst replaceCarets = (comp, options) =>\n comp.trim().split(/\\s+/).map((comp) => {\n return replaceCaret(comp, options)\n }).join(' ')\n\nconst replaceCaret = (comp, options) => {\n debug('caret', comp, options)\n const r = options.loose ? re[t.CARETLOOSE] : re[t.CARET]\n const z = options.includePrerelease ? '-0' : ''\n return comp.replace(r, (_, M, m, p, pr) => {\n debug('caret', comp, _, M, m, p, pr)\n let ret\n\n if (isX(M)) {\n ret = ''\n } else if (isX(m)) {\n ret = `>=${M}.0.0${z} <${+M + 1}.0.0-0`\n } else if (isX(p)) {\n if (M === '0') {\n ret = `>=${M}.${m}.0${z} <${M}.${+m + 1}.0-0`\n } else {\n ret = `>=${M}.${m}.0${z} <${+M + 1}.0.0-0`\n }\n } else if (pr) {\n debug('replaceCaret pr', pr)\n if (M === '0') {\n if (m === '0') {\n ret = `>=${M}.${m}.${p}-${pr\n } <${M}.${m}.${+p + 1}-0`\n } else {\n ret = `>=${M}.${m}.${p}-${pr\n } <${M}.${+m + 1}.0-0`\n }\n } else {\n ret = `>=${M}.${m}.${p}-${pr\n } <${+M + 1}.0.0-0`\n }\n } else {\n debug('no pr')\n if (M === '0') {\n if (m === '0') {\n ret = `>=${M}.${m}.${p\n }${z} <${M}.${m}.${+p + 1}-0`\n } else {\n ret = `>=${M}.${m}.${p\n }${z} <${M}.${+m + 1}.0-0`\n }\n } else {\n ret = `>=${M}.${m}.${p\n } <${+M + 1}.0.0-0`\n }\n }\n\n debug('caret return', ret)\n return ret\n })\n}\n\nconst replaceXRanges = (comp, options) => {\n debug('replaceXRanges', comp, options)\n return comp.split(/\\s+/).map((comp) => {\n return replaceXRange(comp, options)\n }).join(' ')\n}\n\nconst replaceXRange = (comp, options) => {\n comp = comp.trim()\n const r = options.loose ? re[t.XRANGELOOSE] : re[t.XRANGE]\n return comp.replace(r, (ret, gtlt, M, m, p, pr) => {\n debug('xRange', comp, ret, gtlt, M, m, p, pr)\n const xM = isX(M)\n const xm = xM || isX(m)\n const xp = xm || isX(p)\n const anyX = xp\n\n if (gtlt === '=' && anyX) {\n gtlt = ''\n }\n\n // if we're including prereleases in the match, then we need\n // to fix this to -0, the lowest possible prerelease value\n pr = options.includePrerelease ? '-0' : ''\n\n if (xM) {\n if (gtlt === '>' || gtlt === '<') {\n // nothing is allowed\n ret = '<0.0.0-0'\n } else {\n // nothing is forbidden\n ret = '*'\n }\n } else if (gtlt && anyX) {\n // we know patch is an x, because we have any x at all.\n // replace X with 0\n if (xm) {\n m = 0\n }\n p = 0\n\n if (gtlt === '>') {\n // >1 => >=2.0.0\n // >1.2 => >=1.3.0\n gtlt = '>='\n if (xm) {\n M = +M + 1\n m = 0\n p = 0\n } else {\n m = +m + 1\n p = 0\n }\n } else if (gtlt === '<=') {\n // <=0.7.x is actually <0.8.0, since any 0.7.x should\n // pass. Similarly, <=7.x is actually <8.0.0, etc.\n gtlt = '<'\n if (xm) {\n M = +M + 1\n } else {\n m = +m + 1\n }\n }\n\n if (gtlt === '<')\n pr = '-0'\n\n ret = `${gtlt + M}.${m}.${p}${pr}`\n } else if (xm) {\n ret = `>=${M}.0.0${pr} <${+M + 1}.0.0-0`\n } else if (xp) {\n ret = `>=${M}.${m}.0${pr\n } <${M}.${+m + 1}.0-0`\n }\n\n debug('xRange return', ret)\n\n return ret\n })\n}\n\n// Because * is AND-ed with everything else in the comparator,\n// and '' means \"any version\", just remove the *s entirely.\nconst replaceStars = (comp, options) => {\n debug('replaceStars', comp, options)\n // Looseness is ignored here. star is always as loose as it gets!\n return comp.trim().replace(re[t.STAR], '')\n}\n\nconst replaceGTE0 = (comp, options) => {\n debug('replaceGTE0', comp, options)\n return comp.trim()\n .replace(re[options.includePrerelease ? t.GTE0PRE : t.GTE0], '')\n}\n\n// This function is passed to string.replace(re[t.HYPHENRANGE])\n// M, m, patch, prerelease, build\n// 1.2 - 3.4.5 => >=1.2.0 <=3.4.5\n// 1.2.3 - 3.4 => >=1.2.0 <3.5.0-0 Any 3.4.x will do\n// 1.2 - 3.4 => >=1.2.0 <3.5.0-0\nconst hyphenReplace = incPr => ($0,\n from, fM, fm, fp, fpr, fb,\n to, tM, tm, tp, tpr, tb) => {\n if (isX(fM)) {\n from = ''\n } else if (isX(fm)) {\n from = `>=${fM}.0.0${incPr ? '-0' : ''}`\n } else if (isX(fp)) {\n from = `>=${fM}.${fm}.0${incPr ? '-0' : ''}`\n } else if (fpr) {\n from = `>=${from}`\n } else {\n from = `>=${from}${incPr ? '-0' : ''}`\n }\n\n if (isX(tM)) {\n to = ''\n } else if (isX(tm)) {\n to = `<${+tM + 1}.0.0-0`\n } else if (isX(tp)) {\n to = `<${tM}.${+tm + 1}.0-0`\n } else if (tpr) {\n to = `<=${tM}.${tm}.${tp}-${tpr}`\n } else if (incPr) {\n to = `<${tM}.${tm}.${+tp + 1}-0`\n } else {\n to = `<=${to}`\n }\n\n return (`${from} ${to}`).trim()\n}\n\nconst testSet = (set, version, options) => {\n for (let i = 0; i < set.length; i++) {\n if (!set[i].test(version)) {\n return false\n }\n }\n\n if (version.prerelease.length && !options.includePrerelease) {\n // Find the set of versions that are allowed to have prereleases\n // For example, ^1.2.3-pr.1 desugars to >=1.2.3-pr.1 <2.0.0\n // That should allow `1.2.3-pr.2` to pass.\n // However, `1.2.4-alpha.notready` should NOT be allowed,\n // even though it's within the range set by the comparators.\n for (let i = 0; i < set.length; i++) {\n debug(set[i].semver)\n if (set[i].semver === Comparator.ANY) {\n continue\n }\n\n if (set[i].semver.prerelease.length > 0) {\n const allowed = set[i].semver\n if (allowed.major === version.major &&\n allowed.minor === version.minor &&\n allowed.patch === version.patch) {\n return true\n }\n }\n }\n\n // Version has a -pre, but it's not one of the ones we like.\n return false\n }\n\n return true\n}\n","const debug = require('../internal/debug')\nconst { MAX_LENGTH, MAX_SAFE_INTEGER } = require('../internal/constants')\nconst { re, t } = require('../internal/re')\n\nconst parseOptions = require('../internal/parse-options')\nconst { compareIdentifiers } = require('../internal/identifiers')\nclass SemVer {\n constructor (version, options) {\n options = parseOptions(options)\n\n if (version instanceof SemVer) {\n if (version.loose === !!options.loose &&\n version.includePrerelease === !!options.includePrerelease) {\n return version\n } else {\n version = version.version\n }\n } else if (typeof version !== 'string') {\n throw new TypeError(`Invalid Version: ${version}`)\n }\n\n if (version.length > MAX_LENGTH) {\n throw new TypeError(\n `version is longer than ${MAX_LENGTH} characters`\n )\n }\n\n debug('SemVer', version, options)\n this.options = options\n this.loose = !!options.loose\n // this isn't actually relevant for versions, but keep it so that we\n // don't run into trouble passing this.options around.\n this.includePrerelease = !!options.includePrerelease\n\n const m = version.trim().match(options.loose ? re[t.LOOSE] : re[t.FULL])\n\n if (!m) {\n throw new TypeError(`Invalid Version: ${version}`)\n }\n\n this.raw = version\n\n // these are actually numbers\n this.major = +m[1]\n this.minor = +m[2]\n this.patch = +m[3]\n\n if (this.major > MAX_SAFE_INTEGER || this.major < 0) {\n throw new TypeError('Invalid major version')\n }\n\n if (this.minor > MAX_SAFE_INTEGER || this.minor < 0) {\n throw new TypeError('Invalid minor version')\n }\n\n if (this.patch > MAX_SAFE_INTEGER || this.patch < 0) {\n throw new TypeError('Invalid patch version')\n }\n\n // numberify any prerelease numeric ids\n if (!m[4]) {\n this.prerelease = []\n } else {\n this.prerelease = m[4].split('.').map((id) => {\n if (/^[0-9]+$/.test(id)) {\n const num = +id\n if (num >= 0 && num < MAX_SAFE_INTEGER) {\n return num\n }\n }\n return id\n })\n }\n\n this.build = m[5] ? m[5].split('.') : []\n this.format()\n }\n\n format () {\n this.version = `${this.major}.${this.minor}.${this.patch}`\n if (this.prerelease.length) {\n this.version += `-${this.prerelease.join('.')}`\n }\n return this.version\n }\n\n toString () {\n return this.version\n }\n\n compare (other) {\n debug('SemVer.compare', this.version, this.options, other)\n if (!(other instanceof SemVer)) {\n if (typeof other === 'string' && other === this.version) {\n return 0\n }\n other = new SemVer(other, this.options)\n }\n\n if (other.version === this.version) {\n return 0\n }\n\n return this.compareMain(other) || this.comparePre(other)\n }\n\n compareMain (other) {\n if (!(other instanceof SemVer)) {\n other = new SemVer(other, this.options)\n }\n\n return (\n compareIdentifiers(this.major, other.major) ||\n compareIdentifiers(this.minor, other.minor) ||\n compareIdentifiers(this.patch, other.patch)\n )\n }\n\n comparePre (other) {\n if (!(other instanceof SemVer)) {\n other = new SemVer(other, this.options)\n }\n\n // NOT having a prerelease is > having one\n if (this.prerelease.length && !other.prerelease.length) {\n return -1\n } else if (!this.prerelease.length && other.prerelease.length) {\n return 1\n } else if (!this.prerelease.length && !other.prerelease.length) {\n return 0\n }\n\n let i = 0\n do {\n const a = this.prerelease[i]\n const b = other.prerelease[i]\n debug('prerelease compare', i, a, b)\n if (a === undefined && b === undefined) {\n return 0\n } else if (b === undefined) {\n return 1\n } else if (a === undefined) {\n return -1\n } else if (a === b) {\n continue\n } else {\n return compareIdentifiers(a, b)\n }\n } while (++i)\n }\n\n compareBuild (other) {\n if (!(other instanceof SemVer)) {\n other = new SemVer(other, this.options)\n }\n\n let i = 0\n do {\n const a = this.build[i]\n const b = other.build[i]\n debug('prerelease compare', i, a, b)\n if (a === undefined && b === undefined) {\n return 0\n } else if (b === undefined) {\n return 1\n } else if (a === undefined) {\n return -1\n } else if (a === b) {\n continue\n } else {\n return compareIdentifiers(a, b)\n }\n } while (++i)\n }\n\n // preminor will bump the version up to the next minor release, and immediately\n // down to pre-release. premajor and prepatch work the same way.\n inc (release, identifier) {\n switch (release) {\n case 'premajor':\n this.prerelease.length = 0\n this.patch = 0\n this.minor = 0\n this.major++\n this.inc('pre', identifier)\n break\n case 'preminor':\n this.prerelease.length = 0\n this.patch = 0\n this.minor++\n this.inc('pre', identifier)\n break\n case 'prepatch':\n // If this is already a prerelease, it will bump to the next version\n // drop any prereleases that might already exist, since they are not\n // relevant at this point.\n this.prerelease.length = 0\n this.inc('patch', identifier)\n this.inc('pre', identifier)\n break\n // If the input is a non-prerelease version, this acts the same as\n // prepatch.\n case 'prerelease':\n if (this.prerelease.length === 0) {\n this.inc('patch', identifier)\n }\n this.inc('pre', identifier)\n break\n\n case 'major':\n // If this is a pre-major version, bump up to the same major version.\n // Otherwise increment major.\n // 1.0.0-5 bumps to 1.0.0\n // 1.1.0 bumps to 2.0.0\n if (\n this.minor !== 0 ||\n this.patch !== 0 ||\n this.prerelease.length === 0\n ) {\n this.major++\n }\n this.minor = 0\n this.patch = 0\n this.prerelease = []\n break\n case 'minor':\n // If this is a pre-minor version, bump up to the same minor version.\n // Otherwise increment minor.\n // 1.2.0-5 bumps to 1.2.0\n // 1.2.1 bumps to 1.3.0\n if (this.patch !== 0 || this.prerelease.length === 0) {\n this.minor++\n }\n this.patch = 0\n this.prerelease = []\n break\n case 'patch':\n // If this is not a pre-release version, it will increment the patch.\n // If it is a pre-release it will bump up to the same patch version.\n // 1.2.0-5 patches to 1.2.0\n // 1.2.0 patches to 1.2.1\n if (this.prerelease.length === 0) {\n this.patch++\n }\n this.prerelease = []\n break\n // This probably shouldn't be used publicly.\n // 1.0.0 'pre' would become 1.0.0-0 which is the wrong direction.\n case 'pre':\n if (this.prerelease.length === 0) {\n this.prerelease = [0]\n } else {\n let i = this.prerelease.length\n while (--i >= 0) {\n if (typeof this.prerelease[i] === 'number') {\n this.prerelease[i]++\n i = -2\n }\n }\n if (i === -1) {\n // didn't increment anything\n this.prerelease.push(0)\n }\n }\n if (identifier) {\n // 1.2.0-beta.1 bumps to 1.2.0-beta.2,\n // 1.2.0-beta.fooblz or 1.2.0-beta bumps to 1.2.0-beta.0\n if (this.prerelease[0] === identifier) {\n if (isNaN(this.prerelease[1])) {\n this.prerelease = [identifier, 0]\n }\n } else {\n this.prerelease = [identifier, 0]\n }\n }\n break\n\n default:\n throw new Error(`invalid increment argument: ${release}`)\n }\n this.format()\n this.raw = this.version\n return this\n }\n}\n\nmodule.exports = SemVer\n","const parse = require('./parse')\nconst clean = (version, options) => {\n const s = parse(version.trim().replace(/^[=v]+/, ''), options)\n return s ? s.version : null\n}\nmodule.exports = clean\n","const eq = require('./eq')\nconst neq = require('./neq')\nconst gt = require('./gt')\nconst gte = require('./gte')\nconst lt = require('./lt')\nconst lte = require('./lte')\n\nconst cmp = (a, op, b, loose) => {\n switch (op) {\n case '===':\n if (typeof a === 'object')\n a = a.version\n if (typeof b === 'object')\n b = b.version\n return a === b\n\n case '!==':\n if (typeof a === 'object')\n a = a.version\n if (typeof b === 'object')\n b = b.version\n return a !== b\n\n case '':\n case '=':\n case '==':\n return eq(a, b, loose)\n\n case '!=':\n return neq(a, b, loose)\n\n case '>':\n return gt(a, b, loose)\n\n case '>=':\n return gte(a, b, loose)\n\n case '<':\n return lt(a, b, loose)\n\n case '<=':\n return lte(a, b, loose)\n\n default:\n throw new TypeError(`Invalid operator: ${op}`)\n }\n}\nmodule.exports = cmp\n","const SemVer = require('../classes/semver')\nconst parse = require('./parse')\nconst {re, t} = require('../internal/re')\n\nconst coerce = (version, options) => {\n if (version instanceof SemVer) {\n return version\n }\n\n if (typeof version === 'number') {\n version = String(version)\n }\n\n if (typeof version !== 'string') {\n return null\n }\n\n options = options || {}\n\n let match = null\n if (!options.rtl) {\n match = version.match(re[t.COERCE])\n } else {\n // Find the right-most coercible string that does not share\n // a terminus with a more left-ward coercible string.\n // Eg, '1.2.3.4' wants to coerce '2.3.4', not '3.4' or '4'\n //\n // Walk through the string checking with a /g regexp\n // Manually set the index so as to pick up overlapping matches.\n // Stop when we get a match that ends at the string end, since no\n // coercible string can be more right-ward without the same terminus.\n let next\n while ((next = re[t.COERCERTL].exec(version)) &&\n (!match || match.index + match[0].length !== version.length)\n ) {\n if (!match ||\n next.index + next[0].length !== match.index + match[0].length) {\n match = next\n }\n re[t.COERCERTL].lastIndex = next.index + next[1].length + next[2].length\n }\n // leave it in a clean state\n re[t.COERCERTL].lastIndex = -1\n }\n\n if (match === null)\n return null\n\n return parse(`${match[2]}.${match[3] || '0'}.${match[4] || '0'}`, options)\n}\nmodule.exports = coerce\n","const SemVer = require('../classes/semver')\nconst compareBuild = (a, b, loose) => {\n const versionA = new SemVer(a, loose)\n const versionB = new SemVer(b, loose)\n return versionA.compare(versionB) || versionA.compareBuild(versionB)\n}\nmodule.exports = compareBuild\n","const compare = require('./compare')\nconst compareLoose = (a, b) => compare(a, b, true)\nmodule.exports = compareLoose\n","const SemVer = require('../classes/semver')\nconst compare = (a, b, loose) =>\n new SemVer(a, loose).compare(new SemVer(b, loose))\n\nmodule.exports = compare\n","const parse = require('./parse')\nconst eq = require('./eq')\n\nconst diff = (version1, version2) => {\n if (eq(version1, version2)) {\n return null\n } else {\n const v1 = parse(version1)\n const v2 = parse(version2)\n const hasPre = v1.prerelease.length || v2.prerelease.length\n const prefix = hasPre ? 'pre' : ''\n const defaultResult = hasPre ? 'prerelease' : ''\n for (const key in v1) {\n if (key === 'major' || key === 'minor' || key === 'patch') {\n if (v1[key] !== v2[key]) {\n return prefix + key\n }\n }\n }\n return defaultResult // may be undefined\n }\n}\nmodule.exports = diff\n","const compare = require('./compare')\nconst eq = (a, b, loose) => compare(a, b, loose) === 0\nmodule.exports = eq\n","const compare = require('./compare')\nconst gt = (a, b, loose) => compare(a, b, loose) > 0\nmodule.exports = gt\n","const compare = require('./compare')\nconst gte = (a, b, loose) => compare(a, b, loose) >= 0\nmodule.exports = gte\n","const SemVer = require('../classes/semver')\n\nconst inc = (version, release, options, identifier) => {\n if (typeof (options) === 'string') {\n identifier = options\n options = undefined\n }\n\n try {\n return new SemVer(version, options).inc(release, identifier).version\n } catch (er) {\n return null\n }\n}\nmodule.exports = inc\n","const compare = require('./compare')\nconst lt = (a, b, loose) => compare(a, b, loose) < 0\nmodule.exports = lt\n","const compare = require('./compare')\nconst lte = (a, b, loose) => compare(a, b, loose) <= 0\nmodule.exports = lte\n","const SemVer = require('../classes/semver')\nconst major = (a, loose) => new SemVer(a, loose).major\nmodule.exports = major\n","const SemVer = require('../classes/semver')\nconst minor = (a, loose) => new SemVer(a, loose).minor\nmodule.exports = minor\n","const compare = require('./compare')\nconst neq = (a, b, loose) => compare(a, b, loose) !== 0\nmodule.exports = neq\n","const {MAX_LENGTH} = require('../internal/constants')\nconst { re, t } = require('../internal/re')\nconst SemVer = require('../classes/semver')\n\nconst parseOptions = require('../internal/parse-options')\nconst parse = (version, options) => {\n options = parseOptions(options)\n\n if (version instanceof SemVer) {\n return version\n }\n\n if (typeof version !== 'string') {\n return null\n }\n\n if (version.length > MAX_LENGTH) {\n return null\n }\n\n const r = options.loose ? re[t.LOOSE] : re[t.FULL]\n if (!r.test(version)) {\n return null\n }\n\n try {\n return new SemVer(version, options)\n } catch (er) {\n return null\n }\n}\n\nmodule.exports = parse\n","const SemVer = require('../classes/semver')\nconst patch = (a, loose) => new SemVer(a, loose).patch\nmodule.exports = patch\n","const parse = require('./parse')\nconst prerelease = (version, options) => {\n const parsed = parse(version, options)\n return (parsed && parsed.prerelease.length) ? parsed.prerelease : null\n}\nmodule.exports = prerelease\n","const compare = require('./compare')\nconst rcompare = (a, b, loose) => compare(b, a, loose)\nmodule.exports = rcompare\n","const compareBuild = require('./compare-build')\nconst rsort = (list, loose) => list.sort((a, b) => compareBuild(b, a, loose))\nmodule.exports = rsort\n","const Range = require('../classes/range')\nconst satisfies = (version, range, options) => {\n try {\n range = new Range(range, options)\n } catch (er) {\n return false\n }\n return range.test(version)\n}\nmodule.exports = satisfies\n","const compareBuild = require('./compare-build')\nconst sort = (list, loose) => list.sort((a, b) => compareBuild(a, b, loose))\nmodule.exports = sort\n","const parse = require('./parse')\nconst valid = (version, options) => {\n const v = parse(version, options)\n return v ? v.version : null\n}\nmodule.exports = valid\n","// just pre-load all the stuff that index.js lazily exports\nconst internalRe = require('./internal/re')\nmodule.exports = {\n re: internalRe.re,\n src: internalRe.src,\n tokens: internalRe.t,\n SEMVER_SPEC_VERSION: require('./internal/constants').SEMVER_SPEC_VERSION,\n SemVer: require('./classes/semver'),\n compareIdentifiers: require('./internal/identifiers').compareIdentifiers,\n rcompareIdentifiers: require('./internal/identifiers').rcompareIdentifiers,\n parse: require('./functions/parse'),\n valid: require('./functions/valid'),\n clean: require('./functions/clean'),\n inc: require('./functions/inc'),\n diff: require('./functions/diff'),\n major: require('./functions/major'),\n minor: require('./functions/minor'),\n patch: require('./functions/patch'),\n prerelease: require('./functions/prerelease'),\n compare: require('./functions/compare'),\n rcompare: require('./functions/rcompare'),\n compareLoose: require('./functions/compare-loose'),\n compareBuild: require('./functions/compare-build'),\n sort: require('./functions/sort'),\n rsort: require('./functions/rsort'),\n gt: require('./functions/gt'),\n lt: require('./functions/lt'),\n eq: require('./functions/eq'),\n neq: require('./functions/neq'),\n gte: require('./functions/gte'),\n lte: require('./functions/lte'),\n cmp: require('./functions/cmp'),\n coerce: require('./functions/coerce'),\n Comparator: require('./classes/comparator'),\n Range: require('./classes/range'),\n satisfies: require('./functions/satisfies'),\n toComparators: require('./ranges/to-comparators'),\n maxSatisfying: require('./ranges/max-satisfying'),\n minSatisfying: require('./ranges/min-satisfying'),\n minVersion: require('./ranges/min-version'),\n validRange: require('./ranges/valid'),\n outside: require('./ranges/outside'),\n gtr: require('./ranges/gtr'),\n ltr: require('./ranges/ltr'),\n intersects: require('./ranges/intersects'),\n simplifyRange: require('./ranges/simplify'),\n subset: require('./ranges/subset'),\n}\n","// Note: this is the semver.org version of the spec that it implements\n// Not necessarily the package version of this code.\nconst SEMVER_SPEC_VERSION = '2.0.0'\n\nconst MAX_LENGTH = 256\nconst MAX_SAFE_INTEGER = Number.MAX_SAFE_INTEGER ||\n /* istanbul ignore next */ 9007199254740991\n\n// Max safe segment length for coercion.\nconst MAX_SAFE_COMPONENT_LENGTH = 16\n\nmodule.exports = {\n SEMVER_SPEC_VERSION,\n MAX_LENGTH,\n MAX_SAFE_INTEGER,\n MAX_SAFE_COMPONENT_LENGTH\n}\n","const debug = (\n typeof process === 'object' &&\n process.env &&\n process.env.NODE_DEBUG &&\n /\\bsemver\\b/i.test(process.env.NODE_DEBUG)\n) ? (...args) => console.error('SEMVER', ...args)\n : () => {}\n\nmodule.exports = debug\n","const numeric = /^[0-9]+$/\nconst compareIdentifiers = (a, b) => {\n const anum = numeric.test(a)\n const bnum = numeric.test(b)\n\n if (anum && bnum) {\n a = +a\n b = +b\n }\n\n return a === b ? 0\n : (anum && !bnum) ? -1\n : (bnum && !anum) ? 1\n : a < b ? -1\n : 1\n}\n\nconst rcompareIdentifiers = (a, b) => compareIdentifiers(b, a)\n\nmodule.exports = {\n compareIdentifiers,\n rcompareIdentifiers\n}\n","// parse out just the options we care about so we always get a consistent\n// obj with keys in a consistent order.\nconst opts = ['includePrerelease', 'loose', 'rtl']\nconst parseOptions = options =>\n !options ? {}\n : typeof options !== 'object' ? { loose: true }\n : opts.filter(k => options[k]).reduce((options, k) => {\n options[k] = true\n return options\n }, {})\nmodule.exports = parseOptions\n","const { MAX_SAFE_COMPONENT_LENGTH } = require('./constants')\nconst debug = require('./debug')\nexports = module.exports = {}\n\n// The actual regexps go on exports.re\nconst re = exports.re = []\nconst src = exports.src = []\nconst t = exports.t = {}\nlet R = 0\n\nconst createToken = (name, value, isGlobal) => {\n const index = R++\n debug(index, value)\n t[name] = index\n src[index] = value\n re[index] = new RegExp(value, isGlobal ? 'g' : undefined)\n}\n\n// The following Regular Expressions can be used for tokenizing,\n// validating, and parsing SemVer version strings.\n\n// ## Numeric Identifier\n// A single `0`, or a non-zero digit followed by zero or more digits.\n\ncreateToken('NUMERICIDENTIFIER', '0|[1-9]\\\\d*')\ncreateToken('NUMERICIDENTIFIERLOOSE', '[0-9]+')\n\n// ## Non-numeric Identifier\n// Zero or more digits, followed by a letter or hyphen, and then zero or\n// more letters, digits, or hyphens.\n\ncreateToken('NONNUMERICIDENTIFIER', '\\\\d*[a-zA-Z-][a-zA-Z0-9-]*')\n\n// ## Main Version\n// Three dot-separated numeric identifiers.\n\ncreateToken('MAINVERSION', `(${src[t.NUMERICIDENTIFIER]})\\\\.` +\n `(${src[t.NUMERICIDENTIFIER]})\\\\.` +\n `(${src[t.NUMERICIDENTIFIER]})`)\n\ncreateToken('MAINVERSIONLOOSE', `(${src[t.NUMERICIDENTIFIERLOOSE]})\\\\.` +\n `(${src[t.NUMERICIDENTIFIERLOOSE]})\\\\.` +\n `(${src[t.NUMERICIDENTIFIERLOOSE]})`)\n\n// ## Pre-release Version Identifier\n// A numeric identifier, or a non-numeric identifier.\n\ncreateToken('PRERELEASEIDENTIFIER', `(?:${src[t.NUMERICIDENTIFIER]\n}|${src[t.NONNUMERICIDENTIFIER]})`)\n\ncreateToken('PRERELEASEIDENTIFIERLOOSE', `(?:${src[t.NUMERICIDENTIFIERLOOSE]\n}|${src[t.NONNUMERICIDENTIFIER]})`)\n\n// ## Pre-release Version\n// Hyphen, followed by one or more dot-separated pre-release version\n// identifiers.\n\ncreateToken('PRERELEASE', `(?:-(${src[t.PRERELEASEIDENTIFIER]\n}(?:\\\\.${src[t.PRERELEASEIDENTIFIER]})*))`)\n\ncreateToken('PRERELEASELOOSE', `(?:-?(${src[t.PRERELEASEIDENTIFIERLOOSE]\n}(?:\\\\.${src[t.PRERELEASEIDENTIFIERLOOSE]})*))`)\n\n// ## Build Metadata Identifier\n// Any combination of digits, letters, or hyphens.\n\ncreateToken('BUILDIDENTIFIER', '[0-9A-Za-z-]+')\n\n// ## Build Metadata\n// Plus sign, followed by one or more period-separated build metadata\n// identifiers.\n\ncreateToken('BUILD', `(?:\\\\+(${src[t.BUILDIDENTIFIER]\n}(?:\\\\.${src[t.BUILDIDENTIFIER]})*))`)\n\n// ## Full Version String\n// A main version, followed optionally by a pre-release version and\n// build metadata.\n\n// Note that the only major, minor, patch, and pre-release sections of\n// the version string are capturing groups. The build metadata is not a\n// capturing group, because it should not ever be used in version\n// comparison.\n\ncreateToken('FULLPLAIN', `v?${src[t.MAINVERSION]\n}${src[t.PRERELEASE]}?${\n src[t.BUILD]}?`)\n\ncreateToken('FULL', `^${src[t.FULLPLAIN]}$`)\n\n// like full, but allows v1.2.3 and =1.2.3, which people do sometimes.\n// also, 1.0.0alpha1 (prerelease without the hyphen) which is pretty\n// common in the npm registry.\ncreateToken('LOOSEPLAIN', `[v=\\\\s]*${src[t.MAINVERSIONLOOSE]\n}${src[t.PRERELEASELOOSE]}?${\n src[t.BUILD]}?`)\n\ncreateToken('LOOSE', `^${src[t.LOOSEPLAIN]}$`)\n\ncreateToken('GTLT', '((?:<|>)?=?)')\n\n// Something like \"2.*\" or \"1.2.x\".\n// Note that \"x.x\" is a valid xRange identifer, meaning \"any version\"\n// Only the first item is strictly required.\ncreateToken('XRANGEIDENTIFIERLOOSE', `${src[t.NUMERICIDENTIFIERLOOSE]}|x|X|\\\\*`)\ncreateToken('XRANGEIDENTIFIER', `${src[t.NUMERICIDENTIFIER]}|x|X|\\\\*`)\n\ncreateToken('XRANGEPLAIN', `[v=\\\\s]*(${src[t.XRANGEIDENTIFIER]})` +\n `(?:\\\\.(${src[t.XRANGEIDENTIFIER]})` +\n `(?:\\\\.(${src[t.XRANGEIDENTIFIER]})` +\n `(?:${src[t.PRERELEASE]})?${\n src[t.BUILD]}?` +\n `)?)?`)\n\ncreateToken('XRANGEPLAINLOOSE', `[v=\\\\s]*(${src[t.XRANGEIDENTIFIERLOOSE]})` +\n `(?:\\\\.(${src[t.XRANGEIDENTIFIERLOOSE]})` +\n `(?:\\\\.(${src[t.XRANGEIDENTIFIERLOOSE]})` +\n `(?:${src[t.PRERELEASELOOSE]})?${\n src[t.BUILD]}?` +\n `)?)?`)\n\ncreateToken('XRANGE', `^${src[t.GTLT]}\\\\s*${src[t.XRANGEPLAIN]}$`)\ncreateToken('XRANGELOOSE', `^${src[t.GTLT]}\\\\s*${src[t.XRANGEPLAINLOOSE]}$`)\n\n// Coercion.\n// Extract anything that could conceivably be a part of a valid semver\ncreateToken('COERCE', `${'(^|[^\\\\d])' +\n '(\\\\d{1,'}${MAX_SAFE_COMPONENT_LENGTH}})` +\n `(?:\\\\.(\\\\d{1,${MAX_SAFE_COMPONENT_LENGTH}}))?` +\n `(?:\\\\.(\\\\d{1,${MAX_SAFE_COMPONENT_LENGTH}}))?` +\n `(?:$|[^\\\\d])`)\ncreateToken('COERCERTL', src[t.COERCE], true)\n\n// Tilde ranges.\n// Meaning is \"reasonably at or greater than\"\ncreateToken('LONETILDE', '(?:~>?)')\n\ncreateToken('TILDETRIM', `(\\\\s*)${src[t.LONETILDE]}\\\\s+`, true)\nexports.tildeTrimReplace = '$1~'\n\ncreateToken('TILDE', `^${src[t.LONETILDE]}${src[t.XRANGEPLAIN]}$`)\ncreateToken('TILDELOOSE', `^${src[t.LONETILDE]}${src[t.XRANGEPLAINLOOSE]}$`)\n\n// Caret ranges.\n// Meaning is \"at least and backwards compatible with\"\ncreateToken('LONECARET', '(?:\\\\^)')\n\ncreateToken('CARETTRIM', `(\\\\s*)${src[t.LONECARET]}\\\\s+`, true)\nexports.caretTrimReplace = '$1^'\n\ncreateToken('CARET', `^${src[t.LONECARET]}${src[t.XRANGEPLAIN]}$`)\ncreateToken('CARETLOOSE', `^${src[t.LONECARET]}${src[t.XRANGEPLAINLOOSE]}$`)\n\n// A simple gt/lt/eq thing, or just \"\" to indicate \"any version\"\ncreateToken('COMPARATORLOOSE', `^${src[t.GTLT]}\\\\s*(${src[t.LOOSEPLAIN]})$|^$`)\ncreateToken('COMPARATOR', `^${src[t.GTLT]}\\\\s*(${src[t.FULLPLAIN]})$|^$`)\n\n// An expression to strip any whitespace between the gtlt and the thing\n// it modifies, so that `> 1.2.3` ==> `>1.2.3`\ncreateToken('COMPARATORTRIM', `(\\\\s*)${src[t.GTLT]\n}\\\\s*(${src[t.LOOSEPLAIN]}|${src[t.XRANGEPLAIN]})`, true)\nexports.comparatorTrimReplace = '$1$2$3'\n\n// Something like `1.2.3 - 1.2.4`\n// Note that these all use the loose form, because they'll be\n// checked against either the strict or loose comparator form\n// later.\ncreateToken('HYPHENRANGE', `^\\\\s*(${src[t.XRANGEPLAIN]})` +\n `\\\\s+-\\\\s+` +\n `(${src[t.XRANGEPLAIN]})` +\n `\\\\s*$`)\n\ncreateToken('HYPHENRANGELOOSE', `^\\\\s*(${src[t.XRANGEPLAINLOOSE]})` +\n `\\\\s+-\\\\s+` +\n `(${src[t.XRANGEPLAINLOOSE]})` +\n `\\\\s*$`)\n\n// Star ranges basically just allow anything at all.\ncreateToken('STAR', '(<|>)?=?\\\\s*\\\\*')\n// >=0.0.0 is like a star\ncreateToken('GTE0', '^\\\\s*>=\\\\s*0\\.0\\.0\\\\s*$')\ncreateToken('GTE0PRE', '^\\\\s*>=\\\\s*0\\.0\\.0-0\\\\s*$')\n","// Determine if version is greater than all the versions possible in the range.\nconst outside = require('./outside')\nconst gtr = (version, range, options) => outside(version, range, '>', options)\nmodule.exports = gtr\n","const Range = require('../classes/range')\nconst intersects = (r1, r2, options) => {\n r1 = new Range(r1, options)\n r2 = new Range(r2, options)\n return r1.intersects(r2)\n}\nmodule.exports = intersects\n","const outside = require('./outside')\n// Determine if version is less than all the versions possible in the range\nconst ltr = (version, range, options) => outside(version, range, '<', options)\nmodule.exports = ltr\n","const SemVer = require('../classes/semver')\nconst Range = require('../classes/range')\n\nconst maxSatisfying = (versions, range, options) => {\n let max = null\n let maxSV = null\n let rangeObj = null\n try {\n rangeObj = new Range(range, options)\n } catch (er) {\n return null\n }\n versions.forEach((v) => {\n if (rangeObj.test(v)) {\n // satisfies(v, range, options)\n if (!max || maxSV.compare(v) === -1) {\n // compare(max, v, true)\n max = v\n maxSV = new SemVer(max, options)\n }\n }\n })\n return max\n}\nmodule.exports = maxSatisfying\n","const SemVer = require('../classes/semver')\nconst Range = require('../classes/range')\nconst minSatisfying = (versions, range, options) => {\n let min = null\n let minSV = null\n let rangeObj = null\n try {\n rangeObj = new Range(range, options)\n } catch (er) {\n return null\n }\n versions.forEach((v) => {\n if (rangeObj.test(v)) {\n // satisfies(v, range, options)\n if (!min || minSV.compare(v) === 1) {\n // compare(min, v, true)\n min = v\n minSV = new SemVer(min, options)\n }\n }\n })\n return min\n}\nmodule.exports = minSatisfying\n","const SemVer = require('../classes/semver')\nconst Range = require('../classes/range')\nconst gt = require('../functions/gt')\n\nconst minVersion = (range, loose) => {\n range = new Range(range, loose)\n\n let minver = new SemVer('0.0.0')\n if (range.test(minver)) {\n return minver\n }\n\n minver = new SemVer('0.0.0-0')\n if (range.test(minver)) {\n return minver\n }\n\n minver = null\n for (let i = 0; i < range.set.length; ++i) {\n const comparators = range.set[i]\n\n let setMin = null\n comparators.forEach((comparator) => {\n // Clone to avoid manipulating the comparator's semver object.\n const compver = new SemVer(comparator.semver.version)\n switch (comparator.operator) {\n case '>':\n if (compver.prerelease.length === 0) {\n compver.patch++\n } else {\n compver.prerelease.push(0)\n }\n compver.raw = compver.format()\n /* fallthrough */\n case '':\n case '>=':\n if (!setMin || gt(compver, setMin)) {\n setMin = compver\n }\n break\n case '<':\n case '<=':\n /* Ignore maximum versions */\n break\n /* istanbul ignore next */\n default:\n throw new Error(`Unexpected operation: ${comparator.operator}`)\n }\n })\n if (setMin && (!minver || gt(minver, setMin)))\n minver = setMin\n }\n\n if (minver && range.test(minver)) {\n return minver\n }\n\n return null\n}\nmodule.exports = minVersion\n","const SemVer = require('../classes/semver')\nconst Comparator = require('../classes/comparator')\nconst {ANY} = Comparator\nconst Range = require('../classes/range')\nconst satisfies = require('../functions/satisfies')\nconst gt = require('../functions/gt')\nconst lt = require('../functions/lt')\nconst lte = require('../functions/lte')\nconst gte = require('../functions/gte')\n\nconst outside = (version, range, hilo, options) => {\n version = new SemVer(version, options)\n range = new Range(range, options)\n\n let gtfn, ltefn, ltfn, comp, ecomp\n switch (hilo) {\n case '>':\n gtfn = gt\n ltefn = lte\n ltfn = lt\n comp = '>'\n ecomp = '>='\n break\n case '<':\n gtfn = lt\n ltefn = gte\n ltfn = gt\n comp = '<'\n ecomp = '<='\n break\n default:\n throw new TypeError('Must provide a hilo val of \"<\" or \">\"')\n }\n\n // If it satisfies the range it is not outside\n if (satisfies(version, range, options)) {\n return false\n }\n\n // From now on, variable terms are as if we're in \"gtr\" mode.\n // but note that everything is flipped for the \"ltr\" function.\n\n for (let i = 0; i < range.set.length; ++i) {\n const comparators = range.set[i]\n\n let high = null\n let low = null\n\n comparators.forEach((comparator) => {\n if (comparator.semver === ANY) {\n comparator = new Comparator('>=0.0.0')\n }\n high = high || comparator\n low = low || comparator\n if (gtfn(comparator.semver, high.semver, options)) {\n high = comparator\n } else if (ltfn(comparator.semver, low.semver, options)) {\n low = comparator\n }\n })\n\n // If the edge version comparator has a operator then our version\n // isn't outside it\n if (high.operator === comp || high.operator === ecomp) {\n return false\n }\n\n // If the lowest version comparator has an operator and our version\n // is less than it then it isn't higher than the range\n if ((!low.operator || low.operator === comp) &&\n ltefn(version, low.semver)) {\n return false\n } else if (low.operator === ecomp && ltfn(version, low.semver)) {\n return false\n }\n }\n return true\n}\n\nmodule.exports = outside\n","// given a set of versions and a range, create a \"simplified\" range\n// that includes the same versions that the original range does\n// If the original range is shorter than the simplified one, return that.\nconst satisfies = require('../functions/satisfies.js')\nconst compare = require('../functions/compare.js')\nmodule.exports = (versions, range, options) => {\n const set = []\n let min = null\n let prev = null\n const v = versions.sort((a, b) => compare(a, b, options))\n for (const version of v) {\n const included = satisfies(version, range, options)\n if (included) {\n prev = version\n if (!min)\n min = version\n } else {\n if (prev) {\n set.push([min, prev])\n }\n prev = null\n min = null\n }\n }\n if (min)\n set.push([min, null])\n\n const ranges = []\n for (const [min, max] of set) {\n if (min === max)\n ranges.push(min)\n else if (!max && min === v[0])\n ranges.push('*')\n else if (!max)\n ranges.push(`>=${min}`)\n else if (min === v[0])\n ranges.push(`<=${max}`)\n else\n ranges.push(`${min} - ${max}`)\n }\n const simplified = ranges.join(' || ')\n const original = typeof range.raw === 'string' ? range.raw : String(range)\n return simplified.length < original.length ? simplified : range\n}\n","const Range = require('../classes/range.js')\nconst Comparator = require('../classes/comparator.js')\nconst { ANY } = Comparator\nconst satisfies = require('../functions/satisfies.js')\nconst compare = require('../functions/compare.js')\n\n// Complex range `r1 || r2 || ...` is a subset of `R1 || R2 || ...` iff:\n// - Every simple range `r1, r2, ...` is a null set, OR\n// - Every simple range `r1, r2, ...` which is not a null set is a subset of\n// some `R1, R2, ...`\n//\n// Simple range `c1 c2 ...` is a subset of simple range `C1 C2 ...` iff:\n// - If c is only the ANY comparator\n// - If C is only the ANY comparator, return true\n// - Else if in prerelease mode, return false\n// - else replace c with `[>=0.0.0]`\n// - If C is only the ANY comparator\n// - if in prerelease mode, return true\n// - else replace C with `[>=0.0.0]`\n// - Let EQ be the set of = comparators in c\n// - If EQ is more than one, return true (null set)\n// - Let GT be the highest > or >= comparator in c\n// - Let LT be the lowest < or <= comparator in c\n// - If GT and LT, and GT.semver > LT.semver, return true (null set)\n// - If any C is a = range, and GT or LT are set, return false\n// - If EQ\n// - If GT, and EQ does not satisfy GT, return true (null set)\n// - If LT, and EQ does not satisfy LT, return true (null set)\n// - If EQ satisfies every C, return true\n// - Else return false\n// - If GT\n// - If GT.semver is lower than any > or >= comp in C, return false\n// - If GT is >=, and GT.semver does not satisfy every C, return false\n// - If GT.semver has a prerelease, and not in prerelease mode\n// - If no C has a prerelease and the GT.semver tuple, return false\n// - If LT\n// - If LT.semver is greater than any < or <= comp in C, return false\n// - If LT is <=, and LT.semver does not satisfy every C, return false\n// - If GT.semver has a prerelease, and not in prerelease mode\n// - If no C has a prerelease and the LT.semver tuple, return false\n// - Else return true\n\nconst subset = (sub, dom, options = {}) => {\n if (sub === dom)\n return true\n\n sub = new Range(sub, options)\n dom = new Range(dom, options)\n let sawNonNull = false\n\n OUTER: for (const simpleSub of sub.set) {\n for (const simpleDom of dom.set) {\n const isSub = simpleSubset(simpleSub, simpleDom, options)\n sawNonNull = sawNonNull || isSub !== null\n if (isSub)\n continue OUTER\n }\n // the null set is a subset of everything, but null simple ranges in\n // a complex range should be ignored. so if we saw a non-null range,\n // then we know this isn't a subset, but if EVERY simple range was null,\n // then it is a subset.\n if (sawNonNull)\n return false\n }\n return true\n}\n\nconst simpleSubset = (sub, dom, options) => {\n if (sub === dom)\n return true\n\n if (sub.length === 1 && sub[0].semver === ANY) {\n if (dom.length === 1 && dom[0].semver === ANY)\n return true\n else if (options.includePrerelease)\n sub = [ new Comparator('>=0.0.0-0') ]\n else\n sub = [ new Comparator('>=0.0.0') ]\n }\n\n if (dom.length === 1 && dom[0].semver === ANY) {\n if (options.includePrerelease)\n return true\n else\n dom = [ new Comparator('>=0.0.0') ]\n }\n\n const eqSet = new Set()\n let gt, lt\n for (const c of sub) {\n if (c.operator === '>' || c.operator === '>=')\n gt = higherGT(gt, c, options)\n else if (c.operator === '<' || c.operator === '<=')\n lt = lowerLT(lt, c, options)\n else\n eqSet.add(c.semver)\n }\n\n if (eqSet.size > 1)\n return null\n\n let gtltComp\n if (gt && lt) {\n gtltComp = compare(gt.semver, lt.semver, options)\n if (gtltComp > 0)\n return null\n else if (gtltComp === 0 && (gt.operator !== '>=' || lt.operator !== '<='))\n return null\n }\n\n // will iterate one or zero times\n for (const eq of eqSet) {\n if (gt && !satisfies(eq, String(gt), options))\n return null\n\n if (lt && !satisfies(eq, String(lt), options))\n return null\n\n for (const c of dom) {\n if (!satisfies(eq, String(c), options))\n return false\n }\n\n return true\n }\n\n let higher, lower\n let hasDomLT, hasDomGT\n // if the subset has a prerelease, we need a comparator in the superset\n // with the same tuple and a prerelease, or it's not a subset\n let needDomLTPre = lt &&\n !options.includePrerelease &&\n lt.semver.prerelease.length ? lt.semver : false\n let needDomGTPre = gt &&\n !options.includePrerelease &&\n gt.semver.prerelease.length ? gt.semver : false\n // exception: <1.2.3-0 is the same as <1.2.3\n if (needDomLTPre && needDomLTPre.prerelease.length === 1 &&\n lt.operator === '<' && needDomLTPre.prerelease[0] === 0) {\n needDomLTPre = false\n }\n\n for (const c of dom) {\n hasDomGT = hasDomGT || c.operator === '>' || c.operator === '>='\n hasDomLT = hasDomLT || c.operator === '<' || c.operator === '<='\n if (gt) {\n if (needDomGTPre) {\n if (c.semver.prerelease && c.semver.prerelease.length &&\n c.semver.major === needDomGTPre.major &&\n c.semver.minor === needDomGTPre.minor &&\n c.semver.patch === needDomGTPre.patch) {\n needDomGTPre = false\n }\n }\n if (c.operator === '>' || c.operator === '>=') {\n higher = higherGT(gt, c, options)\n if (higher === c && higher !== gt)\n return false\n } else if (gt.operator === '>=' && !satisfies(gt.semver, String(c), options))\n return false\n }\n if (lt) {\n if (needDomLTPre) {\n if (c.semver.prerelease && c.semver.prerelease.length &&\n c.semver.major === needDomLTPre.major &&\n c.semver.minor === needDomLTPre.minor &&\n c.semver.patch === needDomLTPre.patch) {\n needDomLTPre = false\n }\n }\n if (c.operator === '<' || c.operator === '<=') {\n lower = lowerLT(lt, c, options)\n if (lower === c && lower !== lt)\n return false\n } else if (lt.operator === '<=' && !satisfies(lt.semver, String(c), options))\n return false\n }\n if (!c.operator && (lt || gt) && gtltComp !== 0)\n return false\n }\n\n // if there was a < or >, and nothing in the dom, then must be false\n // UNLESS it was limited by another range in the other direction.\n // Eg, >1.0.0 <1.0.1 is still a subset of <2.0.0\n if (gt && hasDomLT && !lt && gtltComp !== 0)\n return false\n\n if (lt && hasDomGT && !gt && gtltComp !== 0)\n return false\n\n // we needed a prerelease range in a specific tuple, but didn't get one\n // then this isn't a subset. eg >=1.2.3-pre is not a subset of >=1.0.0,\n // because it includes prereleases in the 1.2.3 tuple\n if (needDomGTPre || needDomLTPre)\n return false\n\n return true\n}\n\n// >=1.2.3 is lower than >1.2.3\nconst higherGT = (a, b, options) => {\n if (!a)\n return b\n const comp = compare(a.semver, b.semver, options)\n return comp > 0 ? a\n : comp < 0 ? b\n : b.operator === '>' && a.operator === '>=' ? b\n : a\n}\n\n// <=1.2.3 is higher than <1.2.3\nconst lowerLT = (a, b, options) => {\n if (!a)\n return b\n const comp = compare(a.semver, b.semver, options)\n return comp < 0 ? a\n : comp > 0 ? b\n : b.operator === '<' && a.operator === '<=' ? b\n : a\n}\n\nmodule.exports = subset\n","const Range = require('../classes/range')\n\n// Mostly just for testing and legacy API reasons\nconst toComparators = (range, options) =>\n new Range(range, options).set\n .map(comp => comp.map(c => c.value).join(' ').trim().split(' '))\n\nmodule.exports = toComparators\n","const Range = require('../classes/range')\nconst validRange = (range, options) => {\n try {\n // Return '*' instead of '' so that truthiness works.\n // This will throw if it's invalid anyway\n return new Range(range, options).range || '*'\n } catch (er) {\n return null\n }\n}\nmodule.exports = validRange\n","module.exports = [\n 'cat',\n 'cd',\n 'chmod',\n 'cp',\n 'dirs',\n 'echo',\n 'exec',\n 'find',\n 'grep',\n 'head',\n 'ln',\n 'ls',\n 'mkdir',\n 'mv',\n 'pwd',\n 'rm',\n 'sed',\n 'set',\n 'sort',\n 'tail',\n 'tempdir',\n 'test',\n 'to',\n 'toEnd',\n 'touch',\n 'uniq',\n 'which',\n];\n",null,"var common = require('./common');\nvar fs = require('fs');\n\ncommon.register('cat', _cat, {\n canReceivePipe: true,\n cmdOptions: {\n 'n': 'number',\n },\n});\n\n//@\n//@ ### cat([options,] file [, file ...])\n//@ ### cat([options,] file_array)\n//@\n//@ Available options:\n//@\n//@ + `-n`: number all output lines\n//@\n//@ Examples:\n//@\n//@ ```javascript\n//@ var str = cat('file*.txt');\n//@ var str = cat('file1', 'file2');\n//@ var str = cat(['file1', 'file2']); // same as above\n//@ ```\n//@\n//@ Returns a string containing the given file, or a concatenated string\n//@ containing the files if more than one file is given (a new line character is\n//@ introduced between each file).\nfunction _cat(options, files) {\n var cat = common.readFromPipe();\n\n if (!files && !cat) common.error('no paths given');\n\n files = [].slice.call(arguments, 1);\n\n files.forEach(function (file) {\n if (!fs.existsSync(file)) {\n common.error('no such file or directory: ' + file);\n } else if (common.statFollowLinks(file).isDirectory()) {\n common.error(file + ': Is a directory');\n }\n\n cat += fs.readFileSync(file, 'utf8');\n });\n\n if (options.number) {\n cat = addNumbers(cat);\n }\n\n return cat;\n}\nmodule.exports = _cat;\n\nfunction addNumbers(cat) {\n var lines = cat.split('\\n');\n var lastLine = lines.pop();\n\n lines = lines.map(function (line, i) {\n return numberedLine(i + 1, line);\n });\n\n if (lastLine.length) {\n lastLine = numberedLine(lines.length + 1, lastLine);\n }\n lines.push(lastLine);\n\n return lines.join('\\n');\n}\n\nfunction numberedLine(n, line) {\n // GNU cat use six pad start number + tab. See http://lingrok.org/xref/coreutils/src/cat.c#57\n // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/padStart\n var number = (' ' + n).slice(-6) + '\\t';\n return number + line;\n}\n","var os = require('os');\nvar common = require('./common');\n\ncommon.register('cd', _cd, {});\n\n//@\n//@ ### cd([dir])\n//@\n//@ Changes to directory `dir` for the duration of the script. Changes to home\n//@ directory if no argument is supplied.\nfunction _cd(options, dir) {\n if (!dir) dir = os.homedir();\n\n if (dir === '-') {\n if (!process.env.OLDPWD) {\n common.error('could not find previous directory');\n } else {\n dir = process.env.OLDPWD;\n }\n }\n\n try {\n var curDir = process.cwd();\n process.chdir(dir);\n process.env.OLDPWD = curDir;\n } catch (e) {\n // something went wrong, let's figure out the error\n var err;\n try {\n common.statFollowLinks(dir); // if this succeeds, it must be some sort of file\n err = 'not a directory: ' + dir;\n } catch (e2) {\n err = 'no such file or directory: ' + dir;\n }\n if (err) common.error(err);\n }\n return '';\n}\nmodule.exports = _cd;\n","var common = require('./common');\nvar fs = require('fs');\nvar path = require('path');\n\nvar PERMS = (function (base) {\n return {\n OTHER_EXEC: base.EXEC,\n OTHER_WRITE: base.WRITE,\n OTHER_READ: base.READ,\n\n GROUP_EXEC: base.EXEC << 3,\n GROUP_WRITE: base.WRITE << 3,\n GROUP_READ: base.READ << 3,\n\n OWNER_EXEC: base.EXEC << 6,\n OWNER_WRITE: base.WRITE << 6,\n OWNER_READ: base.READ << 6,\n\n // Literal octal numbers are apparently not allowed in \"strict\" javascript.\n STICKY: parseInt('01000', 8),\n SETGID: parseInt('02000', 8),\n SETUID: parseInt('04000', 8),\n\n TYPE_MASK: parseInt('0770000', 8),\n };\n}({\n EXEC: 1,\n WRITE: 2,\n READ: 4,\n}));\n\ncommon.register('chmod', _chmod, {\n});\n\n//@\n//@ ### chmod([options,] octal_mode || octal_string, file)\n//@ ### chmod([options,] symbolic_mode, file)\n//@\n//@ Available options:\n//@\n//@ + `-v`: output a diagnostic for every file processed//@\n//@ + `-c`: like verbose, but report only when a change is made//@\n//@ + `-R`: change files and directories recursively//@\n//@\n//@ Examples:\n//@\n//@ ```javascript\n//@ chmod(755, '/Users/brandon');\n//@ chmod('755', '/Users/brandon'); // same as above\n//@ chmod('u+x', '/Users/brandon');\n//@ chmod('-R', 'a-w', '/Users/brandon');\n//@ ```\n//@\n//@ Alters the permissions of a file or directory by either specifying the\n//@ absolute permissions in octal form or expressing the changes in symbols.\n//@ This command tries to mimic the POSIX behavior as much as possible.\n//@ Notable exceptions:\n//@\n//@ + In symbolic modes, `a-r` and `-r` are identical. No consideration is\n//@ given to the `umask`.\n//@ + There is no \"quiet\" option, since default behavior is to run silent.\nfunction _chmod(options, mode, filePattern) {\n if (!filePattern) {\n if (options.length > 0 && options.charAt(0) === '-') {\n // Special case where the specified file permissions started with - to subtract perms, which\n // get picked up by the option parser as command flags.\n // If we are down by one argument and options starts with -, shift everything over.\n [].unshift.call(arguments, '');\n } else {\n common.error('You must specify a file.');\n }\n }\n\n options = common.parseOptions(options, {\n 'R': 'recursive',\n 'c': 'changes',\n 'v': 'verbose',\n });\n\n filePattern = [].slice.call(arguments, 2);\n\n var files;\n\n // TODO: replace this with a call to common.expand()\n if (options.recursive) {\n files = [];\n filePattern.forEach(function addFile(expandedFile) {\n var stat = common.statNoFollowLinks(expandedFile);\n\n if (!stat.isSymbolicLink()) {\n files.push(expandedFile);\n\n if (stat.isDirectory()) { // intentionally does not follow symlinks.\n fs.readdirSync(expandedFile).forEach(function (child) {\n addFile(expandedFile + '/' + child);\n });\n }\n }\n });\n } else {\n files = filePattern;\n }\n\n files.forEach(function innerChmod(file) {\n file = path.resolve(file);\n if (!fs.existsSync(file)) {\n common.error('File not found: ' + file);\n }\n\n // When recursing, don't follow symlinks.\n if (options.recursive && common.statNoFollowLinks(file).isSymbolicLink()) {\n return;\n }\n\n var stat = common.statFollowLinks(file);\n var isDir = stat.isDirectory();\n var perms = stat.mode;\n var type = perms & PERMS.TYPE_MASK;\n\n var newPerms = perms;\n\n if (isNaN(parseInt(mode, 8))) {\n // parse options\n mode.split(',').forEach(function (symbolicMode) {\n var pattern = /([ugoa]*)([=\\+-])([rwxXst]*)/i;\n var matches = pattern.exec(symbolicMode);\n\n if (matches) {\n var applyTo = matches[1];\n var operator = matches[2];\n var change = matches[3];\n\n var changeOwner = applyTo.indexOf('u') !== -1 || applyTo === 'a' || applyTo === '';\n var changeGroup = applyTo.indexOf('g') !== -1 || applyTo === 'a' || applyTo === '';\n var changeOther = applyTo.indexOf('o') !== -1 || applyTo === 'a' || applyTo === '';\n\n var changeRead = change.indexOf('r') !== -1;\n var changeWrite = change.indexOf('w') !== -1;\n var changeExec = change.indexOf('x') !== -1;\n var changeExecDir = change.indexOf('X') !== -1;\n var changeSticky = change.indexOf('t') !== -1;\n var changeSetuid = change.indexOf('s') !== -1;\n\n if (changeExecDir && isDir) {\n changeExec = true;\n }\n\n var mask = 0;\n if (changeOwner) {\n mask |= (changeRead ? PERMS.OWNER_READ : 0) + (changeWrite ? PERMS.OWNER_WRITE : 0) + (changeExec ? PERMS.OWNER_EXEC : 0) + (changeSetuid ? PERMS.SETUID : 0);\n }\n if (changeGroup) {\n mask |= (changeRead ? PERMS.GROUP_READ : 0) + (changeWrite ? PERMS.GROUP_WRITE : 0) + (changeExec ? PERMS.GROUP_EXEC : 0) + (changeSetuid ? PERMS.SETGID : 0);\n }\n if (changeOther) {\n mask |= (changeRead ? PERMS.OTHER_READ : 0) + (changeWrite ? PERMS.OTHER_WRITE : 0) + (changeExec ? PERMS.OTHER_EXEC : 0);\n }\n\n // Sticky bit is special - it's not tied to user, group or other.\n if (changeSticky) {\n mask |= PERMS.STICKY;\n }\n\n switch (operator) {\n case '+':\n newPerms |= mask;\n break;\n\n case '-':\n newPerms &= ~mask;\n break;\n\n case '=':\n newPerms = type + mask;\n\n // According to POSIX, when using = to explicitly set the\n // permissions, setuid and setgid can never be cleared.\n if (common.statFollowLinks(file).isDirectory()) {\n newPerms |= (PERMS.SETUID + PERMS.SETGID) & perms;\n }\n break;\n default:\n common.error('Could not recognize operator: `' + operator + '`');\n }\n\n if (options.verbose) {\n console.log(file + ' -> ' + newPerms.toString(8));\n }\n\n if (perms !== newPerms) {\n if (!options.verbose && options.changes) {\n console.log(file + ' -> ' + newPerms.toString(8));\n }\n fs.chmodSync(file, newPerms);\n perms = newPerms; // for the next round of changes!\n }\n } else {\n common.error('Invalid symbolic mode change: ' + symbolicMode);\n }\n });\n } else {\n // they gave us a full number\n newPerms = type + parseInt(mode, 8);\n\n // POSIX rules are that setuid and setgid can only be added using numeric\n // form, but not cleared.\n if (common.statFollowLinks(file).isDirectory()) {\n newPerms |= (PERMS.SETUID + PERMS.SETGID) & perms;\n }\n\n fs.chmodSync(file, newPerms);\n }\n });\n return '';\n}\nmodule.exports = _chmod;\n","// Ignore warning about 'new String()'\n/* eslint no-new-wrappers: 0 */\n'use strict';\n\nvar os = require('os');\nvar fs = require('fs');\nvar glob = require('glob');\nvar shell = require('..');\n\nvar shellMethods = Object.create(shell);\n\nexports.extend = Object.assign;\n\n// Check if we're running under electron\nvar isElectron = Boolean(process.versions.electron);\n\n// Module globals (assume no execPath by default)\nvar DEFAULT_CONFIG = {\n fatal: false,\n globOptions: {},\n maxdepth: 255,\n noglob: false,\n silent: false,\n verbose: false,\n execPath: null,\n bufLength: 64 * 1024, // 64KB\n};\n\nvar config = {\n reset: function () {\n Object.assign(this, DEFAULT_CONFIG);\n if (!isElectron) {\n this.execPath = process.execPath;\n }\n },\n resetForTesting: function () {\n this.reset();\n this.silent = true;\n },\n};\n\nconfig.reset();\nexports.config = config;\n\n// Note: commands should generally consider these as read-only values.\nvar state = {\n error: null,\n errorCode: 0,\n currentCmd: 'shell.js',\n};\nexports.state = state;\n\ndelete process.env.OLDPWD; // initially, there's no previous directory\n\n// Reliably test if something is any sort of javascript object\nfunction isObject(a) {\n return typeof a === 'object' && a !== null;\n}\nexports.isObject = isObject;\n\nfunction log() {\n /* istanbul ignore next */\n if (!config.silent) {\n console.error.apply(console, arguments);\n }\n}\nexports.log = log;\n\n// Converts strings to be equivalent across all platforms. Primarily responsible\n// for making sure we use '/' instead of '\\' as path separators, but this may be\n// expanded in the future if necessary\nfunction convertErrorOutput(msg) {\n if (typeof msg !== 'string') {\n throw new TypeError('input must be a string');\n }\n return msg.replace(/\\\\/g, '/');\n}\nexports.convertErrorOutput = convertErrorOutput;\n\n// Shows error message. Throws if config.fatal is true\nfunction error(msg, _code, options) {\n // Validate input\n if (typeof msg !== 'string') throw new Error('msg must be a string');\n\n var DEFAULT_OPTIONS = {\n continue: false,\n code: 1,\n prefix: state.currentCmd + ': ',\n silent: false,\n };\n\n if (typeof _code === 'number' && isObject(options)) {\n options.code = _code;\n } else if (isObject(_code)) { // no 'code'\n options = _code;\n } else if (typeof _code === 'number') { // no 'options'\n options = { code: _code };\n } else if (typeof _code !== 'number') { // only 'msg'\n options = {};\n }\n options = Object.assign({}, DEFAULT_OPTIONS, options);\n\n if (!state.errorCode) state.errorCode = options.code;\n\n var logEntry = convertErrorOutput(options.prefix + msg);\n state.error = state.error ? state.error + '\\n' : '';\n state.error += logEntry;\n\n // Throw an error, or log the entry\n if (config.fatal) throw new Error(logEntry);\n if (msg.length > 0 && !options.silent) log(logEntry);\n\n if (!options.continue) {\n throw {\n msg: 'earlyExit',\n retValue: (new ShellString('', state.error, state.errorCode)),\n };\n }\n}\nexports.error = error;\n\n//@\n//@ ### ShellString(str)\n//@\n//@ Examples:\n//@\n//@ ```javascript\n//@ var foo = ShellString('hello world');\n//@ ```\n//@\n//@ Turns a regular string into a string-like object similar to what each\n//@ command returns. This has special methods, like `.to()` and `.toEnd()`.\nfunction ShellString(stdout, stderr, code) {\n var that;\n if (stdout instanceof Array) {\n that = stdout;\n that.stdout = stdout.join('\\n');\n if (stdout.length > 0) that.stdout += '\\n';\n } else {\n that = new String(stdout);\n that.stdout = stdout;\n }\n that.stderr = stderr;\n that.code = code;\n // A list of all commands that can appear on the right-hand side of a pipe\n // (populated by calls to common.wrap())\n pipeMethods.forEach(function (cmd) {\n that[cmd] = shellMethods[cmd].bind(that);\n });\n return that;\n}\n\nexports.ShellString = ShellString;\n\n// Returns {'alice': true, 'bob': false} when passed a string and dictionary as follows:\n// parseOptions('-a', {'a':'alice', 'b':'bob'});\n// Returns {'reference': 'string-value', 'bob': false} when passed two dictionaries of the form:\n// parseOptions({'-r': 'string-value'}, {'r':'reference', 'b':'bob'});\n// Throws an error when passed a string that does not start with '-':\n// parseOptions('a', {'a':'alice'}); // throws\nfunction parseOptions(opt, map, errorOptions) {\n // Validate input\n if (typeof opt !== 'string' && !isObject(opt)) {\n throw new Error('options must be strings or key-value pairs');\n } else if (!isObject(map)) {\n throw new Error('parseOptions() internal error: map must be an object');\n } else if (errorOptions && !isObject(errorOptions)) {\n throw new Error('parseOptions() internal error: errorOptions must be object');\n }\n\n if (opt === '--') {\n // This means there are no options.\n return {};\n }\n\n // All options are false by default\n var options = {};\n Object.keys(map).forEach(function (letter) {\n var optName = map[letter];\n if (optName[0] !== '!') {\n options[optName] = false;\n }\n });\n\n if (opt === '') return options; // defaults\n\n if (typeof opt === 'string') {\n if (opt[0] !== '-') {\n throw new Error(\"Options string must start with a '-'\");\n }\n\n // e.g. chars = ['R', 'f']\n var chars = opt.slice(1).split('');\n\n chars.forEach(function (c) {\n if (c in map) {\n var optionName = map[c];\n if (optionName[0] === '!') {\n options[optionName.slice(1)] = false;\n } else {\n options[optionName] = true;\n }\n } else {\n error('option not recognized: ' + c, errorOptions || {});\n }\n });\n } else { // opt is an Object\n Object.keys(opt).forEach(function (key) {\n // key is a string of the form '-r', '-d', etc.\n var c = key[1];\n if (c in map) {\n var optionName = map[c];\n options[optionName] = opt[key]; // assign the given value\n } else {\n error('option not recognized: ' + c, errorOptions || {});\n }\n });\n }\n return options;\n}\nexports.parseOptions = parseOptions;\n\n// Expands wildcards with matching (ie. existing) file names.\n// For example:\n// expand(['file*.js']) = ['file1.js', 'file2.js', ...]\n// (if the files 'file1.js', 'file2.js', etc, exist in the current dir)\nfunction expand(list) {\n if (!Array.isArray(list)) {\n throw new TypeError('must be an array');\n }\n var expanded = [];\n list.forEach(function (listEl) {\n // Don't expand non-strings\n if (typeof listEl !== 'string') {\n expanded.push(listEl);\n } else {\n var ret;\n try {\n ret = glob.sync(listEl, config.globOptions);\n // if nothing matched, interpret the string literally\n ret = ret.length > 0 ? ret : [listEl];\n } catch (e) {\n // if glob fails, interpret the string literally\n ret = [listEl];\n }\n expanded = expanded.concat(ret);\n }\n });\n return expanded;\n}\nexports.expand = expand;\n\n// Normalizes Buffer creation, using Buffer.alloc if possible.\n// Also provides a good default buffer length for most use cases.\nvar buffer = typeof Buffer.alloc === 'function' ?\n function (len) {\n return Buffer.alloc(len || config.bufLength);\n } :\n function (len) {\n return new Buffer(len || config.bufLength);\n };\nexports.buffer = buffer;\n\n// Normalizes _unlinkSync() across platforms to match Unix behavior, i.e.\n// file can be unlinked even if it's read-only, see https://github.com/joyent/node/issues/3006\nfunction unlinkSync(file) {\n try {\n fs.unlinkSync(file);\n } catch (e) {\n // Try to override file permission\n /* istanbul ignore next */\n if (e.code === 'EPERM') {\n fs.chmodSync(file, '0666');\n fs.unlinkSync(file);\n } else {\n throw e;\n }\n }\n}\nexports.unlinkSync = unlinkSync;\n\n// wrappers around common.statFollowLinks and common.statNoFollowLinks that clarify intent\n// and improve readability\nfunction statFollowLinks() {\n return fs.statSync.apply(fs, arguments);\n}\nexports.statFollowLinks = statFollowLinks;\n\nfunction statNoFollowLinks() {\n return fs.lstatSync.apply(fs, arguments);\n}\nexports.statNoFollowLinks = statNoFollowLinks;\n\n// e.g. 'shelljs_a5f185d0443ca...'\nfunction randomFileName() {\n function randomHash(count) {\n if (count === 1) {\n return parseInt(16 * Math.random(), 10).toString(16);\n }\n var hash = '';\n for (var i = 0; i < count; i++) {\n hash += randomHash(1);\n }\n return hash;\n }\n\n return 'shelljs_' + randomHash(20);\n}\nexports.randomFileName = randomFileName;\n\n// Common wrapper for all Unix-like commands that performs glob expansion,\n// command-logging, and other nice things\nfunction wrap(cmd, fn, options) {\n options = options || {};\n return function () {\n var retValue = null;\n\n state.currentCmd = cmd;\n state.error = null;\n state.errorCode = 0;\n\n try {\n var args = [].slice.call(arguments, 0);\n\n // Log the command to stderr, if appropriate\n if (config.verbose) {\n console.error.apply(console, [cmd].concat(args));\n }\n\n // If this is coming from a pipe, let's set the pipedValue (otherwise, set\n // it to the empty string)\n state.pipedValue = (this && typeof this.stdout === 'string') ? this.stdout : '';\n\n if (options.unix === false) { // this branch is for exec()\n retValue = fn.apply(this, args);\n } else { // and this branch is for everything else\n if (isObject(args[0]) && args[0].constructor.name === 'Object') {\n // a no-op, allowing the syntax `touch({'-r': file}, ...)`\n } else if (args.length === 0 || typeof args[0] !== 'string' || args[0].length <= 1 || args[0][0] !== '-') {\n args.unshift(''); // only add dummy option if '-option' not already present\n }\n\n // flatten out arrays that are arguments, to make the syntax:\n // `cp([file1, file2, file3], dest);`\n // equivalent to:\n // `cp(file1, file2, file3, dest);`\n args = args.reduce(function (accum, cur) {\n if (Array.isArray(cur)) {\n return accum.concat(cur);\n }\n accum.push(cur);\n return accum;\n }, []);\n\n // Convert ShellStrings (basically just String objects) to regular strings\n args = args.map(function (arg) {\n if (isObject(arg) && arg.constructor.name === 'String') {\n return arg.toString();\n }\n return arg;\n });\n\n // Expand the '~' if appropriate\n var homeDir = os.homedir();\n args = args.map(function (arg) {\n if (typeof arg === 'string' && arg.slice(0, 2) === '~/' || arg === '~') {\n return arg.replace(/^~/, homeDir);\n }\n return arg;\n });\n\n // Perform glob-expansion on all arguments after globStart, but preserve\n // the arguments before it (like regexes for sed and grep)\n if (!config.noglob && options.allowGlobbing === true) {\n args = args.slice(0, options.globStart).concat(expand(args.slice(options.globStart)));\n }\n\n try {\n // parse options if options are provided\n if (isObject(options.cmdOptions)) {\n args[0] = parseOptions(args[0], options.cmdOptions);\n }\n\n retValue = fn.apply(this, args);\n } catch (e) {\n /* istanbul ignore else */\n if (e.msg === 'earlyExit') {\n retValue = e.retValue;\n } else {\n throw e; // this is probably a bug that should be thrown up the call stack\n }\n }\n }\n } catch (e) {\n /* istanbul ignore next */\n if (!state.error) {\n // If state.error hasn't been set it's an error thrown by Node, not us - probably a bug...\n e.name = 'ShellJSInternalError';\n throw e;\n }\n if (config.fatal) throw e;\n }\n\n if (options.wrapOutput &&\n (typeof retValue === 'string' || Array.isArray(retValue))) {\n retValue = new ShellString(retValue, state.error, state.errorCode);\n }\n\n state.currentCmd = 'shell.js';\n return retValue;\n };\n} // wrap\nexports.wrap = wrap;\n\n// This returns all the input that is piped into the current command (or the\n// empty string, if this isn't on the right-hand side of a pipe\nfunction _readFromPipe() {\n return state.pipedValue;\n}\nexports.readFromPipe = _readFromPipe;\n\nvar DEFAULT_WRAP_OPTIONS = {\n allowGlobbing: true,\n canReceivePipe: false,\n cmdOptions: null,\n globStart: 1,\n pipeOnly: false,\n wrapOutput: true,\n unix: true,\n};\n\n// This is populated during plugin registration\nvar pipeMethods = [];\n\n// Register a new ShellJS command\nfunction _register(name, implementation, wrapOptions) {\n wrapOptions = wrapOptions || {};\n\n // Validate options\n Object.keys(wrapOptions).forEach(function (option) {\n if (!DEFAULT_WRAP_OPTIONS.hasOwnProperty(option)) {\n throw new Error(\"Unknown option '\" + option + \"'\");\n }\n if (typeof wrapOptions[option] !== typeof DEFAULT_WRAP_OPTIONS[option]) {\n throw new TypeError(\"Unsupported type '\" + typeof wrapOptions[option] +\n \"' for option '\" + option + \"'\");\n }\n });\n\n // If an option isn't specified, use the default\n wrapOptions = Object.assign({}, DEFAULT_WRAP_OPTIONS, wrapOptions);\n\n if (shell.hasOwnProperty(name)) {\n throw new Error('Command `' + name + '` already exists');\n }\n\n if (wrapOptions.pipeOnly) {\n wrapOptions.canReceivePipe = true;\n shellMethods[name] = wrap(name, implementation, wrapOptions);\n } else {\n shell[name] = wrap(name, implementation, wrapOptions);\n }\n\n if (wrapOptions.canReceivePipe) {\n pipeMethods.push(name);\n }\n}\nexports.register = _register;\n","var fs = require('fs');\nvar path = require('path');\nvar common = require('./common');\n\ncommon.register('cp', _cp, {\n cmdOptions: {\n 'f': '!no_force',\n 'n': 'no_force',\n 'u': 'update',\n 'R': 'recursive',\n 'r': 'recursive',\n 'L': 'followsymlink',\n 'P': 'noFollowsymlink',\n },\n wrapOutput: false,\n});\n\n// Buffered file copy, synchronous\n// (Using readFileSync() + writeFileSync() could easily cause a memory overflow\n// with large files)\nfunction copyFileSync(srcFile, destFile, options) {\n if (!fs.existsSync(srcFile)) {\n common.error('copyFileSync: no such file or directory: ' + srcFile);\n }\n\n var isWindows = process.platform === 'win32';\n\n // Check the mtimes of the files if the '-u' flag is provided\n try {\n if (options.update && common.statFollowLinks(srcFile).mtime < fs.statSync(destFile).mtime) {\n return;\n }\n } catch (e) {\n // If we're here, destFile probably doesn't exist, so just do a normal copy\n }\n\n if (common.statNoFollowLinks(srcFile).isSymbolicLink() && !options.followsymlink) {\n try {\n common.statNoFollowLinks(destFile);\n common.unlinkSync(destFile); // re-link it\n } catch (e) {\n // it doesn't exist, so no work needs to be done\n }\n\n var symlinkFull = fs.readlinkSync(srcFile);\n fs.symlinkSync(symlinkFull, destFile, isWindows ? 'junction' : null);\n } else {\n var buf = common.buffer();\n var bufLength = buf.length;\n var bytesRead = bufLength;\n var pos = 0;\n var fdr = null;\n var fdw = null;\n\n try {\n fdr = fs.openSync(srcFile, 'r');\n } catch (e) {\n /* istanbul ignore next */\n common.error('copyFileSync: could not read src file (' + srcFile + ')');\n }\n\n try {\n fdw = fs.openSync(destFile, 'w');\n } catch (e) {\n /* istanbul ignore next */\n common.error('copyFileSync: could not write to dest file (code=' + e.code + '):' + destFile);\n }\n\n while (bytesRead === bufLength) {\n bytesRead = fs.readSync(fdr, buf, 0, bufLength, pos);\n fs.writeSync(fdw, buf, 0, bytesRead);\n pos += bytesRead;\n }\n\n fs.closeSync(fdr);\n fs.closeSync(fdw);\n\n fs.chmodSync(destFile, common.statFollowLinks(srcFile).mode);\n }\n}\n\n// Recursively copies 'sourceDir' into 'destDir'\n// Adapted from https://github.com/ryanmcgrath/wrench-js\n//\n// Copyright (c) 2010 Ryan McGrath\n// Copyright (c) 2012 Artur Adib\n//\n// Licensed under the MIT License\n// http://www.opensource.org/licenses/mit-license.php\nfunction cpdirSyncRecursive(sourceDir, destDir, currentDepth, opts) {\n if (!opts) opts = {};\n\n // Ensure there is not a run away recursive copy\n if (currentDepth >= common.config.maxdepth) return;\n currentDepth++;\n\n var isWindows = process.platform === 'win32';\n\n // Create the directory where all our junk is moving to; read the mode of the\n // source directory and mirror it\n try {\n fs.mkdirSync(destDir);\n } catch (e) {\n // if the directory already exists, that's okay\n if (e.code !== 'EEXIST') throw e;\n }\n\n var files = fs.readdirSync(sourceDir);\n\n for (var i = 0; i < files.length; i++) {\n var srcFile = sourceDir + '/' + files[i];\n var destFile = destDir + '/' + files[i];\n var srcFileStat = common.statNoFollowLinks(srcFile);\n\n var symlinkFull;\n if (opts.followsymlink) {\n if (cpcheckcycle(sourceDir, srcFile)) {\n // Cycle link found.\n console.error('Cycle link found.');\n symlinkFull = fs.readlinkSync(srcFile);\n fs.symlinkSync(symlinkFull, destFile, isWindows ? 'junction' : null);\n continue;\n }\n }\n if (srcFileStat.isDirectory()) {\n /* recursion this thing right on back. */\n cpdirSyncRecursive(srcFile, destFile, currentDepth, opts);\n } else if (srcFileStat.isSymbolicLink() && !opts.followsymlink) {\n symlinkFull = fs.readlinkSync(srcFile);\n try {\n common.statNoFollowLinks(destFile);\n common.unlinkSync(destFile); // re-link it\n } catch (e) {\n // it doesn't exist, so no work needs to be done\n }\n fs.symlinkSync(symlinkFull, destFile, isWindows ? 'junction' : null);\n } else if (srcFileStat.isSymbolicLink() && opts.followsymlink) {\n srcFileStat = common.statFollowLinks(srcFile);\n if (srcFileStat.isDirectory()) {\n cpdirSyncRecursive(srcFile, destFile, currentDepth, opts);\n } else {\n copyFileSync(srcFile, destFile, opts);\n }\n } else {\n /* At this point, we've hit a file actually worth copying... so copy it on over. */\n if (fs.existsSync(destFile) && opts.no_force) {\n common.log('skipping existing file: ' + files[i]);\n } else {\n copyFileSync(srcFile, destFile, opts);\n }\n }\n } // for files\n\n // finally change the mode for the newly created directory (otherwise, we\n // couldn't add files to a read-only directory).\n var checkDir = common.statFollowLinks(sourceDir);\n fs.chmodSync(destDir, checkDir.mode);\n} // cpdirSyncRecursive\n\n// Checks if cureent file was created recently\nfunction checkRecentCreated(sources, index) {\n var lookedSource = sources[index];\n return sources.slice(0, index).some(function (src) {\n return path.basename(src) === path.basename(lookedSource);\n });\n}\n\nfunction cpcheckcycle(sourceDir, srcFile) {\n var srcFileStat = common.statNoFollowLinks(srcFile);\n if (srcFileStat.isSymbolicLink()) {\n // Do cycle check. For example:\n // $ mkdir -p 1/2/3/4\n // $ cd 1/2/3/4\n // $ ln -s ../../3 link\n // $ cd ../../../..\n // $ cp -RL 1 copy\n var cyclecheck = common.statFollowLinks(srcFile);\n if (cyclecheck.isDirectory()) {\n var sourcerealpath = fs.realpathSync(sourceDir);\n var symlinkrealpath = fs.realpathSync(srcFile);\n var re = new RegExp(symlinkrealpath);\n if (re.test(sourcerealpath)) {\n return true;\n }\n }\n }\n return false;\n}\n\n//@\n//@ ### cp([options,] source [, source ...], dest)\n//@ ### cp([options,] source_array, dest)\n//@\n//@ Available options:\n//@\n//@ + `-f`: force (default behavior)\n//@ + `-n`: no-clobber\n//@ + `-u`: only copy if `source` is newer than `dest`\n//@ + `-r`, `-R`: recursive\n//@ + `-L`: follow symlinks\n//@ + `-P`: don't follow symlinks\n//@\n//@ Examples:\n//@\n//@ ```javascript\n//@ cp('file1', 'dir1');\n//@ cp('-R', 'path/to/dir/', '~/newCopy/');\n//@ cp('-Rf', '/tmp/*', '/usr/local/*', '/home/tmp');\n//@ cp('-Rf', ['/tmp/*', '/usr/local/*'], '/home/tmp'); // same as above\n//@ ```\n//@\n//@ Copies files.\nfunction _cp(options, sources, dest) {\n // If we're missing -R, it actually implies -L (unless -P is explicit)\n if (options.followsymlink) {\n options.noFollowsymlink = false;\n }\n if (!options.recursive && !options.noFollowsymlink) {\n options.followsymlink = true;\n }\n\n // Get sources, dest\n if (arguments.length < 3) {\n common.error('missing and/or ');\n } else {\n sources = [].slice.call(arguments, 1, arguments.length - 1);\n dest = arguments[arguments.length - 1];\n }\n\n var destExists = fs.existsSync(dest);\n var destStat = destExists && common.statFollowLinks(dest);\n\n // Dest is not existing dir, but multiple sources given\n if ((!destExists || !destStat.isDirectory()) && sources.length > 1) {\n common.error('dest is not a directory (too many sources)');\n }\n\n // Dest is an existing file, but -n is given\n if (destExists && destStat.isFile() && options.no_force) {\n return new common.ShellString('', '', 0);\n }\n\n sources.forEach(function (src, srcIndex) {\n if (!fs.existsSync(src)) {\n if (src === '') src = \"''\"; // if src was empty string, display empty string\n common.error('no such file or directory: ' + src, { continue: true });\n return; // skip file\n }\n var srcStat = common.statFollowLinks(src);\n if (!options.noFollowsymlink && srcStat.isDirectory()) {\n if (!options.recursive) {\n // Non-Recursive\n common.error(\"omitting directory '\" + src + \"'\", { continue: true });\n } else {\n // Recursive\n // 'cp /a/source dest' should create 'source' in 'dest'\n var newDest = (destStat && destStat.isDirectory()) ?\n path.join(dest, path.basename(src)) :\n dest;\n\n try {\n common.statFollowLinks(path.dirname(dest));\n cpdirSyncRecursive(src, newDest, 0, { no_force: options.no_force, followsymlink: options.followsymlink });\n } catch (e) {\n /* istanbul ignore next */\n common.error(\"cannot create directory '\" + dest + \"': No such file or directory\");\n }\n }\n } else {\n // If here, src is a file\n\n // When copying to '/path/dir':\n // thisDest = '/path/dir/file1'\n var thisDest = dest;\n if (destStat && destStat.isDirectory()) {\n thisDest = path.normalize(dest + '/' + path.basename(src));\n }\n\n var thisDestExists = fs.existsSync(thisDest);\n if (thisDestExists && checkRecentCreated(sources, srcIndex)) {\n // cannot overwrite file created recently in current execution, but we want to continue copying other files\n if (!options.no_force) {\n common.error(\"will not overwrite just-created '\" + thisDest + \"' with '\" + src + \"'\", { continue: true });\n }\n return;\n }\n\n if (thisDestExists && options.no_force) {\n return; // skip file\n }\n\n if (path.relative(src, thisDest) === '') {\n // a file cannot be copied to itself, but we want to continue copying other files\n common.error(\"'\" + thisDest + \"' and '\" + src + \"' are the same file\", { continue: true });\n return;\n }\n\n copyFileSync(src, thisDest, options);\n }\n }); // forEach(src)\n\n return new common.ShellString('', common.state.error, common.state.errorCode);\n}\nmodule.exports = _cp;\n","var common = require('./common');\nvar _cd = require('./cd');\nvar path = require('path');\n\ncommon.register('dirs', _dirs, {\n wrapOutput: false,\n});\ncommon.register('pushd', _pushd, {\n wrapOutput: false,\n});\ncommon.register('popd', _popd, {\n wrapOutput: false,\n});\n\n// Pushd/popd/dirs internals\nvar _dirStack = [];\n\nfunction _isStackIndex(index) {\n return (/^[\\-+]\\d+$/).test(index);\n}\n\nfunction _parseStackIndex(index) {\n if (_isStackIndex(index)) {\n if (Math.abs(index) < _dirStack.length + 1) { // +1 for pwd\n return (/^-/).test(index) ? Number(index) - 1 : Number(index);\n }\n common.error(index + ': directory stack index out of range');\n } else {\n common.error(index + ': invalid number');\n }\n}\n\nfunction _actualDirStack() {\n return [process.cwd()].concat(_dirStack);\n}\n\n//@\n//@ ### pushd([options,] [dir | '-N' | '+N'])\n//@\n//@ Available options:\n//@\n//@ + `-n`: Suppresses the normal change of directory when adding directories to the stack, so that only the stack is manipulated.\n//@ + `-q`: Supresses output to the console.\n//@\n//@ Arguments:\n//@\n//@ + `dir`: Sets the current working directory to the top of the stack, then executes the equivalent of `cd dir`.\n//@ + `+N`: Brings the Nth directory (counting from the left of the list printed by dirs, starting with zero) to the top of the list by rotating the stack.\n//@ + `-N`: Brings the Nth directory (counting from the right of the list printed by dirs, starting with zero) to the top of the list by rotating the stack.\n//@\n//@ Examples:\n//@\n//@ ```javascript\n//@ // process.cwd() === '/usr'\n//@ pushd('/etc'); // Returns /etc /usr\n//@ pushd('+1'); // Returns /usr /etc\n//@ ```\n//@\n//@ Save the current directory on the top of the directory stack and then `cd` to `dir`. With no arguments, `pushd` exchanges the top two directories. Returns an array of paths in the stack.\nfunction _pushd(options, dir) {\n if (_isStackIndex(options)) {\n dir = options;\n options = '';\n }\n\n options = common.parseOptions(options, {\n 'n': 'no-cd',\n 'q': 'quiet',\n });\n\n var dirs = _actualDirStack();\n\n if (dir === '+0') {\n return dirs; // +0 is a noop\n } else if (!dir) {\n if (dirs.length > 1) {\n dirs = dirs.splice(1, 1).concat(dirs);\n } else {\n return common.error('no other directory');\n }\n } else if (_isStackIndex(dir)) {\n var n = _parseStackIndex(dir);\n dirs = dirs.slice(n).concat(dirs.slice(0, n));\n } else {\n if (options['no-cd']) {\n dirs.splice(1, 0, dir);\n } else {\n dirs.unshift(dir);\n }\n }\n\n if (options['no-cd']) {\n dirs = dirs.slice(1);\n } else {\n dir = path.resolve(dirs.shift());\n _cd('', dir);\n }\n\n _dirStack = dirs;\n return _dirs(options.quiet ? '-q' : '');\n}\nexports.pushd = _pushd;\n\n//@\n//@\n//@ ### popd([options,] ['-N' | '+N'])\n//@\n//@ Available options:\n//@\n//@ + `-n`: Suppress the normal directory change when removing directories from the stack, so that only the stack is manipulated.\n//@ + `-q`: Supresses output to the console.\n//@\n//@ Arguments:\n//@\n//@ + `+N`: Removes the Nth directory (counting from the left of the list printed by dirs), starting with zero.\n//@ + `-N`: Removes the Nth directory (counting from the right of the list printed by dirs), starting with zero.\n//@\n//@ Examples:\n//@\n//@ ```javascript\n//@ echo(process.cwd()); // '/usr'\n//@ pushd('/etc'); // '/etc /usr'\n//@ echo(process.cwd()); // '/etc'\n//@ popd(); // '/usr'\n//@ echo(process.cwd()); // '/usr'\n//@ ```\n//@\n//@ When no arguments are given, `popd` removes the top directory from the stack and performs a `cd` to the new top directory. The elements are numbered from 0, starting at the first directory listed with dirs (i.e., `popd` is equivalent to `popd +0`). Returns an array of paths in the stack.\nfunction _popd(options, index) {\n if (_isStackIndex(options)) {\n index = options;\n options = '';\n }\n\n options = common.parseOptions(options, {\n 'n': 'no-cd',\n 'q': 'quiet',\n });\n\n if (!_dirStack.length) {\n return common.error('directory stack empty');\n }\n\n index = _parseStackIndex(index || '+0');\n\n if (options['no-cd'] || index > 0 || _dirStack.length + index === 0) {\n index = index > 0 ? index - 1 : index;\n _dirStack.splice(index, 1);\n } else {\n var dir = path.resolve(_dirStack.shift());\n _cd('', dir);\n }\n\n return _dirs(options.quiet ? '-q' : '');\n}\nexports.popd = _popd;\n\n//@\n//@\n//@ ### dirs([options | '+N' | '-N'])\n//@\n//@ Available options:\n//@\n//@ + `-c`: Clears the directory stack by deleting all of the elements.\n//@ + `-q`: Supresses output to the console.\n//@\n//@ Arguments:\n//@\n//@ + `+N`: Displays the Nth directory (counting from the left of the list printed by dirs when invoked without options), starting with zero.\n//@ + `-N`: Displays the Nth directory (counting from the right of the list printed by dirs when invoked without options), starting with zero.\n//@\n//@ Display the list of currently remembered directories. Returns an array of paths in the stack, or a single path if `+N` or `-N` was specified.\n//@\n//@ See also: `pushd`, `popd`\nfunction _dirs(options, index) {\n if (_isStackIndex(options)) {\n index = options;\n options = '';\n }\n\n options = common.parseOptions(options, {\n 'c': 'clear',\n 'q': 'quiet',\n });\n\n if (options.clear) {\n _dirStack = [];\n return _dirStack;\n }\n\n var stack = _actualDirStack();\n\n if (index) {\n index = _parseStackIndex(index);\n\n if (index < 0) {\n index = stack.length + index;\n }\n\n if (!options.quiet) {\n common.log(stack[index]);\n }\n return stack[index];\n }\n\n if (!options.quiet) {\n common.log(stack.join(' '));\n }\n\n return stack;\n}\nexports.dirs = _dirs;\n","var format = require('util').format;\n\nvar common = require('./common');\n\ncommon.register('echo', _echo, {\n allowGlobbing: false,\n});\n\n//@\n//@ ### echo([options,] string [, string ...])\n//@\n//@ Available options:\n//@\n//@ + `-e`: interpret backslash escapes (default)\n//@ + `-n`: remove trailing newline from output\n//@\n//@ Examples:\n//@\n//@ ```javascript\n//@ echo('hello world');\n//@ var str = echo('hello world');\n//@ echo('-n', 'no newline at end');\n//@ ```\n//@\n//@ Prints `string` to stdout, and returns string with additional utility methods\n//@ like `.to()`.\nfunction _echo(opts) {\n // allow strings starting with '-', see issue #20\n var messages = [].slice.call(arguments, opts ? 0 : 1);\n var options = {};\n\n // If the first argument starts with '-', parse it as options string.\n // If parseOptions throws, it wasn't an options string.\n try {\n options = common.parseOptions(messages[0], {\n 'e': 'escapes',\n 'n': 'no_newline',\n }, {\n silent: true,\n });\n\n // Allow null to be echoed\n if (messages[0]) {\n messages.shift();\n }\n } catch (_) {\n // Clear out error if an error occurred\n common.state.error = null;\n }\n\n var output = format.apply(null, messages);\n\n // Add newline if -n is not passed.\n if (!options.no_newline) {\n output += '\\n';\n }\n\n process.stdout.write(output);\n\n return output;\n}\n\nmodule.exports = _echo;\n","var common = require('./common');\n\n//@\n//@ ### error()\n//@\n//@ Tests if error occurred in the last command. Returns a truthy value if an\n//@ error returned, or a falsy value otherwise.\n//@\n//@ **Note**: do not rely on the\n//@ return value to be an error message. If you need the last error message, use\n//@ the `.stderr` attribute from the last command's return value instead.\nfunction error() {\n return common.state.error;\n}\nmodule.exports = error;\n",null,null,"var path = require('path');\nvar common = require('./common');\nvar _ls = require('./ls');\n\ncommon.register('find', _find, {});\n\n//@\n//@ ### find(path [, path ...])\n//@ ### find(path_array)\n//@\n//@ Examples:\n//@\n//@ ```javascript\n//@ find('src', 'lib');\n//@ find(['src', 'lib']); // same as above\n//@ find('.').filter(function(file) { return file.match(/\\.js$/); });\n//@ ```\n//@\n//@ Returns array of all files (however deep) in the given paths.\n//@\n//@ The main difference from `ls('-R', path)` is that the resulting file names\n//@ include the base directories (e.g., `lib/resources/file1` instead of just `file1`).\nfunction _find(options, paths) {\n if (!paths) {\n common.error('no path specified');\n } else if (typeof paths === 'string') {\n paths = [].slice.call(arguments, 1);\n }\n\n var list = [];\n\n function pushFile(file) {\n if (process.platform === 'win32') {\n file = file.replace(/\\\\/g, '/');\n }\n list.push(file);\n }\n\n // why not simply do `ls('-R', paths)`? because the output wouldn't give the base dirs\n // to get the base dir in the output, we need instead `ls('-R', 'dir/*')` for every directory\n\n paths.forEach(function (file) {\n var stat;\n try {\n stat = common.statFollowLinks(file);\n } catch (e) {\n common.error('no such file or directory: ' + file);\n }\n\n pushFile(file);\n\n if (stat.isDirectory()) {\n _ls({ recursive: true, all: true }, file).forEach(function (subfile) {\n pushFile(path.join(file, subfile));\n });\n }\n });\n\n return list;\n}\nmodule.exports = _find;\n","var common = require('./common');\nvar fs = require('fs');\n\ncommon.register('grep', _grep, {\n globStart: 2, // don't glob-expand the regex\n canReceivePipe: true,\n cmdOptions: {\n 'v': 'inverse',\n 'l': 'nameOnly',\n 'i': 'ignoreCase',\n },\n});\n\n//@\n//@ ### grep([options,] regex_filter, file [, file ...])\n//@ ### grep([options,] regex_filter, file_array)\n//@\n//@ Available options:\n//@\n//@ + `-v`: Invert `regex_filter` (only print non-matching lines).\n//@ + `-l`: Print only filenames of matching files.\n//@ + `-i`: Ignore case.\n//@\n//@ Examples:\n//@\n//@ ```javascript\n//@ grep('-v', 'GLOBAL_VARIABLE', '*.js');\n//@ grep('GLOBAL_VARIABLE', '*.js');\n//@ ```\n//@\n//@ Reads input string from given files and returns a string containing all lines of the\n//@ file that match the given `regex_filter`.\nfunction _grep(options, regex, files) {\n // Check if this is coming from a pipe\n var pipe = common.readFromPipe();\n\n if (!files && !pipe) common.error('no paths given', 2);\n\n files = [].slice.call(arguments, 2);\n\n if (pipe) {\n files.unshift('-');\n }\n\n var grep = [];\n if (options.ignoreCase) {\n regex = new RegExp(regex, 'i');\n }\n files.forEach(function (file) {\n if (!fs.existsSync(file) && file !== '-') {\n common.error('no such file or directory: ' + file, 2, { continue: true });\n return;\n }\n\n var contents = file === '-' ? pipe : fs.readFileSync(file, 'utf8');\n if (options.nameOnly) {\n if (contents.match(regex)) {\n grep.push(file);\n }\n } else {\n var lines = contents.split('\\n');\n lines.forEach(function (line) {\n var matched = line.match(regex);\n if ((options.inverse && !matched) || (!options.inverse && matched)) {\n grep.push(line);\n }\n });\n }\n });\n\n return grep.join('\\n') + '\\n';\n}\nmodule.exports = _grep;\n","var common = require('./common');\nvar fs = require('fs');\n\ncommon.register('head', _head, {\n canReceivePipe: true,\n cmdOptions: {\n 'n': 'numLines',\n },\n});\n\n// Reads |numLines| lines or the entire file, whichever is less.\nfunction readSomeLines(file, numLines) {\n var buf = common.buffer();\n var bufLength = buf.length;\n var bytesRead = bufLength;\n var pos = 0;\n\n var fdr = fs.openSync(file, 'r');\n var numLinesRead = 0;\n var ret = '';\n while (bytesRead === bufLength && numLinesRead < numLines) {\n bytesRead = fs.readSync(fdr, buf, 0, bufLength, pos);\n var bufStr = buf.toString('utf8', 0, bytesRead);\n numLinesRead += bufStr.split('\\n').length - 1;\n ret += bufStr;\n pos += bytesRead;\n }\n\n fs.closeSync(fdr);\n return ret;\n}\n\n//@\n//@ ### head([{'-n': \\},] file [, file ...])\n//@ ### head([{'-n': \\},] file_array)\n//@\n//@ Available options:\n//@\n//@ + `-n `: Show the first `` lines of the files\n//@\n//@ Examples:\n//@\n//@ ```javascript\n//@ var str = head({'-n': 1}, 'file*.txt');\n//@ var str = head('file1', 'file2');\n//@ var str = head(['file1', 'file2']); // same as above\n//@ ```\n//@\n//@ Read the start of a file.\nfunction _head(options, files) {\n var head = [];\n var pipe = common.readFromPipe();\n\n if (!files && !pipe) common.error('no paths given');\n\n var idx = 1;\n if (options.numLines === true) {\n idx = 2;\n options.numLines = Number(arguments[1]);\n } else if (options.numLines === false) {\n options.numLines = 10;\n }\n files = [].slice.call(arguments, idx);\n\n if (pipe) {\n files.unshift('-');\n }\n\n var shouldAppendNewline = false;\n files.forEach(function (file) {\n if (file !== '-') {\n if (!fs.existsSync(file)) {\n common.error('no such file or directory: ' + file, { continue: true });\n return;\n } else if (common.statFollowLinks(file).isDirectory()) {\n common.error(\"error reading '\" + file + \"': Is a directory\", {\n continue: true,\n });\n return;\n }\n }\n\n var contents;\n if (file === '-') {\n contents = pipe;\n } else if (options.numLines < 0) {\n contents = fs.readFileSync(file, 'utf8');\n } else {\n contents = readSomeLines(file, options.numLines);\n }\n\n var lines = contents.split('\\n');\n var hasTrailingNewline = (lines[lines.length - 1] === '');\n if (hasTrailingNewline) {\n lines.pop();\n }\n shouldAppendNewline = (hasTrailingNewline || options.numLines < lines.length);\n\n head = head.concat(lines.slice(0, options.numLines));\n });\n\n if (shouldAppendNewline) {\n head.push(''); // to add a trailing newline once we join\n }\n return head.join('\\n');\n}\nmodule.exports = _head;\n","var fs = require('fs');\nvar path = require('path');\nvar common = require('./common');\n\ncommon.register('ln', _ln, {\n cmdOptions: {\n 's': 'symlink',\n 'f': 'force',\n },\n});\n\n//@\n//@ ### ln([options,] source, dest)\n//@\n//@ Available options:\n//@\n//@ + `-s`: symlink\n//@ + `-f`: force\n//@\n//@ Examples:\n//@\n//@ ```javascript\n//@ ln('file', 'newlink');\n//@ ln('-sf', 'file', 'existing');\n//@ ```\n//@\n//@ Links `source` to `dest`. Use `-f` to force the link, should `dest` already exist.\nfunction _ln(options, source, dest) {\n if (!source || !dest) {\n common.error('Missing and/or ');\n }\n\n source = String(source);\n var sourcePath = path.normalize(source).replace(RegExp(path.sep + '$'), '');\n var isAbsolute = (path.resolve(source) === sourcePath);\n dest = path.resolve(process.cwd(), String(dest));\n\n if (fs.existsSync(dest)) {\n if (!options.force) {\n common.error('Destination file exists', { continue: true });\n }\n\n fs.unlinkSync(dest);\n }\n\n if (options.symlink) {\n var isWindows = process.platform === 'win32';\n var linkType = isWindows ? 'file' : null;\n var resolvedSourcePath = isAbsolute ? sourcePath : path.resolve(process.cwd(), path.dirname(dest), source);\n if (!fs.existsSync(resolvedSourcePath)) {\n common.error('Source file does not exist', { continue: true });\n } else if (isWindows && common.statFollowLinks(resolvedSourcePath).isDirectory()) {\n linkType = 'junction';\n }\n\n try {\n fs.symlinkSync(linkType === 'junction' ? resolvedSourcePath : source, dest, linkType);\n } catch (err) {\n common.error(err.message);\n }\n } else {\n if (!fs.existsSync(source)) {\n common.error('Source file does not exist', { continue: true });\n }\n try {\n fs.linkSync(source, dest);\n } catch (err) {\n common.error(err.message);\n }\n }\n return '';\n}\nmodule.exports = _ln;\n","var path = require('path');\nvar fs = require('fs');\nvar common = require('./common');\nvar glob = require('glob');\n\nvar globPatternRecursive = path.sep + '**';\n\ncommon.register('ls', _ls, {\n cmdOptions: {\n 'R': 'recursive',\n 'A': 'all',\n 'L': 'link',\n 'a': 'all_deprecated',\n 'd': 'directory',\n 'l': 'long',\n },\n});\n\n//@\n//@ ### ls([options,] [path, ...])\n//@ ### ls([options,] path_array)\n//@\n//@ Available options:\n//@\n//@ + `-R`: recursive\n//@ + `-A`: all files (include files beginning with `.`, except for `.` and `..`)\n//@ + `-L`: follow symlinks\n//@ + `-d`: list directories themselves, not their contents\n//@ + `-l`: list objects representing each file, each with fields containing `ls\n//@ -l` output fields. See\n//@ [`fs.Stats`](https://nodejs.org/api/fs.html#fs_class_fs_stats)\n//@ for more info\n//@\n//@ Examples:\n//@\n//@ ```javascript\n//@ ls('projs/*.js');\n//@ ls('-R', '/users/me', '/tmp');\n//@ ls('-R', ['/users/me', '/tmp']); // same as above\n//@ ls('-l', 'file.txt'); // { name: 'file.txt', mode: 33188, nlink: 1, ...}\n//@ ```\n//@\n//@ Returns array of files in the given `path`, or files in\n//@ the current directory if no `path` is provided.\nfunction _ls(options, paths) {\n if (options.all_deprecated) {\n // We won't support the -a option as it's hard to image why it's useful\n // (it includes '.' and '..' in addition to '.*' files)\n // For backwards compatibility we'll dump a deprecated message and proceed as before\n common.log('ls: Option -a is deprecated. Use -A instead');\n options.all = true;\n }\n\n if (!paths) {\n paths = ['.'];\n } else {\n paths = [].slice.call(arguments, 1);\n }\n\n var list = [];\n\n function pushFile(abs, relName, stat) {\n if (process.platform === 'win32') {\n relName = relName.replace(/\\\\/g, '/');\n }\n if (options.long) {\n stat = stat || (options.link ? common.statFollowLinks(abs) : common.statNoFollowLinks(abs));\n list.push(addLsAttributes(relName, stat));\n } else {\n // list.push(path.relative(rel || '.', file));\n list.push(relName);\n }\n }\n\n paths.forEach(function (p) {\n var stat;\n\n try {\n stat = options.link ? common.statFollowLinks(p) : common.statNoFollowLinks(p);\n // follow links to directories by default\n if (stat.isSymbolicLink()) {\n /* istanbul ignore next */\n // workaround for https://github.com/shelljs/shelljs/issues/795\n // codecov seems to have a bug that miscalculate this block as uncovered.\n // but according to nyc report this block does get covered.\n try {\n var _stat = common.statFollowLinks(p);\n if (_stat.isDirectory()) {\n stat = _stat;\n }\n } catch (_) {} // bad symlink, treat it like a file\n }\n } catch (e) {\n common.error('no such file or directory: ' + p, 2, { continue: true });\n return;\n }\n\n // If the stat succeeded\n if (stat.isDirectory() && !options.directory) {\n if (options.recursive) {\n // use glob, because it's simple\n glob.sync(p + globPatternRecursive, { dot: options.all, follow: options.link })\n .forEach(function (item) {\n // Glob pattern returns the directory itself and needs to be filtered out.\n if (path.relative(p, item)) {\n pushFile(item, path.relative(p, item));\n }\n });\n } else if (options.all) {\n // use fs.readdirSync, because it's fast\n fs.readdirSync(p).forEach(function (item) {\n pushFile(path.join(p, item), item);\n });\n } else {\n // use fs.readdirSync and then filter out secret files\n fs.readdirSync(p).forEach(function (item) {\n if (item[0] !== '.') {\n pushFile(path.join(p, item), item);\n }\n });\n }\n } else {\n pushFile(p, p, stat);\n }\n });\n\n // Add methods, to make this more compatible with ShellStrings\n return list;\n}\n\nfunction addLsAttributes(pathName, stats) {\n // Note: this object will contain more information than .toString() returns\n stats.name = pathName;\n stats.toString = function () {\n // Return a string resembling unix's `ls -l` format\n return [this.mode, this.nlink, this.uid, this.gid, this.size, this.mtime, this.name].join(' ');\n };\n return stats;\n}\n\nmodule.exports = _ls;\n","var common = require('./common');\nvar fs = require('fs');\nvar path = require('path');\n\ncommon.register('mkdir', _mkdir, {\n cmdOptions: {\n 'p': 'fullpath',\n },\n});\n\n// Recursively creates `dir`\nfunction mkdirSyncRecursive(dir) {\n var baseDir = path.dirname(dir);\n\n // Prevents some potential problems arising from malformed UNCs or\n // insufficient permissions.\n /* istanbul ignore next */\n if (baseDir === dir) {\n common.error('dirname() failed: [' + dir + ']');\n }\n\n // Base dir exists, no recursion necessary\n if (fs.existsSync(baseDir)) {\n fs.mkdirSync(dir, parseInt('0777', 8));\n return;\n }\n\n // Base dir does not exist, go recursive\n mkdirSyncRecursive(baseDir);\n\n // Base dir created, can create dir\n fs.mkdirSync(dir, parseInt('0777', 8));\n}\n\n//@\n//@ ### mkdir([options,] dir [, dir ...])\n//@ ### mkdir([options,] dir_array)\n//@\n//@ Available options:\n//@\n//@ + `-p`: full path (and create intermediate directories, if necessary)\n//@\n//@ Examples:\n//@\n//@ ```javascript\n//@ mkdir('-p', '/tmp/a/b/c/d', '/tmp/e/f/g');\n//@ mkdir('-p', ['/tmp/a/b/c/d', '/tmp/e/f/g']); // same as above\n//@ ```\n//@\n//@ Creates directories.\nfunction _mkdir(options, dirs) {\n if (!dirs) common.error('no paths given');\n\n if (typeof dirs === 'string') {\n dirs = [].slice.call(arguments, 1);\n }\n // if it's array leave it as it is\n\n dirs.forEach(function (dir) {\n try {\n var stat = common.statNoFollowLinks(dir);\n if (!options.fullpath) {\n common.error('path already exists: ' + dir, { continue: true });\n } else if (stat.isFile()) {\n common.error('cannot create directory ' + dir + ': File exists', { continue: true });\n }\n return; // skip dir\n } catch (e) {\n // do nothing\n }\n\n // Base dir does not exist, and no -p option given\n var baseDir = path.dirname(dir);\n if (!fs.existsSync(baseDir) && !options.fullpath) {\n common.error('no such file or directory: ' + baseDir, { continue: true });\n return; // skip dir\n }\n\n try {\n if (options.fullpath) {\n mkdirSyncRecursive(path.resolve(dir));\n } else {\n fs.mkdirSync(dir, parseInt('0777', 8));\n }\n } catch (e) {\n var reason;\n if (e.code === 'EACCES') {\n reason = 'Permission denied';\n } else if (e.code === 'ENOTDIR' || e.code === 'ENOENT') {\n reason = 'Not a directory';\n } else {\n /* istanbul ignore next */\n throw e;\n }\n common.error('cannot create directory ' + dir + ': ' + reason, { continue: true });\n }\n });\n return '';\n} // mkdir\nmodule.exports = _mkdir;\n","var fs = require('fs');\nvar path = require('path');\nvar common = require('./common');\nvar cp = require('./cp');\nvar rm = require('./rm');\n\ncommon.register('mv', _mv, {\n cmdOptions: {\n 'f': '!no_force',\n 'n': 'no_force',\n },\n});\n\n// Checks if cureent file was created recently\nfunction checkRecentCreated(sources, index) {\n var lookedSource = sources[index];\n return sources.slice(0, index).some(function (src) {\n return path.basename(src) === path.basename(lookedSource);\n });\n}\n\n//@\n//@ ### mv([options ,] source [, source ...], dest')\n//@ ### mv([options ,] source_array, dest')\n//@\n//@ Available options:\n//@\n//@ + `-f`: force (default behavior)\n//@ + `-n`: no-clobber\n//@\n//@ Examples:\n//@\n//@ ```javascript\n//@ mv('-n', 'file', 'dir/');\n//@ mv('file1', 'file2', 'dir/');\n//@ mv(['file1', 'file2'], 'dir/'); // same as above\n//@ ```\n//@\n//@ Moves `source` file(s) to `dest`.\nfunction _mv(options, sources, dest) {\n // Get sources, dest\n if (arguments.length < 3) {\n common.error('missing and/or ');\n } else if (arguments.length > 3) {\n sources = [].slice.call(arguments, 1, arguments.length - 1);\n dest = arguments[arguments.length - 1];\n } else if (typeof sources === 'string') {\n sources = [sources];\n } else {\n // TODO(nate): figure out if we actually need this line\n common.error('invalid arguments');\n }\n\n var exists = fs.existsSync(dest);\n var stats = exists && common.statFollowLinks(dest);\n\n // Dest is not existing dir, but multiple sources given\n if ((!exists || !stats.isDirectory()) && sources.length > 1) {\n common.error('dest is not a directory (too many sources)');\n }\n\n // Dest is an existing file, but no -f given\n if (exists && stats.isFile() && options.no_force) {\n common.error('dest file already exists: ' + dest);\n }\n\n sources.forEach(function (src, srcIndex) {\n if (!fs.existsSync(src)) {\n common.error('no such file or directory: ' + src, { continue: true });\n return; // skip file\n }\n\n // If here, src exists\n\n // When copying to '/path/dir':\n // thisDest = '/path/dir/file1'\n var thisDest = dest;\n if (fs.existsSync(dest) && common.statFollowLinks(dest).isDirectory()) {\n thisDest = path.normalize(dest + '/' + path.basename(src));\n }\n\n var thisDestExists = fs.existsSync(thisDest);\n\n if (thisDestExists && checkRecentCreated(sources, srcIndex)) {\n // cannot overwrite file created recently in current execution, but we want to continue copying other files\n if (!options.no_force) {\n common.error(\"will not overwrite just-created '\" + thisDest + \"' with '\" + src + \"'\", { continue: true });\n }\n return;\n }\n\n if (fs.existsSync(thisDest) && options.no_force) {\n common.error('dest file already exists: ' + thisDest, { continue: true });\n return; // skip file\n }\n\n if (path.resolve(src) === path.dirname(path.resolve(thisDest))) {\n common.error('cannot move to self: ' + src, { continue: true });\n return; // skip file\n }\n\n try {\n fs.renameSync(src, thisDest);\n } catch (e) {\n /* istanbul ignore next */\n if (e.code === 'EXDEV') {\n // If we're trying to `mv` to an external partition, we'll actually need\n // to perform a copy and then clean up the original file. If either the\n // copy or the rm fails with an exception, we should allow this\n // exception to pass up to the top level.\n cp('-r', src, thisDest);\n rm('-rf', src);\n }\n }\n }); // forEach(src)\n return '';\n} // mv\nmodule.exports = _mv;\n","// see dirs.js\n","// see dirs.js\n","var path = require('path');\nvar common = require('./common');\n\ncommon.register('pwd', _pwd, {\n allowGlobbing: false,\n});\n\n//@\n//@ ### pwd()\n//@\n//@ Returns the current directory.\nfunction _pwd() {\n var pwd = path.resolve(process.cwd());\n return pwd;\n}\nmodule.exports = _pwd;\n","var common = require('./common');\nvar fs = require('fs');\n\ncommon.register('rm', _rm, {\n cmdOptions: {\n 'f': 'force',\n 'r': 'recursive',\n 'R': 'recursive',\n },\n});\n\n// Recursively removes 'dir'\n// Adapted from https://github.com/ryanmcgrath/wrench-js\n//\n// Copyright (c) 2010 Ryan McGrath\n// Copyright (c) 2012 Artur Adib\n//\n// Licensed under the MIT License\n// http://www.opensource.org/licenses/mit-license.php\nfunction rmdirSyncRecursive(dir, force, fromSymlink) {\n var files;\n\n files = fs.readdirSync(dir);\n\n // Loop through and delete everything in the sub-tree after checking it\n for (var i = 0; i < files.length; i++) {\n var file = dir + '/' + files[i];\n var currFile = common.statNoFollowLinks(file);\n\n if (currFile.isDirectory()) { // Recursive function back to the beginning\n rmdirSyncRecursive(file, force);\n } else { // Assume it's a file - perhaps a try/catch belongs here?\n if (force || isWriteable(file)) {\n try {\n common.unlinkSync(file);\n } catch (e) {\n /* istanbul ignore next */\n common.error('could not remove file (code ' + e.code + '): ' + file, {\n continue: true,\n });\n }\n }\n }\n }\n\n // if was directory was referenced through a symbolic link,\n // the contents should be removed, but not the directory itself\n if (fromSymlink) return;\n\n // Now that we know everything in the sub-tree has been deleted, we can delete the main directory.\n // Huzzah for the shopkeep.\n\n var result;\n try {\n // Retry on windows, sometimes it takes a little time before all the files in the directory are gone\n var start = Date.now();\n\n // TODO: replace this with a finite loop\n for (;;) {\n try {\n result = fs.rmdirSync(dir);\n if (fs.existsSync(dir)) throw { code: 'EAGAIN' };\n break;\n } catch (er) {\n /* istanbul ignore next */\n // In addition to error codes, also check if the directory still exists and loop again if true\n if (process.platform === 'win32' && (er.code === 'ENOTEMPTY' || er.code === 'EBUSY' || er.code === 'EPERM' || er.code === 'EAGAIN')) {\n if (Date.now() - start > 1000) throw er;\n } else if (er.code === 'ENOENT') {\n // Directory did not exist, deletion was successful\n break;\n } else {\n throw er;\n }\n }\n }\n } catch (e) {\n common.error('could not remove directory (code ' + e.code + '): ' + dir, { continue: true });\n }\n\n return result;\n} // rmdirSyncRecursive\n\n// Hack to determine if file has write permissions for current user\n// Avoids having to check user, group, etc, but it's probably slow\nfunction isWriteable(file) {\n var writePermission = true;\n try {\n var __fd = fs.openSync(file, 'a');\n fs.closeSync(__fd);\n } catch (e) {\n writePermission = false;\n }\n\n return writePermission;\n}\n\nfunction handleFile(file, options) {\n if (options.force || isWriteable(file)) {\n // -f was passed, or file is writable, so it can be removed\n common.unlinkSync(file);\n } else {\n common.error('permission denied: ' + file, { continue: true });\n }\n}\n\nfunction handleDirectory(file, options) {\n if (options.recursive) {\n // -r was passed, so directory can be removed\n rmdirSyncRecursive(file, options.force);\n } else {\n common.error('path is a directory', { continue: true });\n }\n}\n\nfunction handleSymbolicLink(file, options) {\n var stats;\n try {\n stats = common.statFollowLinks(file);\n } catch (e) {\n // symlink is broken, so remove the symlink itself\n common.unlinkSync(file);\n return;\n }\n\n if (stats.isFile()) {\n common.unlinkSync(file);\n } else if (stats.isDirectory()) {\n if (file[file.length - 1] === '/') {\n // trailing separator, so remove the contents, not the link\n if (options.recursive) {\n // -r was passed, so directory can be removed\n var fromSymlink = true;\n rmdirSyncRecursive(file, options.force, fromSymlink);\n } else {\n common.error('path is a directory', { continue: true });\n }\n } else {\n // no trailing separator, so remove the link\n common.unlinkSync(file);\n }\n }\n}\n\nfunction handleFIFO(file) {\n common.unlinkSync(file);\n}\n\n//@\n//@ ### rm([options,] file [, file ...])\n//@ ### rm([options,] file_array)\n//@\n//@ Available options:\n//@\n//@ + `-f`: force\n//@ + `-r, -R`: recursive\n//@\n//@ Examples:\n//@\n//@ ```javascript\n//@ rm('-rf', '/tmp/*');\n//@ rm('some_file.txt', 'another_file.txt');\n//@ rm(['some_file.txt', 'another_file.txt']); // same as above\n//@ ```\n//@\n//@ Removes files.\nfunction _rm(options, files) {\n if (!files) common.error('no paths given');\n\n // Convert to array\n files = [].slice.call(arguments, 1);\n\n files.forEach(function (file) {\n var lstats;\n try {\n var filepath = (file[file.length - 1] === '/')\n ? file.slice(0, -1) // remove the '/' so lstatSync can detect symlinks\n : file;\n lstats = common.statNoFollowLinks(filepath); // test for existence\n } catch (e) {\n // Path does not exist, no force flag given\n if (!options.force) {\n common.error('no such file or directory: ' + file, { continue: true });\n }\n return; // skip file\n }\n\n // If here, path exists\n if (lstats.isFile()) {\n handleFile(file, options);\n } else if (lstats.isDirectory()) {\n handleDirectory(file, options);\n } else if (lstats.isSymbolicLink()) {\n handleSymbolicLink(file, options);\n } else if (lstats.isFIFO()) {\n handleFIFO(file);\n }\n }); // forEach(file)\n return '';\n} // rm\nmodule.exports = _rm;\n","var common = require('./common');\nvar fs = require('fs');\n\ncommon.register('sed', _sed, {\n globStart: 3, // don't glob-expand regexes\n canReceivePipe: true,\n cmdOptions: {\n 'i': 'inplace',\n },\n});\n\n//@\n//@ ### sed([options,] search_regex, replacement, file [, file ...])\n//@ ### sed([options,] search_regex, replacement, file_array)\n//@\n//@ Available options:\n//@\n//@ + `-i`: Replace contents of `file` in-place. _Note that no backups will be created!_\n//@\n//@ Examples:\n//@\n//@ ```javascript\n//@ sed('-i', 'PROGRAM_VERSION', 'v0.1.3', 'source.js');\n//@ sed(/.*DELETE_THIS_LINE.*\\n/, '', 'source.js');\n//@ ```\n//@\n//@ Reads an input string from `file`s, and performs a JavaScript `replace()` on the input\n//@ using the given `search_regex` and `replacement` string or function. Returns the new string after replacement.\n//@\n//@ Note:\n//@\n//@ Like unix `sed`, ShellJS `sed` supports capture groups. Capture groups are specified\n//@ using the `$n` syntax:\n//@\n//@ ```javascript\n//@ sed(/(\\w+)\\s(\\w+)/, '$2, $1', 'file.txt');\n//@ ```\nfunction _sed(options, regex, replacement, files) {\n // Check if this is coming from a pipe\n var pipe = common.readFromPipe();\n\n if (typeof replacement !== 'string' && typeof replacement !== 'function') {\n if (typeof replacement === 'number') {\n replacement = replacement.toString(); // fallback\n } else {\n common.error('invalid replacement string');\n }\n }\n\n // Convert all search strings to RegExp\n if (typeof regex === 'string') {\n regex = RegExp(regex);\n }\n\n if (!files && !pipe) {\n common.error('no files given');\n }\n\n files = [].slice.call(arguments, 3);\n\n if (pipe) {\n files.unshift('-');\n }\n\n var sed = [];\n files.forEach(function (file) {\n if (!fs.existsSync(file) && file !== '-') {\n common.error('no such file or directory: ' + file, 2, { continue: true });\n return;\n }\n\n var contents = file === '-' ? pipe : fs.readFileSync(file, 'utf8');\n var lines = contents.split('\\n');\n var result = lines.map(function (line) {\n return line.replace(regex, replacement);\n }).join('\\n');\n\n sed.push(result);\n\n if (options.inplace) {\n fs.writeFileSync(file, result, 'utf8');\n }\n });\n\n return sed.join('\\n');\n}\nmodule.exports = _sed;\n","var common = require('./common');\n\ncommon.register('set', _set, {\n allowGlobbing: false,\n wrapOutput: false,\n});\n\n//@\n//@ ### set(options)\n//@\n//@ Available options:\n//@\n//@ + `+/-e`: exit upon error (`config.fatal`)\n//@ + `+/-v`: verbose: show all commands (`config.verbose`)\n//@ + `+/-f`: disable filename expansion (globbing)\n//@\n//@ Examples:\n//@\n//@ ```javascript\n//@ set('-e'); // exit upon first error\n//@ set('+e'); // this undoes a \"set('-e')\"\n//@ ```\n//@\n//@ Sets global configuration variables.\nfunction _set(options) {\n if (!options) {\n var args = [].slice.call(arguments, 0);\n if (args.length < 2) common.error('must provide an argument');\n options = args[1];\n }\n var negate = (options[0] === '+');\n if (negate) {\n options = '-' + options.slice(1); // parseOptions needs a '-' prefix\n }\n options = common.parseOptions(options, {\n 'e': 'fatal',\n 'v': 'verbose',\n 'f': 'noglob',\n });\n\n if (negate) {\n Object.keys(options).forEach(function (key) {\n options[key] = !options[key];\n });\n }\n\n Object.keys(options).forEach(function (key) {\n // Only change the global config if `negate` is false and the option is true\n // or if `negate` is true and the option is false (aka negate !== option)\n if (negate !== options[key]) {\n common.config[key] = options[key];\n }\n });\n return;\n}\nmodule.exports = _set;\n","var common = require('./common');\nvar fs = require('fs');\n\ncommon.register('sort', _sort, {\n canReceivePipe: true,\n cmdOptions: {\n 'r': 'reverse',\n 'n': 'numerical',\n },\n});\n\n// parse out the number prefix of a line\nfunction parseNumber(str) {\n var match = str.match(/^\\s*(\\d*)\\s*(.*)$/);\n return { num: Number(match[1]), value: match[2] };\n}\n\n// compare two strings case-insensitively, but examine case for strings that are\n// case-insensitive equivalent\nfunction unixCmp(a, b) {\n var aLower = a.toLowerCase();\n var bLower = b.toLowerCase();\n return (aLower === bLower ?\n -1 * a.localeCompare(b) : // unix sort treats case opposite how javascript does\n aLower.localeCompare(bLower));\n}\n\n// compare two strings in the fashion that unix sort's -n option works\nfunction numericalCmp(a, b) {\n var objA = parseNumber(a);\n var objB = parseNumber(b);\n if (objA.hasOwnProperty('num') && objB.hasOwnProperty('num')) {\n return ((objA.num !== objB.num) ?\n (objA.num - objB.num) :\n unixCmp(objA.value, objB.value));\n } else {\n return unixCmp(objA.value, objB.value);\n }\n}\n\n//@\n//@ ### sort([options,] file [, file ...])\n//@ ### sort([options,] file_array)\n//@\n//@ Available options:\n//@\n//@ + `-r`: Reverse the results\n//@ + `-n`: Compare according to numerical value\n//@\n//@ Examples:\n//@\n//@ ```javascript\n//@ sort('foo.txt', 'bar.txt');\n//@ sort('-r', 'foo.txt');\n//@ ```\n//@\n//@ Return the contents of the `file`s, sorted line-by-line. Sorting multiple\n//@ files mixes their content (just as unix `sort` does).\nfunction _sort(options, files) {\n // Check if this is coming from a pipe\n var pipe = common.readFromPipe();\n\n if (!files && !pipe) common.error('no files given');\n\n files = [].slice.call(arguments, 1);\n\n if (pipe) {\n files.unshift('-');\n }\n\n var lines = files.reduce(function (accum, file) {\n if (file !== '-') {\n if (!fs.existsSync(file)) {\n common.error('no such file or directory: ' + file, { continue: true });\n return accum;\n } else if (common.statFollowLinks(file).isDirectory()) {\n common.error('read failed: ' + file + ': Is a directory', {\n continue: true,\n });\n return accum;\n }\n }\n\n var contents = file === '-' ? pipe : fs.readFileSync(file, 'utf8');\n return accum.concat(contents.trimRight().split('\\n'));\n }, []);\n\n var sorted = lines.sort(options.numerical ? numericalCmp : unixCmp);\n\n if (options.reverse) {\n sorted = sorted.reverse();\n }\n\n return sorted.join('\\n') + '\\n';\n}\n\nmodule.exports = _sort;\n","var common = require('./common');\nvar fs = require('fs');\n\ncommon.register('tail', _tail, {\n canReceivePipe: true,\n cmdOptions: {\n 'n': 'numLines',\n },\n});\n\n//@\n//@ ### tail([{'-n': \\},] file [, file ...])\n//@ ### tail([{'-n': \\},] file_array)\n//@\n//@ Available options:\n//@\n//@ + `-n `: Show the last `` lines of `file`s\n//@\n//@ Examples:\n//@\n//@ ```javascript\n//@ var str = tail({'-n': 1}, 'file*.txt');\n//@ var str = tail('file1', 'file2');\n//@ var str = tail(['file1', 'file2']); // same as above\n//@ ```\n//@\n//@ Read the end of a `file`.\nfunction _tail(options, files) {\n var tail = [];\n var pipe = common.readFromPipe();\n\n if (!files && !pipe) common.error('no paths given');\n\n var idx = 1;\n if (options.numLines === true) {\n idx = 2;\n options.numLines = Number(arguments[1]);\n } else if (options.numLines === false) {\n options.numLines = 10;\n }\n options.numLines = -1 * Math.abs(options.numLines);\n files = [].slice.call(arguments, idx);\n\n if (pipe) {\n files.unshift('-');\n }\n\n var shouldAppendNewline = false;\n files.forEach(function (file) {\n if (file !== '-') {\n if (!fs.existsSync(file)) {\n common.error('no such file or directory: ' + file, { continue: true });\n return;\n } else if (common.statFollowLinks(file).isDirectory()) {\n common.error(\"error reading '\" + file + \"': Is a directory\", {\n continue: true,\n });\n return;\n }\n }\n\n var contents = file === '-' ? pipe : fs.readFileSync(file, 'utf8');\n\n var lines = contents.split('\\n');\n if (lines[lines.length - 1] === '') {\n lines.pop();\n shouldAppendNewline = true;\n } else {\n shouldAppendNewline = false;\n }\n\n tail = tail.concat(lines.slice(options.numLines));\n });\n\n if (shouldAppendNewline) {\n tail.push(''); // to add a trailing newline once we join\n }\n return tail.join('\\n');\n}\nmodule.exports = _tail;\n","var common = require('./common');\nvar os = require('os');\nvar fs = require('fs');\n\ncommon.register('tempdir', _tempDir, {\n allowGlobbing: false,\n wrapOutput: false,\n});\n\n// Returns false if 'dir' is not a writeable directory, 'dir' otherwise\nfunction writeableDir(dir) {\n if (!dir || !fs.existsSync(dir)) return false;\n\n if (!common.statFollowLinks(dir).isDirectory()) return false;\n\n var testFile = dir + '/' + common.randomFileName();\n try {\n fs.writeFileSync(testFile, ' ');\n common.unlinkSync(testFile);\n return dir;\n } catch (e) {\n /* istanbul ignore next */\n return false;\n }\n}\n\n// Variable to cache the tempdir value for successive lookups.\nvar cachedTempDir;\n\n//@\n//@ ### tempdir()\n//@\n//@ Examples:\n//@\n//@ ```javascript\n//@ var tmp = tempdir(); // \"/tmp\" for most *nix platforms\n//@ ```\n//@\n//@ Searches and returns string containing a writeable, platform-dependent temporary directory.\n//@ Follows Python's [tempfile algorithm](http://docs.python.org/library/tempfile.html#tempfile.tempdir).\nfunction _tempDir() {\n if (cachedTempDir) return cachedTempDir;\n\n cachedTempDir = writeableDir(os.tmpdir()) ||\n writeableDir(process.env.TMPDIR) ||\n writeableDir(process.env.TEMP) ||\n writeableDir(process.env.TMP) ||\n writeableDir(process.env.Wimp$ScrapDir) || // RiscOS\n writeableDir('C:\\\\TEMP') || // Windows\n writeableDir('C:\\\\TMP') || // Windows\n writeableDir('\\\\TEMP') || // Windows\n writeableDir('\\\\TMP') || // Windows\n writeableDir('/tmp') ||\n writeableDir('/var/tmp') ||\n writeableDir('/usr/tmp') ||\n writeableDir('.'); // last resort\n\n return cachedTempDir;\n}\n\n// Indicates if the tempdir value is currently cached. This is exposed for tests\n// only. The return value should only be tested for truthiness.\nfunction isCached() {\n return cachedTempDir;\n}\n\n// Clears the cached tempDir value, if one is cached. This is exposed for tests\n// only.\nfunction clearCache() {\n cachedTempDir = undefined;\n}\n\nmodule.exports.tempDir = _tempDir;\nmodule.exports.isCached = isCached;\nmodule.exports.clearCache = clearCache;\n","var common = require('./common');\nvar fs = require('fs');\n\ncommon.register('test', _test, {\n cmdOptions: {\n 'b': 'block',\n 'c': 'character',\n 'd': 'directory',\n 'e': 'exists',\n 'f': 'file',\n 'L': 'link',\n 'p': 'pipe',\n 'S': 'socket',\n },\n wrapOutput: false,\n allowGlobbing: false,\n});\n\n\n//@\n//@ ### test(expression)\n//@\n//@ Available expression primaries:\n//@\n//@ + `'-b', 'path'`: true if path is a block device\n//@ + `'-c', 'path'`: true if path is a character device\n//@ + `'-d', 'path'`: true if path is a directory\n//@ + `'-e', 'path'`: true if path exists\n//@ + `'-f', 'path'`: true if path is a regular file\n//@ + `'-L', 'path'`: true if path is a symbolic link\n//@ + `'-p', 'path'`: true if path is a pipe (FIFO)\n//@ + `'-S', 'path'`: true if path is a socket\n//@\n//@ Examples:\n//@\n//@ ```javascript\n//@ if (test('-d', path)) { /* do something with dir */ };\n//@ if (!test('-f', path)) continue; // skip if it's a regular file\n//@ ```\n//@\n//@ Evaluates `expression` using the available primaries and returns corresponding value.\nfunction _test(options, path) {\n if (!path) common.error('no path given');\n\n var canInterpret = false;\n Object.keys(options).forEach(function (key) {\n if (options[key] === true) {\n canInterpret = true;\n }\n });\n\n if (!canInterpret) common.error('could not interpret expression');\n\n if (options.link) {\n try {\n return common.statNoFollowLinks(path).isSymbolicLink();\n } catch (e) {\n return false;\n }\n }\n\n if (!fs.existsSync(path)) return false;\n\n if (options.exists) return true;\n\n var stats = common.statFollowLinks(path);\n\n if (options.block) return stats.isBlockDevice();\n\n if (options.character) return stats.isCharacterDevice();\n\n if (options.directory) return stats.isDirectory();\n\n if (options.file) return stats.isFile();\n\n /* istanbul ignore next */\n if (options.pipe) return stats.isFIFO();\n\n /* istanbul ignore next */\n if (options.socket) return stats.isSocket();\n\n /* istanbul ignore next */\n return false; // fallback\n} // test\nmodule.exports = _test;\n","var common = require('./common');\nvar fs = require('fs');\nvar path = require('path');\n\ncommon.register('to', _to, {\n pipeOnly: true,\n wrapOutput: false,\n});\n\n//@\n//@ ### ShellString.prototype.to(file)\n//@\n//@ Examples:\n//@\n//@ ```javascript\n//@ cat('input.txt').to('output.txt');\n//@ ```\n//@\n//@ Analogous to the redirection operator `>` in Unix, but works with\n//@ `ShellStrings` (such as those returned by `cat`, `grep`, etc.). _Like Unix\n//@ redirections, `to()` will overwrite any existing file!_\nfunction _to(options, file) {\n if (!file) common.error('wrong arguments');\n\n if (!fs.existsSync(path.dirname(file))) {\n common.error('no such file or directory: ' + path.dirname(file));\n }\n\n try {\n fs.writeFileSync(file, this.stdout || this.toString(), 'utf8');\n return this;\n } catch (e) {\n /* istanbul ignore next */\n common.error('could not write to file (code ' + e.code + '): ' + file, { continue: true });\n }\n}\nmodule.exports = _to;\n","var common = require('./common');\nvar fs = require('fs');\nvar path = require('path');\n\ncommon.register('toEnd', _toEnd, {\n pipeOnly: true,\n wrapOutput: false,\n});\n\n//@\n//@ ### ShellString.prototype.toEnd(file)\n//@\n//@ Examples:\n//@\n//@ ```javascript\n//@ cat('input.txt').toEnd('output.txt');\n//@ ```\n//@\n//@ Analogous to the redirect-and-append operator `>>` in Unix, but works with\n//@ `ShellStrings` (such as those returned by `cat`, `grep`, etc.).\nfunction _toEnd(options, file) {\n if (!file) common.error('wrong arguments');\n\n if (!fs.existsSync(path.dirname(file))) {\n common.error('no such file or directory: ' + path.dirname(file));\n }\n\n try {\n fs.appendFileSync(file, this.stdout || this.toString(), 'utf8');\n return this;\n } catch (e) {\n /* istanbul ignore next */\n common.error('could not append to file (code ' + e.code + '): ' + file, { continue: true });\n }\n}\nmodule.exports = _toEnd;\n","var common = require('./common');\nvar fs = require('fs');\n\ncommon.register('touch', _touch, {\n cmdOptions: {\n 'a': 'atime_only',\n 'c': 'no_create',\n 'd': 'date',\n 'm': 'mtime_only',\n 'r': 'reference',\n },\n});\n\n//@\n//@ ### touch([options,] file [, file ...])\n//@ ### touch([options,] file_array)\n//@\n//@ Available options:\n//@\n//@ + `-a`: Change only the access time\n//@ + `-c`: Do not create any files\n//@ + `-m`: Change only the modification time\n//@ + `-d DATE`: Parse `DATE` and use it instead of current time\n//@ + `-r FILE`: Use `FILE`'s times instead of current time\n//@\n//@ Examples:\n//@\n//@ ```javascript\n//@ touch('source.js');\n//@ touch('-c', '/path/to/some/dir/source.js');\n//@ touch({ '-r': FILE }, '/path/to/some/dir/source.js');\n//@ ```\n//@\n//@ Update the access and modification times of each `FILE` to the current time.\n//@ A `FILE` argument that does not exist is created empty, unless `-c` is supplied.\n//@ This is a partial implementation of [`touch(1)`](http://linux.die.net/man/1/touch).\nfunction _touch(opts, files) {\n if (!files) {\n common.error('no files given');\n } else if (typeof files === 'string') {\n files = [].slice.call(arguments, 1);\n } else {\n common.error('file arg should be a string file path or an Array of string file paths');\n }\n\n files.forEach(function (f) {\n touchFile(opts, f);\n });\n return '';\n}\n\nfunction touchFile(opts, file) {\n var stat = tryStatFile(file);\n\n if (stat && stat.isDirectory()) {\n // don't error just exit\n return;\n }\n\n // if the file doesn't already exist and the user has specified --no-create then\n // this script is finished\n if (!stat && opts.no_create) {\n return;\n }\n\n // open the file and then close it. this will create it if it doesn't exist but will\n // not truncate the file\n fs.closeSync(fs.openSync(file, 'a'));\n\n //\n // Set timestamps\n //\n\n // setup some defaults\n var now = new Date();\n var mtime = opts.date || now;\n var atime = opts.date || now;\n\n // use reference file\n if (opts.reference) {\n var refStat = tryStatFile(opts.reference);\n if (!refStat) {\n common.error('failed to get attributess of ' + opts.reference);\n }\n mtime = refStat.mtime;\n atime = refStat.atime;\n } else if (opts.date) {\n mtime = opts.date;\n atime = opts.date;\n }\n\n if (opts.atime_only && opts.mtime_only) {\n // keep the new values of mtime and atime like GNU\n } else if (opts.atime_only) {\n mtime = stat.mtime;\n } else if (opts.mtime_only) {\n atime = stat.atime;\n }\n\n fs.utimesSync(file, atime, mtime);\n}\n\nmodule.exports = _touch;\n\nfunction tryStatFile(filePath) {\n try {\n return common.statFollowLinks(filePath);\n } catch (e) {\n return null;\n }\n}\n","var common = require('./common');\nvar fs = require('fs');\n\n// add c spaces to the left of str\nfunction lpad(c, str) {\n var res = '' + str;\n if (res.length < c) {\n res = Array((c - res.length) + 1).join(' ') + res;\n }\n return res;\n}\n\ncommon.register('uniq', _uniq, {\n canReceivePipe: true,\n cmdOptions: {\n 'i': 'ignoreCase',\n 'c': 'count',\n 'd': 'duplicates',\n },\n});\n\n//@\n//@ ### uniq([options,] [input, [output]])\n//@\n//@ Available options:\n//@\n//@ + `-i`: Ignore case while comparing\n//@ + `-c`: Prefix lines by the number of occurrences\n//@ + `-d`: Only print duplicate lines, one for each group of identical lines\n//@\n//@ Examples:\n//@\n//@ ```javascript\n//@ uniq('foo.txt');\n//@ uniq('-i', 'foo.txt');\n//@ uniq('-cd', 'foo.txt', 'bar.txt');\n//@ ```\n//@\n//@ Filter adjacent matching lines from `input`.\nfunction _uniq(options, input, output) {\n // Check if this is coming from a pipe\n var pipe = common.readFromPipe();\n\n if (!pipe) {\n if (!input) common.error('no input given');\n\n if (!fs.existsSync(input)) {\n common.error(input + ': No such file or directory');\n } else if (common.statFollowLinks(input).isDirectory()) {\n common.error(\"error reading '\" + input + \"'\");\n }\n }\n if (output && fs.existsSync(output) && common.statFollowLinks(output).isDirectory()) {\n common.error(output + ': Is a directory');\n }\n\n var lines = (input ? fs.readFileSync(input, 'utf8') : pipe).\n trimRight().\n split('\\n');\n\n var compare = function (a, b) {\n return options.ignoreCase ?\n a.toLocaleLowerCase().localeCompare(b.toLocaleLowerCase()) :\n a.localeCompare(b);\n };\n var uniqed = lines.reduceRight(function (res, e) {\n // Perform uniq -c on the input\n if (res.length === 0) {\n return [{ count: 1, ln: e }];\n } else if (compare(res[0].ln, e) === 0) {\n return [{ count: res[0].count + 1, ln: e }].concat(res.slice(1));\n } else {\n return [{ count: 1, ln: e }].concat(res);\n }\n }, []).filter(function (obj) {\n // Do we want only duplicated objects?\n return options.duplicates ? obj.count > 1 : true;\n }).map(function (obj) {\n // Are we tracking the counts of each line?\n return (options.count ? (lpad(7, obj.count) + ' ') : '') + obj.ln;\n }).join('\\n') + '\\n';\n\n if (output) {\n (new common.ShellString(uniqed)).to(output);\n // if uniq writes to output, nothing is passed to the next command in the pipeline (if any)\n return '';\n } else {\n return uniqed;\n }\n}\n\nmodule.exports = _uniq;\n","var common = require('./common');\nvar fs = require('fs');\nvar path = require('path');\n\ncommon.register('which', _which, {\n allowGlobbing: false,\n cmdOptions: {\n 'a': 'all',\n },\n});\n\n// XP's system default value for `PATHEXT` system variable, just in case it's not\n// set on Windows.\nvar XP_DEFAULT_PATHEXT = '.com;.exe;.bat;.cmd;.vbs;.vbe;.js;.jse;.wsf;.wsh';\n\n// For earlier versions of NodeJS that doesn't have a list of constants (< v6)\nvar FILE_EXECUTABLE_MODE = 1;\n\nfunction isWindowsPlatform() {\n return process.platform === 'win32';\n}\n\n// Cross-platform method for splitting environment `PATH` variables\nfunction splitPath(p) {\n return p ? p.split(path.delimiter) : [];\n}\n\n// Tests are running all cases for this func but it stays uncovered by codecov due to unknown reason\n/* istanbul ignore next */\nfunction isExecutable(pathName) {\n try {\n // TODO(node-support): replace with fs.constants.X_OK once remove support for node < v6\n fs.accessSync(pathName, FILE_EXECUTABLE_MODE);\n } catch (err) {\n return false;\n }\n return true;\n}\n\nfunction checkPath(pathName) {\n return fs.existsSync(pathName) && !common.statFollowLinks(pathName).isDirectory()\n && (isWindowsPlatform() || isExecutable(pathName));\n}\n\n//@\n//@ ### which(command)\n//@\n//@ Examples:\n//@\n//@ ```javascript\n//@ var nodeExec = which('node');\n//@ ```\n//@\n//@ Searches for `command` in the system's `PATH`. On Windows, this uses the\n//@ `PATHEXT` variable to append the extension if it's not already executable.\n//@ Returns string containing the absolute path to `command`.\nfunction _which(options, cmd) {\n if (!cmd) common.error('must specify command');\n\n var isWindows = isWindowsPlatform();\n var pathArray = splitPath(process.env.PATH);\n\n var queryMatches = [];\n\n // No relative/absolute paths provided?\n if (cmd.indexOf('/') === -1) {\n // Assume that there are no extensions to append to queries (this is the\n // case for unix)\n var pathExtArray = [''];\n if (isWindows) {\n // In case the PATHEXT variable is somehow not set (e.g.\n // child_process.spawn with an empty environment), use the XP default.\n var pathExtEnv = process.env.PATHEXT || XP_DEFAULT_PATHEXT;\n pathExtArray = splitPath(pathExtEnv.toUpperCase());\n }\n\n // Search for command in PATH\n for (var k = 0; k < pathArray.length; k++) {\n // already found it\n if (queryMatches.length > 0 && !options.all) break;\n\n var attempt = path.resolve(pathArray[k], cmd);\n\n if (isWindows) {\n attempt = attempt.toUpperCase();\n }\n\n var match = attempt.match(/\\.[^<>:\"/\\|?*.]+$/);\n if (match && pathExtArray.indexOf(match[0]) >= 0) { // this is Windows-only\n // The user typed a query with the file extension, like\n // `which('node.exe')`\n if (checkPath(attempt)) {\n queryMatches.push(attempt);\n break;\n }\n } else { // All-platforms\n // Cycle through the PATHEXT array, and check each extension\n // Note: the array is always [''] on Unix\n for (var i = 0; i < pathExtArray.length; i++) {\n var ext = pathExtArray[i];\n var newAttempt = attempt + ext;\n if (checkPath(newAttempt)) {\n queryMatches.push(newAttempt);\n break;\n }\n }\n }\n }\n } else if (checkPath(cmd)) { // a valid absolute or relative path\n queryMatches.push(path.resolve(cmd));\n }\n\n if (queryMatches.length > 0) {\n return options.all ? queryMatches : queryMatches[0];\n }\n return options.all ? [] : null;\n}\nmodule.exports = _which;\n","'use strict';\n\nvar GetIntrinsic = require('get-intrinsic');\nvar callBound = require('call-bind/callBound');\nvar inspect = require('object-inspect');\n\nvar $TypeError = GetIntrinsic('%TypeError%');\nvar $WeakMap = GetIntrinsic('%WeakMap%', true);\nvar $Map = GetIntrinsic('%Map%', true);\n\nvar $weakMapGet = callBound('WeakMap.prototype.get', true);\nvar $weakMapSet = callBound('WeakMap.prototype.set', true);\nvar $weakMapHas = callBound('WeakMap.prototype.has', true);\nvar $mapGet = callBound('Map.prototype.get', true);\nvar $mapSet = callBound('Map.prototype.set', true);\nvar $mapHas = callBound('Map.prototype.has', true);\n\n/*\n * This function traverses the list returning the node corresponding to the\n * given key.\n *\n * That node is also moved to the head of the list, so that if it's accessed\n * again we don't need to traverse the whole list. By doing so, all the recently\n * used nodes can be accessed relatively quickly.\n */\nvar listGetNode = function (list, key) { // eslint-disable-line consistent-return\n\tfor (var prev = list, curr; (curr = prev.next) !== null; prev = curr) {\n\t\tif (curr.key === key) {\n\t\t\tprev.next = curr.next;\n\t\t\tcurr.next = list.next;\n\t\t\tlist.next = curr; // eslint-disable-line no-param-reassign\n\t\t\treturn curr;\n\t\t}\n\t}\n};\n\nvar listGet = function (objects, key) {\n\tvar node = listGetNode(objects, key);\n\treturn node && node.value;\n};\nvar listSet = function (objects, key, value) {\n\tvar node = listGetNode(objects, key);\n\tif (node) {\n\t\tnode.value = value;\n\t} else {\n\t\t// Prepend the new node to the beginning of the list\n\t\tobjects.next = { // eslint-disable-line no-param-reassign\n\t\t\tkey: key,\n\t\t\tnext: objects.next,\n\t\t\tvalue: value\n\t\t};\n\t}\n};\nvar listHas = function (objects, key) {\n\treturn !!listGetNode(objects, key);\n};\n\nmodule.exports = function getSideChannel() {\n\tvar $wm;\n\tvar $m;\n\tvar $o;\n\tvar channel = {\n\t\tassert: function (key) {\n\t\t\tif (!channel.has(key)) {\n\t\t\t\tthrow new $TypeError('Side channel does not contain ' + inspect(key));\n\t\t\t}\n\t\t},\n\t\tget: function (key) { // eslint-disable-line consistent-return\n\t\t\tif ($WeakMap && key && (typeof key === 'object' || typeof key === 'function')) {\n\t\t\t\tif ($wm) {\n\t\t\t\t\treturn $weakMapGet($wm, key);\n\t\t\t\t}\n\t\t\t} else if ($Map) {\n\t\t\t\tif ($m) {\n\t\t\t\t\treturn $mapGet($m, key);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tif ($o) { // eslint-disable-line no-lonely-if\n\t\t\t\t\treturn listGet($o, key);\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\t\thas: function (key) {\n\t\t\tif ($WeakMap && key && (typeof key === 'object' || typeof key === 'function')) {\n\t\t\t\tif ($wm) {\n\t\t\t\t\treturn $weakMapHas($wm, key);\n\t\t\t\t}\n\t\t\t} else if ($Map) {\n\t\t\t\tif ($m) {\n\t\t\t\t\treturn $mapHas($m, key);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tif ($o) { // eslint-disable-line no-lonely-if\n\t\t\t\t\treturn listHas($o, key);\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn false;\n\t\t},\n\t\tset: function (key, value) {\n\t\t\tif ($WeakMap && key && (typeof key === 'object' || typeof key === 'function')) {\n\t\t\t\tif (!$wm) {\n\t\t\t\t\t$wm = new $WeakMap();\n\t\t\t\t}\n\t\t\t\t$weakMapSet($wm, key, value);\n\t\t\t} else if ($Map) {\n\t\t\t\tif (!$m) {\n\t\t\t\t\t$m = new $Map();\n\t\t\t\t}\n\t\t\t\t$mapSet($m, key, value);\n\t\t\t} else {\n\t\t\t\tif (!$o) {\n\t\t\t\t\t/*\n\t\t\t\t\t * Initialize the linked list as an empty node, so that we don't have\n\t\t\t\t\t * to special-case handling of the first node: we can always refer to\n\t\t\t\t\t * it as (previous node).next, instead of something like (list).head\n\t\t\t\t\t */\n\t\t\t\t\t$o = { key: {}, next: null };\n\t\t\t\t}\n\t\t\t\tlistSet($o, key, value);\n\t\t\t}\n\t\t}\n\t};\n\treturn channel;\n};\n","// Copyright 2015 Joyent, Inc.\n\nvar Buffer = require('safer-buffer').Buffer;\n\nvar algInfo = {\n\t'dsa': {\n\t\tparts: ['p', 'q', 'g', 'y'],\n\t\tsizePart: 'p'\n\t},\n\t'rsa': {\n\t\tparts: ['e', 'n'],\n\t\tsizePart: 'n'\n\t},\n\t'ecdsa': {\n\t\tparts: ['curve', 'Q'],\n\t\tsizePart: 'Q'\n\t},\n\t'ed25519': {\n\t\tparts: ['A'],\n\t\tsizePart: 'A'\n\t}\n};\nalgInfo['curve25519'] = algInfo['ed25519'];\n\nvar algPrivInfo = {\n\t'dsa': {\n\t\tparts: ['p', 'q', 'g', 'y', 'x']\n\t},\n\t'rsa': {\n\t\tparts: ['n', 'e', 'd', 'iqmp', 'p', 'q']\n\t},\n\t'ecdsa': {\n\t\tparts: ['curve', 'Q', 'd']\n\t},\n\t'ed25519': {\n\t\tparts: ['A', 'k']\n\t}\n};\nalgPrivInfo['curve25519'] = algPrivInfo['ed25519'];\n\nvar hashAlgs = {\n\t'md5': true,\n\t'sha1': true,\n\t'sha256': true,\n\t'sha384': true,\n\t'sha512': true\n};\n\n/*\n * Taken from\n * http://csrc.nist.gov/groups/ST/toolkit/documents/dss/NISTReCur.pdf\n */\nvar curves = {\n\t'nistp256': {\n\t\tsize: 256,\n\t\tpkcs8oid: '1.2.840.10045.3.1.7',\n\t\tp: Buffer.from(('00' +\n\t\t 'ffffffff 00000001 00000000 00000000' +\n\t\t '00000000 ffffffff ffffffff ffffffff').\n\t\t replace(/ /g, ''), 'hex'),\n\t\ta: Buffer.from(('00' +\n\t\t 'FFFFFFFF 00000001 00000000 00000000' +\n\t\t '00000000 FFFFFFFF FFFFFFFF FFFFFFFC').\n\t\t replace(/ /g, ''), 'hex'),\n\t\tb: Buffer.from((\n\t\t '5ac635d8 aa3a93e7 b3ebbd55 769886bc' +\n\t\t '651d06b0 cc53b0f6 3bce3c3e 27d2604b').\n\t\t replace(/ /g, ''), 'hex'),\n\t\ts: Buffer.from(('00' +\n\t\t 'c49d3608 86e70493 6a6678e1 139d26b7' +\n\t\t '819f7e90').\n\t\t replace(/ /g, ''), 'hex'),\n\t\tn: Buffer.from(('00' +\n\t\t 'ffffffff 00000000 ffffffff ffffffff' +\n\t\t 'bce6faad a7179e84 f3b9cac2 fc632551').\n\t\t replace(/ /g, ''), 'hex'),\n\t\tG: Buffer.from(('04' +\n\t\t '6b17d1f2 e12c4247 f8bce6e5 63a440f2' +\n\t\t '77037d81 2deb33a0 f4a13945 d898c296' +\n\t\t '4fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e16' +\n\t\t '2bce3357 6b315ece cbb64068 37bf51f5').\n\t\t replace(/ /g, ''), 'hex')\n\t},\n\t'nistp384': {\n\t\tsize: 384,\n\t\tpkcs8oid: '1.3.132.0.34',\n\t\tp: Buffer.from(('00' +\n\t\t 'ffffffff ffffffff ffffffff ffffffff' +\n\t\t 'ffffffff ffffffff ffffffff fffffffe' +\n\t\t 'ffffffff 00000000 00000000 ffffffff').\n\t\t replace(/ /g, ''), 'hex'),\n\t\ta: Buffer.from(('00' +\n\t\t 'FFFFFFFF FFFFFFFF FFFFFFFF FFFFFFFF' +\n\t\t 'FFFFFFFF FFFFFFFF FFFFFFFF FFFFFFFE' +\n\t\t 'FFFFFFFF 00000000 00000000 FFFFFFFC').\n\t\t replace(/ /g, ''), 'hex'),\n\t\tb: Buffer.from((\n\t\t 'b3312fa7 e23ee7e4 988e056b e3f82d19' +\n\t\t '181d9c6e fe814112 0314088f 5013875a' +\n\t\t 'c656398d 8a2ed19d 2a85c8ed d3ec2aef').\n\t\t replace(/ /g, ''), 'hex'),\n\t\ts: Buffer.from(('00' +\n\t\t 'a335926a a319a27a 1d00896a 6773a482' +\n\t\t '7acdac73').\n\t\t replace(/ /g, ''), 'hex'),\n\t\tn: Buffer.from(('00' +\n\t\t 'ffffffff ffffffff ffffffff ffffffff' +\n\t\t 'ffffffff ffffffff c7634d81 f4372ddf' +\n\t\t '581a0db2 48b0a77a ecec196a ccc52973').\n\t\t replace(/ /g, ''), 'hex'),\n\t\tG: Buffer.from(('04' +\n\t\t 'aa87ca22 be8b0537 8eb1c71e f320ad74' +\n\t\t '6e1d3b62 8ba79b98 59f741e0 82542a38' +\n\t\t '5502f25d bf55296c 3a545e38 72760ab7' +\n\t\t '3617de4a 96262c6f 5d9e98bf 9292dc29' +\n\t\t 'f8f41dbd 289a147c e9da3113 b5f0b8c0' +\n\t\t '0a60b1ce 1d7e819d 7a431d7c 90ea0e5f').\n\t\t replace(/ /g, ''), 'hex')\n\t},\n\t'nistp521': {\n\t\tsize: 521,\n\t\tpkcs8oid: '1.3.132.0.35',\n\t\tp: Buffer.from((\n\t\t '01ffffff ffffffff ffffffff ffffffff' +\n\t\t 'ffffffff ffffffff ffffffff ffffffff' +\n\t\t 'ffffffff ffffffff ffffffff ffffffff' +\n\t\t 'ffffffff ffffffff ffffffff ffffffff' +\n\t\t 'ffff').replace(/ /g, ''), 'hex'),\n\t\ta: Buffer.from(('01FF' +\n\t\t 'FFFFFFFF FFFFFFFF FFFFFFFF FFFFFFFF' +\n\t\t 'FFFFFFFF FFFFFFFF FFFFFFFF FFFFFFFF' +\n\t\t 'FFFFFFFF FFFFFFFF FFFFFFFF FFFFFFFF' +\n\t\t 'FFFFFFFF FFFFFFFF FFFFFFFF FFFFFFFC').\n\t\t replace(/ /g, ''), 'hex'),\n\t\tb: Buffer.from(('51' +\n\t\t '953eb961 8e1c9a1f 929a21a0 b68540ee' +\n\t\t 'a2da725b 99b315f3 b8b48991 8ef109e1' +\n\t\t '56193951 ec7e937b 1652c0bd 3bb1bf07' +\n\t\t '3573df88 3d2c34f1 ef451fd4 6b503f00').\n\t\t replace(/ /g, ''), 'hex'),\n\t\ts: Buffer.from(('00' +\n\t\t 'd09e8800 291cb853 96cc6717 393284aa' +\n\t\t 'a0da64ba').replace(/ /g, ''), 'hex'),\n\t\tn: Buffer.from(('01ff' +\n\t\t 'ffffffff ffffffff ffffffff ffffffff' +\n\t\t 'ffffffff ffffffff ffffffff fffffffa' +\n\t\t '51868783 bf2f966b 7fcc0148 f709a5d0' +\n\t\t '3bb5c9b8 899c47ae bb6fb71e 91386409').\n\t\t replace(/ /g, ''), 'hex'),\n\t\tG: Buffer.from(('04' +\n\t\t '00c6 858e06b7 0404e9cd 9e3ecb66 2395b442' +\n\t\t '9c648139 053fb521 f828af60 6b4d3dba' +\n\t\t 'a14b5e77 efe75928 fe1dc127 a2ffa8de' +\n\t\t '3348b3c1 856a429b f97e7e31 c2e5bd66' +\n\t\t '0118 39296a78 9a3bc004 5c8a5fb4 2c7d1bd9' +\n\t\t '98f54449 579b4468 17afbd17 273e662c' +\n\t\t '97ee7299 5ef42640 c550b901 3fad0761' +\n\t\t '353c7086 a272c240 88be9476 9fd16650').\n\t\t replace(/ /g, ''), 'hex')\n\t}\n};\n\nmodule.exports = {\n\tinfo: algInfo,\n\tprivInfo: algPrivInfo,\n\thashAlgs: hashAlgs,\n\tcurves: curves\n};\n","// Copyright 2016 Joyent, Inc.\n\nmodule.exports = Certificate;\n\nvar assert = require('assert-plus');\nvar Buffer = require('safer-buffer').Buffer;\nvar algs = require('./algs');\nvar crypto = require('crypto');\nvar Fingerprint = require('./fingerprint');\nvar Signature = require('./signature');\nvar errs = require('./errors');\nvar util = require('util');\nvar utils = require('./utils');\nvar Key = require('./key');\nvar PrivateKey = require('./private-key');\nvar Identity = require('./identity');\n\nvar formats = {};\nformats['openssh'] = require('./formats/openssh-cert');\nformats['x509'] = require('./formats/x509');\nformats['pem'] = require('./formats/x509-pem');\n\nvar CertificateParseError = errs.CertificateParseError;\nvar InvalidAlgorithmError = errs.InvalidAlgorithmError;\n\nfunction Certificate(opts) {\n\tassert.object(opts, 'options');\n\tassert.arrayOfObject(opts.subjects, 'options.subjects');\n\tutils.assertCompatible(opts.subjects[0], Identity, [1, 0],\n\t 'options.subjects');\n\tutils.assertCompatible(opts.subjectKey, Key, [1, 0],\n\t 'options.subjectKey');\n\tutils.assertCompatible(opts.issuer, Identity, [1, 0], 'options.issuer');\n\tif (opts.issuerKey !== undefined) {\n\t\tutils.assertCompatible(opts.issuerKey, Key, [1, 0],\n\t\t 'options.issuerKey');\n\t}\n\tassert.object(opts.signatures, 'options.signatures');\n\tassert.buffer(opts.serial, 'options.serial');\n\tassert.date(opts.validFrom, 'options.validFrom');\n\tassert.date(opts.validUntil, 'optons.validUntil');\n\n\tassert.optionalArrayOfString(opts.purposes, 'options.purposes');\n\n\tthis._hashCache = {};\n\n\tthis.subjects = opts.subjects;\n\tthis.issuer = opts.issuer;\n\tthis.subjectKey = opts.subjectKey;\n\tthis.issuerKey = opts.issuerKey;\n\tthis.signatures = opts.signatures;\n\tthis.serial = opts.serial;\n\tthis.validFrom = opts.validFrom;\n\tthis.validUntil = opts.validUntil;\n\tthis.purposes = opts.purposes;\n}\n\nCertificate.formats = formats;\n\nCertificate.prototype.toBuffer = function (format, options) {\n\tif (format === undefined)\n\t\tformat = 'x509';\n\tassert.string(format, 'format');\n\tassert.object(formats[format], 'formats[format]');\n\tassert.optionalObject(options, 'options');\n\n\treturn (formats[format].write(this, options));\n};\n\nCertificate.prototype.toString = function (format, options) {\n\tif (format === undefined)\n\t\tformat = 'pem';\n\treturn (this.toBuffer(format, options).toString());\n};\n\nCertificate.prototype.fingerprint = function (algo) {\n\tif (algo === undefined)\n\t\talgo = 'sha256';\n\tassert.string(algo, 'algorithm');\n\tvar opts = {\n\t\ttype: 'certificate',\n\t\thash: this.hash(algo),\n\t\talgorithm: algo\n\t};\n\treturn (new Fingerprint(opts));\n};\n\nCertificate.prototype.hash = function (algo) {\n\tassert.string(algo, 'algorithm');\n\talgo = algo.toLowerCase();\n\tif (algs.hashAlgs[algo] === undefined)\n\t\tthrow (new InvalidAlgorithmError(algo));\n\n\tif (this._hashCache[algo])\n\t\treturn (this._hashCache[algo]);\n\n\tvar hash = crypto.createHash(algo).\n\t update(this.toBuffer('x509')).digest();\n\tthis._hashCache[algo] = hash;\n\treturn (hash);\n};\n\nCertificate.prototype.isExpired = function (when) {\n\tif (when === undefined)\n\t\twhen = new Date();\n\treturn (!((when.getTime() >= this.validFrom.getTime()) &&\n\t\t(when.getTime() < this.validUntil.getTime())));\n};\n\nCertificate.prototype.isSignedBy = function (issuerCert) {\n\tutils.assertCompatible(issuerCert, Certificate, [1, 0], 'issuer');\n\n\tif (!this.issuer.equals(issuerCert.subjects[0]))\n\t\treturn (false);\n\tif (this.issuer.purposes && this.issuer.purposes.length > 0 &&\n\t this.issuer.purposes.indexOf('ca') === -1) {\n\t\treturn (false);\n\t}\n\n\treturn (this.isSignedByKey(issuerCert.subjectKey));\n};\n\nCertificate.prototype.getExtension = function (keyOrOid) {\n\tassert.string(keyOrOid, 'keyOrOid');\n\tvar ext = this.getExtensions().filter(function (maybeExt) {\n\t\tif (maybeExt.format === 'x509')\n\t\t\treturn (maybeExt.oid === keyOrOid);\n\t\tif (maybeExt.format === 'openssh')\n\t\t\treturn (maybeExt.name === keyOrOid);\n\t\treturn (false);\n\t})[0];\n\treturn (ext);\n};\n\nCertificate.prototype.getExtensions = function () {\n\tvar exts = [];\n\tvar x509 = this.signatures.x509;\n\tif (x509 && x509.extras && x509.extras.exts) {\n\t\tx509.extras.exts.forEach(function (ext) {\n\t\t\text.format = 'x509';\n\t\t\texts.push(ext);\n\t\t});\n\t}\n\tvar openssh = this.signatures.openssh;\n\tif (openssh && openssh.exts) {\n\t\topenssh.exts.forEach(function (ext) {\n\t\t\text.format = 'openssh';\n\t\t\texts.push(ext);\n\t\t});\n\t}\n\treturn (exts);\n};\n\nCertificate.prototype.isSignedByKey = function (issuerKey) {\n\tutils.assertCompatible(issuerKey, Key, [1, 2], 'issuerKey');\n\n\tif (this.issuerKey !== undefined) {\n\t\treturn (this.issuerKey.\n\t\t fingerprint('sha512').matches(issuerKey));\n\t}\n\n\tvar fmt = Object.keys(this.signatures)[0];\n\tvar valid = formats[fmt].verify(this, issuerKey);\n\tif (valid)\n\t\tthis.issuerKey = issuerKey;\n\treturn (valid);\n};\n\nCertificate.prototype.signWith = function (key) {\n\tutils.assertCompatible(key, PrivateKey, [1, 2], 'key');\n\tvar fmts = Object.keys(formats);\n\tvar didOne = false;\n\tfor (var i = 0; i < fmts.length; ++i) {\n\t\tif (fmts[i] !== 'pem') {\n\t\t\tvar ret = formats[fmts[i]].sign(this, key);\n\t\t\tif (ret === true)\n\t\t\t\tdidOne = true;\n\t\t}\n\t}\n\tif (!didOne) {\n\t\tthrow (new Error('Failed to sign the certificate for any ' +\n\t\t 'available certificate formats'));\n\t}\n};\n\nCertificate.createSelfSigned = function (subjectOrSubjects, key, options) {\n\tvar subjects;\n\tif (Array.isArray(subjectOrSubjects))\n\t\tsubjects = subjectOrSubjects;\n\telse\n\t\tsubjects = [subjectOrSubjects];\n\n\tassert.arrayOfObject(subjects);\n\tsubjects.forEach(function (subject) {\n\t\tutils.assertCompatible(subject, Identity, [1, 0], 'subject');\n\t});\n\n\tutils.assertCompatible(key, PrivateKey, [1, 2], 'private key');\n\n\tassert.optionalObject(options, 'options');\n\tif (options === undefined)\n\t\toptions = {};\n\tassert.optionalObject(options.validFrom, 'options.validFrom');\n\tassert.optionalObject(options.validUntil, 'options.validUntil');\n\tvar validFrom = options.validFrom;\n\tvar validUntil = options.validUntil;\n\tif (validFrom === undefined)\n\t\tvalidFrom = new Date();\n\tif (validUntil === undefined) {\n\t\tassert.optionalNumber(options.lifetime, 'options.lifetime');\n\t\tvar lifetime = options.lifetime;\n\t\tif (lifetime === undefined)\n\t\t\tlifetime = 10*365*24*3600;\n\t\tvalidUntil = new Date();\n\t\tvalidUntil.setTime(validUntil.getTime() + lifetime*1000);\n\t}\n\tassert.optionalBuffer(options.serial, 'options.serial');\n\tvar serial = options.serial;\n\tif (serial === undefined)\n\t\tserial = Buffer.from('0000000000000001', 'hex');\n\n\tvar purposes = options.purposes;\n\tif (purposes === undefined)\n\t\tpurposes = [];\n\n\tif (purposes.indexOf('signature') === -1)\n\t\tpurposes.push('signature');\n\n\t/* Self-signed certs are always CAs. */\n\tif (purposes.indexOf('ca') === -1)\n\t\tpurposes.push('ca');\n\tif (purposes.indexOf('crl') === -1)\n\t\tpurposes.push('crl');\n\n\t/*\n\t * If we weren't explicitly given any other purposes, do the sensible\n\t * thing and add some basic ones depending on the subject type.\n\t */\n\tif (purposes.length <= 3) {\n\t\tvar hostSubjects = subjects.filter(function (subject) {\n\t\t\treturn (subject.type === 'host');\n\t\t});\n\t\tvar userSubjects = subjects.filter(function (subject) {\n\t\t\treturn (subject.type === 'user');\n\t\t});\n\t\tif (hostSubjects.length > 0) {\n\t\t\tif (purposes.indexOf('serverAuth') === -1)\n\t\t\t\tpurposes.push('serverAuth');\n\t\t}\n\t\tif (userSubjects.length > 0) {\n\t\t\tif (purposes.indexOf('clientAuth') === -1)\n\t\t\t\tpurposes.push('clientAuth');\n\t\t}\n\t\tif (userSubjects.length > 0 || hostSubjects.length > 0) {\n\t\t\tif (purposes.indexOf('keyAgreement') === -1)\n\t\t\t\tpurposes.push('keyAgreement');\n\t\t\tif (key.type === 'rsa' &&\n\t\t\t purposes.indexOf('encryption') === -1)\n\t\t\t\tpurposes.push('encryption');\n\t\t}\n\t}\n\n\tvar cert = new Certificate({\n\t\tsubjects: subjects,\n\t\tissuer: subjects[0],\n\t\tsubjectKey: key.toPublic(),\n\t\tissuerKey: key.toPublic(),\n\t\tsignatures: {},\n\t\tserial: serial,\n\t\tvalidFrom: validFrom,\n\t\tvalidUntil: validUntil,\n\t\tpurposes: purposes\n\t});\n\tcert.signWith(key);\n\n\treturn (cert);\n};\n\nCertificate.create =\n function (subjectOrSubjects, key, issuer, issuerKey, options) {\n\tvar subjects;\n\tif (Array.isArray(subjectOrSubjects))\n\t\tsubjects = subjectOrSubjects;\n\telse\n\t\tsubjects = [subjectOrSubjects];\n\n\tassert.arrayOfObject(subjects);\n\tsubjects.forEach(function (subject) {\n\t\tutils.assertCompatible(subject, Identity, [1, 0], 'subject');\n\t});\n\n\tutils.assertCompatible(key, Key, [1, 0], 'key');\n\tif (PrivateKey.isPrivateKey(key))\n\t\tkey = key.toPublic();\n\tutils.assertCompatible(issuer, Identity, [1, 0], 'issuer');\n\tutils.assertCompatible(issuerKey, PrivateKey, [1, 2], 'issuer key');\n\n\tassert.optionalObject(options, 'options');\n\tif (options === undefined)\n\t\toptions = {};\n\tassert.optionalObject(options.validFrom, 'options.validFrom');\n\tassert.optionalObject(options.validUntil, 'options.validUntil');\n\tvar validFrom = options.validFrom;\n\tvar validUntil = options.validUntil;\n\tif (validFrom === undefined)\n\t\tvalidFrom = new Date();\n\tif (validUntil === undefined) {\n\t\tassert.optionalNumber(options.lifetime, 'options.lifetime');\n\t\tvar lifetime = options.lifetime;\n\t\tif (lifetime === undefined)\n\t\t\tlifetime = 10*365*24*3600;\n\t\tvalidUntil = new Date();\n\t\tvalidUntil.setTime(validUntil.getTime() + lifetime*1000);\n\t}\n\tassert.optionalBuffer(options.serial, 'options.serial');\n\tvar serial = options.serial;\n\tif (serial === undefined)\n\t\tserial = Buffer.from('0000000000000001', 'hex');\n\n\tvar purposes = options.purposes;\n\tif (purposes === undefined)\n\t\tpurposes = [];\n\n\tif (purposes.indexOf('signature') === -1)\n\t\tpurposes.push('signature');\n\n\tif (options.ca === true) {\n\t\tif (purposes.indexOf('ca') === -1)\n\t\t\tpurposes.push('ca');\n\t\tif (purposes.indexOf('crl') === -1)\n\t\t\tpurposes.push('crl');\n\t}\n\n\tvar hostSubjects = subjects.filter(function (subject) {\n\t\treturn (subject.type === 'host');\n\t});\n\tvar userSubjects = subjects.filter(function (subject) {\n\t\treturn (subject.type === 'user');\n\t});\n\tif (hostSubjects.length > 0) {\n\t\tif (purposes.indexOf('serverAuth') === -1)\n\t\t\tpurposes.push('serverAuth');\n\t}\n\tif (userSubjects.length > 0) {\n\t\tif (purposes.indexOf('clientAuth') === -1)\n\t\t\tpurposes.push('clientAuth');\n\t}\n\tif (userSubjects.length > 0 || hostSubjects.length > 0) {\n\t\tif (purposes.indexOf('keyAgreement') === -1)\n\t\t\tpurposes.push('keyAgreement');\n\t\tif (key.type === 'rsa' &&\n\t\t purposes.indexOf('encryption') === -1)\n\t\t\tpurposes.push('encryption');\n\t}\n\n\tvar cert = new Certificate({\n\t\tsubjects: subjects,\n\t\tissuer: issuer,\n\t\tsubjectKey: key,\n\t\tissuerKey: issuerKey.toPublic(),\n\t\tsignatures: {},\n\t\tserial: serial,\n\t\tvalidFrom: validFrom,\n\t\tvalidUntil: validUntil,\n\t\tpurposes: purposes\n\t});\n\tcert.signWith(issuerKey);\n\n\treturn (cert);\n};\n\nCertificate.parse = function (data, format, options) {\n\tif (typeof (data) !== 'string')\n\t\tassert.buffer(data, 'data');\n\tif (format === undefined)\n\t\tformat = 'auto';\n\tassert.string(format, 'format');\n\tif (typeof (options) === 'string')\n\t\toptions = { filename: options };\n\tassert.optionalObject(options, 'options');\n\tif (options === undefined)\n\t\toptions = {};\n\tassert.optionalString(options.filename, 'options.filename');\n\tif (options.filename === undefined)\n\t\toptions.filename = '(unnamed)';\n\n\tassert.object(formats[format], 'formats[format]');\n\n\ttry {\n\t\tvar k = formats[format].read(data, options);\n\t\treturn (k);\n\t} catch (e) {\n\t\tthrow (new CertificateParseError(options.filename, format, e));\n\t}\n};\n\nCertificate.isCertificate = function (obj, ver) {\n\treturn (utils.isCompatible(obj, Certificate, ver));\n};\n\n/*\n * API versions for Certificate:\n * [1,0] -- initial ver\n * [1,1] -- openssh format now unpacks extensions\n */\nCertificate.prototype._sshpkApiVersion = [1, 1];\n\nCertificate._oldVersionDetect = function (obj) {\n\treturn ([1, 0]);\n};\n","// Copyright 2017 Joyent, Inc.\n\nmodule.exports = {\n\tDiffieHellman: DiffieHellman,\n\tgenerateECDSA: generateECDSA,\n\tgenerateED25519: generateED25519\n};\n\nvar assert = require('assert-plus');\nvar crypto = require('crypto');\nvar Buffer = require('safer-buffer').Buffer;\nvar algs = require('./algs');\nvar utils = require('./utils');\nvar nacl = require('tweetnacl');\n\nvar Key = require('./key');\nvar PrivateKey = require('./private-key');\n\nvar CRYPTO_HAVE_ECDH = (crypto.createECDH !== undefined);\n\nvar ecdh = require('ecc-jsbn');\nvar ec = require('ecc-jsbn/lib/ec');\nvar jsbn = require('jsbn').BigInteger;\n\nfunction DiffieHellman(key) {\n\tutils.assertCompatible(key, Key, [1, 4], 'key');\n\tthis._isPriv = PrivateKey.isPrivateKey(key, [1, 3]);\n\tthis._algo = key.type;\n\tthis._curve = key.curve;\n\tthis._key = key;\n\tif (key.type === 'dsa') {\n\t\tif (!CRYPTO_HAVE_ECDH) {\n\t\t\tthrow (new Error('Due to bugs in the node 0.10 ' +\n\t\t\t 'crypto API, node 0.12.x or later is required ' +\n\t\t\t 'to use DH'));\n\t\t}\n\t\tthis._dh = crypto.createDiffieHellman(\n\t\t key.part.p.data, undefined,\n\t\t key.part.g.data, undefined);\n\t\tthis._p = key.part.p;\n\t\tthis._g = key.part.g;\n\t\tif (this._isPriv)\n\t\t\tthis._dh.setPrivateKey(key.part.x.data);\n\t\tthis._dh.setPublicKey(key.part.y.data);\n\n\t} else if (key.type === 'ecdsa') {\n\t\tif (!CRYPTO_HAVE_ECDH) {\n\t\t\tthis._ecParams = new X9ECParameters(this._curve);\n\n\t\t\tif (this._isPriv) {\n\t\t\t\tthis._priv = new ECPrivate(\n\t\t\t\t this._ecParams, key.part.d.data);\n\t\t\t}\n\t\t\treturn;\n\t\t}\n\n\t\tvar curve = {\n\t\t\t'nistp256': 'prime256v1',\n\t\t\t'nistp384': 'secp384r1',\n\t\t\t'nistp521': 'secp521r1'\n\t\t}[key.curve];\n\t\tthis._dh = crypto.createECDH(curve);\n\t\tif (typeof (this._dh) !== 'object' ||\n\t\t typeof (this._dh.setPrivateKey) !== 'function') {\n\t\t\tCRYPTO_HAVE_ECDH = false;\n\t\t\tDiffieHellman.call(this, key);\n\t\t\treturn;\n\t\t}\n\t\tif (this._isPriv)\n\t\t\tthis._dh.setPrivateKey(key.part.d.data);\n\t\tthis._dh.setPublicKey(key.part.Q.data);\n\n\t} else if (key.type === 'curve25519') {\n\t\tif (this._isPriv) {\n\t\t\tutils.assertCompatible(key, PrivateKey, [1, 5], 'key');\n\t\t\tthis._priv = key.part.k.data;\n\t\t}\n\n\t} else {\n\t\tthrow (new Error('DH not supported for ' + key.type + ' keys'));\n\t}\n}\n\nDiffieHellman.prototype.getPublicKey = function () {\n\tif (this._isPriv)\n\t\treturn (this._key.toPublic());\n\treturn (this._key);\n};\n\nDiffieHellman.prototype.getPrivateKey = function () {\n\tif (this._isPriv)\n\t\treturn (this._key);\n\telse\n\t\treturn (undefined);\n};\nDiffieHellman.prototype.getKey = DiffieHellman.prototype.getPrivateKey;\n\nDiffieHellman.prototype._keyCheck = function (pk, isPub) {\n\tassert.object(pk, 'key');\n\tif (!isPub)\n\t\tutils.assertCompatible(pk, PrivateKey, [1, 3], 'key');\n\tutils.assertCompatible(pk, Key, [1, 4], 'key');\n\n\tif (pk.type !== this._algo) {\n\t\tthrow (new Error('A ' + pk.type + ' key cannot be used in ' +\n\t\t this._algo + ' Diffie-Hellman'));\n\t}\n\n\tif (pk.curve !== this._curve) {\n\t\tthrow (new Error('A key from the ' + pk.curve + ' curve ' +\n\t\t 'cannot be used with a ' + this._curve +\n\t\t ' Diffie-Hellman'));\n\t}\n\n\tif (pk.type === 'dsa') {\n\t\tassert.deepEqual(pk.part.p, this._p,\n\t\t 'DSA key prime does not match');\n\t\tassert.deepEqual(pk.part.g, this._g,\n\t\t 'DSA key generator does not match');\n\t}\n};\n\nDiffieHellman.prototype.setKey = function (pk) {\n\tthis._keyCheck(pk);\n\n\tif (pk.type === 'dsa') {\n\t\tthis._dh.setPrivateKey(pk.part.x.data);\n\t\tthis._dh.setPublicKey(pk.part.y.data);\n\n\t} else if (pk.type === 'ecdsa') {\n\t\tif (CRYPTO_HAVE_ECDH) {\n\t\t\tthis._dh.setPrivateKey(pk.part.d.data);\n\t\t\tthis._dh.setPublicKey(pk.part.Q.data);\n\t\t} else {\n\t\t\tthis._priv = new ECPrivate(\n\t\t\t this._ecParams, pk.part.d.data);\n\t\t}\n\n\t} else if (pk.type === 'curve25519') {\n\t\tvar k = pk.part.k;\n\t\tif (!pk.part.k)\n\t\t\tk = pk.part.r;\n\t\tthis._priv = k.data;\n\t\tif (this._priv[0] === 0x00)\n\t\t\tthis._priv = this._priv.slice(1);\n\t\tthis._priv = this._priv.slice(0, 32);\n\t}\n\tthis._key = pk;\n\tthis._isPriv = true;\n};\nDiffieHellman.prototype.setPrivateKey = DiffieHellman.prototype.setKey;\n\nDiffieHellman.prototype.computeSecret = function (otherpk) {\n\tthis._keyCheck(otherpk, true);\n\tif (!this._isPriv)\n\t\tthrow (new Error('DH exchange has not been initialized with ' +\n\t\t 'a private key yet'));\n\n\tvar pub;\n\tif (this._algo === 'dsa') {\n\t\treturn (this._dh.computeSecret(\n\t\t otherpk.part.y.data));\n\n\t} else if (this._algo === 'ecdsa') {\n\t\tif (CRYPTO_HAVE_ECDH) {\n\t\t\treturn (this._dh.computeSecret(\n\t\t\t otherpk.part.Q.data));\n\t\t} else {\n\t\t\tpub = new ECPublic(\n\t\t\t this._ecParams, otherpk.part.Q.data);\n\t\t\treturn (this._priv.deriveSharedSecret(pub));\n\t\t}\n\n\t} else if (this._algo === 'curve25519') {\n\t\tpub = otherpk.part.A.data;\n\t\twhile (pub[0] === 0x00 && pub.length > 32)\n\t\t\tpub = pub.slice(1);\n\t\tvar priv = this._priv;\n\t\tassert.strictEqual(pub.length, 32);\n\t\tassert.strictEqual(priv.length, 32);\n\n\t\tvar secret = nacl.box.before(new Uint8Array(pub),\n\t\t new Uint8Array(priv));\n\n\t\treturn (Buffer.from(secret));\n\t}\n\n\tthrow (new Error('Invalid algorithm: ' + this._algo));\n};\n\nDiffieHellman.prototype.generateKey = function () {\n\tvar parts = [];\n\tvar priv, pub;\n\tif (this._algo === 'dsa') {\n\t\tthis._dh.generateKeys();\n\n\t\tparts.push({name: 'p', data: this._p.data});\n\t\tparts.push({name: 'q', data: this._key.part.q.data});\n\t\tparts.push({name: 'g', data: this._g.data});\n\t\tparts.push({name: 'y', data: this._dh.getPublicKey()});\n\t\tparts.push({name: 'x', data: this._dh.getPrivateKey()});\n\t\tthis._key = new PrivateKey({\n\t\t\ttype: 'dsa',\n\t\t\tparts: parts\n\t\t});\n\t\tthis._isPriv = true;\n\t\treturn (this._key);\n\n\t} else if (this._algo === 'ecdsa') {\n\t\tif (CRYPTO_HAVE_ECDH) {\n\t\t\tthis._dh.generateKeys();\n\n\t\t\tparts.push({name: 'curve',\n\t\t\t data: Buffer.from(this._curve)});\n\t\t\tparts.push({name: 'Q', data: this._dh.getPublicKey()});\n\t\t\tparts.push({name: 'd', data: this._dh.getPrivateKey()});\n\t\t\tthis._key = new PrivateKey({\n\t\t\t\ttype: 'ecdsa',\n\t\t\t\tcurve: this._curve,\n\t\t\t\tparts: parts\n\t\t\t});\n\t\t\tthis._isPriv = true;\n\t\t\treturn (this._key);\n\n\t\t} else {\n\t\t\tvar n = this._ecParams.getN();\n\t\t\tvar r = new jsbn(crypto.randomBytes(n.bitLength()));\n\t\t\tvar n1 = n.subtract(jsbn.ONE);\n\t\t\tpriv = r.mod(n1).add(jsbn.ONE);\n\t\t\tpub = this._ecParams.getG().multiply(priv);\n\n\t\t\tpriv = Buffer.from(priv.toByteArray());\n\t\t\tpub = Buffer.from(this._ecParams.getCurve().\n\t\t\t encodePointHex(pub), 'hex');\n\n\t\t\tthis._priv = new ECPrivate(this._ecParams, priv);\n\n\t\t\tparts.push({name: 'curve',\n\t\t\t data: Buffer.from(this._curve)});\n\t\t\tparts.push({name: 'Q', data: pub});\n\t\t\tparts.push({name: 'd', data: priv});\n\n\t\t\tthis._key = new PrivateKey({\n\t\t\t\ttype: 'ecdsa',\n\t\t\t\tcurve: this._curve,\n\t\t\t\tparts: parts\n\t\t\t});\n\t\t\tthis._isPriv = true;\n\t\t\treturn (this._key);\n\t\t}\n\n\t} else if (this._algo === 'curve25519') {\n\t\tvar pair = nacl.box.keyPair();\n\t\tpriv = Buffer.from(pair.secretKey);\n\t\tpub = Buffer.from(pair.publicKey);\n\t\tpriv = Buffer.concat([priv, pub]);\n\t\tassert.strictEqual(priv.length, 64);\n\t\tassert.strictEqual(pub.length, 32);\n\n\t\tparts.push({name: 'A', data: pub});\n\t\tparts.push({name: 'k', data: priv});\n\t\tthis._key = new PrivateKey({\n\t\t\ttype: 'curve25519',\n\t\t\tparts: parts\n\t\t});\n\t\tthis._isPriv = true;\n\t\treturn (this._key);\n\t}\n\n\tthrow (new Error('Invalid algorithm: ' + this._algo));\n};\nDiffieHellman.prototype.generateKeys = DiffieHellman.prototype.generateKey;\n\n/* These are helpers for using ecc-jsbn (for node 0.10 compatibility). */\n\nfunction X9ECParameters(name) {\n\tvar params = algs.curves[name];\n\tassert.object(params);\n\n\tvar p = new jsbn(params.p);\n\tvar a = new jsbn(params.a);\n\tvar b = new jsbn(params.b);\n\tvar n = new jsbn(params.n);\n\tvar h = jsbn.ONE;\n\tvar curve = new ec.ECCurveFp(p, a, b);\n\tvar G = curve.decodePointHex(params.G.toString('hex'));\n\n\tthis.curve = curve;\n\tthis.g = G;\n\tthis.n = n;\n\tthis.h = h;\n}\nX9ECParameters.prototype.getCurve = function () { return (this.curve); };\nX9ECParameters.prototype.getG = function () { return (this.g); };\nX9ECParameters.prototype.getN = function () { return (this.n); };\nX9ECParameters.prototype.getH = function () { return (this.h); };\n\nfunction ECPublic(params, buffer) {\n\tthis._params = params;\n\tif (buffer[0] === 0x00)\n\t\tbuffer = buffer.slice(1);\n\tthis._pub = params.getCurve().decodePointHex(buffer.toString('hex'));\n}\n\nfunction ECPrivate(params, buffer) {\n\tthis._params = params;\n\tthis._priv = new jsbn(utils.mpNormalize(buffer));\n}\nECPrivate.prototype.deriveSharedSecret = function (pubKey) {\n\tassert.ok(pubKey instanceof ECPublic);\n\tvar S = pubKey._pub.multiply(this._priv);\n\treturn (Buffer.from(S.getX().toBigInteger().toByteArray()));\n};\n\nfunction generateED25519() {\n\tvar pair = nacl.sign.keyPair();\n\tvar priv = Buffer.from(pair.secretKey);\n\tvar pub = Buffer.from(pair.publicKey);\n\tassert.strictEqual(priv.length, 64);\n\tassert.strictEqual(pub.length, 32);\n\n\tvar parts = [];\n\tparts.push({name: 'A', data: pub});\n\tparts.push({name: 'k', data: priv.slice(0, 32)});\n\tvar key = new PrivateKey({\n\t\ttype: 'ed25519',\n\t\tparts: parts\n\t});\n\treturn (key);\n}\n\n/* Generates a new ECDSA private key on a given curve. */\nfunction generateECDSA(curve) {\n\tvar parts = [];\n\tvar key;\n\n\tif (CRYPTO_HAVE_ECDH) {\n\t\t/*\n\t\t * Node crypto doesn't expose key generation directly, but the\n\t\t * ECDH instances can generate keys. It turns out this just\n\t\t * calls into the OpenSSL generic key generator, and we can\n\t\t * read its output happily without doing an actual DH. So we\n\t\t * use that here.\n\t\t */\n\t\tvar osCurve = {\n\t\t\t'nistp256': 'prime256v1',\n\t\t\t'nistp384': 'secp384r1',\n\t\t\t'nistp521': 'secp521r1'\n\t\t}[curve];\n\n\t\tvar dh = crypto.createECDH(osCurve);\n\t\tdh.generateKeys();\n\n\t\tparts.push({name: 'curve',\n\t\t data: Buffer.from(curve)});\n\t\tparts.push({name: 'Q', data: dh.getPublicKey()});\n\t\tparts.push({name: 'd', data: dh.getPrivateKey()});\n\n\t\tkey = new PrivateKey({\n\t\t\ttype: 'ecdsa',\n\t\t\tcurve: curve,\n\t\t\tparts: parts\n\t\t});\n\t\treturn (key);\n\t} else {\n\n\t\tvar ecParams = new X9ECParameters(curve);\n\n\t\t/* This algorithm taken from FIPS PUB 186-4 (section B.4.1) */\n\t\tvar n = ecParams.getN();\n\t\t/*\n\t\t * The crypto.randomBytes() function can only give us whole\n\t\t * bytes, so taking a nod from X9.62, we round up.\n\t\t */\n\t\tvar cByteLen = Math.ceil((n.bitLength() + 64) / 8);\n\t\tvar c = new jsbn(crypto.randomBytes(cByteLen));\n\n\t\tvar n1 = n.subtract(jsbn.ONE);\n\t\tvar priv = c.mod(n1).add(jsbn.ONE);\n\t\tvar pub = ecParams.getG().multiply(priv);\n\n\t\tpriv = Buffer.from(priv.toByteArray());\n\t\tpub = Buffer.from(ecParams.getCurve().\n\t\t encodePointHex(pub), 'hex');\n\n\t\tparts.push({name: 'curve', data: Buffer.from(curve)});\n\t\tparts.push({name: 'Q', data: pub});\n\t\tparts.push({name: 'd', data: priv});\n\n\t\tkey = new PrivateKey({\n\t\t\ttype: 'ecdsa',\n\t\t\tcurve: curve,\n\t\t\tparts: parts\n\t\t});\n\t\treturn (key);\n\t}\n}\n","// Copyright 2015 Joyent, Inc.\n\nmodule.exports = {\n\tVerifier: Verifier,\n\tSigner: Signer\n};\n\nvar nacl = require('tweetnacl');\nvar stream = require('stream');\nvar util = require('util');\nvar assert = require('assert-plus');\nvar Buffer = require('safer-buffer').Buffer;\nvar Signature = require('./signature');\n\nfunction Verifier(key, hashAlgo) {\n\tif (hashAlgo.toLowerCase() !== 'sha512')\n\t\tthrow (new Error('ED25519 only supports the use of ' +\n\t\t 'SHA-512 hashes'));\n\n\tthis.key = key;\n\tthis.chunks = [];\n\n\tstream.Writable.call(this, {});\n}\nutil.inherits(Verifier, stream.Writable);\n\nVerifier.prototype._write = function (chunk, enc, cb) {\n\tthis.chunks.push(chunk);\n\tcb();\n};\n\nVerifier.prototype.update = function (chunk) {\n\tif (typeof (chunk) === 'string')\n\t\tchunk = Buffer.from(chunk, 'binary');\n\tthis.chunks.push(chunk);\n};\n\nVerifier.prototype.verify = function (signature, fmt) {\n\tvar sig;\n\tif (Signature.isSignature(signature, [2, 0])) {\n\t\tif (signature.type !== 'ed25519')\n\t\t\treturn (false);\n\t\tsig = signature.toBuffer('raw');\n\n\t} else if (typeof (signature) === 'string') {\n\t\tsig = Buffer.from(signature, 'base64');\n\n\t} else if (Signature.isSignature(signature, [1, 0])) {\n\t\tthrow (new Error('signature was created by too old ' +\n\t\t 'a version of sshpk and cannot be verified'));\n\t}\n\n\tassert.buffer(sig);\n\treturn (nacl.sign.detached.verify(\n\t new Uint8Array(Buffer.concat(this.chunks)),\n\t new Uint8Array(sig),\n\t new Uint8Array(this.key.part.A.data)));\n};\n\nfunction Signer(key, hashAlgo) {\n\tif (hashAlgo.toLowerCase() !== 'sha512')\n\t\tthrow (new Error('ED25519 only supports the use of ' +\n\t\t 'SHA-512 hashes'));\n\n\tthis.key = key;\n\tthis.chunks = [];\n\n\tstream.Writable.call(this, {});\n}\nutil.inherits(Signer, stream.Writable);\n\nSigner.prototype._write = function (chunk, enc, cb) {\n\tthis.chunks.push(chunk);\n\tcb();\n};\n\nSigner.prototype.update = function (chunk) {\n\tif (typeof (chunk) === 'string')\n\t\tchunk = Buffer.from(chunk, 'binary');\n\tthis.chunks.push(chunk);\n};\n\nSigner.prototype.sign = function () {\n\tvar sig = nacl.sign.detached(\n\t new Uint8Array(Buffer.concat(this.chunks)),\n\t new Uint8Array(Buffer.concat([\n\t\tthis.key.part.k.data, this.key.part.A.data])));\n\tvar sigBuf = Buffer.from(sig);\n\tvar sigObj = Signature.parse(sigBuf, 'ed25519', 'raw');\n\tsigObj.hashAlgorithm = 'sha512';\n\treturn (sigObj);\n};\n","// Copyright 2015 Joyent, Inc.\n\nvar assert = require('assert-plus');\nvar util = require('util');\n\nfunction FingerprintFormatError(fp, format) {\n\tif (Error.captureStackTrace)\n\t\tError.captureStackTrace(this, FingerprintFormatError);\n\tthis.name = 'FingerprintFormatError';\n\tthis.fingerprint = fp;\n\tthis.format = format;\n\tthis.message = 'Fingerprint format is not supported, or is invalid: ';\n\tif (fp !== undefined)\n\t\tthis.message += ' fingerprint = ' + fp;\n\tif (format !== undefined)\n\t\tthis.message += ' format = ' + format;\n}\nutil.inherits(FingerprintFormatError, Error);\n\nfunction InvalidAlgorithmError(alg) {\n\tif (Error.captureStackTrace)\n\t\tError.captureStackTrace(this, InvalidAlgorithmError);\n\tthis.name = 'InvalidAlgorithmError';\n\tthis.algorithm = alg;\n\tthis.message = 'Algorithm \"' + alg + '\" is not supported';\n}\nutil.inherits(InvalidAlgorithmError, Error);\n\nfunction KeyParseError(name, format, innerErr) {\n\tif (Error.captureStackTrace)\n\t\tError.captureStackTrace(this, KeyParseError);\n\tthis.name = 'KeyParseError';\n\tthis.format = format;\n\tthis.keyName = name;\n\tthis.innerErr = innerErr;\n\tthis.message = 'Failed to parse ' + name + ' as a valid ' + format +\n\t ' format key: ' + innerErr.message;\n}\nutil.inherits(KeyParseError, Error);\n\nfunction SignatureParseError(type, format, innerErr) {\n\tif (Error.captureStackTrace)\n\t\tError.captureStackTrace(this, SignatureParseError);\n\tthis.name = 'SignatureParseError';\n\tthis.type = type;\n\tthis.format = format;\n\tthis.innerErr = innerErr;\n\tthis.message = 'Failed to parse the given data as a ' + type +\n\t ' signature in ' + format + ' format: ' + innerErr.message;\n}\nutil.inherits(SignatureParseError, Error);\n\nfunction CertificateParseError(name, format, innerErr) {\n\tif (Error.captureStackTrace)\n\t\tError.captureStackTrace(this, CertificateParseError);\n\tthis.name = 'CertificateParseError';\n\tthis.format = format;\n\tthis.certName = name;\n\tthis.innerErr = innerErr;\n\tthis.message = 'Failed to parse ' + name + ' as a valid ' + format +\n\t ' format certificate: ' + innerErr.message;\n}\nutil.inherits(CertificateParseError, Error);\n\nfunction KeyEncryptedError(name, format) {\n\tif (Error.captureStackTrace)\n\t\tError.captureStackTrace(this, KeyEncryptedError);\n\tthis.name = 'KeyEncryptedError';\n\tthis.format = format;\n\tthis.keyName = name;\n\tthis.message = 'The ' + format + ' format key ' + name + ' is ' +\n\t 'encrypted (password-protected), and no passphrase was ' +\n\t 'provided in `options`';\n}\nutil.inherits(KeyEncryptedError, Error);\n\nmodule.exports = {\n\tFingerprintFormatError: FingerprintFormatError,\n\tInvalidAlgorithmError: InvalidAlgorithmError,\n\tKeyParseError: KeyParseError,\n\tSignatureParseError: SignatureParseError,\n\tKeyEncryptedError: KeyEncryptedError,\n\tCertificateParseError: CertificateParseError\n};\n","// Copyright 2018 Joyent, Inc.\n\nmodule.exports = Fingerprint;\n\nvar assert = require('assert-plus');\nvar Buffer = require('safer-buffer').Buffer;\nvar algs = require('./algs');\nvar crypto = require('crypto');\nvar errs = require('./errors');\nvar Key = require('./key');\nvar PrivateKey = require('./private-key');\nvar Certificate = require('./certificate');\nvar utils = require('./utils');\n\nvar FingerprintFormatError = errs.FingerprintFormatError;\nvar InvalidAlgorithmError = errs.InvalidAlgorithmError;\n\nfunction Fingerprint(opts) {\n\tassert.object(opts, 'options');\n\tassert.string(opts.type, 'options.type');\n\tassert.buffer(opts.hash, 'options.hash');\n\tassert.string(opts.algorithm, 'options.algorithm');\n\n\tthis.algorithm = opts.algorithm.toLowerCase();\n\tif (algs.hashAlgs[this.algorithm] !== true)\n\t\tthrow (new InvalidAlgorithmError(this.algorithm));\n\n\tthis.hash = opts.hash;\n\tthis.type = opts.type;\n\tthis.hashType = opts.hashType;\n}\n\nFingerprint.prototype.toString = function (format) {\n\tif (format === undefined) {\n\t\tif (this.algorithm === 'md5' || this.hashType === 'spki')\n\t\t\tformat = 'hex';\n\t\telse\n\t\t\tformat = 'base64';\n\t}\n\tassert.string(format);\n\n\tswitch (format) {\n\tcase 'hex':\n\t\tif (this.hashType === 'spki')\n\t\t\treturn (this.hash.toString('hex'));\n\t\treturn (addColons(this.hash.toString('hex')));\n\tcase 'base64':\n\t\tif (this.hashType === 'spki')\n\t\t\treturn (this.hash.toString('base64'));\n\t\treturn (sshBase64Format(this.algorithm,\n\t\t this.hash.toString('base64')));\n\tdefault:\n\t\tthrow (new FingerprintFormatError(undefined, format));\n\t}\n};\n\nFingerprint.prototype.matches = function (other) {\n\tassert.object(other, 'key or certificate');\n\tif (this.type === 'key' && this.hashType !== 'ssh') {\n\t\tutils.assertCompatible(other, Key, [1, 7], 'key with spki');\n\t\tif (PrivateKey.isPrivateKey(other)) {\n\t\t\tutils.assertCompatible(other, PrivateKey, [1, 6],\n\t\t\t 'privatekey with spki support');\n\t\t}\n\t} else if (this.type === 'key') {\n\t\tutils.assertCompatible(other, Key, [1, 0], 'key');\n\t} else {\n\t\tutils.assertCompatible(other, Certificate, [1, 0],\n\t\t 'certificate');\n\t}\n\n\tvar theirHash = other.hash(this.algorithm, this.hashType);\n\tvar theirHash2 = crypto.createHash(this.algorithm).\n\t update(theirHash).digest('base64');\n\n\tif (this.hash2 === undefined)\n\t\tthis.hash2 = crypto.createHash(this.algorithm).\n\t\t update(this.hash).digest('base64');\n\n\treturn (this.hash2 === theirHash2);\n};\n\n/*JSSTYLED*/\nvar base64RE = /^[A-Za-z0-9+\\/=]+$/;\n/*JSSTYLED*/\nvar hexRE = /^[a-fA-F0-9]+$/;\n\nFingerprint.parse = function (fp, options) {\n\tassert.string(fp, 'fingerprint');\n\n\tvar alg, hash, enAlgs;\n\tif (Array.isArray(options)) {\n\t\tenAlgs = options;\n\t\toptions = {};\n\t}\n\tassert.optionalObject(options, 'options');\n\tif (options === undefined)\n\t\toptions = {};\n\tif (options.enAlgs !== undefined)\n\t\tenAlgs = options.enAlgs;\n\tif (options.algorithms !== undefined)\n\t\tenAlgs = options.algorithms;\n\tassert.optionalArrayOfString(enAlgs, 'algorithms');\n\n\tvar hashType = 'ssh';\n\tif (options.hashType !== undefined)\n\t\thashType = options.hashType;\n\tassert.string(hashType, 'options.hashType');\n\n\tvar parts = fp.split(':');\n\tif (parts.length == 2) {\n\t\talg = parts[0].toLowerCase();\n\t\tif (!base64RE.test(parts[1]))\n\t\t\tthrow (new FingerprintFormatError(fp));\n\t\ttry {\n\t\t\thash = Buffer.from(parts[1], 'base64');\n\t\t} catch (e) {\n\t\t\tthrow (new FingerprintFormatError(fp));\n\t\t}\n\t} else if (parts.length > 2) {\n\t\talg = 'md5';\n\t\tif (parts[0].toLowerCase() === 'md5')\n\t\t\tparts = parts.slice(1);\n\t\tparts = parts.map(function (p) {\n\t\t\twhile (p.length < 2)\n\t\t\t\tp = '0' + p;\n\t\t\tif (p.length > 2)\n\t\t\t\tthrow (new FingerprintFormatError(fp));\n\t\t\treturn (p);\n\t\t});\n\t\tparts = parts.join('');\n\t\tif (!hexRE.test(parts) || parts.length % 2 !== 0)\n\t\t\tthrow (new FingerprintFormatError(fp));\n\t\ttry {\n\t\t\thash = Buffer.from(parts, 'hex');\n\t\t} catch (e) {\n\t\t\tthrow (new FingerprintFormatError(fp));\n\t\t}\n\t} else {\n\t\tif (hexRE.test(fp)) {\n\t\t\thash = Buffer.from(fp, 'hex');\n\t\t} else if (base64RE.test(fp)) {\n\t\t\thash = Buffer.from(fp, 'base64');\n\t\t} else {\n\t\t\tthrow (new FingerprintFormatError(fp));\n\t\t}\n\n\t\tswitch (hash.length) {\n\t\tcase 32:\n\t\t\talg = 'sha256';\n\t\t\tbreak;\n\t\tcase 16:\n\t\t\talg = 'md5';\n\t\t\tbreak;\n\t\tcase 20:\n\t\t\talg = 'sha1';\n\t\t\tbreak;\n\t\tcase 64:\n\t\t\talg = 'sha512';\n\t\t\tbreak;\n\t\tdefault:\n\t\t\tthrow (new FingerprintFormatError(fp));\n\t\t}\n\n\t\t/* Plain hex/base64: guess it's probably SPKI unless told. */\n\t\tif (options.hashType === undefined)\n\t\t\thashType = 'spki';\n\t}\n\n\tif (alg === undefined)\n\t\tthrow (new FingerprintFormatError(fp));\n\n\tif (algs.hashAlgs[alg] === undefined)\n\t\tthrow (new InvalidAlgorithmError(alg));\n\n\tif (enAlgs !== undefined) {\n\t\tenAlgs = enAlgs.map(function (a) { return a.toLowerCase(); });\n\t\tif (enAlgs.indexOf(alg) === -1)\n\t\t\tthrow (new InvalidAlgorithmError(alg));\n\t}\n\n\treturn (new Fingerprint({\n\t\talgorithm: alg,\n\t\thash: hash,\n\t\ttype: options.type || 'key',\n\t\thashType: hashType\n\t}));\n};\n\nfunction addColons(s) {\n\t/*JSSTYLED*/\n\treturn (s.replace(/(.{2})(?=.)/g, '$1:'));\n}\n\nfunction base64Strip(s) {\n\t/*JSSTYLED*/\n\treturn (s.replace(/=*$/, ''));\n}\n\nfunction sshBase64Format(alg, h) {\n\treturn (alg.toUpperCase() + ':' + base64Strip(h));\n}\n\nFingerprint.isFingerprint = function (obj, ver) {\n\treturn (utils.isCompatible(obj, Fingerprint, ver));\n};\n\n/*\n * API versions for Fingerprint:\n * [1,0] -- initial ver\n * [1,1] -- first tagged ver\n * [1,2] -- hashType and spki support\n */\nFingerprint.prototype._sshpkApiVersion = [1, 2];\n\nFingerprint._oldVersionDetect = function (obj) {\n\tassert.func(obj.toString);\n\tassert.func(obj.matches);\n\treturn ([1, 0]);\n};\n","// Copyright 2018 Joyent, Inc.\n\nmodule.exports = {\n\tread: read,\n\twrite: write\n};\n\nvar assert = require('assert-plus');\nvar Buffer = require('safer-buffer').Buffer;\nvar utils = require('../utils');\nvar Key = require('../key');\nvar PrivateKey = require('../private-key');\n\nvar pem = require('./pem');\nvar ssh = require('./ssh');\nvar rfc4253 = require('./rfc4253');\nvar dnssec = require('./dnssec');\nvar putty = require('./putty');\n\nvar DNSSEC_PRIVKEY_HEADER_PREFIX = 'Private-key-format: v1';\n\nfunction read(buf, options) {\n\tif (typeof (buf) === 'string') {\n\t\tif (buf.trim().match(/^[-]+[ ]*BEGIN/))\n\t\t\treturn (pem.read(buf, options));\n\t\tif (buf.match(/^\\s*ssh-[a-z]/))\n\t\t\treturn (ssh.read(buf, options));\n\t\tif (buf.match(/^\\s*ecdsa-/))\n\t\t\treturn (ssh.read(buf, options));\n\t\tif (buf.match(/^putty-user-key-file-2:/i))\n\t\t\treturn (putty.read(buf, options));\n\t\tif (findDNSSECHeader(buf))\n\t\t\treturn (dnssec.read(buf, options));\n\t\tbuf = Buffer.from(buf, 'binary');\n\t} else {\n\t\tassert.buffer(buf);\n\t\tif (findPEMHeader(buf))\n\t\t\treturn (pem.read(buf, options));\n\t\tif (findSSHHeader(buf))\n\t\t\treturn (ssh.read(buf, options));\n\t\tif (findPuTTYHeader(buf))\n\t\t\treturn (putty.read(buf, options));\n\t\tif (findDNSSECHeader(buf))\n\t\t\treturn (dnssec.read(buf, options));\n\t}\n\tif (buf.readUInt32BE(0) < buf.length)\n\t\treturn (rfc4253.read(buf, options));\n\tthrow (new Error('Failed to auto-detect format of key'));\n}\n\nfunction findPuTTYHeader(buf) {\n\tvar offset = 0;\n\twhile (offset < buf.length &&\n\t (buf[offset] === 32 || buf[offset] === 10 || buf[offset] === 9))\n\t\t++offset;\n\tif (offset + 22 <= buf.length &&\n\t buf.slice(offset, offset + 22).toString('ascii').toLowerCase() ===\n\t 'putty-user-key-file-2:')\n\t\treturn (true);\n\treturn (false);\n}\n\nfunction findSSHHeader(buf) {\n\tvar offset = 0;\n\twhile (offset < buf.length &&\n\t (buf[offset] === 32 || buf[offset] === 10 || buf[offset] === 9))\n\t\t++offset;\n\tif (offset + 4 <= buf.length &&\n\t buf.slice(offset, offset + 4).toString('ascii') === 'ssh-')\n\t\treturn (true);\n\tif (offset + 6 <= buf.length &&\n\t buf.slice(offset, offset + 6).toString('ascii') === 'ecdsa-')\n\t\treturn (true);\n\treturn (false);\n}\n\nfunction findPEMHeader(buf) {\n\tvar offset = 0;\n\twhile (offset < buf.length &&\n\t (buf[offset] === 32 || buf[offset] === 10))\n\t\t++offset;\n\tif (buf[offset] !== 45)\n\t\treturn (false);\n\twhile (offset < buf.length &&\n\t (buf[offset] === 45))\n\t\t++offset;\n\twhile (offset < buf.length &&\n\t (buf[offset] === 32))\n\t\t++offset;\n\tif (offset + 5 > buf.length ||\n\t buf.slice(offset, offset + 5).toString('ascii') !== 'BEGIN')\n\t\treturn (false);\n\treturn (true);\n}\n\nfunction findDNSSECHeader(buf) {\n\t// private case first\n\tif (buf.length <= DNSSEC_PRIVKEY_HEADER_PREFIX.length)\n\t\treturn (false);\n\tvar headerCheck = buf.slice(0, DNSSEC_PRIVKEY_HEADER_PREFIX.length);\n\tif (headerCheck.toString('ascii') === DNSSEC_PRIVKEY_HEADER_PREFIX)\n\t\treturn (true);\n\n\t// public-key RFC3110 ?\n\t// 'domain.com. IN KEY ...' or 'domain.com. IN DNSKEY ...'\n\t// skip any comment-lines\n\tif (typeof (buf) !== 'string') {\n\t\tbuf = buf.toString('ascii');\n\t}\n\tvar lines = buf.split('\\n');\n\tvar line = 0;\n\t/* JSSTYLED */\n\twhile (lines[line].match(/^\\;/))\n\t\tline++;\n\tif (lines[line].toString('ascii').match(/\\. IN KEY /))\n\t\treturn (true);\n\tif (lines[line].toString('ascii').match(/\\. IN DNSKEY /))\n\t\treturn (true);\n\treturn (false);\n}\n\nfunction write(key, options) {\n\tthrow (new Error('\"auto\" format cannot be used for writing'));\n}\n","// Copyright 2017 Joyent, Inc.\n\nmodule.exports = {\n\tread: read,\n\twrite: write\n};\n\nvar assert = require('assert-plus');\nvar Buffer = require('safer-buffer').Buffer;\nvar Key = require('../key');\nvar PrivateKey = require('../private-key');\nvar utils = require('../utils');\nvar SSHBuffer = require('../ssh-buffer');\nvar Dhe = require('../dhe');\n\nvar supportedAlgos = {\n\t'rsa-sha1' : 5,\n\t'rsa-sha256' : 8,\n\t'rsa-sha512' : 10,\n\t'ecdsa-p256-sha256' : 13,\n\t'ecdsa-p384-sha384' : 14\n\t/*\n\t * ed25519 is hypothetically supported with id 15\n\t * but the common tools available don't appear to be\n\t * capable of generating/using ed25519 keys\n\t */\n};\n\nvar supportedAlgosById = {};\nObject.keys(supportedAlgos).forEach(function (k) {\n\tsupportedAlgosById[supportedAlgos[k]] = k.toUpperCase();\n});\n\nfunction read(buf, options) {\n\tif (typeof (buf) !== 'string') {\n\t\tassert.buffer(buf, 'buf');\n\t\tbuf = buf.toString('ascii');\n\t}\n\tvar lines = buf.split('\\n');\n\tif (lines[0].match(/^Private-key-format\\: v1/)) {\n\t\tvar algElems = lines[1].split(' ');\n\t\tvar algoNum = parseInt(algElems[1], 10);\n\t\tvar algoName = algElems[2];\n\t\tif (!supportedAlgosById[algoNum])\n\t\t\tthrow (new Error('Unsupported algorithm: ' + algoName));\n\t\treturn (readDNSSECPrivateKey(algoNum, lines.slice(2)));\n\t}\n\n\t// skip any comment-lines\n\tvar line = 0;\n\t/* JSSTYLED */\n\twhile (lines[line].match(/^\\;/))\n\t\tline++;\n\t// we should now have *one single* line left with our KEY on it.\n\tif ((lines[line].match(/\\. IN KEY /) ||\n\t lines[line].match(/\\. IN DNSKEY /)) && lines[line+1].length === 0) {\n\t\treturn (readRFC3110(lines[line]));\n\t}\n\tthrow (new Error('Cannot parse dnssec key'));\n}\n\nfunction readRFC3110(keyString) {\n\tvar elems = keyString.split(' ');\n\t//unused var flags = parseInt(elems[3], 10);\n\t//unused var protocol = parseInt(elems[4], 10);\n\tvar algorithm = parseInt(elems[5], 10);\n\tif (!supportedAlgosById[algorithm])\n\t\tthrow (new Error('Unsupported algorithm: ' + algorithm));\n\tvar base64key = elems.slice(6, elems.length).join();\n\tvar keyBuffer = Buffer.from(base64key, 'base64');\n\tif (supportedAlgosById[algorithm].match(/^RSA-/)) {\n\t\t// join the rest of the body into a single base64-blob\n\t\tvar publicExponentLen = keyBuffer.readUInt8(0);\n\t\tif (publicExponentLen != 3 && publicExponentLen != 1)\n\t\t\tthrow (new Error('Cannot parse dnssec key: ' +\n\t\t\t 'unsupported exponent length'));\n\n\t\tvar publicExponent = keyBuffer.slice(1, publicExponentLen+1);\n\t\tpublicExponent = utils.mpNormalize(publicExponent);\n\t\tvar modulus = keyBuffer.slice(1+publicExponentLen);\n\t\tmodulus = utils.mpNormalize(modulus);\n\t\t// now, make the key\n\t\tvar rsaKey = {\n\t\t\ttype: 'rsa',\n\t\t\tparts: []\n\t\t};\n\t\trsaKey.parts.push({ name: 'e', data: publicExponent});\n\t\trsaKey.parts.push({ name: 'n', data: modulus});\n\t\treturn (new Key(rsaKey));\n\t}\n\tif (supportedAlgosById[algorithm] === 'ECDSA-P384-SHA384' ||\n\t supportedAlgosById[algorithm] === 'ECDSA-P256-SHA256') {\n\t\tvar curve = 'nistp384';\n\t\tvar size = 384;\n\t\tif (supportedAlgosById[algorithm].match(/^ECDSA-P256-SHA256/)) {\n\t\t\tcurve = 'nistp256';\n\t\t\tsize = 256;\n\t\t}\n\n\t\tvar ecdsaKey = {\n\t\t\ttype: 'ecdsa',\n\t\t\tcurve: curve,\n\t\t\tsize: size,\n\t\t\tparts: [\n\t\t\t\t{name: 'curve', data: Buffer.from(curve) },\n\t\t\t\t{name: 'Q', data: utils.ecNormalize(keyBuffer) }\n\t\t\t]\n\t\t};\n\t\treturn (new Key(ecdsaKey));\n\t}\n\tthrow (new Error('Unsupported algorithm: ' +\n\t supportedAlgosById[algorithm]));\n}\n\nfunction elementToBuf(e) {\n\treturn (Buffer.from(e.split(' ')[1], 'base64'));\n}\n\nfunction readDNSSECRSAPrivateKey(elements) {\n\tvar rsaParams = {};\n\telements.forEach(function (element) {\n\t\tif (element.split(' ')[0] === 'Modulus:')\n\t\t\trsaParams['n'] = elementToBuf(element);\n\t\telse if (element.split(' ')[0] === 'PublicExponent:')\n\t\t\trsaParams['e'] = elementToBuf(element);\n\t\telse if (element.split(' ')[0] === 'PrivateExponent:')\n\t\t\trsaParams['d'] = elementToBuf(element);\n\t\telse if (element.split(' ')[0] === 'Prime1:')\n\t\t\trsaParams['p'] = elementToBuf(element);\n\t\telse if (element.split(' ')[0] === 'Prime2:')\n\t\t\trsaParams['q'] = elementToBuf(element);\n\t\telse if (element.split(' ')[0] === 'Exponent1:')\n\t\t\trsaParams['dmodp'] = elementToBuf(element);\n\t\telse if (element.split(' ')[0] === 'Exponent2:')\n\t\t\trsaParams['dmodq'] = elementToBuf(element);\n\t\telse if (element.split(' ')[0] === 'Coefficient:')\n\t\t\trsaParams['iqmp'] = elementToBuf(element);\n\t});\n\t// now, make the key\n\tvar key = {\n\t\ttype: 'rsa',\n\t\tparts: [\n\t\t\t{ name: 'e', data: utils.mpNormalize(rsaParams['e'])},\n\t\t\t{ name: 'n', data: utils.mpNormalize(rsaParams['n'])},\n\t\t\t{ name: 'd', data: utils.mpNormalize(rsaParams['d'])},\n\t\t\t{ name: 'p', data: utils.mpNormalize(rsaParams['p'])},\n\t\t\t{ name: 'q', data: utils.mpNormalize(rsaParams['q'])},\n\t\t\t{ name: 'dmodp',\n\t\t\t data: utils.mpNormalize(rsaParams['dmodp'])},\n\t\t\t{ name: 'dmodq',\n\t\t\t data: utils.mpNormalize(rsaParams['dmodq'])},\n\t\t\t{ name: 'iqmp',\n\t\t\t data: utils.mpNormalize(rsaParams['iqmp'])}\n\t\t]\n\t};\n\treturn (new PrivateKey(key));\n}\n\nfunction readDNSSECPrivateKey(alg, elements) {\n\tif (supportedAlgosById[alg].match(/^RSA-/)) {\n\t\treturn (readDNSSECRSAPrivateKey(elements));\n\t}\n\tif (supportedAlgosById[alg] === 'ECDSA-P384-SHA384' ||\n\t supportedAlgosById[alg] === 'ECDSA-P256-SHA256') {\n\t\tvar d = Buffer.from(elements[0].split(' ')[1], 'base64');\n\t\tvar curve = 'nistp384';\n\t\tvar size = 384;\n\t\tif (supportedAlgosById[alg] === 'ECDSA-P256-SHA256') {\n\t\t\tcurve = 'nistp256';\n\t\t\tsize = 256;\n\t\t}\n\t\t// DNSSEC generates the public-key on the fly (go calculate it)\n\t\tvar publicKey = utils.publicFromPrivateECDSA(curve, d);\n\t\tvar Q = publicKey.part['Q'].data;\n\t\tvar ecdsaKey = {\n\t\t\ttype: 'ecdsa',\n\t\t\tcurve: curve,\n\t\t\tsize: size,\n\t\t\tparts: [\n\t\t\t\t{name: 'curve', data: Buffer.from(curve) },\n\t\t\t\t{name: 'd', data: d },\n\t\t\t\t{name: 'Q', data: Q }\n\t\t\t]\n\t\t};\n\t\treturn (new PrivateKey(ecdsaKey));\n\t}\n\tthrow (new Error('Unsupported algorithm: ' + supportedAlgosById[alg]));\n}\n\nfunction dnssecTimestamp(date) {\n\tvar year = date.getFullYear() + ''; //stringify\n\tvar month = (date.getMonth() + 1);\n\tvar timestampStr = year + month + date.getUTCDate();\n\ttimestampStr += '' + date.getUTCHours() + date.getUTCMinutes();\n\ttimestampStr += date.getUTCSeconds();\n\treturn (timestampStr);\n}\n\nfunction rsaAlgFromOptions(opts) {\n\tif (!opts || !opts.hashAlgo || opts.hashAlgo === 'sha1')\n\t\treturn ('5 (RSASHA1)');\n\telse if (opts.hashAlgo === 'sha256')\n\t\treturn ('8 (RSASHA256)');\n\telse if (opts.hashAlgo === 'sha512')\n\t\treturn ('10 (RSASHA512)');\n\telse\n\t\tthrow (new Error('Unknown or unsupported hash: ' +\n\t\t opts.hashAlgo));\n}\n\nfunction writeRSA(key, options) {\n\t// if we're missing parts, add them.\n\tif (!key.part.dmodp || !key.part.dmodq) {\n\t\tutils.addRSAMissing(key);\n\t}\n\n\tvar out = '';\n\tout += 'Private-key-format: v1.3\\n';\n\tout += 'Algorithm: ' + rsaAlgFromOptions(options) + '\\n';\n\tvar n = utils.mpDenormalize(key.part['n'].data);\n\tout += 'Modulus: ' + n.toString('base64') + '\\n';\n\tvar e = utils.mpDenormalize(key.part['e'].data);\n\tout += 'PublicExponent: ' + e.toString('base64') + '\\n';\n\tvar d = utils.mpDenormalize(key.part['d'].data);\n\tout += 'PrivateExponent: ' + d.toString('base64') + '\\n';\n\tvar p = utils.mpDenormalize(key.part['p'].data);\n\tout += 'Prime1: ' + p.toString('base64') + '\\n';\n\tvar q = utils.mpDenormalize(key.part['q'].data);\n\tout += 'Prime2: ' + q.toString('base64') + '\\n';\n\tvar dmodp = utils.mpDenormalize(key.part['dmodp'].data);\n\tout += 'Exponent1: ' + dmodp.toString('base64') + '\\n';\n\tvar dmodq = utils.mpDenormalize(key.part['dmodq'].data);\n\tout += 'Exponent2: ' + dmodq.toString('base64') + '\\n';\n\tvar iqmp = utils.mpDenormalize(key.part['iqmp'].data);\n\tout += 'Coefficient: ' + iqmp.toString('base64') + '\\n';\n\t// Assume that we're valid as-of now\n\tvar timestamp = new Date();\n\tout += 'Created: ' + dnssecTimestamp(timestamp) + '\\n';\n\tout += 'Publish: ' + dnssecTimestamp(timestamp) + '\\n';\n\tout += 'Activate: ' + dnssecTimestamp(timestamp) + '\\n';\n\treturn (Buffer.from(out, 'ascii'));\n}\n\nfunction writeECDSA(key, options) {\n\tvar out = '';\n\tout += 'Private-key-format: v1.3\\n';\n\n\tif (key.curve === 'nistp256') {\n\t\tout += 'Algorithm: 13 (ECDSAP256SHA256)\\n';\n\t} else if (key.curve === 'nistp384') {\n\t\tout += 'Algorithm: 14 (ECDSAP384SHA384)\\n';\n\t} else {\n\t\tthrow (new Error('Unsupported curve'));\n\t}\n\tvar base64Key = key.part['d'].data.toString('base64');\n\tout += 'PrivateKey: ' + base64Key + '\\n';\n\n\t// Assume that we're valid as-of now\n\tvar timestamp = new Date();\n\tout += 'Created: ' + dnssecTimestamp(timestamp) + '\\n';\n\tout += 'Publish: ' + dnssecTimestamp(timestamp) + '\\n';\n\tout += 'Activate: ' + dnssecTimestamp(timestamp) + '\\n';\n\n\treturn (Buffer.from(out, 'ascii'));\n}\n\nfunction write(key, options) {\n\tif (PrivateKey.isPrivateKey(key)) {\n\t\tif (key.type === 'rsa') {\n\t\t\treturn (writeRSA(key, options));\n\t\t} else if (key.type === 'ecdsa') {\n\t\t\treturn (writeECDSA(key, options));\n\t\t} else {\n\t\t\tthrow (new Error('Unsupported algorithm: ' + key.type));\n\t\t}\n\t} else if (Key.isKey(key)) {\n\t\t/*\n\t\t * RFC3110 requires a keyname, and a keytype, which we\n\t\t * don't really have a mechanism for specifying such\n\t\t * additional metadata.\n\t\t */\n\t\tthrow (new Error('Format \"dnssec\" only supports ' +\n\t\t 'writing private keys'));\n\t} else {\n\t\tthrow (new Error('key is not a Key or PrivateKey'));\n\t}\n}\n","// Copyright 2017 Joyent, Inc.\n\nmodule.exports = {\n\tread: read,\n\tverify: verify,\n\tsign: sign,\n\tsignAsync: signAsync,\n\twrite: write,\n\n\t/* Internal private API */\n\tfromBuffer: fromBuffer,\n\ttoBuffer: toBuffer\n};\n\nvar assert = require('assert-plus');\nvar SSHBuffer = require('../ssh-buffer');\nvar crypto = require('crypto');\nvar Buffer = require('safer-buffer').Buffer;\nvar algs = require('../algs');\nvar Key = require('../key');\nvar PrivateKey = require('../private-key');\nvar Identity = require('../identity');\nvar rfc4253 = require('./rfc4253');\nvar Signature = require('../signature');\nvar utils = require('../utils');\nvar Certificate = require('../certificate');\n\nfunction verify(cert, key) {\n\t/*\n\t * We always give an issuerKey, so if our verify() is being called then\n\t * there was no signature. Return false.\n\t */\n\treturn (false);\n}\n\nvar TYPES = {\n\t'user': 1,\n\t'host': 2\n};\nObject.keys(TYPES).forEach(function (k) { TYPES[TYPES[k]] = k; });\n\nvar ECDSA_ALGO = /^ecdsa-sha2-([^@-]+)-cert-v01@openssh.com$/;\n\nfunction read(buf, options) {\n\tif (Buffer.isBuffer(buf))\n\t\tbuf = buf.toString('ascii');\n\tvar parts = buf.trim().split(/[ \\t\\n]+/g);\n\tif (parts.length < 2 || parts.length > 3)\n\t\tthrow (new Error('Not a valid SSH certificate line'));\n\n\tvar algo = parts[0];\n\tvar data = parts[1];\n\n\tdata = Buffer.from(data, 'base64');\n\treturn (fromBuffer(data, algo));\n}\n\nfunction fromBuffer(data, algo, partial) {\n\tvar sshbuf = new SSHBuffer({ buffer: data });\n\tvar innerAlgo = sshbuf.readString();\n\tif (algo !== undefined && innerAlgo !== algo)\n\t\tthrow (new Error('SSH certificate algorithm mismatch'));\n\tif (algo === undefined)\n\t\talgo = innerAlgo;\n\n\tvar cert = {};\n\tcert.signatures = {};\n\tcert.signatures.openssh = {};\n\n\tcert.signatures.openssh.nonce = sshbuf.readBuffer();\n\n\tvar key = {};\n\tvar parts = (key.parts = []);\n\tkey.type = getAlg(algo);\n\n\tvar partCount = algs.info[key.type].parts.length;\n\twhile (parts.length < partCount)\n\t\tparts.push(sshbuf.readPart());\n\tassert.ok(parts.length >= 1, 'key must have at least one part');\n\n\tvar algInfo = algs.info[key.type];\n\tif (key.type === 'ecdsa') {\n\t\tvar res = ECDSA_ALGO.exec(algo);\n\t\tassert.ok(res !== null);\n\t\tassert.strictEqual(res[1], parts[0].data.toString());\n\t}\n\n\tfor (var i = 0; i < algInfo.parts.length; ++i) {\n\t\tparts[i].name = algInfo.parts[i];\n\t\tif (parts[i].name !== 'curve' &&\n\t\t algInfo.normalize !== false) {\n\t\t\tvar p = parts[i];\n\t\t\tp.data = utils.mpNormalize(p.data);\n\t\t}\n\t}\n\n\tcert.subjectKey = new Key(key);\n\n\tcert.serial = sshbuf.readInt64();\n\n\tvar type = TYPES[sshbuf.readInt()];\n\tassert.string(type, 'valid cert type');\n\n\tcert.signatures.openssh.keyId = sshbuf.readString();\n\n\tvar principals = [];\n\tvar pbuf = sshbuf.readBuffer();\n\tvar psshbuf = new SSHBuffer({ buffer: pbuf });\n\twhile (!psshbuf.atEnd())\n\t\tprincipals.push(psshbuf.readString());\n\tif (principals.length === 0)\n\t\tprincipals = ['*'];\n\n\tcert.subjects = principals.map(function (pr) {\n\t\tif (type === 'user')\n\t\t\treturn (Identity.forUser(pr));\n\t\telse if (type === 'host')\n\t\t\treturn (Identity.forHost(pr));\n\t\tthrow (new Error('Unknown identity type ' + type));\n\t});\n\n\tcert.validFrom = int64ToDate(sshbuf.readInt64());\n\tcert.validUntil = int64ToDate(sshbuf.readInt64());\n\n\tvar exts = [];\n\tvar extbuf = new SSHBuffer({ buffer: sshbuf.readBuffer() });\n\tvar ext;\n\twhile (!extbuf.atEnd()) {\n\t\text = { critical: true };\n\t\text.name = extbuf.readString();\n\t\text.data = extbuf.readBuffer();\n\t\texts.push(ext);\n\t}\n\textbuf = new SSHBuffer({ buffer: sshbuf.readBuffer() });\n\twhile (!extbuf.atEnd()) {\n\t\text = { critical: false };\n\t\text.name = extbuf.readString();\n\t\text.data = extbuf.readBuffer();\n\t\texts.push(ext);\n\t}\n\tcert.signatures.openssh.exts = exts;\n\n\t/* reserved */\n\tsshbuf.readBuffer();\n\n\tvar signingKeyBuf = sshbuf.readBuffer();\n\tcert.issuerKey = rfc4253.read(signingKeyBuf);\n\n\t/*\n\t * OpenSSH certs don't give the identity of the issuer, just their\n\t * public key. So, we use an Identity that matches anything. The\n\t * isSignedBy() function will later tell you if the key matches.\n\t */\n\tcert.issuer = Identity.forHost('**');\n\n\tvar sigBuf = sshbuf.readBuffer();\n\tcert.signatures.openssh.signature =\n\t Signature.parse(sigBuf, cert.issuerKey.type, 'ssh');\n\n\tif (partial !== undefined) {\n\t\tpartial.remainder = sshbuf.remainder();\n\t\tpartial.consumed = sshbuf._offset;\n\t}\n\n\treturn (new Certificate(cert));\n}\n\nfunction int64ToDate(buf) {\n\tvar i = buf.readUInt32BE(0) * 4294967296;\n\ti += buf.readUInt32BE(4);\n\tvar d = new Date();\n\td.setTime(i * 1000);\n\td.sourceInt64 = buf;\n\treturn (d);\n}\n\nfunction dateToInt64(date) {\n\tif (date.sourceInt64 !== undefined)\n\t\treturn (date.sourceInt64);\n\tvar i = Math.round(date.getTime() / 1000);\n\tvar upper = Math.floor(i / 4294967296);\n\tvar lower = Math.floor(i % 4294967296);\n\tvar buf = Buffer.alloc(8);\n\tbuf.writeUInt32BE(upper, 0);\n\tbuf.writeUInt32BE(lower, 4);\n\treturn (buf);\n}\n\nfunction sign(cert, key) {\n\tif (cert.signatures.openssh === undefined)\n\t\tcert.signatures.openssh = {};\n\ttry {\n\t\tvar blob = toBuffer(cert, true);\n\t} catch (e) {\n\t\tdelete (cert.signatures.openssh);\n\t\treturn (false);\n\t}\n\tvar sig = cert.signatures.openssh;\n\tvar hashAlgo = undefined;\n\tif (key.type === 'rsa' || key.type === 'dsa')\n\t\thashAlgo = 'sha1';\n\tvar signer = key.createSign(hashAlgo);\n\tsigner.write(blob);\n\tsig.signature = signer.sign();\n\treturn (true);\n}\n\nfunction signAsync(cert, signer, done) {\n\tif (cert.signatures.openssh === undefined)\n\t\tcert.signatures.openssh = {};\n\ttry {\n\t\tvar blob = toBuffer(cert, true);\n\t} catch (e) {\n\t\tdelete (cert.signatures.openssh);\n\t\tdone(e);\n\t\treturn;\n\t}\n\tvar sig = cert.signatures.openssh;\n\n\tsigner(blob, function (err, signature) {\n\t\tif (err) {\n\t\t\tdone(err);\n\t\t\treturn;\n\t\t}\n\t\ttry {\n\t\t\t/*\n\t\t\t * This will throw if the signature isn't of a\n\t\t\t * type/algo that can be used for SSH.\n\t\t\t */\n\t\t\tsignature.toBuffer('ssh');\n\t\t} catch (e) {\n\t\t\tdone(e);\n\t\t\treturn;\n\t\t}\n\t\tsig.signature = signature;\n\t\tdone();\n\t});\n}\n\nfunction write(cert, options) {\n\tif (options === undefined)\n\t\toptions = {};\n\n\tvar blob = toBuffer(cert);\n\tvar out = getCertType(cert.subjectKey) + ' ' + blob.toString('base64');\n\tif (options.comment)\n\t\tout = out + ' ' + options.comment;\n\treturn (out);\n}\n\n\nfunction toBuffer(cert, noSig) {\n\tassert.object(cert.signatures.openssh, 'signature for openssh format');\n\tvar sig = cert.signatures.openssh;\n\n\tif (sig.nonce === undefined)\n\t\tsig.nonce = crypto.randomBytes(16);\n\tvar buf = new SSHBuffer({});\n\tbuf.writeString(getCertType(cert.subjectKey));\n\tbuf.writeBuffer(sig.nonce);\n\n\tvar key = cert.subjectKey;\n\tvar algInfo = algs.info[key.type];\n\talgInfo.parts.forEach(function (part) {\n\t\tbuf.writePart(key.part[part]);\n\t});\n\n\tbuf.writeInt64(cert.serial);\n\n\tvar type = cert.subjects[0].type;\n\tassert.notStrictEqual(type, 'unknown');\n\tcert.subjects.forEach(function (id) {\n\t\tassert.strictEqual(id.type, type);\n\t});\n\ttype = TYPES[type];\n\tbuf.writeInt(type);\n\n\tif (sig.keyId === undefined) {\n\t\tsig.keyId = cert.subjects[0].type + '_' +\n\t\t (cert.subjects[0].uid || cert.subjects[0].hostname);\n\t}\n\tbuf.writeString(sig.keyId);\n\n\tvar sub = new SSHBuffer({});\n\tcert.subjects.forEach(function (id) {\n\t\tif (type === TYPES.host)\n\t\t\tsub.writeString(id.hostname);\n\t\telse if (type === TYPES.user)\n\t\t\tsub.writeString(id.uid);\n\t});\n\tbuf.writeBuffer(sub.toBuffer());\n\n\tbuf.writeInt64(dateToInt64(cert.validFrom));\n\tbuf.writeInt64(dateToInt64(cert.validUntil));\n\n\tvar exts = sig.exts;\n\tif (exts === undefined)\n\t\texts = [];\n\n\tvar extbuf = new SSHBuffer({});\n\texts.forEach(function (ext) {\n\t\tif (ext.critical !== true)\n\t\t\treturn;\n\t\textbuf.writeString(ext.name);\n\t\textbuf.writeBuffer(ext.data);\n\t});\n\tbuf.writeBuffer(extbuf.toBuffer());\n\n\textbuf = new SSHBuffer({});\n\texts.forEach(function (ext) {\n\t\tif (ext.critical === true)\n\t\t\treturn;\n\t\textbuf.writeString(ext.name);\n\t\textbuf.writeBuffer(ext.data);\n\t});\n\tbuf.writeBuffer(extbuf.toBuffer());\n\n\t/* reserved */\n\tbuf.writeBuffer(Buffer.alloc(0));\n\n\tsub = rfc4253.write(cert.issuerKey);\n\tbuf.writeBuffer(sub);\n\n\tif (!noSig)\n\t\tbuf.writeBuffer(sig.signature.toBuffer('ssh'));\n\n\treturn (buf.toBuffer());\n}\n\nfunction getAlg(certType) {\n\tif (certType === 'ssh-rsa-cert-v01@openssh.com')\n\t\treturn ('rsa');\n\tif (certType === 'ssh-dss-cert-v01@openssh.com')\n\t\treturn ('dsa');\n\tif (certType.match(ECDSA_ALGO))\n\t\treturn ('ecdsa');\n\tif (certType === 'ssh-ed25519-cert-v01@openssh.com')\n\t\treturn ('ed25519');\n\tthrow (new Error('Unsupported cert type ' + certType));\n}\n\nfunction getCertType(key) {\n\tif (key.type === 'rsa')\n\t\treturn ('ssh-rsa-cert-v01@openssh.com');\n\tif (key.type === 'dsa')\n\t\treturn ('ssh-dss-cert-v01@openssh.com');\n\tif (key.type === 'ecdsa')\n\t\treturn ('ecdsa-sha2-' + key.curve + '-cert-v01@openssh.com');\n\tif (key.type === 'ed25519')\n\t\treturn ('ssh-ed25519-cert-v01@openssh.com');\n\tthrow (new Error('Unsupported key type ' + key.type));\n}\n","// Copyright 2018 Joyent, Inc.\n\nmodule.exports = {\n\tread: read,\n\twrite: write\n};\n\nvar assert = require('assert-plus');\nvar asn1 = require('asn1');\nvar crypto = require('crypto');\nvar Buffer = require('safer-buffer').Buffer;\nvar algs = require('../algs');\nvar utils = require('../utils');\nvar Key = require('../key');\nvar PrivateKey = require('../private-key');\n\nvar pkcs1 = require('./pkcs1');\nvar pkcs8 = require('./pkcs8');\nvar sshpriv = require('./ssh-private');\nvar rfc4253 = require('./rfc4253');\n\nvar errors = require('../errors');\n\nvar OID_PBES2 = '1.2.840.113549.1.5.13';\nvar OID_PBKDF2 = '1.2.840.113549.1.5.12';\n\nvar OID_TO_CIPHER = {\n\t'1.2.840.113549.3.7': '3des-cbc',\n\t'2.16.840.1.101.3.4.1.2': 'aes128-cbc',\n\t'2.16.840.1.101.3.4.1.42': 'aes256-cbc'\n};\nvar CIPHER_TO_OID = {};\nObject.keys(OID_TO_CIPHER).forEach(function (k) {\n\tCIPHER_TO_OID[OID_TO_CIPHER[k]] = k;\n});\n\nvar OID_TO_HASH = {\n\t'1.2.840.113549.2.7': 'sha1',\n\t'1.2.840.113549.2.9': 'sha256',\n\t'1.2.840.113549.2.11': 'sha512'\n};\nvar HASH_TO_OID = {};\nObject.keys(OID_TO_HASH).forEach(function (k) {\n\tHASH_TO_OID[OID_TO_HASH[k]] = k;\n});\n\n/*\n * For reading we support both PKCS#1 and PKCS#8. If we find a private key,\n * we just take the public component of it and use that.\n */\nfunction read(buf, options, forceType) {\n\tvar input = buf;\n\tif (typeof (buf) !== 'string') {\n\t\tassert.buffer(buf, 'buf');\n\t\tbuf = buf.toString('ascii');\n\t}\n\n\tvar lines = buf.trim().split(/[\\r\\n]+/g);\n\n\tvar m;\n\tvar si = -1;\n\twhile (!m && si < lines.length) {\n\t\tm = lines[++si].match(/*JSSTYLED*/\n\t\t /[-]+[ ]*BEGIN ([A-Z0-9][A-Za-z0-9]+ )?(PUBLIC|PRIVATE) KEY[ ]*[-]+/);\n\t}\n\tassert.ok(m, 'invalid PEM header');\n\n\tvar m2;\n\tvar ei = lines.length;\n\twhile (!m2 && ei > 0) {\n\t\tm2 = lines[--ei].match(/*JSSTYLED*/\n\t\t /[-]+[ ]*END ([A-Z0-9][A-Za-z0-9]+ )?(PUBLIC|PRIVATE) KEY[ ]*[-]+/);\n\t}\n\tassert.ok(m2, 'invalid PEM footer');\n\n\t/* Begin and end banners must match key type */\n\tassert.equal(m[2], m2[2]);\n\tvar type = m[2].toLowerCase();\n\n\tvar alg;\n\tif (m[1]) {\n\t\t/* They also must match algorithms, if given */\n\t\tassert.equal(m[1], m2[1], 'PEM header and footer mismatch');\n\t\talg = m[1].trim();\n\t}\n\n\tlines = lines.slice(si, ei + 1);\n\n\tvar headers = {};\n\twhile (true) {\n\t\tlines = lines.slice(1);\n\t\tm = lines[0].match(/*JSSTYLED*/\n\t\t /^([A-Za-z0-9-]+): (.+)$/);\n\t\tif (!m)\n\t\t\tbreak;\n\t\theaders[m[1].toLowerCase()] = m[2];\n\t}\n\n\t/* Chop off the first and last lines */\n\tlines = lines.slice(0, -1).join('');\n\tbuf = Buffer.from(lines, 'base64');\n\n\tvar cipher, key, iv;\n\tif (headers['proc-type']) {\n\t\tvar parts = headers['proc-type'].split(',');\n\t\tif (parts[0] === '4' && parts[1] === 'ENCRYPTED') {\n\t\t\tif (typeof (options.passphrase) === 'string') {\n\t\t\t\toptions.passphrase = Buffer.from(\n\t\t\t\t options.passphrase, 'utf-8');\n\t\t\t}\n\t\t\tif (!Buffer.isBuffer(options.passphrase)) {\n\t\t\t\tthrow (new errors.KeyEncryptedError(\n\t\t\t\t options.filename, 'PEM'));\n\t\t\t} else {\n\t\t\t\tparts = headers['dek-info'].split(',');\n\t\t\t\tassert.ok(parts.length === 2);\n\t\t\t\tcipher = parts[0].toLowerCase();\n\t\t\t\tiv = Buffer.from(parts[1], 'hex');\n\t\t\t\tkey = utils.opensslKeyDeriv(cipher, iv,\n\t\t\t\t options.passphrase, 1).key;\n\t\t\t}\n\t\t}\n\t}\n\n\tif (alg && alg.toLowerCase() === 'encrypted') {\n\t\tvar eder = new asn1.BerReader(buf);\n\t\tvar pbesEnd;\n\t\teder.readSequence();\n\n\t\teder.readSequence();\n\t\tpbesEnd = eder.offset + eder.length;\n\n\t\tvar method = eder.readOID();\n\t\tif (method !== OID_PBES2) {\n\t\t\tthrow (new Error('Unsupported PEM/PKCS8 encryption ' +\n\t\t\t 'scheme: ' + method));\n\t\t}\n\n\t\teder.readSequence();\t/* PBES2-params */\n\n\t\teder.readSequence();\t/* keyDerivationFunc */\n\t\tvar kdfEnd = eder.offset + eder.length;\n\t\tvar kdfOid = eder.readOID();\n\t\tif (kdfOid !== OID_PBKDF2)\n\t\t\tthrow (new Error('Unsupported PBES2 KDF: ' + kdfOid));\n\t\teder.readSequence();\n\t\tvar salt = eder.readString(asn1.Ber.OctetString, true);\n\t\tvar iterations = eder.readInt();\n\t\tvar hashAlg = 'sha1';\n\t\tif (eder.offset < kdfEnd) {\n\t\t\teder.readSequence();\n\t\t\tvar hashAlgOid = eder.readOID();\n\t\t\thashAlg = OID_TO_HASH[hashAlgOid];\n\t\t\tif (hashAlg === undefined) {\n\t\t\t\tthrow (new Error('Unsupported PBKDF2 hash: ' +\n\t\t\t\t hashAlgOid));\n\t\t\t}\n\t\t}\n\t\teder._offset = kdfEnd;\n\n\t\teder.readSequence();\t/* encryptionScheme */\n\t\tvar cipherOid = eder.readOID();\n\t\tcipher = OID_TO_CIPHER[cipherOid];\n\t\tif (cipher === undefined) {\n\t\t\tthrow (new Error('Unsupported PBES2 cipher: ' +\n\t\t\t cipherOid));\n\t\t}\n\t\tiv = eder.readString(asn1.Ber.OctetString, true);\n\n\t\teder._offset = pbesEnd;\n\t\tbuf = eder.readString(asn1.Ber.OctetString, true);\n\n\t\tif (typeof (options.passphrase) === 'string') {\n\t\t\toptions.passphrase = Buffer.from(\n\t\t\t options.passphrase, 'utf-8');\n\t\t}\n\t\tif (!Buffer.isBuffer(options.passphrase)) {\n\t\t\tthrow (new errors.KeyEncryptedError(\n\t\t\t options.filename, 'PEM'));\n\t\t}\n\n\t\tvar cinfo = utils.opensshCipherInfo(cipher);\n\n\t\tcipher = cinfo.opensslName;\n\t\tkey = utils.pbkdf2(hashAlg, salt, iterations, cinfo.keySize,\n\t\t options.passphrase);\n\t\talg = undefined;\n\t}\n\n\tif (cipher && key && iv) {\n\t\tvar cipherStream = crypto.createDecipheriv(cipher, key, iv);\n\t\tvar chunk, chunks = [];\n\t\tcipherStream.once('error', function (e) {\n\t\t\tif (e.toString().indexOf('bad decrypt') !== -1) {\n\t\t\t\tthrow (new Error('Incorrect passphrase ' +\n\t\t\t\t 'supplied, could not decrypt key'));\n\t\t\t}\n\t\t\tthrow (e);\n\t\t});\n\t\tcipherStream.write(buf);\n\t\tcipherStream.end();\n\t\twhile ((chunk = cipherStream.read()) !== null)\n\t\t\tchunks.push(chunk);\n\t\tbuf = Buffer.concat(chunks);\n\t}\n\n\t/* The new OpenSSH internal format abuses PEM headers */\n\tif (alg && alg.toLowerCase() === 'openssh')\n\t\treturn (sshpriv.readSSHPrivate(type, buf, options));\n\tif (alg && alg.toLowerCase() === 'ssh2')\n\t\treturn (rfc4253.readType(type, buf, options));\n\n\tvar der = new asn1.BerReader(buf);\n\tder.originalInput = input;\n\n\t/*\n\t * All of the PEM file types start with a sequence tag, so chop it\n\t * off here\n\t */\n\tder.readSequence();\n\n\t/* PKCS#1 type keys name an algorithm in the banner explicitly */\n\tif (alg) {\n\t\tif (forceType)\n\t\t\tassert.strictEqual(forceType, 'pkcs1');\n\t\treturn (pkcs1.readPkcs1(alg, type, der));\n\t} else {\n\t\tif (forceType)\n\t\t\tassert.strictEqual(forceType, 'pkcs8');\n\t\treturn (pkcs8.readPkcs8(alg, type, der));\n\t}\n}\n\nfunction write(key, options, type) {\n\tassert.object(key);\n\n\tvar alg = {\n\t 'ecdsa': 'EC',\n\t 'rsa': 'RSA',\n\t 'dsa': 'DSA',\n\t 'ed25519': 'EdDSA'\n\t}[key.type];\n\tvar header;\n\n\tvar der = new asn1.BerWriter();\n\n\tif (PrivateKey.isPrivateKey(key)) {\n\t\tif (type && type === 'pkcs8') {\n\t\t\theader = 'PRIVATE KEY';\n\t\t\tpkcs8.writePkcs8(der, key);\n\t\t} else {\n\t\t\tif (type)\n\t\t\t\tassert.strictEqual(type, 'pkcs1');\n\t\t\theader = alg + ' PRIVATE KEY';\n\t\t\tpkcs1.writePkcs1(der, key);\n\t\t}\n\n\t} else if (Key.isKey(key)) {\n\t\tif (type && type === 'pkcs1') {\n\t\t\theader = alg + ' PUBLIC KEY';\n\t\t\tpkcs1.writePkcs1(der, key);\n\t\t} else {\n\t\t\tif (type)\n\t\t\t\tassert.strictEqual(type, 'pkcs8');\n\t\t\theader = 'PUBLIC KEY';\n\t\t\tpkcs8.writePkcs8(der, key);\n\t\t}\n\n\t} else {\n\t\tthrow (new Error('key is not a Key or PrivateKey'));\n\t}\n\n\tvar tmp = der.buffer.toString('base64');\n\tvar len = tmp.length + (tmp.length / 64) +\n\t 18 + 16 + header.length*2 + 10;\n\tvar buf = Buffer.alloc(len);\n\tvar o = 0;\n\to += buf.write('-----BEGIN ' + header + '-----\\n', o);\n\tfor (var i = 0; i < tmp.length; ) {\n\t\tvar limit = i + 64;\n\t\tif (limit > tmp.length)\n\t\t\tlimit = tmp.length;\n\t\to += buf.write(tmp.slice(i, limit), o);\n\t\tbuf[o++] = 10;\n\t\ti = limit;\n\t}\n\to += buf.write('-----END ' + header + '-----\\n', o);\n\n\treturn (buf.slice(0, o));\n}\n","// Copyright 2015 Joyent, Inc.\n\nmodule.exports = {\n\tread: read,\n\treadPkcs1: readPkcs1,\n\twrite: write,\n\twritePkcs1: writePkcs1\n};\n\nvar assert = require('assert-plus');\nvar asn1 = require('asn1');\nvar Buffer = require('safer-buffer').Buffer;\nvar algs = require('../algs');\nvar utils = require('../utils');\n\nvar Key = require('../key');\nvar PrivateKey = require('../private-key');\nvar pem = require('./pem');\n\nvar pkcs8 = require('./pkcs8');\nvar readECDSACurve = pkcs8.readECDSACurve;\n\nfunction read(buf, options) {\n\treturn (pem.read(buf, options, 'pkcs1'));\n}\n\nfunction write(key, options) {\n\treturn (pem.write(key, options, 'pkcs1'));\n}\n\n/* Helper to read in a single mpint */\nfunction readMPInt(der, nm) {\n\tassert.strictEqual(der.peek(), asn1.Ber.Integer,\n\t nm + ' is not an Integer');\n\treturn (utils.mpNormalize(der.readString(asn1.Ber.Integer, true)));\n}\n\nfunction readPkcs1(alg, type, der) {\n\tswitch (alg) {\n\tcase 'RSA':\n\t\tif (type === 'public')\n\t\t\treturn (readPkcs1RSAPublic(der));\n\t\telse if (type === 'private')\n\t\t\treturn (readPkcs1RSAPrivate(der));\n\t\tthrow (new Error('Unknown key type: ' + type));\n\tcase 'DSA':\n\t\tif (type === 'public')\n\t\t\treturn (readPkcs1DSAPublic(der));\n\t\telse if (type === 'private')\n\t\t\treturn (readPkcs1DSAPrivate(der));\n\t\tthrow (new Error('Unknown key type: ' + type));\n\tcase 'EC':\n\tcase 'ECDSA':\n\t\tif (type === 'private')\n\t\t\treturn (readPkcs1ECDSAPrivate(der));\n\t\telse if (type === 'public')\n\t\t\treturn (readPkcs1ECDSAPublic(der));\n\t\tthrow (new Error('Unknown key type: ' + type));\n\tcase 'EDDSA':\n\tcase 'EdDSA':\n\t\tif (type === 'private')\n\t\t\treturn (readPkcs1EdDSAPrivate(der));\n\t\tthrow (new Error(type + ' keys not supported with EdDSA'));\n\tdefault:\n\t\tthrow (new Error('Unknown key algo: ' + alg));\n\t}\n}\n\nfunction readPkcs1RSAPublic(der) {\n\t// modulus and exponent\n\tvar n = readMPInt(der, 'modulus');\n\tvar e = readMPInt(der, 'exponent');\n\n\t// now, make the key\n\tvar key = {\n\t\ttype: 'rsa',\n\t\tparts: [\n\t\t\t{ name: 'e', data: e },\n\t\t\t{ name: 'n', data: n }\n\t\t]\n\t};\n\n\treturn (new Key(key));\n}\n\nfunction readPkcs1RSAPrivate(der) {\n\tvar version = readMPInt(der, 'version');\n\tassert.strictEqual(version[0], 0);\n\n\t// modulus then public exponent\n\tvar n = readMPInt(der, 'modulus');\n\tvar e = readMPInt(der, 'public exponent');\n\tvar d = readMPInt(der, 'private exponent');\n\tvar p = readMPInt(der, 'prime1');\n\tvar q = readMPInt(der, 'prime2');\n\tvar dmodp = readMPInt(der, 'exponent1');\n\tvar dmodq = readMPInt(der, 'exponent2');\n\tvar iqmp = readMPInt(der, 'iqmp');\n\n\t// now, make the key\n\tvar key = {\n\t\ttype: 'rsa',\n\t\tparts: [\n\t\t\t{ name: 'n', data: n },\n\t\t\t{ name: 'e', data: e },\n\t\t\t{ name: 'd', data: d },\n\t\t\t{ name: 'iqmp', data: iqmp },\n\t\t\t{ name: 'p', data: p },\n\t\t\t{ name: 'q', data: q },\n\t\t\t{ name: 'dmodp', data: dmodp },\n\t\t\t{ name: 'dmodq', data: dmodq }\n\t\t]\n\t};\n\n\treturn (new PrivateKey(key));\n}\n\nfunction readPkcs1DSAPrivate(der) {\n\tvar version = readMPInt(der, 'version');\n\tassert.strictEqual(version.readUInt8(0), 0);\n\n\tvar p = readMPInt(der, 'p');\n\tvar q = readMPInt(der, 'q');\n\tvar g = readMPInt(der, 'g');\n\tvar y = readMPInt(der, 'y');\n\tvar x = readMPInt(der, 'x');\n\n\t// now, make the key\n\tvar key = {\n\t\ttype: 'dsa',\n\t\tparts: [\n\t\t\t{ name: 'p', data: p },\n\t\t\t{ name: 'q', data: q },\n\t\t\t{ name: 'g', data: g },\n\t\t\t{ name: 'y', data: y },\n\t\t\t{ name: 'x', data: x }\n\t\t]\n\t};\n\n\treturn (new PrivateKey(key));\n}\n\nfunction readPkcs1EdDSAPrivate(der) {\n\tvar version = readMPInt(der, 'version');\n\tassert.strictEqual(version.readUInt8(0), 1);\n\n\t// private key\n\tvar k = der.readString(asn1.Ber.OctetString, true);\n\n\tder.readSequence(0xa0);\n\tvar oid = der.readOID();\n\tassert.strictEqual(oid, '1.3.101.112', 'the ed25519 curve identifier');\n\n\tder.readSequence(0xa1);\n\tvar A = utils.readBitString(der);\n\n\tvar key = {\n\t\ttype: 'ed25519',\n\t\tparts: [\n\t\t\t{ name: 'A', data: utils.zeroPadToLength(A, 32) },\n\t\t\t{ name: 'k', data: k }\n\t\t]\n\t};\n\n\treturn (new PrivateKey(key));\n}\n\nfunction readPkcs1DSAPublic(der) {\n\tvar y = readMPInt(der, 'y');\n\tvar p = readMPInt(der, 'p');\n\tvar q = readMPInt(der, 'q');\n\tvar g = readMPInt(der, 'g');\n\n\tvar key = {\n\t\ttype: 'dsa',\n\t\tparts: [\n\t\t\t{ name: 'y', data: y },\n\t\t\t{ name: 'p', data: p },\n\t\t\t{ name: 'q', data: q },\n\t\t\t{ name: 'g', data: g }\n\t\t]\n\t};\n\n\treturn (new Key(key));\n}\n\nfunction readPkcs1ECDSAPublic(der) {\n\tder.readSequence();\n\n\tvar oid = der.readOID();\n\tassert.strictEqual(oid, '1.2.840.10045.2.1', 'must be ecPublicKey');\n\n\tvar curveOid = der.readOID();\n\n\tvar curve;\n\tvar curves = Object.keys(algs.curves);\n\tfor (var j = 0; j < curves.length; ++j) {\n\t\tvar c = curves[j];\n\t\tvar cd = algs.curves[c];\n\t\tif (cd.pkcs8oid === curveOid) {\n\t\t\tcurve = c;\n\t\t\tbreak;\n\t\t}\n\t}\n\tassert.string(curve, 'a known ECDSA named curve');\n\n\tvar Q = der.readString(asn1.Ber.BitString, true);\n\tQ = utils.ecNormalize(Q);\n\n\tvar key = {\n\t\ttype: 'ecdsa',\n\t\tparts: [\n\t\t\t{ name: 'curve', data: Buffer.from(curve) },\n\t\t\t{ name: 'Q', data: Q }\n\t\t]\n\t};\n\n\treturn (new Key(key));\n}\n\nfunction readPkcs1ECDSAPrivate(der) {\n\tvar version = readMPInt(der, 'version');\n\tassert.strictEqual(version.readUInt8(0), 1);\n\n\t// private key\n\tvar d = der.readString(asn1.Ber.OctetString, true);\n\n\tder.readSequence(0xa0);\n\tvar curve = readECDSACurve(der);\n\tassert.string(curve, 'a known elliptic curve');\n\n\tder.readSequence(0xa1);\n\tvar Q = der.readString(asn1.Ber.BitString, true);\n\tQ = utils.ecNormalize(Q);\n\n\tvar key = {\n\t\ttype: 'ecdsa',\n\t\tparts: [\n\t\t\t{ name: 'curve', data: Buffer.from(curve) },\n\t\t\t{ name: 'Q', data: Q },\n\t\t\t{ name: 'd', data: d }\n\t\t]\n\t};\n\n\treturn (new PrivateKey(key));\n}\n\nfunction writePkcs1(der, key) {\n\tder.startSequence();\n\n\tswitch (key.type) {\n\tcase 'rsa':\n\t\tif (PrivateKey.isPrivateKey(key))\n\t\t\twritePkcs1RSAPrivate(der, key);\n\t\telse\n\t\t\twritePkcs1RSAPublic(der, key);\n\t\tbreak;\n\tcase 'dsa':\n\t\tif (PrivateKey.isPrivateKey(key))\n\t\t\twritePkcs1DSAPrivate(der, key);\n\t\telse\n\t\t\twritePkcs1DSAPublic(der, key);\n\t\tbreak;\n\tcase 'ecdsa':\n\t\tif (PrivateKey.isPrivateKey(key))\n\t\t\twritePkcs1ECDSAPrivate(der, key);\n\t\telse\n\t\t\twritePkcs1ECDSAPublic(der, key);\n\t\tbreak;\n\tcase 'ed25519':\n\t\tif (PrivateKey.isPrivateKey(key))\n\t\t\twritePkcs1EdDSAPrivate(der, key);\n\t\telse\n\t\t\twritePkcs1EdDSAPublic(der, key);\n\t\tbreak;\n\tdefault:\n\t\tthrow (new Error('Unknown key algo: ' + key.type));\n\t}\n\n\tder.endSequence();\n}\n\nfunction writePkcs1RSAPublic(der, key) {\n\tder.writeBuffer(key.part.n.data, asn1.Ber.Integer);\n\tder.writeBuffer(key.part.e.data, asn1.Ber.Integer);\n}\n\nfunction writePkcs1RSAPrivate(der, key) {\n\tvar ver = Buffer.from([0]);\n\tder.writeBuffer(ver, asn1.Ber.Integer);\n\n\tder.writeBuffer(key.part.n.data, asn1.Ber.Integer);\n\tder.writeBuffer(key.part.e.data, asn1.Ber.Integer);\n\tder.writeBuffer(key.part.d.data, asn1.Ber.Integer);\n\tder.writeBuffer(key.part.p.data, asn1.Ber.Integer);\n\tder.writeBuffer(key.part.q.data, asn1.Ber.Integer);\n\tif (!key.part.dmodp || !key.part.dmodq)\n\t\tutils.addRSAMissing(key);\n\tder.writeBuffer(key.part.dmodp.data, asn1.Ber.Integer);\n\tder.writeBuffer(key.part.dmodq.data, asn1.Ber.Integer);\n\tder.writeBuffer(key.part.iqmp.data, asn1.Ber.Integer);\n}\n\nfunction writePkcs1DSAPrivate(der, key) {\n\tvar ver = Buffer.from([0]);\n\tder.writeBuffer(ver, asn1.Ber.Integer);\n\n\tder.writeBuffer(key.part.p.data, asn1.Ber.Integer);\n\tder.writeBuffer(key.part.q.data, asn1.Ber.Integer);\n\tder.writeBuffer(key.part.g.data, asn1.Ber.Integer);\n\tder.writeBuffer(key.part.y.data, asn1.Ber.Integer);\n\tder.writeBuffer(key.part.x.data, asn1.Ber.Integer);\n}\n\nfunction writePkcs1DSAPublic(der, key) {\n\tder.writeBuffer(key.part.y.data, asn1.Ber.Integer);\n\tder.writeBuffer(key.part.p.data, asn1.Ber.Integer);\n\tder.writeBuffer(key.part.q.data, asn1.Ber.Integer);\n\tder.writeBuffer(key.part.g.data, asn1.Ber.Integer);\n}\n\nfunction writePkcs1ECDSAPublic(der, key) {\n\tder.startSequence();\n\n\tder.writeOID('1.2.840.10045.2.1'); /* ecPublicKey */\n\tvar curve = key.part.curve.data.toString();\n\tvar curveOid = algs.curves[curve].pkcs8oid;\n\tassert.string(curveOid, 'a known ECDSA named curve');\n\tder.writeOID(curveOid);\n\n\tder.endSequence();\n\n\tvar Q = utils.ecNormalize(key.part.Q.data, true);\n\tder.writeBuffer(Q, asn1.Ber.BitString);\n}\n\nfunction writePkcs1ECDSAPrivate(der, key) {\n\tvar ver = Buffer.from([1]);\n\tder.writeBuffer(ver, asn1.Ber.Integer);\n\n\tder.writeBuffer(key.part.d.data, asn1.Ber.OctetString);\n\n\tder.startSequence(0xa0);\n\tvar curve = key.part.curve.data.toString();\n\tvar curveOid = algs.curves[curve].pkcs8oid;\n\tassert.string(curveOid, 'a known ECDSA named curve');\n\tder.writeOID(curveOid);\n\tder.endSequence();\n\n\tder.startSequence(0xa1);\n\tvar Q = utils.ecNormalize(key.part.Q.data, true);\n\tder.writeBuffer(Q, asn1.Ber.BitString);\n\tder.endSequence();\n}\n\nfunction writePkcs1EdDSAPrivate(der, key) {\n\tvar ver = Buffer.from([1]);\n\tder.writeBuffer(ver, asn1.Ber.Integer);\n\n\tder.writeBuffer(key.part.k.data, asn1.Ber.OctetString);\n\n\tder.startSequence(0xa0);\n\tder.writeOID('1.3.101.112');\n\tder.endSequence();\n\n\tder.startSequence(0xa1);\n\tutils.writeBitString(der, key.part.A.data);\n\tder.endSequence();\n}\n\nfunction writePkcs1EdDSAPublic(der, key) {\n\tthrow (new Error('Public keys are not supported for EdDSA PKCS#1'));\n}\n","// Copyright 2018 Joyent, Inc.\n\nmodule.exports = {\n\tread: read,\n\treadPkcs8: readPkcs8,\n\twrite: write,\n\twritePkcs8: writePkcs8,\n\tpkcs8ToBuffer: pkcs8ToBuffer,\n\n\treadECDSACurve: readECDSACurve,\n\twriteECDSACurve: writeECDSACurve\n};\n\nvar assert = require('assert-plus');\nvar asn1 = require('asn1');\nvar Buffer = require('safer-buffer').Buffer;\nvar algs = require('../algs');\nvar utils = require('../utils');\nvar Key = require('../key');\nvar PrivateKey = require('../private-key');\nvar pem = require('./pem');\n\nfunction read(buf, options) {\n\treturn (pem.read(buf, options, 'pkcs8'));\n}\n\nfunction write(key, options) {\n\treturn (pem.write(key, options, 'pkcs8'));\n}\n\n/* Helper to read in a single mpint */\nfunction readMPInt(der, nm) {\n\tassert.strictEqual(der.peek(), asn1.Ber.Integer,\n\t nm + ' is not an Integer');\n\treturn (utils.mpNormalize(der.readString(asn1.Ber.Integer, true)));\n}\n\nfunction readPkcs8(alg, type, der) {\n\t/* Private keys in pkcs#8 format have a weird extra int */\n\tif (der.peek() === asn1.Ber.Integer) {\n\t\tassert.strictEqual(type, 'private',\n\t\t 'unexpected Integer at start of public key');\n\t\tder.readString(asn1.Ber.Integer, true);\n\t}\n\n\tder.readSequence();\n\tvar next = der.offset + der.length;\n\n\tvar oid = der.readOID();\n\tswitch (oid) {\n\tcase '1.2.840.113549.1.1.1':\n\t\tder._offset = next;\n\t\tif (type === 'public')\n\t\t\treturn (readPkcs8RSAPublic(der));\n\t\telse\n\t\t\treturn (readPkcs8RSAPrivate(der));\n\tcase '1.2.840.10040.4.1':\n\t\tif (type === 'public')\n\t\t\treturn (readPkcs8DSAPublic(der));\n\t\telse\n\t\t\treturn (readPkcs8DSAPrivate(der));\n\tcase '1.2.840.10045.2.1':\n\t\tif (type === 'public')\n\t\t\treturn (readPkcs8ECDSAPublic(der));\n\t\telse\n\t\t\treturn (readPkcs8ECDSAPrivate(der));\n\tcase '1.3.101.112':\n\t\tif (type === 'public') {\n\t\t\treturn (readPkcs8EdDSAPublic(der));\n\t\t} else {\n\t\t\treturn (readPkcs8EdDSAPrivate(der));\n\t\t}\n\tcase '1.3.101.110':\n\t\tif (type === 'public') {\n\t\t\treturn (readPkcs8X25519Public(der));\n\t\t} else {\n\t\t\treturn (readPkcs8X25519Private(der));\n\t\t}\n\tdefault:\n\t\tthrow (new Error('Unknown key type OID ' + oid));\n\t}\n}\n\nfunction readPkcs8RSAPublic(der) {\n\t// bit string sequence\n\tder.readSequence(asn1.Ber.BitString);\n\tder.readByte();\n\tder.readSequence();\n\n\t// modulus\n\tvar n = readMPInt(der, 'modulus');\n\tvar e = readMPInt(der, 'exponent');\n\n\t// now, make the key\n\tvar key = {\n\t\ttype: 'rsa',\n\t\tsource: der.originalInput,\n\t\tparts: [\n\t\t\t{ name: 'e', data: e },\n\t\t\t{ name: 'n', data: n }\n\t\t]\n\t};\n\n\treturn (new Key(key));\n}\n\nfunction readPkcs8RSAPrivate(der) {\n\tder.readSequence(asn1.Ber.OctetString);\n\tder.readSequence();\n\n\tvar ver = readMPInt(der, 'version');\n\tassert.equal(ver[0], 0x0, 'unknown RSA private key version');\n\n\t// modulus then public exponent\n\tvar n = readMPInt(der, 'modulus');\n\tvar e = readMPInt(der, 'public exponent');\n\tvar d = readMPInt(der, 'private exponent');\n\tvar p = readMPInt(der, 'prime1');\n\tvar q = readMPInt(der, 'prime2');\n\tvar dmodp = readMPInt(der, 'exponent1');\n\tvar dmodq = readMPInt(der, 'exponent2');\n\tvar iqmp = readMPInt(der, 'iqmp');\n\n\t// now, make the key\n\tvar key = {\n\t\ttype: 'rsa',\n\t\tparts: [\n\t\t\t{ name: 'n', data: n },\n\t\t\t{ name: 'e', data: e },\n\t\t\t{ name: 'd', data: d },\n\t\t\t{ name: 'iqmp', data: iqmp },\n\t\t\t{ name: 'p', data: p },\n\t\t\t{ name: 'q', data: q },\n\t\t\t{ name: 'dmodp', data: dmodp },\n\t\t\t{ name: 'dmodq', data: dmodq }\n\t\t]\n\t};\n\n\treturn (new PrivateKey(key));\n}\n\nfunction readPkcs8DSAPublic(der) {\n\tder.readSequence();\n\n\tvar p = readMPInt(der, 'p');\n\tvar q = readMPInt(der, 'q');\n\tvar g = readMPInt(der, 'g');\n\n\t// bit string sequence\n\tder.readSequence(asn1.Ber.BitString);\n\tder.readByte();\n\n\tvar y = readMPInt(der, 'y');\n\n\t// now, make the key\n\tvar key = {\n\t\ttype: 'dsa',\n\t\tparts: [\n\t\t\t{ name: 'p', data: p },\n\t\t\t{ name: 'q', data: q },\n\t\t\t{ name: 'g', data: g },\n\t\t\t{ name: 'y', data: y }\n\t\t]\n\t};\n\n\treturn (new Key(key));\n}\n\nfunction readPkcs8DSAPrivate(der) {\n\tder.readSequence();\n\n\tvar p = readMPInt(der, 'p');\n\tvar q = readMPInt(der, 'q');\n\tvar g = readMPInt(der, 'g');\n\n\tder.readSequence(asn1.Ber.OctetString);\n\tvar x = readMPInt(der, 'x');\n\n\t/* The pkcs#8 format does not include the public key */\n\tvar y = utils.calculateDSAPublic(g, p, x);\n\n\tvar key = {\n\t\ttype: 'dsa',\n\t\tparts: [\n\t\t\t{ name: 'p', data: p },\n\t\t\t{ name: 'q', data: q },\n\t\t\t{ name: 'g', data: g },\n\t\t\t{ name: 'y', data: y },\n\t\t\t{ name: 'x', data: x }\n\t\t]\n\t};\n\n\treturn (new PrivateKey(key));\n}\n\nfunction readECDSACurve(der) {\n\tvar curveName, curveNames;\n\tvar j, c, cd;\n\n\tif (der.peek() === asn1.Ber.OID) {\n\t\tvar oid = der.readOID();\n\n\t\tcurveNames = Object.keys(algs.curves);\n\t\tfor (j = 0; j < curveNames.length; ++j) {\n\t\t\tc = curveNames[j];\n\t\t\tcd = algs.curves[c];\n\t\t\tif (cd.pkcs8oid === oid) {\n\t\t\t\tcurveName = c;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t} else {\n\t\t// ECParameters sequence\n\t\tder.readSequence();\n\t\tvar version = der.readString(asn1.Ber.Integer, true);\n\t\tassert.strictEqual(version[0], 1, 'ECDSA key not version 1');\n\n\t\tvar curve = {};\n\n\t\t// FieldID sequence\n\t\tder.readSequence();\n\t\tvar fieldTypeOid = der.readOID();\n\t\tassert.strictEqual(fieldTypeOid, '1.2.840.10045.1.1',\n\t\t 'ECDSA key is not from a prime-field');\n\t\tvar p = curve.p = utils.mpNormalize(\n\t\t der.readString(asn1.Ber.Integer, true));\n\t\t/*\n\t\t * p always starts with a 1 bit, so count the zeros to get its\n\t\t * real size.\n\t\t */\n\t\tcurve.size = p.length * 8 - utils.countZeros(p);\n\n\t\t// Curve sequence\n\t\tder.readSequence();\n\t\tcurve.a = utils.mpNormalize(\n\t\t der.readString(asn1.Ber.OctetString, true));\n\t\tcurve.b = utils.mpNormalize(\n\t\t der.readString(asn1.Ber.OctetString, true));\n\t\tif (der.peek() === asn1.Ber.BitString)\n\t\t\tcurve.s = der.readString(asn1.Ber.BitString, true);\n\n\t\t// Combined Gx and Gy\n\t\tcurve.G = der.readString(asn1.Ber.OctetString, true);\n\t\tassert.strictEqual(curve.G[0], 0x4,\n\t\t 'uncompressed G is required');\n\n\t\tcurve.n = utils.mpNormalize(\n\t\t der.readString(asn1.Ber.Integer, true));\n\t\tcurve.h = utils.mpNormalize(\n\t\t der.readString(asn1.Ber.Integer, true));\n\t\tassert.strictEqual(curve.h[0], 0x1, 'a cofactor=1 curve is ' +\n\t\t 'required');\n\n\t\tcurveNames = Object.keys(algs.curves);\n\t\tvar ks = Object.keys(curve);\n\t\tfor (j = 0; j < curveNames.length; ++j) {\n\t\t\tc = curveNames[j];\n\t\t\tcd = algs.curves[c];\n\t\t\tvar equal = true;\n\t\t\tfor (var i = 0; i < ks.length; ++i) {\n\t\t\t\tvar k = ks[i];\n\t\t\t\tif (cd[k] === undefined)\n\t\t\t\t\tcontinue;\n\t\t\t\tif (typeof (cd[k]) === 'object' &&\n\t\t\t\t cd[k].equals !== undefined) {\n\t\t\t\t\tif (!cd[k].equals(curve[k])) {\n\t\t\t\t\t\tequal = false;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t} else if (Buffer.isBuffer(cd[k])) {\n\t\t\t\t\tif (cd[k].toString('binary')\n\t\t\t\t\t !== curve[k].toString('binary')) {\n\t\t\t\t\t\tequal = false;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tif (cd[k] !== curve[k]) {\n\t\t\t\t\t\tequal = false;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (equal) {\n\t\t\t\tcurveName = c;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n\treturn (curveName);\n}\n\nfunction readPkcs8ECDSAPrivate(der) {\n\tvar curveName = readECDSACurve(der);\n\tassert.string(curveName, 'a known elliptic curve');\n\n\tder.readSequence(asn1.Ber.OctetString);\n\tder.readSequence();\n\n\tvar version = readMPInt(der, 'version');\n\tassert.equal(version[0], 1, 'unknown version of ECDSA key');\n\n\tvar d = der.readString(asn1.Ber.OctetString, true);\n\tvar Q;\n\n\tif (der.peek() == 0xa0) {\n\t\tder.readSequence(0xa0);\n\t\tder._offset += der.length;\n\t}\n\tif (der.peek() == 0xa1) {\n\t\tder.readSequence(0xa1);\n\t\tQ = der.readString(asn1.Ber.BitString, true);\n\t\tQ = utils.ecNormalize(Q);\n\t}\n\n\tif (Q === undefined) {\n\t\tvar pub = utils.publicFromPrivateECDSA(curveName, d);\n\t\tQ = pub.part.Q.data;\n\t}\n\n\tvar key = {\n\t\ttype: 'ecdsa',\n\t\tparts: [\n\t\t\t{ name: 'curve', data: Buffer.from(curveName) },\n\t\t\t{ name: 'Q', data: Q },\n\t\t\t{ name: 'd', data: d }\n\t\t]\n\t};\n\n\treturn (new PrivateKey(key));\n}\n\nfunction readPkcs8ECDSAPublic(der) {\n\tvar curveName = readECDSACurve(der);\n\tassert.string(curveName, 'a known elliptic curve');\n\n\tvar Q = der.readString(asn1.Ber.BitString, true);\n\tQ = utils.ecNormalize(Q);\n\n\tvar key = {\n\t\ttype: 'ecdsa',\n\t\tparts: [\n\t\t\t{ name: 'curve', data: Buffer.from(curveName) },\n\t\t\t{ name: 'Q', data: Q }\n\t\t]\n\t};\n\n\treturn (new Key(key));\n}\n\nfunction readPkcs8EdDSAPublic(der) {\n\tif (der.peek() === 0x00)\n\t\tder.readByte();\n\n\tvar A = utils.readBitString(der);\n\n\tvar key = {\n\t\ttype: 'ed25519',\n\t\tparts: [\n\t\t\t{ name: 'A', data: utils.zeroPadToLength(A, 32) }\n\t\t]\n\t};\n\n\treturn (new Key(key));\n}\n\nfunction readPkcs8X25519Public(der) {\n\tvar A = utils.readBitString(der);\n\n\tvar key = {\n\t\ttype: 'curve25519',\n\t\tparts: [\n\t\t\t{ name: 'A', data: utils.zeroPadToLength(A, 32) }\n\t\t]\n\t};\n\n\treturn (new Key(key));\n}\n\nfunction readPkcs8EdDSAPrivate(der) {\n\tif (der.peek() === 0x00)\n\t\tder.readByte();\n\n\tder.readSequence(asn1.Ber.OctetString);\n\tvar k = der.readString(asn1.Ber.OctetString, true);\n\tk = utils.zeroPadToLength(k, 32);\n\n\tvar A;\n\tif (der.peek() === asn1.Ber.BitString) {\n\t\tA = utils.readBitString(der);\n\t\tA = utils.zeroPadToLength(A, 32);\n\t} else {\n\t\tA = utils.calculateED25519Public(k);\n\t}\n\n\tvar key = {\n\t\ttype: 'ed25519',\n\t\tparts: [\n\t\t\t{ name: 'A', data: utils.zeroPadToLength(A, 32) },\n\t\t\t{ name: 'k', data: utils.zeroPadToLength(k, 32) }\n\t\t]\n\t};\n\n\treturn (new PrivateKey(key));\n}\n\nfunction readPkcs8X25519Private(der) {\n\tif (der.peek() === 0x00)\n\t\tder.readByte();\n\n\tder.readSequence(asn1.Ber.OctetString);\n\tvar k = der.readString(asn1.Ber.OctetString, true);\n\tk = utils.zeroPadToLength(k, 32);\n\n\tvar A = utils.calculateX25519Public(k);\n\n\tvar key = {\n\t\ttype: 'curve25519',\n\t\tparts: [\n\t\t\t{ name: 'A', data: utils.zeroPadToLength(A, 32) },\n\t\t\t{ name: 'k', data: utils.zeroPadToLength(k, 32) }\n\t\t]\n\t};\n\n\treturn (new PrivateKey(key));\n}\n\nfunction pkcs8ToBuffer(key) {\n\tvar der = new asn1.BerWriter();\n\twritePkcs8(der, key);\n\treturn (der.buffer);\n}\n\nfunction writePkcs8(der, key) {\n\tder.startSequence();\n\n\tif (PrivateKey.isPrivateKey(key)) {\n\t\tvar sillyInt = Buffer.from([0]);\n\t\tder.writeBuffer(sillyInt, asn1.Ber.Integer);\n\t}\n\n\tder.startSequence();\n\tswitch (key.type) {\n\tcase 'rsa':\n\t\tder.writeOID('1.2.840.113549.1.1.1');\n\t\tif (PrivateKey.isPrivateKey(key))\n\t\t\twritePkcs8RSAPrivate(key, der);\n\t\telse\n\t\t\twritePkcs8RSAPublic(key, der);\n\t\tbreak;\n\tcase 'dsa':\n\t\tder.writeOID('1.2.840.10040.4.1');\n\t\tif (PrivateKey.isPrivateKey(key))\n\t\t\twritePkcs8DSAPrivate(key, der);\n\t\telse\n\t\t\twritePkcs8DSAPublic(key, der);\n\t\tbreak;\n\tcase 'ecdsa':\n\t\tder.writeOID('1.2.840.10045.2.1');\n\t\tif (PrivateKey.isPrivateKey(key))\n\t\t\twritePkcs8ECDSAPrivate(key, der);\n\t\telse\n\t\t\twritePkcs8ECDSAPublic(key, der);\n\t\tbreak;\n\tcase 'ed25519':\n\t\tder.writeOID('1.3.101.112');\n\t\tif (PrivateKey.isPrivateKey(key))\n\t\t\tthrow (new Error('Ed25519 private keys in pkcs8 ' +\n\t\t\t 'format are not supported'));\n\t\twritePkcs8EdDSAPublic(key, der);\n\t\tbreak;\n\tdefault:\n\t\tthrow (new Error('Unsupported key type: ' + key.type));\n\t}\n\n\tder.endSequence();\n}\n\nfunction writePkcs8RSAPrivate(key, der) {\n\tder.writeNull();\n\tder.endSequence();\n\n\tder.startSequence(asn1.Ber.OctetString);\n\tder.startSequence();\n\n\tvar version = Buffer.from([0]);\n\tder.writeBuffer(version, asn1.Ber.Integer);\n\n\tder.writeBuffer(key.part.n.data, asn1.Ber.Integer);\n\tder.writeBuffer(key.part.e.data, asn1.Ber.Integer);\n\tder.writeBuffer(key.part.d.data, asn1.Ber.Integer);\n\tder.writeBuffer(key.part.p.data, asn1.Ber.Integer);\n\tder.writeBuffer(key.part.q.data, asn1.Ber.Integer);\n\tif (!key.part.dmodp || !key.part.dmodq)\n\t\tutils.addRSAMissing(key);\n\tder.writeBuffer(key.part.dmodp.data, asn1.Ber.Integer);\n\tder.writeBuffer(key.part.dmodq.data, asn1.Ber.Integer);\n\tder.writeBuffer(key.part.iqmp.data, asn1.Ber.Integer);\n\n\tder.endSequence();\n\tder.endSequence();\n}\n\nfunction writePkcs8RSAPublic(key, der) {\n\tder.writeNull();\n\tder.endSequence();\n\n\tder.startSequence(asn1.Ber.BitString);\n\tder.writeByte(0x00);\n\n\tder.startSequence();\n\tder.writeBuffer(key.part.n.data, asn1.Ber.Integer);\n\tder.writeBuffer(key.part.e.data, asn1.Ber.Integer);\n\tder.endSequence();\n\n\tder.endSequence();\n}\n\nfunction writePkcs8DSAPrivate(key, der) {\n\tder.startSequence();\n\tder.writeBuffer(key.part.p.data, asn1.Ber.Integer);\n\tder.writeBuffer(key.part.q.data, asn1.Ber.Integer);\n\tder.writeBuffer(key.part.g.data, asn1.Ber.Integer);\n\tder.endSequence();\n\n\tder.endSequence();\n\n\tder.startSequence(asn1.Ber.OctetString);\n\tder.writeBuffer(key.part.x.data, asn1.Ber.Integer);\n\tder.endSequence();\n}\n\nfunction writePkcs8DSAPublic(key, der) {\n\tder.startSequence();\n\tder.writeBuffer(key.part.p.data, asn1.Ber.Integer);\n\tder.writeBuffer(key.part.q.data, asn1.Ber.Integer);\n\tder.writeBuffer(key.part.g.data, asn1.Ber.Integer);\n\tder.endSequence();\n\tder.endSequence();\n\n\tder.startSequence(asn1.Ber.BitString);\n\tder.writeByte(0x00);\n\tder.writeBuffer(key.part.y.data, asn1.Ber.Integer);\n\tder.endSequence();\n}\n\nfunction writeECDSACurve(key, der) {\n\tvar curve = algs.curves[key.curve];\n\tif (curve.pkcs8oid) {\n\t\t/* This one has a name in pkcs#8, so just write the oid */\n\t\tder.writeOID(curve.pkcs8oid);\n\n\t} else {\n\t\t// ECParameters sequence\n\t\tder.startSequence();\n\n\t\tvar version = Buffer.from([1]);\n\t\tder.writeBuffer(version, asn1.Ber.Integer);\n\n\t\t// FieldID sequence\n\t\tder.startSequence();\n\t\tder.writeOID('1.2.840.10045.1.1'); // prime-field\n\t\tder.writeBuffer(curve.p, asn1.Ber.Integer);\n\t\tder.endSequence();\n\n\t\t// Curve sequence\n\t\tder.startSequence();\n\t\tvar a = curve.p;\n\t\tif (a[0] === 0x0)\n\t\t\ta = a.slice(1);\n\t\tder.writeBuffer(a, asn1.Ber.OctetString);\n\t\tder.writeBuffer(curve.b, asn1.Ber.OctetString);\n\t\tder.writeBuffer(curve.s, asn1.Ber.BitString);\n\t\tder.endSequence();\n\n\t\tder.writeBuffer(curve.G, asn1.Ber.OctetString);\n\t\tder.writeBuffer(curve.n, asn1.Ber.Integer);\n\t\tvar h = curve.h;\n\t\tif (!h) {\n\t\t\th = Buffer.from([1]);\n\t\t}\n\t\tder.writeBuffer(h, asn1.Ber.Integer);\n\n\t\t// ECParameters\n\t\tder.endSequence();\n\t}\n}\n\nfunction writePkcs8ECDSAPublic(key, der) {\n\twriteECDSACurve(key, der);\n\tder.endSequence();\n\n\tvar Q = utils.ecNormalize(key.part.Q.data, true);\n\tder.writeBuffer(Q, asn1.Ber.BitString);\n}\n\nfunction writePkcs8ECDSAPrivate(key, der) {\n\twriteECDSACurve(key, der);\n\tder.endSequence();\n\n\tder.startSequence(asn1.Ber.OctetString);\n\tder.startSequence();\n\n\tvar version = Buffer.from([1]);\n\tder.writeBuffer(version, asn1.Ber.Integer);\n\n\tder.writeBuffer(key.part.d.data, asn1.Ber.OctetString);\n\n\tder.startSequence(0xa1);\n\tvar Q = utils.ecNormalize(key.part.Q.data, true);\n\tder.writeBuffer(Q, asn1.Ber.BitString);\n\tder.endSequence();\n\n\tder.endSequence();\n\tder.endSequence();\n}\n\nfunction writePkcs8EdDSAPublic(key, der) {\n\tder.endSequence();\n\n\tutils.writeBitString(der, key.part.A.data);\n}\n\nfunction writePkcs8EdDSAPrivate(key, der) {\n\tder.endSequence();\n\n\tvar k = utils.mpNormalize(key.part.k.data, true);\n\tder.startSequence(asn1.Ber.OctetString);\n\tder.writeBuffer(k, asn1.Ber.OctetString);\n\tder.endSequence();\n}\n","// Copyright 2018 Joyent, Inc.\n\nmodule.exports = {\n\tread: read,\n\twrite: write\n};\n\nvar assert = require('assert-plus');\nvar Buffer = require('safer-buffer').Buffer;\nvar rfc4253 = require('./rfc4253');\nvar Key = require('../key');\n\nvar errors = require('../errors');\n\nfunction read(buf, options) {\n\tvar lines = buf.toString('ascii').split(/[\\r\\n]+/);\n\tvar found = false;\n\tvar parts;\n\tvar si = 0;\n\twhile (si < lines.length) {\n\t\tparts = splitHeader(lines[si++]);\n\t\tif (parts &&\n\t\t parts[0].toLowerCase() === 'putty-user-key-file-2') {\n\t\t\tfound = true;\n\t\t\tbreak;\n\t\t}\n\t}\n\tif (!found) {\n\t\tthrow (new Error('No PuTTY format first line found'));\n\t}\n\tvar alg = parts[1];\n\n\tparts = splitHeader(lines[si++]);\n\tassert.equal(parts[0].toLowerCase(), 'encryption');\n\n\tparts = splitHeader(lines[si++]);\n\tassert.equal(parts[0].toLowerCase(), 'comment');\n\tvar comment = parts[1];\n\n\tparts = splitHeader(lines[si++]);\n\tassert.equal(parts[0].toLowerCase(), 'public-lines');\n\tvar publicLines = parseInt(parts[1], 10);\n\tif (!isFinite(publicLines) || publicLines < 0 ||\n\t publicLines > lines.length) {\n\t\tthrow (new Error('Invalid public-lines count'));\n\t}\n\n\tvar publicBuf = Buffer.from(\n\t lines.slice(si, si + publicLines).join(''), 'base64');\n\tvar keyType = rfc4253.algToKeyType(alg);\n\tvar key = rfc4253.read(publicBuf);\n\tif (key.type !== keyType) {\n\t\tthrow (new Error('Outer key algorithm mismatch'));\n\t}\n\tkey.comment = comment;\n\treturn (key);\n}\n\nfunction splitHeader(line) {\n\tvar idx = line.indexOf(':');\n\tif (idx === -1)\n\t\treturn (null);\n\tvar header = line.slice(0, idx);\n\t++idx;\n\twhile (line[idx] === ' ')\n\t\t++idx;\n\tvar rest = line.slice(idx);\n\treturn ([header, rest]);\n}\n\nfunction write(key, options) {\n\tassert.object(key);\n\tif (!Key.isKey(key))\n\t\tthrow (new Error('Must be a public key'));\n\n\tvar alg = rfc4253.keyTypeToAlg(key);\n\tvar buf = rfc4253.write(key);\n\tvar comment = key.comment || '';\n\n\tvar b64 = buf.toString('base64');\n\tvar lines = wrap(b64, 64);\n\n\tlines.unshift('Public-Lines: ' + lines.length);\n\tlines.unshift('Comment: ' + comment);\n\tlines.unshift('Encryption: none');\n\tlines.unshift('PuTTY-User-Key-File-2: ' + alg);\n\n\treturn (Buffer.from(lines.join('\\n') + '\\n'));\n}\n\nfunction wrap(txt, len) {\n\tvar lines = [];\n\tvar pos = 0;\n\twhile (pos < txt.length) {\n\t\tlines.push(txt.slice(pos, pos + 64));\n\t\tpos += 64;\n\t}\n\treturn (lines);\n}\n","// Copyright 2015 Joyent, Inc.\n\nmodule.exports = {\n\tread: read.bind(undefined, false, undefined),\n\treadType: read.bind(undefined, false),\n\twrite: write,\n\t/* semi-private api, used by sshpk-agent */\n\treadPartial: read.bind(undefined, true),\n\n\t/* shared with ssh format */\n\treadInternal: read,\n\tkeyTypeToAlg: keyTypeToAlg,\n\talgToKeyType: algToKeyType\n};\n\nvar assert = require('assert-plus');\nvar Buffer = require('safer-buffer').Buffer;\nvar algs = require('../algs');\nvar utils = require('../utils');\nvar Key = require('../key');\nvar PrivateKey = require('../private-key');\nvar SSHBuffer = require('../ssh-buffer');\n\nfunction algToKeyType(alg) {\n\tassert.string(alg);\n\tif (alg === 'ssh-dss')\n\t\treturn ('dsa');\n\telse if (alg === 'ssh-rsa')\n\t\treturn ('rsa');\n\telse if (alg === 'ssh-ed25519')\n\t\treturn ('ed25519');\n\telse if (alg === 'ssh-curve25519')\n\t\treturn ('curve25519');\n\telse if (alg.match(/^ecdsa-sha2-/))\n\t\treturn ('ecdsa');\n\telse\n\t\tthrow (new Error('Unknown algorithm ' + alg));\n}\n\nfunction keyTypeToAlg(key) {\n\tassert.object(key);\n\tif (key.type === 'dsa')\n\t\treturn ('ssh-dss');\n\telse if (key.type === 'rsa')\n\t\treturn ('ssh-rsa');\n\telse if (key.type === 'ed25519')\n\t\treturn ('ssh-ed25519');\n\telse if (key.type === 'curve25519')\n\t\treturn ('ssh-curve25519');\n\telse if (key.type === 'ecdsa')\n\t\treturn ('ecdsa-sha2-' + key.part.curve.data.toString());\n\telse\n\t\tthrow (new Error('Unknown key type ' + key.type));\n}\n\nfunction read(partial, type, buf, options) {\n\tif (typeof (buf) === 'string')\n\t\tbuf = Buffer.from(buf);\n\tassert.buffer(buf, 'buf');\n\n\tvar key = {};\n\n\tvar parts = key.parts = [];\n\tvar sshbuf = new SSHBuffer({buffer: buf});\n\n\tvar alg = sshbuf.readString();\n\tassert.ok(!sshbuf.atEnd(), 'key must have at least one part');\n\n\tkey.type = algToKeyType(alg);\n\n\tvar partCount = algs.info[key.type].parts.length;\n\tif (type && type === 'private')\n\t\tpartCount = algs.privInfo[key.type].parts.length;\n\n\twhile (!sshbuf.atEnd() && parts.length < partCount)\n\t\tparts.push(sshbuf.readPart());\n\twhile (!partial && !sshbuf.atEnd())\n\t\tparts.push(sshbuf.readPart());\n\n\tassert.ok(parts.length >= 1,\n\t 'key must have at least one part');\n\tassert.ok(partial || sshbuf.atEnd(),\n\t 'leftover bytes at end of key');\n\n\tvar Constructor = Key;\n\tvar algInfo = algs.info[key.type];\n\tif (type === 'private' || algInfo.parts.length !== parts.length) {\n\t\talgInfo = algs.privInfo[key.type];\n\t\tConstructor = PrivateKey;\n\t}\n\tassert.strictEqual(algInfo.parts.length, parts.length);\n\n\tif (key.type === 'ecdsa') {\n\t\tvar res = /^ecdsa-sha2-(.+)$/.exec(alg);\n\t\tassert.ok(res !== null);\n\t\tassert.strictEqual(res[1], parts[0].data.toString());\n\t}\n\n\tvar normalized = true;\n\tfor (var i = 0; i < algInfo.parts.length; ++i) {\n\t\tvar p = parts[i];\n\t\tp.name = algInfo.parts[i];\n\t\t/*\n\t\t * OpenSSH stores ed25519 \"private\" keys as seed + public key\n\t\t * concat'd together (k followed by A). We want to keep them\n\t\t * separate for other formats that don't do this.\n\t\t */\n\t\tif (key.type === 'ed25519' && p.name === 'k')\n\t\t\tp.data = p.data.slice(0, 32);\n\n\t\tif (p.name !== 'curve' && algInfo.normalize !== false) {\n\t\t\tvar nd;\n\t\t\tif (key.type === 'ed25519') {\n\t\t\t\tnd = utils.zeroPadToLength(p.data, 32);\n\t\t\t} else {\n\t\t\t\tnd = utils.mpNormalize(p.data);\n\t\t\t}\n\t\t\tif (nd.toString('binary') !==\n\t\t\t p.data.toString('binary')) {\n\t\t\t\tp.data = nd;\n\t\t\t\tnormalized = false;\n\t\t\t}\n\t\t}\n\t}\n\n\tif (normalized)\n\t\tkey._rfc4253Cache = sshbuf.toBuffer();\n\n\tif (partial && typeof (partial) === 'object') {\n\t\tpartial.remainder = sshbuf.remainder();\n\t\tpartial.consumed = sshbuf._offset;\n\t}\n\n\treturn (new Constructor(key));\n}\n\nfunction write(key, options) {\n\tassert.object(key);\n\n\tvar alg = keyTypeToAlg(key);\n\tvar i;\n\n\tvar algInfo = algs.info[key.type];\n\tif (PrivateKey.isPrivateKey(key))\n\t\talgInfo = algs.privInfo[key.type];\n\tvar parts = algInfo.parts;\n\n\tvar buf = new SSHBuffer({});\n\n\tbuf.writeString(alg);\n\n\tfor (i = 0; i < parts.length; ++i) {\n\t\tvar data = key.part[parts[i]].data;\n\t\tif (algInfo.normalize !== false) {\n\t\t\tif (key.type === 'ed25519')\n\t\t\t\tdata = utils.zeroPadToLength(data, 32);\n\t\t\telse\n\t\t\t\tdata = utils.mpNormalize(data);\n\t\t}\n\t\tif (key.type === 'ed25519' && parts[i] === 'k')\n\t\t\tdata = Buffer.concat([data, key.part.A.data]);\n\t\tbuf.writeBuffer(data);\n\t}\n\n\treturn (buf.toBuffer());\n}\n","// Copyright 2015 Joyent, Inc.\n\nmodule.exports = {\n\tread: read,\n\treadSSHPrivate: readSSHPrivate,\n\twrite: write\n};\n\nvar assert = require('assert-plus');\nvar asn1 = require('asn1');\nvar Buffer = require('safer-buffer').Buffer;\nvar algs = require('../algs');\nvar utils = require('../utils');\nvar crypto = require('crypto');\n\nvar Key = require('../key');\nvar PrivateKey = require('../private-key');\nvar pem = require('./pem');\nvar rfc4253 = require('./rfc4253');\nvar SSHBuffer = require('../ssh-buffer');\nvar errors = require('../errors');\n\nvar bcrypt;\n\nfunction read(buf, options) {\n\treturn (pem.read(buf, options));\n}\n\nvar MAGIC = 'openssh-key-v1';\n\nfunction readSSHPrivate(type, buf, options) {\n\tbuf = new SSHBuffer({buffer: buf});\n\n\tvar magic = buf.readCString();\n\tassert.strictEqual(magic, MAGIC, 'bad magic string');\n\n\tvar cipher = buf.readString();\n\tvar kdf = buf.readString();\n\tvar kdfOpts = buf.readBuffer();\n\n\tvar nkeys = buf.readInt();\n\tif (nkeys !== 1) {\n\t\tthrow (new Error('OpenSSH-format key file contains ' +\n\t\t 'multiple keys: this is unsupported.'));\n\t}\n\n\tvar pubKey = buf.readBuffer();\n\n\tif (type === 'public') {\n\t\tassert.ok(buf.atEnd(), 'excess bytes left after key');\n\t\treturn (rfc4253.read(pubKey));\n\t}\n\n\tvar privKeyBlob = buf.readBuffer();\n\tassert.ok(buf.atEnd(), 'excess bytes left after key');\n\n\tvar kdfOptsBuf = new SSHBuffer({ buffer: kdfOpts });\n\tswitch (kdf) {\n\tcase 'none':\n\t\tif (cipher !== 'none') {\n\t\t\tthrow (new Error('OpenSSH-format key uses KDF \"none\" ' +\n\t\t\t 'but specifies a cipher other than \"none\"'));\n\t\t}\n\t\tbreak;\n\tcase 'bcrypt':\n\t\tvar salt = kdfOptsBuf.readBuffer();\n\t\tvar rounds = kdfOptsBuf.readInt();\n\t\tvar cinf = utils.opensshCipherInfo(cipher);\n\t\tif (bcrypt === undefined) {\n\t\t\tbcrypt = require('bcrypt-pbkdf');\n\t\t}\n\n\t\tif (typeof (options.passphrase) === 'string') {\n\t\t\toptions.passphrase = Buffer.from(options.passphrase,\n\t\t\t 'utf-8');\n\t\t}\n\t\tif (!Buffer.isBuffer(options.passphrase)) {\n\t\t\tthrow (new errors.KeyEncryptedError(\n\t\t\t options.filename, 'OpenSSH'));\n\t\t}\n\n\t\tvar pass = new Uint8Array(options.passphrase);\n\t\tvar salti = new Uint8Array(salt);\n\t\t/* Use the pbkdf to derive both the key and the IV. */\n\t\tvar out = new Uint8Array(cinf.keySize + cinf.blockSize);\n\t\tvar res = bcrypt.pbkdf(pass, pass.length, salti, salti.length,\n\t\t out, out.length, rounds);\n\t\tif (res !== 0) {\n\t\t\tthrow (new Error('bcrypt_pbkdf function returned ' +\n\t\t\t 'failure, parameters invalid'));\n\t\t}\n\t\tout = Buffer.from(out);\n\t\tvar ckey = out.slice(0, cinf.keySize);\n\t\tvar iv = out.slice(cinf.keySize, cinf.keySize + cinf.blockSize);\n\t\tvar cipherStream = crypto.createDecipheriv(cinf.opensslName,\n\t\t ckey, iv);\n\t\tcipherStream.setAutoPadding(false);\n\t\tvar chunk, chunks = [];\n\t\tcipherStream.once('error', function (e) {\n\t\t\tif (e.toString().indexOf('bad decrypt') !== -1) {\n\t\t\t\tthrow (new Error('Incorrect passphrase ' +\n\t\t\t\t 'supplied, could not decrypt key'));\n\t\t\t}\n\t\t\tthrow (e);\n\t\t});\n\t\tcipherStream.write(privKeyBlob);\n\t\tcipherStream.end();\n\t\twhile ((chunk = cipherStream.read()) !== null)\n\t\t\tchunks.push(chunk);\n\t\tprivKeyBlob = Buffer.concat(chunks);\n\t\tbreak;\n\tdefault:\n\t\tthrow (new Error(\n\t\t 'OpenSSH-format key uses unknown KDF \"' + kdf + '\"'));\n\t}\n\n\tbuf = new SSHBuffer({buffer: privKeyBlob});\n\n\tvar checkInt1 = buf.readInt();\n\tvar checkInt2 = buf.readInt();\n\tif (checkInt1 !== checkInt2) {\n\t\tthrow (new Error('Incorrect passphrase supplied, could not ' +\n\t\t 'decrypt key'));\n\t}\n\n\tvar ret = {};\n\tvar key = rfc4253.readInternal(ret, 'private', buf.remainder());\n\n\tbuf.skip(ret.consumed);\n\n\tvar comment = buf.readString();\n\tkey.comment = comment;\n\n\treturn (key);\n}\n\nfunction write(key, options) {\n\tvar pubKey;\n\tif (PrivateKey.isPrivateKey(key))\n\t\tpubKey = key.toPublic();\n\telse\n\t\tpubKey = key;\n\n\tvar cipher = 'none';\n\tvar kdf = 'none';\n\tvar kdfopts = Buffer.alloc(0);\n\tvar cinf = { blockSize: 8 };\n\tvar passphrase;\n\tif (options !== undefined) {\n\t\tpassphrase = options.passphrase;\n\t\tif (typeof (passphrase) === 'string')\n\t\t\tpassphrase = Buffer.from(passphrase, 'utf-8');\n\t\tif (passphrase !== undefined) {\n\t\t\tassert.buffer(passphrase, 'options.passphrase');\n\t\t\tassert.optionalString(options.cipher, 'options.cipher');\n\t\t\tcipher = options.cipher;\n\t\t\tif (cipher === undefined)\n\t\t\t\tcipher = 'aes128-ctr';\n\t\t\tcinf = utils.opensshCipherInfo(cipher);\n\t\t\tkdf = 'bcrypt';\n\t\t}\n\t}\n\n\tvar privBuf;\n\tif (PrivateKey.isPrivateKey(key)) {\n\t\tprivBuf = new SSHBuffer({});\n\t\tvar checkInt = crypto.randomBytes(4).readUInt32BE(0);\n\t\tprivBuf.writeInt(checkInt);\n\t\tprivBuf.writeInt(checkInt);\n\t\tprivBuf.write(key.toBuffer('rfc4253'));\n\t\tprivBuf.writeString(key.comment || '');\n\n\t\tvar n = 1;\n\t\twhile (privBuf._offset % cinf.blockSize !== 0)\n\t\t\tprivBuf.writeChar(n++);\n\t\tprivBuf = privBuf.toBuffer();\n\t}\n\n\tswitch (kdf) {\n\tcase 'none':\n\t\tbreak;\n\tcase 'bcrypt':\n\t\tvar salt = crypto.randomBytes(16);\n\t\tvar rounds = 16;\n\t\tvar kdfssh = new SSHBuffer({});\n\t\tkdfssh.writeBuffer(salt);\n\t\tkdfssh.writeInt(rounds);\n\t\tkdfopts = kdfssh.toBuffer();\n\n\t\tif (bcrypt === undefined) {\n\t\t\tbcrypt = require('bcrypt-pbkdf');\n\t\t}\n\t\tvar pass = new Uint8Array(passphrase);\n\t\tvar salti = new Uint8Array(salt);\n\t\t/* Use the pbkdf to derive both the key and the IV. */\n\t\tvar out = new Uint8Array(cinf.keySize + cinf.blockSize);\n\t\tvar res = bcrypt.pbkdf(pass, pass.length, salti, salti.length,\n\t\t out, out.length, rounds);\n\t\tif (res !== 0) {\n\t\t\tthrow (new Error('bcrypt_pbkdf function returned ' +\n\t\t\t 'failure, parameters invalid'));\n\t\t}\n\t\tout = Buffer.from(out);\n\t\tvar ckey = out.slice(0, cinf.keySize);\n\t\tvar iv = out.slice(cinf.keySize, cinf.keySize + cinf.blockSize);\n\n\t\tvar cipherStream = crypto.createCipheriv(cinf.opensslName,\n\t\t ckey, iv);\n\t\tcipherStream.setAutoPadding(false);\n\t\tvar chunk, chunks = [];\n\t\tcipherStream.once('error', function (e) {\n\t\t\tthrow (e);\n\t\t});\n\t\tcipherStream.write(privBuf);\n\t\tcipherStream.end();\n\t\twhile ((chunk = cipherStream.read()) !== null)\n\t\t\tchunks.push(chunk);\n\t\tprivBuf = Buffer.concat(chunks);\n\t\tbreak;\n\tdefault:\n\t\tthrow (new Error('Unsupported kdf ' + kdf));\n\t}\n\n\tvar buf = new SSHBuffer({});\n\n\tbuf.writeCString(MAGIC);\n\tbuf.writeString(cipher);\t/* cipher */\n\tbuf.writeString(kdf);\t\t/* kdf */\n\tbuf.writeBuffer(kdfopts);\t/* kdfoptions */\n\n\tbuf.writeInt(1);\t\t/* nkeys */\n\tbuf.writeBuffer(pubKey.toBuffer('rfc4253'));\n\n\tif (privBuf)\n\t\tbuf.writeBuffer(privBuf);\n\n\tbuf = buf.toBuffer();\n\n\tvar header;\n\tif (PrivateKey.isPrivateKey(key))\n\t\theader = 'OPENSSH PRIVATE KEY';\n\telse\n\t\theader = 'OPENSSH PUBLIC KEY';\n\n\tvar tmp = buf.toString('base64');\n\tvar len = tmp.length + (tmp.length / 70) +\n\t 18 + 16 + header.length*2 + 10;\n\tbuf = Buffer.alloc(len);\n\tvar o = 0;\n\to += buf.write('-----BEGIN ' + header + '-----\\n', o);\n\tfor (var i = 0; i < tmp.length; ) {\n\t\tvar limit = i + 70;\n\t\tif (limit > tmp.length)\n\t\t\tlimit = tmp.length;\n\t\to += buf.write(tmp.slice(i, limit), o);\n\t\tbuf[o++] = 10;\n\t\ti = limit;\n\t}\n\to += buf.write('-----END ' + header + '-----\\n', o);\n\n\treturn (buf.slice(0, o));\n}\n","// Copyright 2015 Joyent, Inc.\n\nmodule.exports = {\n\tread: read,\n\twrite: write\n};\n\nvar assert = require('assert-plus');\nvar Buffer = require('safer-buffer').Buffer;\nvar rfc4253 = require('./rfc4253');\nvar utils = require('../utils');\nvar Key = require('../key');\nvar PrivateKey = require('../private-key');\n\nvar sshpriv = require('./ssh-private');\n\n/*JSSTYLED*/\nvar SSHKEY_RE = /^([a-z0-9-]+)[ \\t]+([a-zA-Z0-9+\\/]+[=]*)([ \\t]+([^ \\t][^\\n]*[\\n]*)?)?$/;\n/*JSSTYLED*/\nvar SSHKEY_RE2 = /^([a-z0-9-]+)[ \\t\\n]+([a-zA-Z0-9+\\/][a-zA-Z0-9+\\/ \\t\\n=]*)([^a-zA-Z0-9+\\/ \\t\\n=].*)?$/;\n\nfunction read(buf, options) {\n\tif (typeof (buf) !== 'string') {\n\t\tassert.buffer(buf, 'buf');\n\t\tbuf = buf.toString('ascii');\n\t}\n\n\tvar trimmed = buf.trim().replace(/[\\\\\\r]/g, '');\n\tvar m = trimmed.match(SSHKEY_RE);\n\tif (!m)\n\t\tm = trimmed.match(SSHKEY_RE2);\n\tassert.ok(m, 'key must match regex');\n\n\tvar type = rfc4253.algToKeyType(m[1]);\n\tvar kbuf = Buffer.from(m[2], 'base64');\n\n\t/*\n\t * This is a bit tricky. If we managed to parse the key and locate the\n\t * key comment with the regex, then do a non-partial read and assert\n\t * that we have consumed all bytes. If we couldn't locate the key\n\t * comment, though, there may be whitespace shenanigans going on that\n\t * have conjoined the comment to the rest of the key. We do a partial\n\t * read in this case to try to make the best out of a sorry situation.\n\t */\n\tvar key;\n\tvar ret = {};\n\tif (m[4]) {\n\t\ttry {\n\t\t\tkey = rfc4253.read(kbuf);\n\n\t\t} catch (e) {\n\t\t\tm = trimmed.match(SSHKEY_RE2);\n\t\t\tassert.ok(m, 'key must match regex');\n\t\t\tkbuf = Buffer.from(m[2], 'base64');\n\t\t\tkey = rfc4253.readInternal(ret, 'public', kbuf);\n\t\t}\n\t} else {\n\t\tkey = rfc4253.readInternal(ret, 'public', kbuf);\n\t}\n\n\tassert.strictEqual(type, key.type);\n\n\tif (m[4] && m[4].length > 0) {\n\t\tkey.comment = m[4];\n\n\t} else if (ret.consumed) {\n\t\t/*\n\t\t * Now the magic: trying to recover the key comment when it's\n\t\t * gotten conjoined to the key or otherwise shenanigan'd.\n\t\t *\n\t\t * Work out how much base64 we used, then drop all non-base64\n\t\t * chars from the beginning up to this point in the the string.\n\t\t * Then offset in this and try to make up for missing = chars.\n\t\t */\n\t\tvar data = m[2] + (m[3] ? m[3] : '');\n\t\tvar realOffset = Math.ceil(ret.consumed / 3) * 4;\n\t\tdata = data.slice(0, realOffset - 2). /*JSSTYLED*/\n\t\t replace(/[^a-zA-Z0-9+\\/=]/g, '') +\n\t\t data.slice(realOffset - 2);\n\n\t\tvar padding = ret.consumed % 3;\n\t\tif (padding > 0 &&\n\t\t data.slice(realOffset - 1, realOffset) !== '=')\n\t\t\trealOffset--;\n\t\twhile (data.slice(realOffset, realOffset + 1) === '=')\n\t\t\trealOffset++;\n\n\t\t/* Finally, grab what we think is the comment & clean it up. */\n\t\tvar trailer = data.slice(realOffset);\n\t\ttrailer = trailer.replace(/[\\r\\n]/g, ' ').\n\t\t replace(/^\\s+/, '');\n\t\tif (trailer.match(/^[a-zA-Z0-9]/))\n\t\t\tkey.comment = trailer;\n\t}\n\n\treturn (key);\n}\n\nfunction write(key, options) {\n\tassert.object(key);\n\tif (!Key.isKey(key))\n\t\tthrow (new Error('Must be a public key'));\n\n\tvar parts = [];\n\tvar alg = rfc4253.keyTypeToAlg(key);\n\tparts.push(alg);\n\n\tvar buf = rfc4253.write(key);\n\tparts.push(buf.toString('base64'));\n\n\tif (key.comment)\n\t\tparts.push(key.comment);\n\n\treturn (Buffer.from(parts.join(' ')));\n}\n","// Copyright 2016 Joyent, Inc.\n\nvar x509 = require('./x509');\n\nmodule.exports = {\n\tread: read,\n\tverify: x509.verify,\n\tsign: x509.sign,\n\twrite: write\n};\n\nvar assert = require('assert-plus');\nvar asn1 = require('asn1');\nvar Buffer = require('safer-buffer').Buffer;\nvar algs = require('../algs');\nvar utils = require('../utils');\nvar Key = require('../key');\nvar PrivateKey = require('../private-key');\nvar pem = require('./pem');\nvar Identity = require('../identity');\nvar Signature = require('../signature');\nvar Certificate = require('../certificate');\n\nfunction read(buf, options) {\n\tif (typeof (buf) !== 'string') {\n\t\tassert.buffer(buf, 'buf');\n\t\tbuf = buf.toString('ascii');\n\t}\n\n\tvar lines = buf.trim().split(/[\\r\\n]+/g);\n\n\tvar m;\n\tvar si = -1;\n\twhile (!m && si < lines.length) {\n\t\tm = lines[++si].match(/*JSSTYLED*/\n\t\t /[-]+[ ]*BEGIN CERTIFICATE[ ]*[-]+/);\n\t}\n\tassert.ok(m, 'invalid PEM header');\n\n\tvar m2;\n\tvar ei = lines.length;\n\twhile (!m2 && ei > 0) {\n\t\tm2 = lines[--ei].match(/*JSSTYLED*/\n\t\t /[-]+[ ]*END CERTIFICATE[ ]*[-]+/);\n\t}\n\tassert.ok(m2, 'invalid PEM footer');\n\n\tlines = lines.slice(si, ei + 1);\n\n\tvar headers = {};\n\twhile (true) {\n\t\tlines = lines.slice(1);\n\t\tm = lines[0].match(/*JSSTYLED*/\n\t\t /^([A-Za-z0-9-]+): (.+)$/);\n\t\tif (!m)\n\t\t\tbreak;\n\t\theaders[m[1].toLowerCase()] = m[2];\n\t}\n\n\t/* Chop off the first and last lines */\n\tlines = lines.slice(0, -1).join('');\n\tbuf = Buffer.from(lines, 'base64');\n\n\treturn (x509.read(buf, options));\n}\n\nfunction write(cert, options) {\n\tvar dbuf = x509.write(cert, options);\n\n\tvar header = 'CERTIFICATE';\n\tvar tmp = dbuf.toString('base64');\n\tvar len = tmp.length + (tmp.length / 64) +\n\t 18 + 16 + header.length*2 + 10;\n\tvar buf = Buffer.alloc(len);\n\tvar o = 0;\n\to += buf.write('-----BEGIN ' + header + '-----\\n', o);\n\tfor (var i = 0; i < tmp.length; ) {\n\t\tvar limit = i + 64;\n\t\tif (limit > tmp.length)\n\t\t\tlimit = tmp.length;\n\t\to += buf.write(tmp.slice(i, limit), o);\n\t\tbuf[o++] = 10;\n\t\ti = limit;\n\t}\n\to += buf.write('-----END ' + header + '-----\\n', o);\n\n\treturn (buf.slice(0, o));\n}\n","// Copyright 2017 Joyent, Inc.\n\nmodule.exports = {\n\tread: read,\n\tverify: verify,\n\tsign: sign,\n\tsignAsync: signAsync,\n\twrite: write\n};\n\nvar assert = require('assert-plus');\nvar asn1 = require('asn1');\nvar Buffer = require('safer-buffer').Buffer;\nvar algs = require('../algs');\nvar utils = require('../utils');\nvar Key = require('../key');\nvar PrivateKey = require('../private-key');\nvar pem = require('./pem');\nvar Identity = require('../identity');\nvar Signature = require('../signature');\nvar Certificate = require('../certificate');\nvar pkcs8 = require('./pkcs8');\n\n/*\n * This file is based on RFC5280 (X.509).\n */\n\n/* Helper to read in a single mpint */\nfunction readMPInt(der, nm) {\n\tassert.strictEqual(der.peek(), asn1.Ber.Integer,\n\t nm + ' is not an Integer');\n\treturn (utils.mpNormalize(der.readString(asn1.Ber.Integer, true)));\n}\n\nfunction verify(cert, key) {\n\tvar sig = cert.signatures.x509;\n\tassert.object(sig, 'x509 signature');\n\n\tvar algParts = sig.algo.split('-');\n\tif (algParts[0] !== key.type)\n\t\treturn (false);\n\n\tvar blob = sig.cache;\n\tif (blob === undefined) {\n\t\tvar der = new asn1.BerWriter();\n\t\twriteTBSCert(cert, der);\n\t\tblob = der.buffer;\n\t}\n\n\tvar verifier = key.createVerify(algParts[1]);\n\tverifier.write(blob);\n\treturn (verifier.verify(sig.signature));\n}\n\nfunction Local(i) {\n\treturn (asn1.Ber.Context | asn1.Ber.Constructor | i);\n}\n\nfunction Context(i) {\n\treturn (asn1.Ber.Context | i);\n}\n\nvar SIGN_ALGS = {\n\t'rsa-md5': '1.2.840.113549.1.1.4',\n\t'rsa-sha1': '1.2.840.113549.1.1.5',\n\t'rsa-sha256': '1.2.840.113549.1.1.11',\n\t'rsa-sha384': '1.2.840.113549.1.1.12',\n\t'rsa-sha512': '1.2.840.113549.1.1.13',\n\t'dsa-sha1': '1.2.840.10040.4.3',\n\t'dsa-sha256': '2.16.840.1.101.3.4.3.2',\n\t'ecdsa-sha1': '1.2.840.10045.4.1',\n\t'ecdsa-sha256': '1.2.840.10045.4.3.2',\n\t'ecdsa-sha384': '1.2.840.10045.4.3.3',\n\t'ecdsa-sha512': '1.2.840.10045.4.3.4',\n\t'ed25519-sha512': '1.3.101.112'\n};\nObject.keys(SIGN_ALGS).forEach(function (k) {\n\tSIGN_ALGS[SIGN_ALGS[k]] = k;\n});\nSIGN_ALGS['1.3.14.3.2.3'] = 'rsa-md5';\nSIGN_ALGS['1.3.14.3.2.29'] = 'rsa-sha1';\n\nvar EXTS = {\n\t'issuerKeyId': '2.5.29.35',\n\t'altName': '2.5.29.17',\n\t'basicConstraints': '2.5.29.19',\n\t'keyUsage': '2.5.29.15',\n\t'extKeyUsage': '2.5.29.37'\n};\n\nfunction read(buf, options) {\n\tif (typeof (buf) === 'string') {\n\t\tbuf = Buffer.from(buf, 'binary');\n\t}\n\tassert.buffer(buf, 'buf');\n\n\tvar der = new asn1.BerReader(buf);\n\n\tder.readSequence();\n\tif (Math.abs(der.length - der.remain) > 1) {\n\t\tthrow (new Error('DER sequence does not contain whole byte ' +\n\t\t 'stream'));\n\t}\n\n\tvar tbsStart = der.offset;\n\tder.readSequence();\n\tvar sigOffset = der.offset + der.length;\n\tvar tbsEnd = sigOffset;\n\n\tif (der.peek() === Local(0)) {\n\t\tder.readSequence(Local(0));\n\t\tvar version = der.readInt();\n\t\tassert.ok(version <= 3,\n\t\t 'only x.509 versions up to v3 supported');\n\t}\n\n\tvar cert = {};\n\tcert.signatures = {};\n\tvar sig = (cert.signatures.x509 = {});\n\tsig.extras = {};\n\n\tcert.serial = readMPInt(der, 'serial');\n\n\tder.readSequence();\n\tvar after = der.offset + der.length;\n\tvar certAlgOid = der.readOID();\n\tvar certAlg = SIGN_ALGS[certAlgOid];\n\tif (certAlg === undefined)\n\t\tthrow (new Error('unknown signature algorithm ' + certAlgOid));\n\n\tder._offset = after;\n\tcert.issuer = Identity.parseAsn1(der);\n\n\tder.readSequence();\n\tcert.validFrom = readDate(der);\n\tcert.validUntil = readDate(der);\n\n\tcert.subjects = [Identity.parseAsn1(der)];\n\n\tder.readSequence();\n\tafter = der.offset + der.length;\n\tcert.subjectKey = pkcs8.readPkcs8(undefined, 'public', der);\n\tder._offset = after;\n\n\t/* issuerUniqueID */\n\tif (der.peek() === Local(1)) {\n\t\tder.readSequence(Local(1));\n\t\tsig.extras.issuerUniqueID =\n\t\t buf.slice(der.offset, der.offset + der.length);\n\t\tder._offset += der.length;\n\t}\n\n\t/* subjectUniqueID */\n\tif (der.peek() === Local(2)) {\n\t\tder.readSequence(Local(2));\n\t\tsig.extras.subjectUniqueID =\n\t\t buf.slice(der.offset, der.offset + der.length);\n\t\tder._offset += der.length;\n\t}\n\n\t/* extensions */\n\tif (der.peek() === Local(3)) {\n\t\tder.readSequence(Local(3));\n\t\tvar extEnd = der.offset + der.length;\n\t\tder.readSequence();\n\n\t\twhile (der.offset < extEnd)\n\t\t\treadExtension(cert, buf, der);\n\n\t\tassert.strictEqual(der.offset, extEnd);\n\t}\n\n\tassert.strictEqual(der.offset, sigOffset);\n\n\tder.readSequence();\n\tafter = der.offset + der.length;\n\tvar sigAlgOid = der.readOID();\n\tvar sigAlg = SIGN_ALGS[sigAlgOid];\n\tif (sigAlg === undefined)\n\t\tthrow (new Error('unknown signature algorithm ' + sigAlgOid));\n\tder._offset = after;\n\n\tvar sigData = der.readString(asn1.Ber.BitString, true);\n\tif (sigData[0] === 0)\n\t\tsigData = sigData.slice(1);\n\tvar algParts = sigAlg.split('-');\n\n\tsig.signature = Signature.parse(sigData, algParts[0], 'asn1');\n\tsig.signature.hashAlgorithm = algParts[1];\n\tsig.algo = sigAlg;\n\tsig.cache = buf.slice(tbsStart, tbsEnd);\n\n\treturn (new Certificate(cert));\n}\n\nfunction readDate(der) {\n\tif (der.peek() === asn1.Ber.UTCTime) {\n\t\treturn (utcTimeToDate(der.readString(asn1.Ber.UTCTime)));\n\t} else if (der.peek() === asn1.Ber.GeneralizedTime) {\n\t\treturn (gTimeToDate(der.readString(asn1.Ber.GeneralizedTime)));\n\t} else {\n\t\tthrow (new Error('Unsupported date format'));\n\t}\n}\n\nfunction writeDate(der, date) {\n\tif (date.getUTCFullYear() >= 2050 || date.getUTCFullYear() < 1950) {\n\t\tder.writeString(dateToGTime(date), asn1.Ber.GeneralizedTime);\n\t} else {\n\t\tder.writeString(dateToUTCTime(date), asn1.Ber.UTCTime);\n\t}\n}\n\n/* RFC5280, section 4.2.1.6 (GeneralName type) */\nvar ALTNAME = {\n\tOtherName: Local(0),\n\tRFC822Name: Context(1),\n\tDNSName: Context(2),\n\tX400Address: Local(3),\n\tDirectoryName: Local(4),\n\tEDIPartyName: Local(5),\n\tURI: Context(6),\n\tIPAddress: Context(7),\n\tOID: Context(8)\n};\n\n/* RFC5280, section 4.2.1.12 (KeyPurposeId) */\nvar EXTPURPOSE = {\n\t'serverAuth': '1.3.6.1.5.5.7.3.1',\n\t'clientAuth': '1.3.6.1.5.5.7.3.2',\n\t'codeSigning': '1.3.6.1.5.5.7.3.3',\n\n\t/* See https://github.com/joyent/oid-docs/blob/master/root.md */\n\t'joyentDocker': '1.3.6.1.4.1.38678.1.4.1',\n\t'joyentCmon': '1.3.6.1.4.1.38678.1.4.2'\n};\nvar EXTPURPOSE_REV = {};\nObject.keys(EXTPURPOSE).forEach(function (k) {\n\tEXTPURPOSE_REV[EXTPURPOSE[k]] = k;\n});\n\nvar KEYUSEBITS = [\n\t'signature', 'identity', 'keyEncryption',\n\t'encryption', 'keyAgreement', 'ca', 'crl'\n];\n\nfunction readExtension(cert, buf, der) {\n\tder.readSequence();\n\tvar after = der.offset + der.length;\n\tvar extId = der.readOID();\n\tvar id;\n\tvar sig = cert.signatures.x509;\n\tif (!sig.extras.exts)\n\t\tsig.extras.exts = [];\n\n\tvar critical;\n\tif (der.peek() === asn1.Ber.Boolean)\n\t\tcritical = der.readBoolean();\n\n\tswitch (extId) {\n\tcase (EXTS.basicConstraints):\n\t\tder.readSequence(asn1.Ber.OctetString);\n\t\tder.readSequence();\n\t\tvar bcEnd = der.offset + der.length;\n\t\tvar ca = false;\n\t\tif (der.peek() === asn1.Ber.Boolean)\n\t\t\tca = der.readBoolean();\n\t\tif (cert.purposes === undefined)\n\t\t\tcert.purposes = [];\n\t\tif (ca === true)\n\t\t\tcert.purposes.push('ca');\n\t\tvar bc = { oid: extId, critical: critical };\n\t\tif (der.offset < bcEnd && der.peek() === asn1.Ber.Integer)\n\t\t\tbc.pathLen = der.readInt();\n\t\tsig.extras.exts.push(bc);\n\t\tbreak;\n\tcase (EXTS.extKeyUsage):\n\t\tder.readSequence(asn1.Ber.OctetString);\n\t\tder.readSequence();\n\t\tif (cert.purposes === undefined)\n\t\t\tcert.purposes = [];\n\t\tvar ekEnd = der.offset + der.length;\n\t\twhile (der.offset < ekEnd) {\n\t\t\tvar oid = der.readOID();\n\t\t\tcert.purposes.push(EXTPURPOSE_REV[oid] || oid);\n\t\t}\n\t\t/*\n\t\t * This is a bit of a hack: in the case where we have a cert\n\t\t * that's only allowed to do serverAuth or clientAuth (and not\n\t\t * the other), we want to make sure all our Subjects are of\n\t\t * the right type. But we already parsed our Subjects and\n\t\t * decided if they were hosts or users earlier (since it appears\n\t\t * first in the cert).\n\t\t *\n\t\t * So we go through and mutate them into the right kind here if\n\t\t * it doesn't match. This might not be hugely beneficial, as it\n\t\t * seems that single-purpose certs are not often seen in the\n\t\t * wild.\n\t\t */\n\t\tif (cert.purposes.indexOf('serverAuth') !== -1 &&\n\t\t cert.purposes.indexOf('clientAuth') === -1) {\n\t\t\tcert.subjects.forEach(function (ide) {\n\t\t\t\tif (ide.type !== 'host') {\n\t\t\t\t\tide.type = 'host';\n\t\t\t\t\tide.hostname = ide.uid ||\n\t\t\t\t\t ide.email ||\n\t\t\t\t\t ide.components[0].value;\n\t\t\t\t}\n\t\t\t});\n\t\t} else if (cert.purposes.indexOf('clientAuth') !== -1 &&\n\t\t cert.purposes.indexOf('serverAuth') === -1) {\n\t\t\tcert.subjects.forEach(function (ide) {\n\t\t\t\tif (ide.type !== 'user') {\n\t\t\t\t\tide.type = 'user';\n\t\t\t\t\tide.uid = ide.hostname ||\n\t\t\t\t\t ide.email ||\n\t\t\t\t\t ide.components[0].value;\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\t\tsig.extras.exts.push({ oid: extId, critical: critical });\n\t\tbreak;\n\tcase (EXTS.keyUsage):\n\t\tder.readSequence(asn1.Ber.OctetString);\n\t\tvar bits = der.readString(asn1.Ber.BitString, true);\n\t\tvar setBits = readBitField(bits, KEYUSEBITS);\n\t\tsetBits.forEach(function (bit) {\n\t\t\tif (cert.purposes === undefined)\n\t\t\t\tcert.purposes = [];\n\t\t\tif (cert.purposes.indexOf(bit) === -1)\n\t\t\t\tcert.purposes.push(bit);\n\t\t});\n\t\tsig.extras.exts.push({ oid: extId, critical: critical,\n\t\t bits: bits });\n\t\tbreak;\n\tcase (EXTS.altName):\n\t\tder.readSequence(asn1.Ber.OctetString);\n\t\tder.readSequence();\n\t\tvar aeEnd = der.offset + der.length;\n\t\twhile (der.offset < aeEnd) {\n\t\t\tswitch (der.peek()) {\n\t\t\tcase ALTNAME.OtherName:\n\t\t\tcase ALTNAME.EDIPartyName:\n\t\t\t\tder.readSequence();\n\t\t\t\tder._offset += der.length;\n\t\t\t\tbreak;\n\t\t\tcase ALTNAME.OID:\n\t\t\t\tder.readOID(ALTNAME.OID);\n\t\t\t\tbreak;\n\t\t\tcase ALTNAME.RFC822Name:\n\t\t\t\t/* RFC822 specifies email addresses */\n\t\t\t\tvar email = der.readString(ALTNAME.RFC822Name);\n\t\t\t\tid = Identity.forEmail(email);\n\t\t\t\tif (!cert.subjects[0].equals(id))\n\t\t\t\t\tcert.subjects.push(id);\n\t\t\t\tbreak;\n\t\t\tcase ALTNAME.DirectoryName:\n\t\t\t\tder.readSequence(ALTNAME.DirectoryName);\n\t\t\t\tid = Identity.parseAsn1(der);\n\t\t\t\tif (!cert.subjects[0].equals(id))\n\t\t\t\t\tcert.subjects.push(id);\n\t\t\t\tbreak;\n\t\t\tcase ALTNAME.DNSName:\n\t\t\t\tvar host = der.readString(\n\t\t\t\t ALTNAME.DNSName);\n\t\t\t\tid = Identity.forHost(host);\n\t\t\t\tif (!cert.subjects[0].equals(id))\n\t\t\t\t\tcert.subjects.push(id);\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tder.readString(der.peek());\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\tsig.extras.exts.push({ oid: extId, critical: critical });\n\t\tbreak;\n\tdefault:\n\t\tsig.extras.exts.push({\n\t\t\toid: extId,\n\t\t\tcritical: critical,\n\t\t\tdata: der.readString(asn1.Ber.OctetString, true)\n\t\t});\n\t\tbreak;\n\t}\n\n\tder._offset = after;\n}\n\nvar UTCTIME_RE =\n /^([0-9]{2})([0-9]{2})([0-9]{2})([0-9]{2})([0-9]{2})([0-9]{2})?Z$/;\nfunction utcTimeToDate(t) {\n\tvar m = t.match(UTCTIME_RE);\n\tassert.ok(m, 'timestamps must be in UTC');\n\tvar d = new Date();\n\n\tvar thisYear = d.getUTCFullYear();\n\tvar century = Math.floor(thisYear / 100) * 100;\n\n\tvar year = parseInt(m[1], 10);\n\tif (thisYear % 100 < 50 && year >= 60)\n\t\tyear += (century - 1);\n\telse\n\t\tyear += century;\n\td.setUTCFullYear(year, parseInt(m[2], 10) - 1, parseInt(m[3], 10));\n\td.setUTCHours(parseInt(m[4], 10), parseInt(m[5], 10));\n\tif (m[6] && m[6].length > 0)\n\t\td.setUTCSeconds(parseInt(m[6], 10));\n\treturn (d);\n}\n\nvar GTIME_RE =\n /^([0-9]{4})([0-9]{2})([0-9]{2})([0-9]{2})([0-9]{2})([0-9]{2})?Z$/;\nfunction gTimeToDate(t) {\n\tvar m = t.match(GTIME_RE);\n\tassert.ok(m);\n\tvar d = new Date();\n\n\td.setUTCFullYear(parseInt(m[1], 10), parseInt(m[2], 10) - 1,\n\t parseInt(m[3], 10));\n\td.setUTCHours(parseInt(m[4], 10), parseInt(m[5], 10));\n\tif (m[6] && m[6].length > 0)\n\t\td.setUTCSeconds(parseInt(m[6], 10));\n\treturn (d);\n}\n\nfunction zeroPad(n, m) {\n\tif (m === undefined)\n\t\tm = 2;\n\tvar s = '' + n;\n\twhile (s.length < m)\n\t\ts = '0' + s;\n\treturn (s);\n}\n\nfunction dateToUTCTime(d) {\n\tvar s = '';\n\ts += zeroPad(d.getUTCFullYear() % 100);\n\ts += zeroPad(d.getUTCMonth() + 1);\n\ts += zeroPad(d.getUTCDate());\n\ts += zeroPad(d.getUTCHours());\n\ts += zeroPad(d.getUTCMinutes());\n\ts += zeroPad(d.getUTCSeconds());\n\ts += 'Z';\n\treturn (s);\n}\n\nfunction dateToGTime(d) {\n\tvar s = '';\n\ts += zeroPad(d.getUTCFullYear(), 4);\n\ts += zeroPad(d.getUTCMonth() + 1);\n\ts += zeroPad(d.getUTCDate());\n\ts += zeroPad(d.getUTCHours());\n\ts += zeroPad(d.getUTCMinutes());\n\ts += zeroPad(d.getUTCSeconds());\n\ts += 'Z';\n\treturn (s);\n}\n\nfunction sign(cert, key) {\n\tif (cert.signatures.x509 === undefined)\n\t\tcert.signatures.x509 = {};\n\tvar sig = cert.signatures.x509;\n\n\tsig.algo = key.type + '-' + key.defaultHashAlgorithm();\n\tif (SIGN_ALGS[sig.algo] === undefined)\n\t\treturn (false);\n\n\tvar der = new asn1.BerWriter();\n\twriteTBSCert(cert, der);\n\tvar blob = der.buffer;\n\tsig.cache = blob;\n\n\tvar signer = key.createSign();\n\tsigner.write(blob);\n\tcert.signatures.x509.signature = signer.sign();\n\n\treturn (true);\n}\n\nfunction signAsync(cert, signer, done) {\n\tif (cert.signatures.x509 === undefined)\n\t\tcert.signatures.x509 = {};\n\tvar sig = cert.signatures.x509;\n\n\tvar der = new asn1.BerWriter();\n\twriteTBSCert(cert, der);\n\tvar blob = der.buffer;\n\tsig.cache = blob;\n\n\tsigner(blob, function (err, signature) {\n\t\tif (err) {\n\t\t\tdone(err);\n\t\t\treturn;\n\t\t}\n\t\tsig.algo = signature.type + '-' + signature.hashAlgorithm;\n\t\tif (SIGN_ALGS[sig.algo] === undefined) {\n\t\t\tdone(new Error('Invalid signing algorithm \"' +\n\t\t\t sig.algo + '\"'));\n\t\t\treturn;\n\t\t}\n\t\tsig.signature = signature;\n\t\tdone();\n\t});\n}\n\nfunction write(cert, options) {\n\tvar sig = cert.signatures.x509;\n\tassert.object(sig, 'x509 signature');\n\n\tvar der = new asn1.BerWriter();\n\tder.startSequence();\n\tif (sig.cache) {\n\t\tder._ensure(sig.cache.length);\n\t\tsig.cache.copy(der._buf, der._offset);\n\t\tder._offset += sig.cache.length;\n\t} else {\n\t\twriteTBSCert(cert, der);\n\t}\n\n\tder.startSequence();\n\tder.writeOID(SIGN_ALGS[sig.algo]);\n\tif (sig.algo.match(/^rsa-/))\n\t\tder.writeNull();\n\tder.endSequence();\n\n\tvar sigData = sig.signature.toBuffer('asn1');\n\tvar data = Buffer.alloc(sigData.length + 1);\n\tdata[0] = 0;\n\tsigData.copy(data, 1);\n\tder.writeBuffer(data, asn1.Ber.BitString);\n\tder.endSequence();\n\n\treturn (der.buffer);\n}\n\nfunction writeTBSCert(cert, der) {\n\tvar sig = cert.signatures.x509;\n\tassert.object(sig, 'x509 signature');\n\n\tder.startSequence();\n\n\tder.startSequence(Local(0));\n\tder.writeInt(2);\n\tder.endSequence();\n\n\tder.writeBuffer(utils.mpNormalize(cert.serial), asn1.Ber.Integer);\n\n\tder.startSequence();\n\tder.writeOID(SIGN_ALGS[sig.algo]);\n\tif (sig.algo.match(/^rsa-/))\n\t\tder.writeNull();\n\tder.endSequence();\n\n\tcert.issuer.toAsn1(der);\n\n\tder.startSequence();\n\twriteDate(der, cert.validFrom);\n\twriteDate(der, cert.validUntil);\n\tder.endSequence();\n\n\tvar subject = cert.subjects[0];\n\tvar altNames = cert.subjects.slice(1);\n\tsubject.toAsn1(der);\n\n\tpkcs8.writePkcs8(der, cert.subjectKey);\n\n\tif (sig.extras && sig.extras.issuerUniqueID) {\n\t\tder.writeBuffer(sig.extras.issuerUniqueID, Local(1));\n\t}\n\n\tif (sig.extras && sig.extras.subjectUniqueID) {\n\t\tder.writeBuffer(sig.extras.subjectUniqueID, Local(2));\n\t}\n\n\tif (altNames.length > 0 || subject.type === 'host' ||\n\t (cert.purposes !== undefined && cert.purposes.length > 0) ||\n\t (sig.extras && sig.extras.exts)) {\n\t\tder.startSequence(Local(3));\n\t\tder.startSequence();\n\n\t\tvar exts = [];\n\t\tif (cert.purposes !== undefined && cert.purposes.length > 0) {\n\t\t\texts.push({\n\t\t\t\toid: EXTS.basicConstraints,\n\t\t\t\tcritical: true\n\t\t\t});\n\t\t\texts.push({\n\t\t\t\toid: EXTS.keyUsage,\n\t\t\t\tcritical: true\n\t\t\t});\n\t\t\texts.push({\n\t\t\t\toid: EXTS.extKeyUsage,\n\t\t\t\tcritical: true\n\t\t\t});\n\t\t}\n\t\texts.push({ oid: EXTS.altName });\n\t\tif (sig.extras && sig.extras.exts)\n\t\t\texts = sig.extras.exts;\n\n\t\tfor (var i = 0; i < exts.length; ++i) {\n\t\t\tder.startSequence();\n\t\t\tder.writeOID(exts[i].oid);\n\n\t\t\tif (exts[i].critical !== undefined)\n\t\t\t\tder.writeBoolean(exts[i].critical);\n\n\t\t\tif (exts[i].oid === EXTS.altName) {\n\t\t\t\tder.startSequence(asn1.Ber.OctetString);\n\t\t\t\tder.startSequence();\n\t\t\t\tif (subject.type === 'host') {\n\t\t\t\t\tder.writeString(subject.hostname,\n\t\t\t\t\t Context(2));\n\t\t\t\t}\n\t\t\t\tfor (var j = 0; j < altNames.length; ++j) {\n\t\t\t\t\tif (altNames[j].type === 'host') {\n\t\t\t\t\t\tder.writeString(\n\t\t\t\t\t\t altNames[j].hostname,\n\t\t\t\t\t\t ALTNAME.DNSName);\n\t\t\t\t\t} else if (altNames[j].type ===\n\t\t\t\t\t 'email') {\n\t\t\t\t\t\tder.writeString(\n\t\t\t\t\t\t altNames[j].email,\n\t\t\t\t\t\t ALTNAME.RFC822Name);\n\t\t\t\t\t} else {\n\t\t\t\t\t\t/*\n\t\t\t\t\t\t * Encode anything else as a\n\t\t\t\t\t\t * DN style name for now.\n\t\t\t\t\t\t */\n\t\t\t\t\t\tder.startSequence(\n\t\t\t\t\t\t ALTNAME.DirectoryName);\n\t\t\t\t\t\taltNames[j].toAsn1(der);\n\t\t\t\t\t\tder.endSequence();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tder.endSequence();\n\t\t\t\tder.endSequence();\n\t\t\t} else if (exts[i].oid === EXTS.basicConstraints) {\n\t\t\t\tder.startSequence(asn1.Ber.OctetString);\n\t\t\t\tder.startSequence();\n\t\t\t\tvar ca = (cert.purposes.indexOf('ca') !== -1);\n\t\t\t\tvar pathLen = exts[i].pathLen;\n\t\t\t\tder.writeBoolean(ca);\n\t\t\t\tif (pathLen !== undefined)\n\t\t\t\t\tder.writeInt(pathLen);\n\t\t\t\tder.endSequence();\n\t\t\t\tder.endSequence();\n\t\t\t} else if (exts[i].oid === EXTS.extKeyUsage) {\n\t\t\t\tder.startSequence(asn1.Ber.OctetString);\n\t\t\t\tder.startSequence();\n\t\t\t\tcert.purposes.forEach(function (purpose) {\n\t\t\t\t\tif (purpose === 'ca')\n\t\t\t\t\t\treturn;\n\t\t\t\t\tif (KEYUSEBITS.indexOf(purpose) !== -1)\n\t\t\t\t\t\treturn;\n\t\t\t\t\tvar oid = purpose;\n\t\t\t\t\tif (EXTPURPOSE[purpose] !== undefined)\n\t\t\t\t\t\toid = EXTPURPOSE[purpose];\n\t\t\t\t\tder.writeOID(oid);\n\t\t\t\t});\n\t\t\t\tder.endSequence();\n\t\t\t\tder.endSequence();\n\t\t\t} else if (exts[i].oid === EXTS.keyUsage) {\n\t\t\t\tder.startSequence(asn1.Ber.OctetString);\n\t\t\t\t/*\n\t\t\t\t * If we parsed this certificate from a byte\n\t\t\t\t * stream (i.e. we didn't generate it in sshpk)\n\t\t\t\t * then we'll have a \".bits\" property on the\n\t\t\t\t * ext with the original raw byte contents.\n\t\t\t\t *\n\t\t\t\t * If we have this, use it here instead of\n\t\t\t\t * regenerating it. This guarantees we output\n\t\t\t\t * the same data we parsed, so signatures still\n\t\t\t\t * validate.\n\t\t\t\t */\n\t\t\t\tif (exts[i].bits !== undefined) {\n\t\t\t\t\tder.writeBuffer(exts[i].bits,\n\t\t\t\t\t asn1.Ber.BitString);\n\t\t\t\t} else {\n\t\t\t\t\tvar bits = writeBitField(cert.purposes,\n\t\t\t\t\t KEYUSEBITS);\n\t\t\t\t\tder.writeBuffer(bits,\n\t\t\t\t\t asn1.Ber.BitString);\n\t\t\t\t}\n\t\t\t\tder.endSequence();\n\t\t\t} else {\n\t\t\t\tder.writeBuffer(exts[i].data,\n\t\t\t\t asn1.Ber.OctetString);\n\t\t\t}\n\n\t\t\tder.endSequence();\n\t\t}\n\n\t\tder.endSequence();\n\t\tder.endSequence();\n\t}\n\n\tder.endSequence();\n}\n\n/*\n * Reads an ASN.1 BER bitfield out of the Buffer produced by doing\n * `BerReader#readString(asn1.Ber.BitString)`. That function gives us the raw\n * contents of the BitString tag, which is a count of unused bits followed by\n * the bits as a right-padded byte string.\n *\n * `bits` is the Buffer, `bitIndex` should contain an array of string names\n * for the bits in the string, ordered starting with bit #0 in the ASN.1 spec.\n *\n * Returns an array of Strings, the names of the bits that were set to 1.\n */\nfunction readBitField(bits, bitIndex) {\n\tvar bitLen = 8 * (bits.length - 1) - bits[0];\n\tvar setBits = {};\n\tfor (var i = 0; i < bitLen; ++i) {\n\t\tvar byteN = 1 + Math.floor(i / 8);\n\t\tvar bit = 7 - (i % 8);\n\t\tvar mask = 1 << bit;\n\t\tvar bitVal = ((bits[byteN] & mask) !== 0);\n\t\tvar name = bitIndex[i];\n\t\tif (bitVal && typeof (name) === 'string') {\n\t\t\tsetBits[name] = true;\n\t\t}\n\t}\n\treturn (Object.keys(setBits));\n}\n\n/*\n * `setBits` is an array of strings, containing the names for each bit that\n * sould be set to 1. `bitIndex` is same as in `readBitField()`.\n *\n * Returns a Buffer, ready to be written out with `BerWriter#writeString()`.\n */\nfunction writeBitField(setBits, bitIndex) {\n\tvar bitLen = bitIndex.length;\n\tvar blen = Math.ceil(bitLen / 8);\n\tvar unused = blen * 8 - bitLen;\n\tvar bits = Buffer.alloc(1 + blen); // zero-filled\n\tbits[0] = unused;\n\tfor (var i = 0; i < bitLen; ++i) {\n\t\tvar byteN = 1 + Math.floor(i / 8);\n\t\tvar bit = 7 - (i % 8);\n\t\tvar mask = 1 << bit;\n\t\tvar name = bitIndex[i];\n\t\tif (name === undefined)\n\t\t\tcontinue;\n\t\tvar bitVal = (setBits.indexOf(name) !== -1);\n\t\tif (bitVal) {\n\t\t\tbits[byteN] |= mask;\n\t\t}\n\t}\n\treturn (bits);\n}\n","// Copyright 2017 Joyent, Inc.\n\nmodule.exports = Identity;\n\nvar assert = require('assert-plus');\nvar algs = require('./algs');\nvar crypto = require('crypto');\nvar Fingerprint = require('./fingerprint');\nvar Signature = require('./signature');\nvar errs = require('./errors');\nvar util = require('util');\nvar utils = require('./utils');\nvar asn1 = require('asn1');\nvar Buffer = require('safer-buffer').Buffer;\n\n/*JSSTYLED*/\nvar DNS_NAME_RE = /^([*]|[a-z0-9][a-z0-9\\-]{0,62})(?:\\.([*]|[a-z0-9][a-z0-9\\-]{0,62}))*$/i;\n\nvar oids = {};\noids.cn = '2.5.4.3';\noids.o = '2.5.4.10';\noids.ou = '2.5.4.11';\noids.l = '2.5.4.7';\noids.s = '2.5.4.8';\noids.c = '2.5.4.6';\noids.sn = '2.5.4.4';\noids.postalCode = '2.5.4.17';\noids.serialNumber = '2.5.4.5';\noids.street = '2.5.4.9';\noids.x500UniqueIdentifier = '2.5.4.45';\noids.role = '2.5.4.72';\noids.telephoneNumber = '2.5.4.20';\noids.description = '2.5.4.13';\noids.dc = '0.9.2342.19200300.100.1.25';\noids.uid = '0.9.2342.19200300.100.1.1';\noids.mail = '0.9.2342.19200300.100.1.3';\noids.title = '2.5.4.12';\noids.gn = '2.5.4.42';\noids.initials = '2.5.4.43';\noids.pseudonym = '2.5.4.65';\noids.emailAddress = '1.2.840.113549.1.9.1';\n\nvar unoids = {};\nObject.keys(oids).forEach(function (k) {\n\tunoids[oids[k]] = k;\n});\n\nfunction Identity(opts) {\n\tvar self = this;\n\tassert.object(opts, 'options');\n\tassert.arrayOfObject(opts.components, 'options.components');\n\tthis.components = opts.components;\n\tthis.componentLookup = {};\n\tthis.components.forEach(function (c) {\n\t\tif (c.name && !c.oid)\n\t\t\tc.oid = oids[c.name];\n\t\tif (c.oid && !c.name)\n\t\t\tc.name = unoids[c.oid];\n\t\tif (self.componentLookup[c.name] === undefined)\n\t\t\tself.componentLookup[c.name] = [];\n\t\tself.componentLookup[c.name].push(c);\n\t});\n\tif (this.componentLookup.cn && this.componentLookup.cn.length > 0) {\n\t\tthis.cn = this.componentLookup.cn[0].value;\n\t}\n\tassert.optionalString(opts.type, 'options.type');\n\tif (opts.type === undefined) {\n\t\tif (this.components.length === 1 &&\n\t\t this.componentLookup.cn &&\n\t\t this.componentLookup.cn.length === 1 &&\n\t\t this.componentLookup.cn[0].value.match(DNS_NAME_RE)) {\n\t\t\tthis.type = 'host';\n\t\t\tthis.hostname = this.componentLookup.cn[0].value;\n\n\t\t} else if (this.componentLookup.dc &&\n\t\t this.components.length === this.componentLookup.dc.length) {\n\t\t\tthis.type = 'host';\n\t\t\tthis.hostname = this.componentLookup.dc.map(\n\t\t\t function (c) {\n\t\t\t\treturn (c.value);\n\t\t\t}).join('.');\n\n\t\t} else if (this.componentLookup.uid &&\n\t\t this.components.length ===\n\t\t this.componentLookup.uid.length) {\n\t\t\tthis.type = 'user';\n\t\t\tthis.uid = this.componentLookup.uid[0].value;\n\n\t\t} else if (this.componentLookup.cn &&\n\t\t this.componentLookup.cn.length === 1 &&\n\t\t this.componentLookup.cn[0].value.match(DNS_NAME_RE)) {\n\t\t\tthis.type = 'host';\n\t\t\tthis.hostname = this.componentLookup.cn[0].value;\n\n\t\t} else if (this.componentLookup.uid &&\n\t\t this.componentLookup.uid.length === 1) {\n\t\t\tthis.type = 'user';\n\t\t\tthis.uid = this.componentLookup.uid[0].value;\n\n\t\t} else if (this.componentLookup.mail &&\n\t\t this.componentLookup.mail.length === 1) {\n\t\t\tthis.type = 'email';\n\t\t\tthis.email = this.componentLookup.mail[0].value;\n\n\t\t} else if (this.componentLookup.cn &&\n\t\t this.componentLookup.cn.length === 1) {\n\t\t\tthis.type = 'user';\n\t\t\tthis.uid = this.componentLookup.cn[0].value;\n\n\t\t} else {\n\t\t\tthis.type = 'unknown';\n\t\t}\n\t} else {\n\t\tthis.type = opts.type;\n\t\tif (this.type === 'host')\n\t\t\tthis.hostname = opts.hostname;\n\t\telse if (this.type === 'user')\n\t\t\tthis.uid = opts.uid;\n\t\telse if (this.type === 'email')\n\t\t\tthis.email = opts.email;\n\t\telse\n\t\t\tthrow (new Error('Unknown type ' + this.type));\n\t}\n}\n\nIdentity.prototype.toString = function () {\n\treturn (this.components.map(function (c) {\n\t\tvar n = c.name.toUpperCase();\n\t\t/*JSSTYLED*/\n\t\tn = n.replace(/=/g, '\\\\=');\n\t\tvar v = c.value;\n\t\t/*JSSTYLED*/\n\t\tv = v.replace(/,/g, '\\\\,');\n\t\treturn (n + '=' + v);\n\t}).join(', '));\n};\n\nIdentity.prototype.get = function (name, asArray) {\n\tassert.string(name, 'name');\n\tvar arr = this.componentLookup[name];\n\tif (arr === undefined || arr.length === 0)\n\t\treturn (undefined);\n\tif (!asArray && arr.length > 1)\n\t\tthrow (new Error('Multiple values for attribute ' + name));\n\tif (!asArray)\n\t\treturn (arr[0].value);\n\treturn (arr.map(function (c) {\n\t\treturn (c.value);\n\t}));\n};\n\nIdentity.prototype.toArray = function (idx) {\n\treturn (this.components.map(function (c) {\n\t\treturn ({\n\t\t\tname: c.name,\n\t\t\tvalue: c.value\n\t\t});\n\t}));\n};\n\n/*\n * These are from X.680 -- PrintableString allowed chars are in section 37.4\n * table 8. Spec for IA5Strings is \"1,6 + SPACE + DEL\" where 1 refers to\n * ISO IR #001 (standard ASCII control characters) and 6 refers to ISO IR #006\n * (the basic ASCII character set).\n */\n/* JSSTYLED */\nvar NOT_PRINTABLE = /[^a-zA-Z0-9 '(),+.\\/:=?-]/;\n/* JSSTYLED */\nvar NOT_IA5 = /[^\\x00-\\x7f]/;\n\nIdentity.prototype.toAsn1 = function (der, tag) {\n\tder.startSequence(tag);\n\tthis.components.forEach(function (c) {\n\t\tder.startSequence(asn1.Ber.Constructor | asn1.Ber.Set);\n\t\tder.startSequence();\n\t\tder.writeOID(c.oid);\n\t\t/*\n\t\t * If we fit in a PrintableString, use that. Otherwise use an\n\t\t * IA5String or UTF8String.\n\t\t *\n\t\t * If this identity was parsed from a DN, use the ASN.1 types\n\t\t * from the original representation (otherwise this might not\n\t\t * be a full match for the original in some validators).\n\t\t */\n\t\tif (c.asn1type === asn1.Ber.Utf8String ||\n\t\t c.value.match(NOT_IA5)) {\n\t\t\tvar v = Buffer.from(c.value, 'utf8');\n\t\t\tder.writeBuffer(v, asn1.Ber.Utf8String);\n\n\t\t} else if (c.asn1type === asn1.Ber.IA5String ||\n\t\t c.value.match(NOT_PRINTABLE)) {\n\t\t\tder.writeString(c.value, asn1.Ber.IA5String);\n\n\t\t} else {\n\t\t\tvar type = asn1.Ber.PrintableString;\n\t\t\tif (c.asn1type !== undefined)\n\t\t\t\ttype = c.asn1type;\n\t\t\tder.writeString(c.value, type);\n\t\t}\n\t\tder.endSequence();\n\t\tder.endSequence();\n\t});\n\tder.endSequence();\n};\n\nfunction globMatch(a, b) {\n\tif (a === '**' || b === '**')\n\t\treturn (true);\n\tvar aParts = a.split('.');\n\tvar bParts = b.split('.');\n\tif (aParts.length !== bParts.length)\n\t\treturn (false);\n\tfor (var i = 0; i < aParts.length; ++i) {\n\t\tif (aParts[i] === '*' || bParts[i] === '*')\n\t\t\tcontinue;\n\t\tif (aParts[i] !== bParts[i])\n\t\t\treturn (false);\n\t}\n\treturn (true);\n}\n\nIdentity.prototype.equals = function (other) {\n\tif (!Identity.isIdentity(other, [1, 0]))\n\t\treturn (false);\n\tif (other.components.length !== this.components.length)\n\t\treturn (false);\n\tfor (var i = 0; i < this.components.length; ++i) {\n\t\tif (this.components[i].oid !== other.components[i].oid)\n\t\t\treturn (false);\n\t\tif (!globMatch(this.components[i].value,\n\t\t other.components[i].value)) {\n\t\t\treturn (false);\n\t\t}\n\t}\n\treturn (true);\n};\n\nIdentity.forHost = function (hostname) {\n\tassert.string(hostname, 'hostname');\n\treturn (new Identity({\n\t\ttype: 'host',\n\t\thostname: hostname,\n\t\tcomponents: [ { name: 'cn', value: hostname } ]\n\t}));\n};\n\nIdentity.forUser = function (uid) {\n\tassert.string(uid, 'uid');\n\treturn (new Identity({\n\t\ttype: 'user',\n\t\tuid: uid,\n\t\tcomponents: [ { name: 'uid', value: uid } ]\n\t}));\n};\n\nIdentity.forEmail = function (email) {\n\tassert.string(email, 'email');\n\treturn (new Identity({\n\t\ttype: 'email',\n\t\temail: email,\n\t\tcomponents: [ { name: 'mail', value: email } ]\n\t}));\n};\n\nIdentity.parseDN = function (dn) {\n\tassert.string(dn, 'dn');\n\tvar parts = [''];\n\tvar idx = 0;\n\tvar rem = dn;\n\twhile (rem.length > 0) {\n\t\tvar m;\n\t\t/*JSSTYLED*/\n\t\tif ((m = /^,/.exec(rem)) !== null) {\n\t\t\tparts[++idx] = '';\n\t\t\trem = rem.slice(m[0].length);\n\t\t/*JSSTYLED*/\n\t\t} else if ((m = /^\\\\,/.exec(rem)) !== null) {\n\t\t\tparts[idx] += ',';\n\t\t\trem = rem.slice(m[0].length);\n\t\t/*JSSTYLED*/\n\t\t} else if ((m = /^\\\\./.exec(rem)) !== null) {\n\t\t\tparts[idx] += m[0];\n\t\t\trem = rem.slice(m[0].length);\n\t\t/*JSSTYLED*/\n\t\t} else if ((m = /^[^\\\\,]+/.exec(rem)) !== null) {\n\t\t\tparts[idx] += m[0];\n\t\t\trem = rem.slice(m[0].length);\n\t\t} else {\n\t\t\tthrow (new Error('Failed to parse DN'));\n\t\t}\n\t}\n\tvar cmps = parts.map(function (c) {\n\t\tc = c.trim();\n\t\tvar eqPos = c.indexOf('=');\n\t\twhile (eqPos > 0 && c.charAt(eqPos - 1) === '\\\\')\n\t\t\teqPos = c.indexOf('=', eqPos + 1);\n\t\tif (eqPos === -1) {\n\t\t\tthrow (new Error('Failed to parse DN'));\n\t\t}\n\t\t/*JSSTYLED*/\n\t\tvar name = c.slice(0, eqPos).toLowerCase().replace(/\\\\=/g, '=');\n\t\tvar value = c.slice(eqPos + 1);\n\t\treturn ({ name: name, value: value });\n\t});\n\treturn (new Identity({ components: cmps }));\n};\n\nIdentity.fromArray = function (components) {\n\tassert.arrayOfObject(components, 'components');\n\tcomponents.forEach(function (cmp) {\n\t\tassert.object(cmp, 'component');\n\t\tassert.string(cmp.name, 'component.name');\n\t\tif (!Buffer.isBuffer(cmp.value) &&\n\t\t !(typeof (cmp.value) === 'string')) {\n\t\t\tthrow (new Error('Invalid component value'));\n\t\t}\n\t});\n\treturn (new Identity({ components: components }));\n};\n\nIdentity.parseAsn1 = function (der, top) {\n\tvar components = [];\n\tder.readSequence(top);\n\tvar end = der.offset + der.length;\n\twhile (der.offset < end) {\n\t\tder.readSequence(asn1.Ber.Constructor | asn1.Ber.Set);\n\t\tvar after = der.offset + der.length;\n\t\tder.readSequence();\n\t\tvar oid = der.readOID();\n\t\tvar type = der.peek();\n\t\tvar value;\n\t\tswitch (type) {\n\t\tcase asn1.Ber.PrintableString:\n\t\tcase asn1.Ber.IA5String:\n\t\tcase asn1.Ber.OctetString:\n\t\tcase asn1.Ber.T61String:\n\t\t\tvalue = der.readString(type);\n\t\t\tbreak;\n\t\tcase asn1.Ber.Utf8String:\n\t\t\tvalue = der.readString(type, true);\n\t\t\tvalue = value.toString('utf8');\n\t\t\tbreak;\n\t\tcase asn1.Ber.CharacterString:\n\t\tcase asn1.Ber.BMPString:\n\t\t\tvalue = der.readString(type, true);\n\t\t\tvalue = value.toString('utf16le');\n\t\t\tbreak;\n\t\tdefault:\n\t\t\tthrow (new Error('Unknown asn1 type ' + type));\n\t\t}\n\t\tcomponents.push({ oid: oid, asn1type: type, value: value });\n\t\tder._offset = after;\n\t}\n\tder._offset = end;\n\treturn (new Identity({\n\t\tcomponents: components\n\t}));\n};\n\nIdentity.isIdentity = function (obj, ver) {\n\treturn (utils.isCompatible(obj, Identity, ver));\n};\n\n/*\n * API versions for Identity:\n * [1,0] -- initial ver\n */\nIdentity.prototype._sshpkApiVersion = [1, 0];\n\nIdentity._oldVersionDetect = function (obj) {\n\treturn ([1, 0]);\n};\n","// Copyright 2015 Joyent, Inc.\n\nvar Key = require('./key');\nvar Fingerprint = require('./fingerprint');\nvar Signature = require('./signature');\nvar PrivateKey = require('./private-key');\nvar Certificate = require('./certificate');\nvar Identity = require('./identity');\nvar errs = require('./errors');\n\nmodule.exports = {\n\t/* top-level classes */\n\tKey: Key,\n\tparseKey: Key.parse,\n\tFingerprint: Fingerprint,\n\tparseFingerprint: Fingerprint.parse,\n\tSignature: Signature,\n\tparseSignature: Signature.parse,\n\tPrivateKey: PrivateKey,\n\tparsePrivateKey: PrivateKey.parse,\n\tgeneratePrivateKey: PrivateKey.generate,\n\tCertificate: Certificate,\n\tparseCertificate: Certificate.parse,\n\tcreateSelfSignedCertificate: Certificate.createSelfSigned,\n\tcreateCertificate: Certificate.create,\n\tIdentity: Identity,\n\tidentityFromDN: Identity.parseDN,\n\tidentityForHost: Identity.forHost,\n\tidentityForUser: Identity.forUser,\n\tidentityForEmail: Identity.forEmail,\n\tidentityFromArray: Identity.fromArray,\n\n\t/* errors */\n\tFingerprintFormatError: errs.FingerprintFormatError,\n\tInvalidAlgorithmError: errs.InvalidAlgorithmError,\n\tKeyParseError: errs.KeyParseError,\n\tSignatureParseError: errs.SignatureParseError,\n\tKeyEncryptedError: errs.KeyEncryptedError,\n\tCertificateParseError: errs.CertificateParseError\n};\n","// Copyright 2018 Joyent, Inc.\n\nmodule.exports = Key;\n\nvar assert = require('assert-plus');\nvar algs = require('./algs');\nvar crypto = require('crypto');\nvar Fingerprint = require('./fingerprint');\nvar Signature = require('./signature');\nvar DiffieHellman = require('./dhe').DiffieHellman;\nvar errs = require('./errors');\nvar utils = require('./utils');\nvar PrivateKey = require('./private-key');\nvar edCompat;\n\ntry {\n\tedCompat = require('./ed-compat');\n} catch (e) {\n\t/* Just continue through, and bail out if we try to use it. */\n}\n\nvar InvalidAlgorithmError = errs.InvalidAlgorithmError;\nvar KeyParseError = errs.KeyParseError;\n\nvar formats = {};\nformats['auto'] = require('./formats/auto');\nformats['pem'] = require('./formats/pem');\nformats['pkcs1'] = require('./formats/pkcs1');\nformats['pkcs8'] = require('./formats/pkcs8');\nformats['rfc4253'] = require('./formats/rfc4253');\nformats['ssh'] = require('./formats/ssh');\nformats['ssh-private'] = require('./formats/ssh-private');\nformats['openssh'] = formats['ssh-private'];\nformats['dnssec'] = require('./formats/dnssec');\nformats['putty'] = require('./formats/putty');\nformats['ppk'] = formats['putty'];\n\nfunction Key(opts) {\n\tassert.object(opts, 'options');\n\tassert.arrayOfObject(opts.parts, 'options.parts');\n\tassert.string(opts.type, 'options.type');\n\tassert.optionalString(opts.comment, 'options.comment');\n\n\tvar algInfo = algs.info[opts.type];\n\tif (typeof (algInfo) !== 'object')\n\t\tthrow (new InvalidAlgorithmError(opts.type));\n\n\tvar partLookup = {};\n\tfor (var i = 0; i < opts.parts.length; ++i) {\n\t\tvar part = opts.parts[i];\n\t\tpartLookup[part.name] = part;\n\t}\n\n\tthis.type = opts.type;\n\tthis.parts = opts.parts;\n\tthis.part = partLookup;\n\tthis.comment = undefined;\n\tthis.source = opts.source;\n\n\t/* for speeding up hashing/fingerprint operations */\n\tthis._rfc4253Cache = opts._rfc4253Cache;\n\tthis._hashCache = {};\n\n\tvar sz;\n\tthis.curve = undefined;\n\tif (this.type === 'ecdsa') {\n\t\tvar curve = this.part.curve.data.toString();\n\t\tthis.curve = curve;\n\t\tsz = algs.curves[curve].size;\n\t} else if (this.type === 'ed25519' || this.type === 'curve25519') {\n\t\tsz = 256;\n\t\tthis.curve = 'curve25519';\n\t} else {\n\t\tvar szPart = this.part[algInfo.sizePart];\n\t\tsz = szPart.data.length;\n\t\tsz = sz * 8 - utils.countZeros(szPart.data);\n\t}\n\tthis.size = sz;\n}\n\nKey.formats = formats;\n\nKey.prototype.toBuffer = function (format, options) {\n\tif (format === undefined)\n\t\tformat = 'ssh';\n\tassert.string(format, 'format');\n\tassert.object(formats[format], 'formats[format]');\n\tassert.optionalObject(options, 'options');\n\n\tif (format === 'rfc4253') {\n\t\tif (this._rfc4253Cache === undefined)\n\t\t\tthis._rfc4253Cache = formats['rfc4253'].write(this);\n\t\treturn (this._rfc4253Cache);\n\t}\n\n\treturn (formats[format].write(this, options));\n};\n\nKey.prototype.toString = function (format, options) {\n\treturn (this.toBuffer(format, options).toString());\n};\n\nKey.prototype.hash = function (algo, type) {\n\tassert.string(algo, 'algorithm');\n\tassert.optionalString(type, 'type');\n\tif (type === undefined)\n\t\ttype = 'ssh';\n\talgo = algo.toLowerCase();\n\tif (algs.hashAlgs[algo] === undefined)\n\t\tthrow (new InvalidAlgorithmError(algo));\n\n\tvar cacheKey = algo + '||' + type;\n\tif (this._hashCache[cacheKey])\n\t\treturn (this._hashCache[cacheKey]);\n\n\tvar buf;\n\tif (type === 'ssh') {\n\t\tbuf = this.toBuffer('rfc4253');\n\t} else if (type === 'spki') {\n\t\tbuf = formats.pkcs8.pkcs8ToBuffer(this);\n\t} else {\n\t\tthrow (new Error('Hash type ' + type + ' not supported'));\n\t}\n\tvar hash = crypto.createHash(algo).update(buf).digest();\n\tthis._hashCache[cacheKey] = hash;\n\treturn (hash);\n};\n\nKey.prototype.fingerprint = function (algo, type) {\n\tif (algo === undefined)\n\t\talgo = 'sha256';\n\tif (type === undefined)\n\t\ttype = 'ssh';\n\tassert.string(algo, 'algorithm');\n\tassert.string(type, 'type');\n\tvar opts = {\n\t\ttype: 'key',\n\t\thash: this.hash(algo, type),\n\t\talgorithm: algo,\n\t\thashType: type\n\t};\n\treturn (new Fingerprint(opts));\n};\n\nKey.prototype.defaultHashAlgorithm = function () {\n\tvar hashAlgo = 'sha1';\n\tif (this.type === 'rsa')\n\t\thashAlgo = 'sha256';\n\tif (this.type === 'dsa' && this.size > 1024)\n\t\thashAlgo = 'sha256';\n\tif (this.type === 'ed25519')\n\t\thashAlgo = 'sha512';\n\tif (this.type === 'ecdsa') {\n\t\tif (this.size <= 256)\n\t\t\thashAlgo = 'sha256';\n\t\telse if (this.size <= 384)\n\t\t\thashAlgo = 'sha384';\n\t\telse\n\t\t\thashAlgo = 'sha512';\n\t}\n\treturn (hashAlgo);\n};\n\nKey.prototype.createVerify = function (hashAlgo) {\n\tif (hashAlgo === undefined)\n\t\thashAlgo = this.defaultHashAlgorithm();\n\tassert.string(hashAlgo, 'hash algorithm');\n\n\t/* ED25519 is not supported by OpenSSL, use a javascript impl. */\n\tif (this.type === 'ed25519' && edCompat !== undefined)\n\t\treturn (new edCompat.Verifier(this, hashAlgo));\n\tif (this.type === 'curve25519')\n\t\tthrow (new Error('Curve25519 keys are not suitable for ' +\n\t\t 'signing or verification'));\n\n\tvar v, nm, err;\n\ttry {\n\t\tnm = hashAlgo.toUpperCase();\n\t\tv = crypto.createVerify(nm);\n\t} catch (e) {\n\t\terr = e;\n\t}\n\tif (v === undefined || (err instanceof Error &&\n\t err.message.match(/Unknown message digest/))) {\n\t\tnm = 'RSA-';\n\t\tnm += hashAlgo.toUpperCase();\n\t\tv = crypto.createVerify(nm);\n\t}\n\tassert.ok(v, 'failed to create verifier');\n\tvar oldVerify = v.verify.bind(v);\n\tvar key = this.toBuffer('pkcs8');\n\tvar curve = this.curve;\n\tvar self = this;\n\tv.verify = function (signature, fmt) {\n\t\tif (Signature.isSignature(signature, [2, 0])) {\n\t\t\tif (signature.type !== self.type)\n\t\t\t\treturn (false);\n\t\t\tif (signature.hashAlgorithm &&\n\t\t\t signature.hashAlgorithm !== hashAlgo)\n\t\t\t\treturn (false);\n\t\t\tif (signature.curve && self.type === 'ecdsa' &&\n\t\t\t signature.curve !== curve)\n\t\t\t\treturn (false);\n\t\t\treturn (oldVerify(key, signature.toBuffer('asn1')));\n\n\t\t} else if (typeof (signature) === 'string' ||\n\t\t Buffer.isBuffer(signature)) {\n\t\t\treturn (oldVerify(key, signature, fmt));\n\n\t\t/*\n\t\t * Avoid doing this on valid arguments, walking the prototype\n\t\t * chain can be quite slow.\n\t\t */\n\t\t} else if (Signature.isSignature(signature, [1, 0])) {\n\t\t\tthrow (new Error('signature was created by too old ' +\n\t\t\t 'a version of sshpk and cannot be verified'));\n\n\t\t} else {\n\t\t\tthrow (new TypeError('signature must be a string, ' +\n\t\t\t 'Buffer, or Signature object'));\n\t\t}\n\t};\n\treturn (v);\n};\n\nKey.prototype.createDiffieHellman = function () {\n\tif (this.type === 'rsa')\n\t\tthrow (new Error('RSA keys do not support Diffie-Hellman'));\n\n\treturn (new DiffieHellman(this));\n};\nKey.prototype.createDH = Key.prototype.createDiffieHellman;\n\nKey.parse = function (data, format, options) {\n\tif (typeof (data) !== 'string')\n\t\tassert.buffer(data, 'data');\n\tif (format === undefined)\n\t\tformat = 'auto';\n\tassert.string(format, 'format');\n\tif (typeof (options) === 'string')\n\t\toptions = { filename: options };\n\tassert.optionalObject(options, 'options');\n\tif (options === undefined)\n\t\toptions = {};\n\tassert.optionalString(options.filename, 'options.filename');\n\tif (options.filename === undefined)\n\t\toptions.filename = '(unnamed)';\n\n\tassert.object(formats[format], 'formats[format]');\n\n\ttry {\n\t\tvar k = formats[format].read(data, options);\n\t\tif (k instanceof PrivateKey)\n\t\t\tk = k.toPublic();\n\t\tif (!k.comment)\n\t\t\tk.comment = options.filename;\n\t\treturn (k);\n\t} catch (e) {\n\t\tif (e.name === 'KeyEncryptedError')\n\t\t\tthrow (e);\n\t\tthrow (new KeyParseError(options.filename, format, e));\n\t}\n};\n\nKey.isKey = function (obj, ver) {\n\treturn (utils.isCompatible(obj, Key, ver));\n};\n\n/*\n * API versions for Key:\n * [1,0] -- initial ver, may take Signature for createVerify or may not\n * [1,1] -- added pkcs1, pkcs8 formats\n * [1,2] -- added auto, ssh-private, openssh formats\n * [1,3] -- added defaultHashAlgorithm\n * [1,4] -- added ed support, createDH\n * [1,5] -- first explicitly tagged version\n * [1,6] -- changed ed25519 part names\n * [1,7] -- spki hash types\n */\nKey.prototype._sshpkApiVersion = [1, 7];\n\nKey._oldVersionDetect = function (obj) {\n\tassert.func(obj.toBuffer);\n\tassert.func(obj.fingerprint);\n\tif (obj.createDH)\n\t\treturn ([1, 4]);\n\tif (obj.defaultHashAlgorithm)\n\t\treturn ([1, 3]);\n\tif (obj.formats['auto'])\n\t\treturn ([1, 2]);\n\tif (obj.formats['pkcs1'])\n\t\treturn ([1, 1]);\n\treturn ([1, 0]);\n};\n","// Copyright 2017 Joyent, Inc.\n\nmodule.exports = PrivateKey;\n\nvar assert = require('assert-plus');\nvar Buffer = require('safer-buffer').Buffer;\nvar algs = require('./algs');\nvar crypto = require('crypto');\nvar Fingerprint = require('./fingerprint');\nvar Signature = require('./signature');\nvar errs = require('./errors');\nvar util = require('util');\nvar utils = require('./utils');\nvar dhe = require('./dhe');\nvar generateECDSA = dhe.generateECDSA;\nvar generateED25519 = dhe.generateED25519;\nvar edCompat = require('./ed-compat');\nvar nacl = require('tweetnacl');\n\nvar Key = require('./key');\n\nvar InvalidAlgorithmError = errs.InvalidAlgorithmError;\nvar KeyParseError = errs.KeyParseError;\nvar KeyEncryptedError = errs.KeyEncryptedError;\n\nvar formats = {};\nformats['auto'] = require('./formats/auto');\nformats['pem'] = require('./formats/pem');\nformats['pkcs1'] = require('./formats/pkcs1');\nformats['pkcs8'] = require('./formats/pkcs8');\nformats['rfc4253'] = require('./formats/rfc4253');\nformats['ssh-private'] = require('./formats/ssh-private');\nformats['openssh'] = formats['ssh-private'];\nformats['ssh'] = formats['ssh-private'];\nformats['dnssec'] = require('./formats/dnssec');\n\nfunction PrivateKey(opts) {\n\tassert.object(opts, 'options');\n\tKey.call(this, opts);\n\n\tthis._pubCache = undefined;\n}\nutil.inherits(PrivateKey, Key);\n\nPrivateKey.formats = formats;\n\nPrivateKey.prototype.toBuffer = function (format, options) {\n\tif (format === undefined)\n\t\tformat = 'pkcs1';\n\tassert.string(format, 'format');\n\tassert.object(formats[format], 'formats[format]');\n\tassert.optionalObject(options, 'options');\n\n\treturn (formats[format].write(this, options));\n};\n\nPrivateKey.prototype.hash = function (algo, type) {\n\treturn (this.toPublic().hash(algo, type));\n};\n\nPrivateKey.prototype.fingerprint = function (algo, type) {\n\treturn (this.toPublic().fingerprint(algo, type));\n};\n\nPrivateKey.prototype.toPublic = function () {\n\tif (this._pubCache)\n\t\treturn (this._pubCache);\n\n\tvar algInfo = algs.info[this.type];\n\tvar pubParts = [];\n\tfor (var i = 0; i < algInfo.parts.length; ++i) {\n\t\tvar p = algInfo.parts[i];\n\t\tpubParts.push(this.part[p]);\n\t}\n\n\tthis._pubCache = new Key({\n\t\ttype: this.type,\n\t\tsource: this,\n\t\tparts: pubParts\n\t});\n\tif (this.comment)\n\t\tthis._pubCache.comment = this.comment;\n\treturn (this._pubCache);\n};\n\nPrivateKey.prototype.derive = function (newType) {\n\tassert.string(newType, 'type');\n\tvar priv, pub, pair;\n\n\tif (this.type === 'ed25519' && newType === 'curve25519') {\n\t\tpriv = this.part.k.data;\n\t\tif (priv[0] === 0x00)\n\t\t\tpriv = priv.slice(1);\n\n\t\tpair = nacl.box.keyPair.fromSecretKey(new Uint8Array(priv));\n\t\tpub = Buffer.from(pair.publicKey);\n\n\t\treturn (new PrivateKey({\n\t\t\ttype: 'curve25519',\n\t\t\tparts: [\n\t\t\t\t{ name: 'A', data: utils.mpNormalize(pub) },\n\t\t\t\t{ name: 'k', data: utils.mpNormalize(priv) }\n\t\t\t]\n\t\t}));\n\t} else if (this.type === 'curve25519' && newType === 'ed25519') {\n\t\tpriv = this.part.k.data;\n\t\tif (priv[0] === 0x00)\n\t\t\tpriv = priv.slice(1);\n\n\t\tpair = nacl.sign.keyPair.fromSeed(new Uint8Array(priv));\n\t\tpub = Buffer.from(pair.publicKey);\n\n\t\treturn (new PrivateKey({\n\t\t\ttype: 'ed25519',\n\t\t\tparts: [\n\t\t\t\t{ name: 'A', data: utils.mpNormalize(pub) },\n\t\t\t\t{ name: 'k', data: utils.mpNormalize(priv) }\n\t\t\t]\n\t\t}));\n\t}\n\tthrow (new Error('Key derivation not supported from ' + this.type +\n\t ' to ' + newType));\n};\n\nPrivateKey.prototype.createVerify = function (hashAlgo) {\n\treturn (this.toPublic().createVerify(hashAlgo));\n};\n\nPrivateKey.prototype.createSign = function (hashAlgo) {\n\tif (hashAlgo === undefined)\n\t\thashAlgo = this.defaultHashAlgorithm();\n\tassert.string(hashAlgo, 'hash algorithm');\n\n\t/* ED25519 is not supported by OpenSSL, use a javascript impl. */\n\tif (this.type === 'ed25519' && edCompat !== undefined)\n\t\treturn (new edCompat.Signer(this, hashAlgo));\n\tif (this.type === 'curve25519')\n\t\tthrow (new Error('Curve25519 keys are not suitable for ' +\n\t\t 'signing or verification'));\n\n\tvar v, nm, err;\n\ttry {\n\t\tnm = hashAlgo.toUpperCase();\n\t\tv = crypto.createSign(nm);\n\t} catch (e) {\n\t\terr = e;\n\t}\n\tif (v === undefined || (err instanceof Error &&\n\t err.message.match(/Unknown message digest/))) {\n\t\tnm = 'RSA-';\n\t\tnm += hashAlgo.toUpperCase();\n\t\tv = crypto.createSign(nm);\n\t}\n\tassert.ok(v, 'failed to create verifier');\n\tvar oldSign = v.sign.bind(v);\n\tvar key = this.toBuffer('pkcs1');\n\tvar type = this.type;\n\tvar curve = this.curve;\n\tv.sign = function () {\n\t\tvar sig = oldSign(key);\n\t\tif (typeof (sig) === 'string')\n\t\t\tsig = Buffer.from(sig, 'binary');\n\t\tsig = Signature.parse(sig, type, 'asn1');\n\t\tsig.hashAlgorithm = hashAlgo;\n\t\tsig.curve = curve;\n\t\treturn (sig);\n\t};\n\treturn (v);\n};\n\nPrivateKey.parse = function (data, format, options) {\n\tif (typeof (data) !== 'string')\n\t\tassert.buffer(data, 'data');\n\tif (format === undefined)\n\t\tformat = 'auto';\n\tassert.string(format, 'format');\n\tif (typeof (options) === 'string')\n\t\toptions = { filename: options };\n\tassert.optionalObject(options, 'options');\n\tif (options === undefined)\n\t\toptions = {};\n\tassert.optionalString(options.filename, 'options.filename');\n\tif (options.filename === undefined)\n\t\toptions.filename = '(unnamed)';\n\n\tassert.object(formats[format], 'formats[format]');\n\n\ttry {\n\t\tvar k = formats[format].read(data, options);\n\t\tassert.ok(k instanceof PrivateKey, 'key is not a private key');\n\t\tif (!k.comment)\n\t\t\tk.comment = options.filename;\n\t\treturn (k);\n\t} catch (e) {\n\t\tif (e.name === 'KeyEncryptedError')\n\t\t\tthrow (e);\n\t\tthrow (new KeyParseError(options.filename, format, e));\n\t}\n};\n\nPrivateKey.isPrivateKey = function (obj, ver) {\n\treturn (utils.isCompatible(obj, PrivateKey, ver));\n};\n\nPrivateKey.generate = function (type, options) {\n\tif (options === undefined)\n\t\toptions = {};\n\tassert.object(options, 'options');\n\n\tswitch (type) {\n\tcase 'ecdsa':\n\t\tif (options.curve === undefined)\n\t\t\toptions.curve = 'nistp256';\n\t\tassert.string(options.curve, 'options.curve');\n\t\treturn (generateECDSA(options.curve));\n\tcase 'ed25519':\n\t\treturn (generateED25519());\n\tdefault:\n\t\tthrow (new Error('Key generation not supported with key ' +\n\t\t 'type \"' + type + '\"'));\n\t}\n};\n\n/*\n * API versions for PrivateKey:\n * [1,0] -- initial ver\n * [1,1] -- added auto, pkcs[18], openssh/ssh-private formats\n * [1,2] -- added defaultHashAlgorithm\n * [1,3] -- added derive, ed, createDH\n * [1,4] -- first tagged version\n * [1,5] -- changed ed25519 part names and format\n * [1,6] -- type arguments for hash() and fingerprint()\n */\nPrivateKey.prototype._sshpkApiVersion = [1, 6];\n\nPrivateKey._oldVersionDetect = function (obj) {\n\tassert.func(obj.toPublic);\n\tassert.func(obj.createSign);\n\tif (obj.derive)\n\t\treturn ([1, 3]);\n\tif (obj.defaultHashAlgorithm)\n\t\treturn ([1, 2]);\n\tif (obj.formats['auto'])\n\t\treturn ([1, 1]);\n\treturn ([1, 0]);\n};\n","// Copyright 2015 Joyent, Inc.\n\nmodule.exports = Signature;\n\nvar assert = require('assert-plus');\nvar Buffer = require('safer-buffer').Buffer;\nvar algs = require('./algs');\nvar crypto = require('crypto');\nvar errs = require('./errors');\nvar utils = require('./utils');\nvar asn1 = require('asn1');\nvar SSHBuffer = require('./ssh-buffer');\n\nvar InvalidAlgorithmError = errs.InvalidAlgorithmError;\nvar SignatureParseError = errs.SignatureParseError;\n\nfunction Signature(opts) {\n\tassert.object(opts, 'options');\n\tassert.arrayOfObject(opts.parts, 'options.parts');\n\tassert.string(opts.type, 'options.type');\n\n\tvar partLookup = {};\n\tfor (var i = 0; i < opts.parts.length; ++i) {\n\t\tvar part = opts.parts[i];\n\t\tpartLookup[part.name] = part;\n\t}\n\n\tthis.type = opts.type;\n\tthis.hashAlgorithm = opts.hashAlgo;\n\tthis.curve = opts.curve;\n\tthis.parts = opts.parts;\n\tthis.part = partLookup;\n}\n\nSignature.prototype.toBuffer = function (format) {\n\tif (format === undefined)\n\t\tformat = 'asn1';\n\tassert.string(format, 'format');\n\n\tvar buf;\n\tvar stype = 'ssh-' + this.type;\n\n\tswitch (this.type) {\n\tcase 'rsa':\n\t\tswitch (this.hashAlgorithm) {\n\t\tcase 'sha256':\n\t\t\tstype = 'rsa-sha2-256';\n\t\t\tbreak;\n\t\tcase 'sha512':\n\t\t\tstype = 'rsa-sha2-512';\n\t\t\tbreak;\n\t\tcase 'sha1':\n\t\tcase undefined:\n\t\t\tbreak;\n\t\tdefault:\n\t\t\tthrow (new Error('SSH signature ' +\n\t\t\t 'format does not support hash ' +\n\t\t\t 'algorithm ' + this.hashAlgorithm));\n\t\t}\n\t\tif (format === 'ssh') {\n\t\t\tbuf = new SSHBuffer({});\n\t\t\tbuf.writeString(stype);\n\t\t\tbuf.writePart(this.part.sig);\n\t\t\treturn (buf.toBuffer());\n\t\t} else {\n\t\t\treturn (this.part.sig.data);\n\t\t}\n\t\tbreak;\n\n\tcase 'ed25519':\n\t\tif (format === 'ssh') {\n\t\t\tbuf = new SSHBuffer({});\n\t\t\tbuf.writeString(stype);\n\t\t\tbuf.writePart(this.part.sig);\n\t\t\treturn (buf.toBuffer());\n\t\t} else {\n\t\t\treturn (this.part.sig.data);\n\t\t}\n\t\tbreak;\n\n\tcase 'dsa':\n\tcase 'ecdsa':\n\t\tvar r, s;\n\t\tif (format === 'asn1') {\n\t\t\tvar der = new asn1.BerWriter();\n\t\t\tder.startSequence();\n\t\t\tr = utils.mpNormalize(this.part.r.data);\n\t\t\ts = utils.mpNormalize(this.part.s.data);\n\t\t\tder.writeBuffer(r, asn1.Ber.Integer);\n\t\t\tder.writeBuffer(s, asn1.Ber.Integer);\n\t\t\tder.endSequence();\n\t\t\treturn (der.buffer);\n\t\t} else if (format === 'ssh' && this.type === 'dsa') {\n\t\t\tbuf = new SSHBuffer({});\n\t\t\tbuf.writeString('ssh-dss');\n\t\t\tr = this.part.r.data;\n\t\t\tif (r.length > 20 && r[0] === 0x00)\n\t\t\t\tr = r.slice(1);\n\t\t\ts = this.part.s.data;\n\t\t\tif (s.length > 20 && s[0] === 0x00)\n\t\t\t\ts = s.slice(1);\n\t\t\tif ((this.hashAlgorithm &&\n\t\t\t this.hashAlgorithm !== 'sha1') ||\n\t\t\t r.length + s.length !== 40) {\n\t\t\t\tthrow (new Error('OpenSSH only supports ' +\n\t\t\t\t 'DSA signatures with SHA1 hash'));\n\t\t\t}\n\t\t\tbuf.writeBuffer(Buffer.concat([r, s]));\n\t\t\treturn (buf.toBuffer());\n\t\t} else if (format === 'ssh' && this.type === 'ecdsa') {\n\t\t\tvar inner = new SSHBuffer({});\n\t\t\tr = this.part.r.data;\n\t\t\tinner.writeBuffer(r);\n\t\t\tinner.writePart(this.part.s);\n\n\t\t\tbuf = new SSHBuffer({});\n\t\t\t/* XXX: find a more proper way to do this? */\n\t\t\tvar curve;\n\t\t\tif (r[0] === 0x00)\n\t\t\t\tr = r.slice(1);\n\t\t\tvar sz = r.length * 8;\n\t\t\tif (sz === 256)\n\t\t\t\tcurve = 'nistp256';\n\t\t\telse if (sz === 384)\n\t\t\t\tcurve = 'nistp384';\n\t\t\telse if (sz === 528)\n\t\t\t\tcurve = 'nistp521';\n\t\t\tbuf.writeString('ecdsa-sha2-' + curve);\n\t\t\tbuf.writeBuffer(inner.toBuffer());\n\t\t\treturn (buf.toBuffer());\n\t\t}\n\t\tthrow (new Error('Invalid signature format'));\n\tdefault:\n\t\tthrow (new Error('Invalid signature data'));\n\t}\n};\n\nSignature.prototype.toString = function (format) {\n\tassert.optionalString(format, 'format');\n\treturn (this.toBuffer(format).toString('base64'));\n};\n\nSignature.parse = function (data, type, format) {\n\tif (typeof (data) === 'string')\n\t\tdata = Buffer.from(data, 'base64');\n\tassert.buffer(data, 'data');\n\tassert.string(format, 'format');\n\tassert.string(type, 'type');\n\n\tvar opts = {};\n\topts.type = type.toLowerCase();\n\topts.parts = [];\n\n\ttry {\n\t\tassert.ok(data.length > 0, 'signature must not be empty');\n\t\tswitch (opts.type) {\n\t\tcase 'rsa':\n\t\t\treturn (parseOneNum(data, type, format, opts));\n\t\tcase 'ed25519':\n\t\t\treturn (parseOneNum(data, type, format, opts));\n\n\t\tcase 'dsa':\n\t\tcase 'ecdsa':\n\t\t\tif (format === 'asn1')\n\t\t\t\treturn (parseDSAasn1(data, type, format, opts));\n\t\t\telse if (opts.type === 'dsa')\n\t\t\t\treturn (parseDSA(data, type, format, opts));\n\t\t\telse\n\t\t\t\treturn (parseECDSA(data, type, format, opts));\n\n\t\tdefault:\n\t\t\tthrow (new InvalidAlgorithmError(type));\n\t\t}\n\n\t} catch (e) {\n\t\tif (e instanceof InvalidAlgorithmError)\n\t\t\tthrow (e);\n\t\tthrow (new SignatureParseError(type, format, e));\n\t}\n};\n\nfunction parseOneNum(data, type, format, opts) {\n\tif (format === 'ssh') {\n\t\ttry {\n\t\t\tvar buf = new SSHBuffer({buffer: data});\n\t\t\tvar head = buf.readString();\n\t\t} catch (e) {\n\t\t\t/* fall through */\n\t\t}\n\t\tif (buf !== undefined) {\n\t\t\tvar msg = 'SSH signature does not match expected ' +\n\t\t\t 'type (expected ' + type + ', got ' + head + ')';\n\t\t\tswitch (head) {\n\t\t\tcase 'ssh-rsa':\n\t\t\t\tassert.strictEqual(type, 'rsa', msg);\n\t\t\t\topts.hashAlgo = 'sha1';\n\t\t\t\tbreak;\n\t\t\tcase 'rsa-sha2-256':\n\t\t\t\tassert.strictEqual(type, 'rsa', msg);\n\t\t\t\topts.hashAlgo = 'sha256';\n\t\t\t\tbreak;\n\t\t\tcase 'rsa-sha2-512':\n\t\t\t\tassert.strictEqual(type, 'rsa', msg);\n\t\t\t\topts.hashAlgo = 'sha512';\n\t\t\t\tbreak;\n\t\t\tcase 'ssh-ed25519':\n\t\t\t\tassert.strictEqual(type, 'ed25519', msg);\n\t\t\t\topts.hashAlgo = 'sha512';\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tthrow (new Error('Unknown SSH signature ' +\n\t\t\t\t 'type: ' + head));\n\t\t\t}\n\t\t\tvar sig = buf.readPart();\n\t\t\tassert.ok(buf.atEnd(), 'extra trailing bytes');\n\t\t\tsig.name = 'sig';\n\t\t\topts.parts.push(sig);\n\t\t\treturn (new Signature(opts));\n\t\t}\n\t}\n\topts.parts.push({name: 'sig', data: data});\n\treturn (new Signature(opts));\n}\n\nfunction parseDSAasn1(data, type, format, opts) {\n\tvar der = new asn1.BerReader(data);\n\tder.readSequence();\n\tvar r = der.readString(asn1.Ber.Integer, true);\n\tvar s = der.readString(asn1.Ber.Integer, true);\n\n\topts.parts.push({name: 'r', data: utils.mpNormalize(r)});\n\topts.parts.push({name: 's', data: utils.mpNormalize(s)});\n\n\treturn (new Signature(opts));\n}\n\nfunction parseDSA(data, type, format, opts) {\n\tif (data.length != 40) {\n\t\tvar buf = new SSHBuffer({buffer: data});\n\t\tvar d = buf.readBuffer();\n\t\tif (d.toString('ascii') === 'ssh-dss')\n\t\t\td = buf.readBuffer();\n\t\tassert.ok(buf.atEnd(), 'extra trailing bytes');\n\t\tassert.strictEqual(d.length, 40, 'invalid inner length');\n\t\tdata = d;\n\t}\n\topts.parts.push({name: 'r', data: data.slice(0, 20)});\n\topts.parts.push({name: 's', data: data.slice(20, 40)});\n\treturn (new Signature(opts));\n}\n\nfunction parseECDSA(data, type, format, opts) {\n\tvar buf = new SSHBuffer({buffer: data});\n\n\tvar r, s;\n\tvar inner = buf.readBuffer();\n\tvar stype = inner.toString('ascii');\n\tif (stype.slice(0, 6) === 'ecdsa-') {\n\t\tvar parts = stype.split('-');\n\t\tassert.strictEqual(parts[0], 'ecdsa');\n\t\tassert.strictEqual(parts[1], 'sha2');\n\t\topts.curve = parts[2];\n\t\tswitch (opts.curve) {\n\t\tcase 'nistp256':\n\t\t\topts.hashAlgo = 'sha256';\n\t\t\tbreak;\n\t\tcase 'nistp384':\n\t\t\topts.hashAlgo = 'sha384';\n\t\t\tbreak;\n\t\tcase 'nistp521':\n\t\t\topts.hashAlgo = 'sha512';\n\t\t\tbreak;\n\t\tdefault:\n\t\t\tthrow (new Error('Unsupported ECDSA curve: ' +\n\t\t\t opts.curve));\n\t\t}\n\t\tinner = buf.readBuffer();\n\t\tassert.ok(buf.atEnd(), 'extra trailing bytes on outer');\n\t\tbuf = new SSHBuffer({buffer: inner});\n\t\tr = buf.readPart();\n\t} else {\n\t\tr = {data: inner};\n\t}\n\n\ts = buf.readPart();\n\tassert.ok(buf.atEnd(), 'extra trailing bytes');\n\n\tr.name = 'r';\n\ts.name = 's';\n\n\topts.parts.push(r);\n\topts.parts.push(s);\n\treturn (new Signature(opts));\n}\n\nSignature.isSignature = function (obj, ver) {\n\treturn (utils.isCompatible(obj, Signature, ver));\n};\n\n/*\n * API versions for Signature:\n * [1,0] -- initial ver\n * [2,0] -- support for rsa in full ssh format, compat with sshpk-agent\n * hashAlgorithm property\n * [2,1] -- first tagged version\n */\nSignature.prototype._sshpkApiVersion = [2, 1];\n\nSignature._oldVersionDetect = function (obj) {\n\tassert.func(obj.toBuffer);\n\tif (obj.hasOwnProperty('hashAlgorithm'))\n\t\treturn ([2, 0]);\n\treturn ([1, 0]);\n};\n","// Copyright 2015 Joyent, Inc.\n\nmodule.exports = SSHBuffer;\n\nvar assert = require('assert-plus');\nvar Buffer = require('safer-buffer').Buffer;\n\nfunction SSHBuffer(opts) {\n\tassert.object(opts, 'options');\n\tif (opts.buffer !== undefined)\n\t\tassert.buffer(opts.buffer, 'options.buffer');\n\n\tthis._size = opts.buffer ? opts.buffer.length : 1024;\n\tthis._buffer = opts.buffer || Buffer.alloc(this._size);\n\tthis._offset = 0;\n}\n\nSSHBuffer.prototype.toBuffer = function () {\n\treturn (this._buffer.slice(0, this._offset));\n};\n\nSSHBuffer.prototype.atEnd = function () {\n\treturn (this._offset >= this._buffer.length);\n};\n\nSSHBuffer.prototype.remainder = function () {\n\treturn (this._buffer.slice(this._offset));\n};\n\nSSHBuffer.prototype.skip = function (n) {\n\tthis._offset += n;\n};\n\nSSHBuffer.prototype.expand = function () {\n\tthis._size *= 2;\n\tvar buf = Buffer.alloc(this._size);\n\tthis._buffer.copy(buf, 0);\n\tthis._buffer = buf;\n};\n\nSSHBuffer.prototype.readPart = function () {\n\treturn ({data: this.readBuffer()});\n};\n\nSSHBuffer.prototype.readBuffer = function () {\n\tvar len = this._buffer.readUInt32BE(this._offset);\n\tthis._offset += 4;\n\tassert.ok(this._offset + len <= this._buffer.length,\n\t 'length out of bounds at +0x' + this._offset.toString(16) +\n\t ' (data truncated?)');\n\tvar buf = this._buffer.slice(this._offset, this._offset + len);\n\tthis._offset += len;\n\treturn (buf);\n};\n\nSSHBuffer.prototype.readString = function () {\n\treturn (this.readBuffer().toString());\n};\n\nSSHBuffer.prototype.readCString = function () {\n\tvar offset = this._offset;\n\twhile (offset < this._buffer.length &&\n\t this._buffer[offset] !== 0x00)\n\t\toffset++;\n\tassert.ok(offset < this._buffer.length, 'c string does not terminate');\n\tvar str = this._buffer.slice(this._offset, offset).toString();\n\tthis._offset = offset + 1;\n\treturn (str);\n};\n\nSSHBuffer.prototype.readInt = function () {\n\tvar v = this._buffer.readUInt32BE(this._offset);\n\tthis._offset += 4;\n\treturn (v);\n};\n\nSSHBuffer.prototype.readInt64 = function () {\n\tassert.ok(this._offset + 8 < this._buffer.length,\n\t 'buffer not long enough to read Int64');\n\tvar v = this._buffer.slice(this._offset, this._offset + 8);\n\tthis._offset += 8;\n\treturn (v);\n};\n\nSSHBuffer.prototype.readChar = function () {\n\tvar v = this._buffer[this._offset++];\n\treturn (v);\n};\n\nSSHBuffer.prototype.writeBuffer = function (buf) {\n\twhile (this._offset + 4 + buf.length > this._size)\n\t\tthis.expand();\n\tthis._buffer.writeUInt32BE(buf.length, this._offset);\n\tthis._offset += 4;\n\tbuf.copy(this._buffer, this._offset);\n\tthis._offset += buf.length;\n};\n\nSSHBuffer.prototype.writeString = function (str) {\n\tthis.writeBuffer(Buffer.from(str, 'utf8'));\n};\n\nSSHBuffer.prototype.writeCString = function (str) {\n\twhile (this._offset + 1 + str.length > this._size)\n\t\tthis.expand();\n\tthis._buffer.write(str, this._offset);\n\tthis._offset += str.length;\n\tthis._buffer[this._offset++] = 0;\n};\n\nSSHBuffer.prototype.writeInt = function (v) {\n\twhile (this._offset + 4 > this._size)\n\t\tthis.expand();\n\tthis._buffer.writeUInt32BE(v, this._offset);\n\tthis._offset += 4;\n};\n\nSSHBuffer.prototype.writeInt64 = function (v) {\n\tassert.buffer(v, 'value');\n\tif (v.length > 8) {\n\t\tvar lead = v.slice(0, v.length - 8);\n\t\tfor (var i = 0; i < lead.length; ++i) {\n\t\t\tassert.strictEqual(lead[i], 0,\n\t\t\t 'must fit in 64 bits of precision');\n\t\t}\n\t\tv = v.slice(v.length - 8, v.length);\n\t}\n\twhile (this._offset + 8 > this._size)\n\t\tthis.expand();\n\tv.copy(this._buffer, this._offset);\n\tthis._offset += 8;\n};\n\nSSHBuffer.prototype.writeChar = function (v) {\n\twhile (this._offset + 1 > this._size)\n\t\tthis.expand();\n\tthis._buffer[this._offset++] = v;\n};\n\nSSHBuffer.prototype.writePart = function (p) {\n\tthis.writeBuffer(p.data);\n};\n\nSSHBuffer.prototype.write = function (buf) {\n\twhile (this._offset + buf.length > this._size)\n\t\tthis.expand();\n\tbuf.copy(this._buffer, this._offset);\n\tthis._offset += buf.length;\n};\n","// Copyright 2015 Joyent, Inc.\n\nmodule.exports = {\n\tbufferSplit: bufferSplit,\n\taddRSAMissing: addRSAMissing,\n\tcalculateDSAPublic: calculateDSAPublic,\n\tcalculateED25519Public: calculateED25519Public,\n\tcalculateX25519Public: calculateX25519Public,\n\tmpNormalize: mpNormalize,\n\tmpDenormalize: mpDenormalize,\n\tecNormalize: ecNormalize,\n\tcountZeros: countZeros,\n\tassertCompatible: assertCompatible,\n\tisCompatible: isCompatible,\n\topensslKeyDeriv: opensslKeyDeriv,\n\topensshCipherInfo: opensshCipherInfo,\n\tpublicFromPrivateECDSA: publicFromPrivateECDSA,\n\tzeroPadToLength: zeroPadToLength,\n\twriteBitString: writeBitString,\n\treadBitString: readBitString,\n\tpbkdf2: pbkdf2\n};\n\nvar assert = require('assert-plus');\nvar Buffer = require('safer-buffer').Buffer;\nvar PrivateKey = require('./private-key');\nvar Key = require('./key');\nvar crypto = require('crypto');\nvar algs = require('./algs');\nvar asn1 = require('asn1');\n\nvar ec = require('ecc-jsbn/lib/ec');\nvar jsbn = require('jsbn').BigInteger;\nvar nacl = require('tweetnacl');\n\nvar MAX_CLASS_DEPTH = 3;\n\nfunction isCompatible(obj, klass, needVer) {\n\tif (obj === null || typeof (obj) !== 'object')\n\t\treturn (false);\n\tif (needVer === undefined)\n\t\tneedVer = klass.prototype._sshpkApiVersion;\n\tif (obj instanceof klass &&\n\t klass.prototype._sshpkApiVersion[0] == needVer[0])\n\t\treturn (true);\n\tvar proto = Object.getPrototypeOf(obj);\n\tvar depth = 0;\n\twhile (proto.constructor.name !== klass.name) {\n\t\tproto = Object.getPrototypeOf(proto);\n\t\tif (!proto || ++depth > MAX_CLASS_DEPTH)\n\t\t\treturn (false);\n\t}\n\tif (proto.constructor.name !== klass.name)\n\t\treturn (false);\n\tvar ver = proto._sshpkApiVersion;\n\tif (ver === undefined)\n\t\tver = klass._oldVersionDetect(obj);\n\tif (ver[0] != needVer[0] || ver[1] < needVer[1])\n\t\treturn (false);\n\treturn (true);\n}\n\nfunction assertCompatible(obj, klass, needVer, name) {\n\tif (name === undefined)\n\t\tname = 'object';\n\tassert.ok(obj, name + ' must not be null');\n\tassert.object(obj, name + ' must be an object');\n\tif (needVer === undefined)\n\t\tneedVer = klass.prototype._sshpkApiVersion;\n\tif (obj instanceof klass &&\n\t klass.prototype._sshpkApiVersion[0] == needVer[0])\n\t\treturn;\n\tvar proto = Object.getPrototypeOf(obj);\n\tvar depth = 0;\n\twhile (proto.constructor.name !== klass.name) {\n\t\tproto = Object.getPrototypeOf(proto);\n\t\tassert.ok(proto && ++depth <= MAX_CLASS_DEPTH,\n\t\t name + ' must be a ' + klass.name + ' instance');\n\t}\n\tassert.strictEqual(proto.constructor.name, klass.name,\n\t name + ' must be a ' + klass.name + ' instance');\n\tvar ver = proto._sshpkApiVersion;\n\tif (ver === undefined)\n\t\tver = klass._oldVersionDetect(obj);\n\tassert.ok(ver[0] == needVer[0] && ver[1] >= needVer[1],\n\t name + ' must be compatible with ' + klass.name + ' klass ' +\n\t 'version ' + needVer[0] + '.' + needVer[1]);\n}\n\nvar CIPHER_LEN = {\n\t'des-ede3-cbc': { key: 24, iv: 8 },\n\t'aes-128-cbc': { key: 16, iv: 16 },\n\t'aes-256-cbc': { key: 32, iv: 16 }\n};\nvar PKCS5_SALT_LEN = 8;\n\nfunction opensslKeyDeriv(cipher, salt, passphrase, count) {\n\tassert.buffer(salt, 'salt');\n\tassert.buffer(passphrase, 'passphrase');\n\tassert.number(count, 'iteration count');\n\n\tvar clen = CIPHER_LEN[cipher];\n\tassert.object(clen, 'supported cipher');\n\n\tsalt = salt.slice(0, PKCS5_SALT_LEN);\n\n\tvar D, D_prev, bufs;\n\tvar material = Buffer.alloc(0);\n\twhile (material.length < clen.key + clen.iv) {\n\t\tbufs = [];\n\t\tif (D_prev)\n\t\t\tbufs.push(D_prev);\n\t\tbufs.push(passphrase);\n\t\tbufs.push(salt);\n\t\tD = Buffer.concat(bufs);\n\t\tfor (var j = 0; j < count; ++j)\n\t\t\tD = crypto.createHash('md5').update(D).digest();\n\t\tmaterial = Buffer.concat([material, D]);\n\t\tD_prev = D;\n\t}\n\n\treturn ({\n\t key: material.slice(0, clen.key),\n\t iv: material.slice(clen.key, clen.key + clen.iv)\n\t});\n}\n\n/* See: RFC2898 */\nfunction pbkdf2(hashAlg, salt, iterations, size, passphrase) {\n\tvar hkey = Buffer.alloc(salt.length + 4);\n\tsalt.copy(hkey);\n\n\tvar gen = 0, ts = [];\n\tvar i = 1;\n\twhile (gen < size) {\n\t\tvar t = T(i++);\n\t\tgen += t.length;\n\t\tts.push(t);\n\t}\n\treturn (Buffer.concat(ts).slice(0, size));\n\n\tfunction T(I) {\n\t\thkey.writeUInt32BE(I, hkey.length - 4);\n\n\t\tvar hmac = crypto.createHmac(hashAlg, passphrase);\n\t\thmac.update(hkey);\n\n\t\tvar Ti = hmac.digest();\n\t\tvar Uc = Ti;\n\t\tvar c = 1;\n\t\twhile (c++ < iterations) {\n\t\t\thmac = crypto.createHmac(hashAlg, passphrase);\n\t\t\thmac.update(Uc);\n\t\t\tUc = hmac.digest();\n\t\t\tfor (var x = 0; x < Ti.length; ++x)\n\t\t\t\tTi[x] ^= Uc[x];\n\t\t}\n\t\treturn (Ti);\n\t}\n}\n\n/* Count leading zero bits on a buffer */\nfunction countZeros(buf) {\n\tvar o = 0, obit = 8;\n\twhile (o < buf.length) {\n\t\tvar mask = (1 << obit);\n\t\tif ((buf[o] & mask) === mask)\n\t\t\tbreak;\n\t\tobit--;\n\t\tif (obit < 0) {\n\t\t\to++;\n\t\t\tobit = 8;\n\t\t}\n\t}\n\treturn (o*8 + (8 - obit) - 1);\n}\n\nfunction bufferSplit(buf, chr) {\n\tassert.buffer(buf);\n\tassert.string(chr);\n\n\tvar parts = [];\n\tvar lastPart = 0;\n\tvar matches = 0;\n\tfor (var i = 0; i < buf.length; ++i) {\n\t\tif (buf[i] === chr.charCodeAt(matches))\n\t\t\t++matches;\n\t\telse if (buf[i] === chr.charCodeAt(0))\n\t\t\tmatches = 1;\n\t\telse\n\t\t\tmatches = 0;\n\n\t\tif (matches >= chr.length) {\n\t\t\tvar newPart = i + 1;\n\t\t\tparts.push(buf.slice(lastPart, newPart - matches));\n\t\t\tlastPart = newPart;\n\t\t\tmatches = 0;\n\t\t}\n\t}\n\tif (lastPart <= buf.length)\n\t\tparts.push(buf.slice(lastPart, buf.length));\n\n\treturn (parts);\n}\n\nfunction ecNormalize(buf, addZero) {\n\tassert.buffer(buf);\n\tif (buf[0] === 0x00 && buf[1] === 0x04) {\n\t\tif (addZero)\n\t\t\treturn (buf);\n\t\treturn (buf.slice(1));\n\t} else if (buf[0] === 0x04) {\n\t\tif (!addZero)\n\t\t\treturn (buf);\n\t} else {\n\t\twhile (buf[0] === 0x00)\n\t\t\tbuf = buf.slice(1);\n\t\tif (buf[0] === 0x02 || buf[0] === 0x03)\n\t\t\tthrow (new Error('Compressed elliptic curve points ' +\n\t\t\t 'are not supported'));\n\t\tif (buf[0] !== 0x04)\n\t\t\tthrow (new Error('Not a valid elliptic curve point'));\n\t\tif (!addZero)\n\t\t\treturn (buf);\n\t}\n\tvar b = Buffer.alloc(buf.length + 1);\n\tb[0] = 0x0;\n\tbuf.copy(b, 1);\n\treturn (b);\n}\n\nfunction readBitString(der, tag) {\n\tif (tag === undefined)\n\t\ttag = asn1.Ber.BitString;\n\tvar buf = der.readString(tag, true);\n\tassert.strictEqual(buf[0], 0x00, 'bit strings with unused bits are ' +\n\t 'not supported (0x' + buf[0].toString(16) + ')');\n\treturn (buf.slice(1));\n}\n\nfunction writeBitString(der, buf, tag) {\n\tif (tag === undefined)\n\t\ttag = asn1.Ber.BitString;\n\tvar b = Buffer.alloc(buf.length + 1);\n\tb[0] = 0x00;\n\tbuf.copy(b, 1);\n\tder.writeBuffer(b, tag);\n}\n\nfunction mpNormalize(buf) {\n\tassert.buffer(buf);\n\twhile (buf.length > 1 && buf[0] === 0x00 && (buf[1] & 0x80) === 0x00)\n\t\tbuf = buf.slice(1);\n\tif ((buf[0] & 0x80) === 0x80) {\n\t\tvar b = Buffer.alloc(buf.length + 1);\n\t\tb[0] = 0x00;\n\t\tbuf.copy(b, 1);\n\t\tbuf = b;\n\t}\n\treturn (buf);\n}\n\nfunction mpDenormalize(buf) {\n\tassert.buffer(buf);\n\twhile (buf.length > 1 && buf[0] === 0x00)\n\t\tbuf = buf.slice(1);\n\treturn (buf);\n}\n\nfunction zeroPadToLength(buf, len) {\n\tassert.buffer(buf);\n\tassert.number(len);\n\twhile (buf.length > len) {\n\t\tassert.equal(buf[0], 0x00);\n\t\tbuf = buf.slice(1);\n\t}\n\twhile (buf.length < len) {\n\t\tvar b = Buffer.alloc(buf.length + 1);\n\t\tb[0] = 0x00;\n\t\tbuf.copy(b, 1);\n\t\tbuf = b;\n\t}\n\treturn (buf);\n}\n\nfunction bigintToMpBuf(bigint) {\n\tvar buf = Buffer.from(bigint.toByteArray());\n\tbuf = mpNormalize(buf);\n\treturn (buf);\n}\n\nfunction calculateDSAPublic(g, p, x) {\n\tassert.buffer(g);\n\tassert.buffer(p);\n\tassert.buffer(x);\n\tg = new jsbn(g);\n\tp = new jsbn(p);\n\tx = new jsbn(x);\n\tvar y = g.modPow(x, p);\n\tvar ybuf = bigintToMpBuf(y);\n\treturn (ybuf);\n}\n\nfunction calculateED25519Public(k) {\n\tassert.buffer(k);\n\n\tvar kp = nacl.sign.keyPair.fromSeed(new Uint8Array(k));\n\treturn (Buffer.from(kp.publicKey));\n}\n\nfunction calculateX25519Public(k) {\n\tassert.buffer(k);\n\n\tvar kp = nacl.box.keyPair.fromSeed(new Uint8Array(k));\n\treturn (Buffer.from(kp.publicKey));\n}\n\nfunction addRSAMissing(key) {\n\tassert.object(key);\n\tassertCompatible(key, PrivateKey, [1, 1]);\n\n\tvar d = new jsbn(key.part.d.data);\n\tvar buf;\n\n\tif (!key.part.dmodp) {\n\t\tvar p = new jsbn(key.part.p.data);\n\t\tvar dmodp = d.mod(p.subtract(1));\n\n\t\tbuf = bigintToMpBuf(dmodp);\n\t\tkey.part.dmodp = {name: 'dmodp', data: buf};\n\t\tkey.parts.push(key.part.dmodp);\n\t}\n\tif (!key.part.dmodq) {\n\t\tvar q = new jsbn(key.part.q.data);\n\t\tvar dmodq = d.mod(q.subtract(1));\n\n\t\tbuf = bigintToMpBuf(dmodq);\n\t\tkey.part.dmodq = {name: 'dmodq', data: buf};\n\t\tkey.parts.push(key.part.dmodq);\n\t}\n}\n\nfunction publicFromPrivateECDSA(curveName, priv) {\n\tassert.string(curveName, 'curveName');\n\tassert.buffer(priv);\n\tvar params = algs.curves[curveName];\n\tvar p = new jsbn(params.p);\n\tvar a = new jsbn(params.a);\n\tvar b = new jsbn(params.b);\n\tvar curve = new ec.ECCurveFp(p, a, b);\n\tvar G = curve.decodePointHex(params.G.toString('hex'));\n\n\tvar d = new jsbn(mpNormalize(priv));\n\tvar pub = G.multiply(d);\n\tpub = Buffer.from(curve.encodePointHex(pub), 'hex');\n\n\tvar parts = [];\n\tparts.push({name: 'curve', data: Buffer.from(curveName)});\n\tparts.push({name: 'Q', data: pub});\n\n\tvar key = new Key({type: 'ecdsa', curve: curve, parts: parts});\n\treturn (key);\n}\n\nfunction opensshCipherInfo(cipher) {\n\tvar inf = {};\n\tswitch (cipher) {\n\tcase '3des-cbc':\n\t\tinf.keySize = 24;\n\t\tinf.blockSize = 8;\n\t\tinf.opensslName = 'des-ede3-cbc';\n\t\tbreak;\n\tcase 'blowfish-cbc':\n\t\tinf.keySize = 16;\n\t\tinf.blockSize = 8;\n\t\tinf.opensslName = 'bf-cbc';\n\t\tbreak;\n\tcase 'aes128-cbc':\n\tcase 'aes128-ctr':\n\tcase 'aes128-gcm@openssh.com':\n\t\tinf.keySize = 16;\n\t\tinf.blockSize = 16;\n\t\tinf.opensslName = 'aes-128-' + cipher.slice(7, 10);\n\t\tbreak;\n\tcase 'aes192-cbc':\n\tcase 'aes192-ctr':\n\tcase 'aes192-gcm@openssh.com':\n\t\tinf.keySize = 24;\n\t\tinf.blockSize = 16;\n\t\tinf.opensslName = 'aes-192-' + cipher.slice(7, 10);\n\t\tbreak;\n\tcase 'aes256-cbc':\n\tcase 'aes256-ctr':\n\tcase 'aes256-gcm@openssh.com':\n\t\tinf.keySize = 32;\n\t\tinf.blockSize = 16;\n\t\tinf.opensslName = 'aes-256-' + cipher.slice(7, 10);\n\t\tbreak;\n\tdefault:\n\t\tthrow (new Error(\n\t\t 'Unsupported openssl cipher \"' + cipher + '\"'));\n\t}\n\treturn (inf);\n}\n","const Component = require('./loader')\n\nclass Client {\n constructor (options) {\n const backend = options.backend\n if (!backend) throw new Error('expected \"backend\"')\n\n const root = new Component({ splits: [], backend, getNames: options.getNames })\n if (options.spec) root._addSpec(options.spec)\n return root\n }\n}\n\nmodule.exports = Client\n","const Client = require('./client')\nconst Component = require('./loader')\n\nmodule.exports = {\n Client,\n Component\n}\n","/* eslint-disable no-sync */\n\n/**\n * @file Convert a OpenAPI/Swagger specification into a API client.\n *\n * Represent Swagger a Path Item Object [1] with chains of objects:\n *\n * /api/v1/namespaces -> api.v1.namespaces\n *\n * Associate operations on a Path Item Object with functions:\n *\n * GET /api/v1/namespaces -> api.v1.namespaces.get()\n *\n * Represent Path Templating [2] with function calls:\n *\n * /api/v1/namespaces/{namespace}/pods -> api.v1.namespaces(namespace).pods\n *\n * Iterate over a Paths Object [3] to generate whole API client.\n *\n * [1]: https://swagger.io/specification/#pathItemObject\n * [2]: https://swagger.io/specification/#pathTemplating\n * [3]: https://swagger.io/specification/#pathsObject\n */\n\nconst merge = require('deepmerge')\nconst isPlainObject = require('is-plain-object')\n\nclass Endpoint {\n /**\n * Internal representation of a Swagger Path Item Object.\n * @param {object} options - Options object\n * @param {string} options.name - Path Item Object name\n * @param {array} options.splits - Pathname pieces split in '/'\n * @param {object} options.pathItem - Swagger Path Item Object.\n */\n constructor (options) {\n this.name = options.name\n this.splits = options.splits\n this.pathItem = options.pathItem\n }\n}\n\nclass Component {\n /**\n * Represents a single path split, child Components, and potentially a Path\n * Item Object.\n * @param {object} options - Options object\n * @param {object} options.http - Request object\n * @param {array} options.splits - Absolute pathname (split on '/')\n * @param {string} options.parameters - Path Template values for parents\n * @param {string} options.template - Optional Path Template (e.g., {name})\n */\n constructor (options) {\n options = Object.assign({ splits: [], parameters: [] }, options)\n let component\n\n //\n // Support Path Templating: use a function to create a a Component-like\n // object if required. Otherwise use a vanilla object (that isn't callable).\n //\n if (options.templated) {\n component = name => {\n const splits = component.splits.concat([name])\n //\n // Assume that we'll never have a path with adjacent templates.\n // E.g., assume `/foo/{name}/{property}` cannot exist.\n //\n const namedComponent = new this.constructor({\n backend: component.backend,\n getNames: options.getNames,\n splits: splits,\n parameters: options.parameters.concat([name])\n })\n component.templatedEndpoints.forEach(child => {\n namedComponent._addEndpoint(child)\n })\n return namedComponent\n }\n component.templatedEndpoints = []\n\n //\n // Attach methods\n //\n Object.setPrototypeOf(component, this.constructor.prototype)\n } else {\n component = this\n component.templatedEndpoints = null\n }\n\n component.parameters = options.parameters\n component.templated = options.templated\n component.splits = options.splits.slice()\n component.backend = options.backend\n component.getNames = options.getNames || (split => [split])\n component.children = []\n return component\n }\n\n /**\n * Get the path.\n * @returns {string} path with '/' as the separator.\n */\n getPath () {\n return `/${this.splits.join('/')}`\n }\n\n /**\n * Return an object of pathname parameters.\n * @returns {object} object mapping each parameter name to its value.\n */\n getPathnameParameters () {\n const pathnameParameterNames = this.swaggerName\n .split('/')\n .filter(component => component.startsWith('{'))\n .map(component => component.slice(1, -1))\n\n return pathnameParameterNames.reduce((acc, value, index) => {\n acc[value] = this.parameters[index]\n return acc\n }, {})\n }\n\n /**\n * Add endpoints defined by a swagger spec to this component. You would\n * typically call this only on the root component to add API resources. For\n * example, during client initialization, to extend the client with CRDs.\n * @param {object} spec - Swagger specification\n */\n _addSpec (spec) {\n //\n // TODO(sbw): It's important to add endpoints with templating before adding\n // any endpoints with paths that are subpaths of templated paths.\n //\n // E.g., add /api/v1/namepaces/{namespace} before adding /api/v1/namepaces\n //\n // This is important because ._addEndpoint constructs Component objects on\n // demand, and Component requires specifying if it's templated or not. If we\n // cause ._addEndpoint to construct a un-templated Component, templated\n // operations that share the Components subpath will not work.\n //\n Object.keys(spec.paths)\n .map(name => {\n const leadingAndTrailingSlashes = /(^\\/)|(\\/$)/g\n const splits = name.replace(leadingAndTrailingSlashes, '').split('/')\n return new Endpoint({ name, splits, pathItem: spec.paths[name] })\n })\n .sort((endpoint0, endpoint1) => {\n return endpoint1.splits.length - endpoint0.splits.length\n }).forEach(endpoint => {\n this._addEndpoint(endpoint)\n })\n }\n\n _addChild (split, component) {\n this.getNames(split, this.splits).forEach(name => {\n this[name] = component\n this.children.push(name)\n })\n }\n\n _walkSplits (endpoint) {\n const splits = this.splits.slice()\n const nextSplits = endpoint.splits.slice()\n\n let parent = this\n while (nextSplits.length) {\n const split = nextSplits.shift()\n splits.push(split)\n\n let template = null\n if (nextSplits.length && nextSplits[0].startsWith('{')) {\n template = nextSplits.shift().slice(1, -1)\n }\n\n if (!(split in parent)) {\n const component = new this.constructor({\n getNames: this.getNames,\n backend: this.backend,\n parameters: this.parameters,\n templated: Boolean(template),\n splits\n })\n parent._addChild(split, component)\n }\n parent = parent[split]\n\n //\n // Path Template: save it and walk it once the user specifies\n // the value.\n //\n if (template) {\n if (!parent.templated) {\n throw new Error('Created Component, but require templated one. ' +\n 'This is a bug. Please report: ' +\n 'https://github.com/silasbw/fluent-openapi/issues')\n }\n parent.templatedEndpoints.push(new Endpoint({\n name: endpoint.name,\n splits: nextSplits,\n pathItem: endpoint.pathItem\n }))\n return null\n }\n }\n return parent\n }\n\n /**\n * Add an Endpoint by creating an object chain according to its pathname\n * splits; and adding operations according to the pathItem.\n * @param {Endpoint} endpoint - Endpoint object.\n * @returns {Component} Component object endpoint was added to.\n */\n _addEndpoint (endpoint) {\n const component = this._walkSplits(endpoint)\n if (!component) return null\n component.pathItemObject = endpoint.pathItem\n component.swaggerName = endpoint.name\n\n //\n // \"Expose\" operations by omitting the leading _ from the method name.\n //\n const supportedMethods = ['get', 'put', 'post', 'delete', 'patch']\n\n supportedMethods\n .filter(method => endpoint.pathItem[method])\n .forEach(method => {\n component[method] = component['_' + method]\n if (method === 'get') component.getStream = component._getStream\n })\n\n return component\n }\n\n /**\n * Invoke a REST method\n * @param {string} method - HTTP method\n * @param {ApiRequestOptions} options - Options object\n * @returns {(Promise|Stream)} Promise\n */\n _requestAsync (method, options) {\n return this.backend.http(Object.assign({\n method,\n pathItemObject: this.pathItemObject,\n pathname: this.getPath(),\n pathnameParameters: this.getPathnameParameters()\n }, options))\n }\n\n //\n // Supported operations.\n //\n\n /**\n * Invoke a GET request against the API server\n * @param {ApiRequestOptions} options - Options object.\n * @returns {Stream} Stream\n */\n _getStream (options) {\n return this._requestAsync('GET', Object.assign({ stream: true }, options))\n }\n\n /**\n * Invoke a GET request against the API server\n * @param {ApiRequestOptions} options - Options object.\n * @returns {Promise} Promise\n */\n _get (options) {\n return this._requestAsync('GET', options)\n }\n\n /**\n * Invoke a DELETE request against the API server\n * @param {ApiRequestOptions} options - Options object.\n * @returns {Promise} Promise\n */\n _delete (options) {\n return this._requestAsync('DELETE', options)\n }\n\n /**\n * Invoke a PATCH request against the API server\n * @param {ApiRequestOptions} options - Options object\n * @returns {Promise} Promise\n */\n _patch (options) {\n return this._requestAsync('PATCH', merge({\n headers: { 'content-type': 'application/strategic-merge-patch+json' }\n }, options, { isMergeableObject: isPlainObject }))\n }\n\n /**\n * Invoke a POST request against the API server\n * @param {ApiRequestOptions} options - Options object\n * @returns {Promise} Promise\n */\n _post (options) {\n return this._requestAsync('POST', merge({\n headers: { 'content-type': 'application/json' }\n }, options, { isMergeableObject: isPlainObject }))\n }\n\n /**\n * Invoke a PUT request against the API server\n * @param {ApiRequestOptions} options - Options object\n * @returns {Promise} Promise\n */\n _put (options) {\n return this._requestAsync('PUT', merge({\n headers: { 'content-type': 'application/json' }\n }, options, { isMergeableObject: isPlainObject }))\n }\n}\n\nmodule.exports = Component\n","'use strict';\n\n/*!\n * isobject \n *\n * Copyright (c) 2014-2017, Jon Schlinkert.\n * Released under the MIT License.\n */\n\nfunction isObject(val) {\n return val != null && typeof val === 'object' && Array.isArray(val) === false;\n}\n\n/*!\n * is-plain-object \n *\n * Copyright (c) 2014-2017, Jon Schlinkert.\n * Released under the MIT License.\n */\n\nfunction isObjectObject(o) {\n return isObject(o) === true\n && Object.prototype.toString.call(o) === '[object Object]';\n}\n\nfunction isPlainObject(o) {\n var ctor,prot;\n\n if (isObjectObject(o) === false) return false;\n\n // If has modified constructor\n ctor = o.constructor;\n if (typeof ctor !== 'function') return false;\n\n // If has modified prototype\n prot = ctor.prototype;\n if (isObjectObject(prot) === false) return false;\n\n // If constructor does not have an Object-specific method\n if (prot.hasOwnProperty('isPrototypeOf') === false) {\n return false;\n }\n\n // Most likely a plain Object\n return true;\n}\n\nmodule.exports = isPlainObject;\n","'use strict';\nconst {Readable} = require('stream');\n\nmodule.exports = input => (\n\tnew Readable({\n\t\tread() {\n\t\t\tthis.push(input);\n\t\t\tthis.push(null);\n\t\t}\n\t})\n);\n","/*!\n * Copyright (c) 2015, Salesforce.com, Inc.\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions are met:\n *\n * 1. Redistributions of source code must retain the above copyright notice,\n * this list of conditions and the following disclaimer.\n *\n * 2. Redistributions in binary form must reproduce the above copyright notice,\n * this list of conditions and the following disclaimer in the documentation\n * and/or other materials provided with the distribution.\n *\n * 3. Neither the name of Salesforce.com nor the names of its contributors may\n * be used to endorse or promote products derived from this software without\n * specific prior written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\"\n * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE\n * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR\n * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF\n * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS\n * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN\n * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE\n * POSSIBILITY OF SUCH DAMAGE.\n */\n'use strict';\nvar net = require('net');\nvar urlParse = require('url').parse;\nvar util = require('util');\nvar pubsuffix = require('./pubsuffix-psl');\nvar Store = require('./store').Store;\nvar MemoryCookieStore = require('./memstore').MemoryCookieStore;\nvar pathMatch = require('./pathMatch').pathMatch;\nvar VERSION = require('./version');\n\nvar punycode;\ntry {\n punycode = require('punycode');\n} catch(e) {\n console.warn(\"tough-cookie: can't load punycode; won't use punycode for domain normalization\");\n}\n\n// From RFC6265 S4.1.1\n// note that it excludes \\x3B \";\"\nvar COOKIE_OCTETS = /^[\\x21\\x23-\\x2B\\x2D-\\x3A\\x3C-\\x5B\\x5D-\\x7E]+$/;\n\nvar CONTROL_CHARS = /[\\x00-\\x1F]/;\n\n// From Chromium // '\\r', '\\n' and '\\0' should be treated as a terminator in\n// the \"relaxed\" mode, see:\n// https://github.com/ChromiumWebApps/chromium/blob/b3d3b4da8bb94c1b2e061600df106d590fda3620/net/cookies/parsed_cookie.cc#L60\nvar TERMINATORS = ['\\n', '\\r', '\\0'];\n\n// RFC6265 S4.1.1 defines path value as 'any CHAR except CTLs or \";\"'\n// Note ';' is \\x3B\nvar PATH_VALUE = /[\\x20-\\x3A\\x3C-\\x7E]+/;\n\n// date-time parsing constants (RFC6265 S5.1.1)\n\nvar DATE_DELIM = /[\\x09\\x20-\\x2F\\x3B-\\x40\\x5B-\\x60\\x7B-\\x7E]/;\n\nvar MONTH_TO_NUM = {\n jan:0, feb:1, mar:2, apr:3, may:4, jun:5,\n jul:6, aug:7, sep:8, oct:9, nov:10, dec:11\n};\nvar NUM_TO_MONTH = [\n 'Jan','Feb','Mar','Apr','May','Jun','Jul','Aug','Sep','Oct','Nov','Dec'\n];\nvar NUM_TO_DAY = [\n 'Sun','Mon','Tue','Wed','Thu','Fri','Sat'\n];\n\nvar MAX_TIME = 2147483647000; // 31-bit max\nvar MIN_TIME = 0; // 31-bit min\n\n/*\n * Parses a Natural number (i.e., non-negative integer) with either the\n * *DIGIT ( non-digit *OCTET )\n * or\n * *DIGIT\n * grammar (RFC6265 S5.1.1).\n *\n * The \"trailingOK\" boolean controls if the grammar accepts a\n * \"( non-digit *OCTET )\" trailer.\n */\nfunction parseDigits(token, minDigits, maxDigits, trailingOK) {\n var count = 0;\n while (count < token.length) {\n var c = token.charCodeAt(count);\n // \"non-digit = %x00-2F / %x3A-FF\"\n if (c <= 0x2F || c >= 0x3A) {\n break;\n }\n count++;\n }\n\n // constrain to a minimum and maximum number of digits.\n if (count < minDigits || count > maxDigits) {\n return null;\n }\n\n if (!trailingOK && count != token.length) {\n return null;\n }\n\n return parseInt(token.substr(0,count), 10);\n}\n\nfunction parseTime(token) {\n var parts = token.split(':');\n var result = [0,0,0];\n\n /* RF6256 S5.1.1:\n * time = hms-time ( non-digit *OCTET )\n * hms-time = time-field \":\" time-field \":\" time-field\n * time-field = 1*2DIGIT\n */\n\n if (parts.length !== 3) {\n return null;\n }\n\n for (var i = 0; i < 3; i++) {\n // \"time-field\" must be strictly \"1*2DIGIT\", HOWEVER, \"hms-time\" can be\n // followed by \"( non-digit *OCTET )\" so therefore the last time-field can\n // have a trailer\n var trailingOK = (i == 2);\n var num = parseDigits(parts[i], 1, 2, trailingOK);\n if (num === null) {\n return null;\n }\n result[i] = num;\n }\n\n return result;\n}\n\nfunction parseMonth(token) {\n token = String(token).substr(0,3).toLowerCase();\n var num = MONTH_TO_NUM[token];\n return num >= 0 ? num : null;\n}\n\n/*\n * RFC6265 S5.1.1 date parser (see RFC for full grammar)\n */\nfunction parseDate(str) {\n if (!str) {\n return;\n }\n\n /* RFC6265 S5.1.1:\n * 2. Process each date-token sequentially in the order the date-tokens\n * appear in the cookie-date\n */\n var tokens = str.split(DATE_DELIM);\n if (!tokens) {\n return;\n }\n\n var hour = null;\n var minute = null;\n var second = null;\n var dayOfMonth = null;\n var month = null;\n var year = null;\n\n for (var i=0; i= 70 && year <= 99) {\n year += 1900;\n } else if (year >= 0 && year <= 69) {\n year += 2000;\n }\n }\n }\n }\n\n /* RFC 6265 S5.1.1\n * \"5. Abort these steps and fail to parse the cookie-date if:\n * * at least one of the found-day-of-month, found-month, found-\n * year, or found-time flags is not set,\n * * the day-of-month-value is less than 1 or greater than 31,\n * * the year-value is less than 1601,\n * * the hour-value is greater than 23,\n * * the minute-value is greater than 59, or\n * * the second-value is greater than 59.\n * (Note that leap seconds cannot be represented in this syntax.)\"\n *\n * So, in order as above:\n */\n if (\n dayOfMonth === null || month === null || year === null || second === null ||\n dayOfMonth < 1 || dayOfMonth > 31 ||\n year < 1601 ||\n hour > 23 ||\n minute > 59 ||\n second > 59\n ) {\n return;\n }\n\n return new Date(Date.UTC(year, month, dayOfMonth, hour, minute, second));\n}\n\nfunction formatDate(date) {\n var d = date.getUTCDate(); d = d >= 10 ? d : '0'+d;\n var h = date.getUTCHours(); h = h >= 10 ? h : '0'+h;\n var m = date.getUTCMinutes(); m = m >= 10 ? m : '0'+m;\n var s = date.getUTCSeconds(); s = s >= 10 ? s : '0'+s;\n return NUM_TO_DAY[date.getUTCDay()] + ', ' +\n d+' '+ NUM_TO_MONTH[date.getUTCMonth()] +' '+ date.getUTCFullYear() +' '+\n h+':'+m+':'+s+' GMT';\n}\n\n// S5.1.2 Canonicalized Host Names\nfunction canonicalDomain(str) {\n if (str == null) {\n return null;\n }\n str = str.trim().replace(/^\\./,''); // S4.1.2.3 & S5.2.3: ignore leading .\n\n // convert to IDN if any non-ASCII characters\n if (punycode && /[^\\u0001-\\u007f]/.test(str)) {\n str = punycode.toASCII(str);\n }\n\n return str.toLowerCase();\n}\n\n// S5.1.3 Domain Matching\nfunction domainMatch(str, domStr, canonicalize) {\n if (str == null || domStr == null) {\n return null;\n }\n if (canonicalize !== false) {\n str = canonicalDomain(str);\n domStr = canonicalDomain(domStr);\n }\n\n /*\n * \"The domain string and the string are identical. (Note that both the\n * domain string and the string will have been canonicalized to lower case at\n * this point)\"\n */\n if (str == domStr) {\n return true;\n }\n\n /* \"All of the following [three] conditions hold:\" (order adjusted from the RFC) */\n\n /* \"* The string is a host name (i.e., not an IP address).\" */\n if (net.isIP(str)) {\n return false;\n }\n\n /* \"* The domain string is a suffix of the string\" */\n var idx = str.indexOf(domStr);\n if (idx <= 0) {\n return false; // it's a non-match (-1) or prefix (0)\n }\n\n // e.g \"a.b.c\".indexOf(\"b.c\") === 2\n // 5 === 3+2\n if (str.length !== domStr.length + idx) { // it's not a suffix\n return false;\n }\n\n /* \"* The last character of the string that is not included in the domain\n * string is a %x2E (\".\") character.\" */\n if (str.substr(idx-1,1) !== '.') {\n return false;\n }\n\n return true;\n}\n\n\n// RFC6265 S5.1.4 Paths and Path-Match\n\n/*\n * \"The user agent MUST use an algorithm equivalent to the following algorithm\n * to compute the default-path of a cookie:\"\n *\n * Assumption: the path (and not query part or absolute uri) is passed in.\n */\nfunction defaultPath(path) {\n // \"2. If the uri-path is empty or if the first character of the uri-path is not\n // a %x2F (\"/\") character, output %x2F (\"/\") and skip the remaining steps.\n if (!path || path.substr(0,1) !== \"/\") {\n return \"/\";\n }\n\n // \"3. If the uri-path contains no more than one %x2F (\"/\") character, output\n // %x2F (\"/\") and skip the remaining step.\"\n if (path === \"/\") {\n return path;\n }\n\n var rightSlash = path.lastIndexOf(\"/\");\n if (rightSlash === 0) {\n return \"/\";\n }\n\n // \"4. Output the characters of the uri-path from the first character up to,\n // but not including, the right-most %x2F (\"/\").\"\n return path.slice(0, rightSlash);\n}\n\nfunction trimTerminator(str) {\n for (var t = 0; t < TERMINATORS.length; t++) {\n var terminatorIdx = str.indexOf(TERMINATORS[t]);\n if (terminatorIdx !== -1) {\n str = str.substr(0,terminatorIdx);\n }\n }\n\n return str;\n}\n\nfunction parseCookiePair(cookiePair, looseMode) {\n cookiePair = trimTerminator(cookiePair);\n\n var firstEq = cookiePair.indexOf('=');\n if (looseMode) {\n if (firstEq === 0) { // '=' is immediately at start\n cookiePair = cookiePair.substr(1);\n firstEq = cookiePair.indexOf('='); // might still need to split on '='\n }\n } else { // non-loose mode\n if (firstEq <= 0) { // no '=' or is at start\n return; // needs to have non-empty \"cookie-name\"\n }\n }\n\n var cookieName, cookieValue;\n if (firstEq <= 0) {\n cookieName = \"\";\n cookieValue = cookiePair.trim();\n } else {\n cookieName = cookiePair.substr(0, firstEq).trim();\n cookieValue = cookiePair.substr(firstEq+1).trim();\n }\n\n if (CONTROL_CHARS.test(cookieName) || CONTROL_CHARS.test(cookieValue)) {\n return;\n }\n\n var c = new Cookie();\n c.key = cookieName;\n c.value = cookieValue;\n return c;\n}\n\nfunction parse(str, options) {\n if (!options || typeof options !== 'object') {\n options = {};\n }\n str = str.trim();\n\n // We use a regex to parse the \"name-value-pair\" part of S5.2\n var firstSemi = str.indexOf(';'); // S5.2 step 1\n var cookiePair = (firstSemi === -1) ? str : str.substr(0, firstSemi);\n var c = parseCookiePair(cookiePair, !!options.loose);\n if (!c) {\n return;\n }\n\n if (firstSemi === -1) {\n return c;\n }\n\n // S5.2.3 \"unparsed-attributes consist of the remainder of the set-cookie-string\n // (including the %x3B (\";\") in question).\" plus later on in the same section\n // \"discard the first \";\" and trim\".\n var unparsed = str.slice(firstSemi + 1).trim();\n\n // \"If the unparsed-attributes string is empty, skip the rest of these\n // steps.\"\n if (unparsed.length === 0) {\n return c;\n }\n\n /*\n * S5.2 says that when looping over the items \"[p]rocess the attribute-name\n * and attribute-value according to the requirements in the following\n * subsections\" for every item. Plus, for many of the individual attributes\n * in S5.3 it says to use the \"attribute-value of the last attribute in the\n * cookie-attribute-list\". Therefore, in this implementation, we overwrite\n * the previous value.\n */\n var cookie_avs = unparsed.split(';');\n while (cookie_avs.length) {\n var av = cookie_avs.shift().trim();\n if (av.length === 0) { // happens if \";;\" appears\n continue;\n }\n var av_sep = av.indexOf('=');\n var av_key, av_value;\n\n if (av_sep === -1) {\n av_key = av;\n av_value = null;\n } else {\n av_key = av.substr(0,av_sep);\n av_value = av.substr(av_sep+1);\n }\n\n av_key = av_key.trim().toLowerCase();\n\n if (av_value) {\n av_value = av_value.trim();\n }\n\n switch(av_key) {\n case 'expires': // S5.2.1\n if (av_value) {\n var exp = parseDate(av_value);\n // \"If the attribute-value failed to parse as a cookie date, ignore the\n // cookie-av.\"\n if (exp) {\n // over and underflow not realistically a concern: V8's getTime() seems to\n // store something larger than a 32-bit time_t (even with 32-bit node)\n c.expires = exp;\n }\n }\n break;\n\n case 'max-age': // S5.2.2\n if (av_value) {\n // \"If the first character of the attribute-value is not a DIGIT or a \"-\"\n // character ...[or]... If the remainder of attribute-value contains a\n // non-DIGIT character, ignore the cookie-av.\"\n if (/^-?[0-9]+$/.test(av_value)) {\n var delta = parseInt(av_value, 10);\n // \"If delta-seconds is less than or equal to zero (0), let expiry-time\n // be the earliest representable date and time.\"\n c.setMaxAge(delta);\n }\n }\n break;\n\n case 'domain': // S5.2.3\n // \"If the attribute-value is empty, the behavior is undefined. However,\n // the user agent SHOULD ignore the cookie-av entirely.\"\n if (av_value) {\n // S5.2.3 \"Let cookie-domain be the attribute-value without the leading %x2E\n // (\".\") character.\"\n var domain = av_value.trim().replace(/^\\./, '');\n if (domain) {\n // \"Convert the cookie-domain to lower case.\"\n c.domain = domain.toLowerCase();\n }\n }\n break;\n\n case 'path': // S5.2.4\n /*\n * \"If the attribute-value is empty or if the first character of the\n * attribute-value is not %x2F (\"/\"):\n * Let cookie-path be the default-path.\n * Otherwise:\n * Let cookie-path be the attribute-value.\"\n *\n * We'll represent the default-path as null since it depends on the\n * context of the parsing.\n */\n c.path = av_value && av_value[0] === \"/\" ? av_value : null;\n break;\n\n case 'secure': // S5.2.5\n /*\n * \"If the attribute-name case-insensitively matches the string \"Secure\",\n * the user agent MUST append an attribute to the cookie-attribute-list\n * with an attribute-name of Secure and an empty attribute-value.\"\n */\n c.secure = true;\n break;\n\n case 'httponly': // S5.2.6 -- effectively the same as 'secure'\n c.httpOnly = true;\n break;\n\n default:\n c.extensions = c.extensions || [];\n c.extensions.push(av);\n break;\n }\n }\n\n return c;\n}\n\n// avoid the V8 deoptimization monster!\nfunction jsonParse(str) {\n var obj;\n try {\n obj = JSON.parse(str);\n } catch (e) {\n return e;\n }\n return obj;\n}\n\nfunction fromJSON(str) {\n if (!str) {\n return null;\n }\n\n var obj;\n if (typeof str === 'string') {\n obj = jsonParse(str);\n if (obj instanceof Error) {\n return null;\n }\n } else {\n // assume it's an Object\n obj = str;\n }\n\n var c = new Cookie();\n for (var i=0; i 1) {\n var lindex = path.lastIndexOf('/');\n if (lindex === 0) {\n break;\n }\n path = path.substr(0,lindex);\n permutations.push(path);\n }\n permutations.push('/');\n return permutations;\n}\n\nfunction getCookieContext(url) {\n if (url instanceof Object) {\n return url;\n }\n // NOTE: decodeURI will throw on malformed URIs (see GH-32).\n // Therefore, we will just skip decoding for such URIs.\n try {\n url = decodeURI(url);\n }\n catch(err) {\n // Silently swallow error\n }\n\n return urlParse(url);\n}\n\nfunction Cookie(options) {\n options = options || {};\n\n Object.keys(options).forEach(function(prop) {\n if (Cookie.prototype.hasOwnProperty(prop) &&\n Cookie.prototype[prop] !== options[prop] &&\n prop.substr(0,1) !== '_')\n {\n this[prop] = options[prop];\n }\n }, this);\n\n this.creation = this.creation || new Date();\n\n // used to break creation ties in cookieCompare():\n Object.defineProperty(this, 'creationIndex', {\n configurable: false,\n enumerable: false, // important for assert.deepEqual checks\n writable: true,\n value: ++Cookie.cookiesCreated\n });\n}\n\nCookie.cookiesCreated = 0; // incremented each time a cookie is created\n\nCookie.parse = parse;\nCookie.fromJSON = fromJSON;\n\nCookie.prototype.key = \"\";\nCookie.prototype.value = \"\";\n\n// the order in which the RFC has them:\nCookie.prototype.expires = \"Infinity\"; // coerces to literal Infinity\nCookie.prototype.maxAge = null; // takes precedence over expires for TTL\nCookie.prototype.domain = null;\nCookie.prototype.path = null;\nCookie.prototype.secure = false;\nCookie.prototype.httpOnly = false;\nCookie.prototype.extensions = null;\n\n// set by the CookieJar:\nCookie.prototype.hostOnly = null; // boolean when set\nCookie.prototype.pathIsDefault = null; // boolean when set\nCookie.prototype.creation = null; // Date when set; defaulted by Cookie.parse\nCookie.prototype.lastAccessed = null; // Date when set\nObject.defineProperty(Cookie.prototype, 'creationIndex', {\n configurable: true,\n enumerable: false,\n writable: true,\n value: 0\n});\n\nCookie.serializableProperties = Object.keys(Cookie.prototype)\n .filter(function(prop) {\n return !(\n Cookie.prototype[prop] instanceof Function ||\n prop === 'creationIndex' ||\n prop.substr(0,1) === '_'\n );\n });\n\nCookie.prototype.inspect = function inspect() {\n var now = Date.now();\n return 'Cookie=\"'+this.toString() +\n '; hostOnly='+(this.hostOnly != null ? this.hostOnly : '?') +\n '; aAge='+(this.lastAccessed ? (now-this.lastAccessed.getTime())+'ms' : '?') +\n '; cAge='+(this.creation ? (now-this.creation.getTime())+'ms' : '?') +\n '\"';\n};\n\n// Use the new custom inspection symbol to add the custom inspect function if\n// available.\nif (util.inspect.custom) {\n Cookie.prototype[util.inspect.custom] = Cookie.prototype.inspect;\n}\n\nCookie.prototype.toJSON = function() {\n var obj = {};\n\n var props = Cookie.serializableProperties;\n for (var i=0; i= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\r\n return c > 3 && r && Object.defineProperty(target, key, r), r;\r\n}\r\n\r\nexport function __param(paramIndex, decorator) {\r\n return function (target, key) { decorator(target, key, paramIndex); }\r\n}\r\n\r\nexport function __metadata(metadataKey, metadataValue) {\r\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(metadataKey, metadataValue);\r\n}\r\n\r\nexport function __awaiter(thisArg, _arguments, P, generator) {\r\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\r\n return new (P || (P = Promise))(function (resolve, reject) {\r\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\r\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\r\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\r\n step((generator = generator.apply(thisArg, _arguments || [])).next());\r\n });\r\n}\r\n\r\nexport function __generator(thisArg, body) {\r\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\r\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\r\n function verb(n) { return function (v) { return step([n, v]); }; }\r\n function step(op) {\r\n if (f) throw new TypeError(\"Generator is already executing.\");\r\n while (_) try {\r\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\r\n if (y = 0, t) op = [op[0] & 2, t.value];\r\n switch (op[0]) {\r\n case 0: case 1: t = op; break;\r\n case 4: _.label++; return { value: op[1], done: false };\r\n case 5: _.label++; y = op[1]; op = [0]; continue;\r\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\r\n default:\r\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\r\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\r\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\r\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\r\n if (t[2]) _.ops.pop();\r\n _.trys.pop(); continue;\r\n }\r\n op = body.call(thisArg, _);\r\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\r\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\r\n }\r\n}\r\n\r\nexport function __createBinding(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n o[k2] = m[k];\r\n}\r\n\r\nexport function __exportStar(m, exports) {\r\n for (var p in m) if (p !== \"default\" && !exports.hasOwnProperty(p)) exports[p] = m[p];\r\n}\r\n\r\nexport function __values(o) {\r\n var s = typeof Symbol === \"function\" && Symbol.iterator, m = s && o[s], i = 0;\r\n if (m) return m.call(o);\r\n if (o && typeof o.length === \"number\") return {\r\n next: function () {\r\n if (o && i >= o.length) o = void 0;\r\n return { value: o && o[i++], done: !o };\r\n }\r\n };\r\n throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\r\n}\r\n\r\nexport function __read(o, n) {\r\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\r\n if (!m) return o;\r\n var i = m.call(o), r, ar = [], e;\r\n try {\r\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\r\n }\r\n catch (error) { e = { error: error }; }\r\n finally {\r\n try {\r\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\r\n }\r\n finally { if (e) throw e.error; }\r\n }\r\n return ar;\r\n}\r\n\r\nexport function __spread() {\r\n for (var ar = [], i = 0; i < arguments.length; i++)\r\n ar = ar.concat(__read(arguments[i]));\r\n return ar;\r\n}\r\n\r\nexport function __spreadArrays() {\r\n for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;\r\n for (var r = Array(s), k = 0, i = 0; i < il; i++)\r\n for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)\r\n r[k] = a[j];\r\n return r;\r\n};\r\n\r\nexport function __await(v) {\r\n return this instanceof __await ? (this.v = v, this) : new __await(v);\r\n}\r\n\r\nexport function __asyncGenerator(thisArg, _arguments, generator) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var g = generator.apply(thisArg, _arguments || []), i, q = [];\r\n return i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i;\r\n function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }\r\n function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }\r\n function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }\r\n function fulfill(value) { resume(\"next\", value); }\r\n function reject(value) { resume(\"throw\", value); }\r\n function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }\r\n}\r\n\r\nexport function __asyncDelegator(o) {\r\n var i, p;\r\n return i = {}, verb(\"next\"), verb(\"throw\", function (e) { throw e; }), verb(\"return\"), i[Symbol.iterator] = function () { return this; }, i;\r\n function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === \"return\" } : f ? f(v) : v; } : f; }\r\n}\r\n\r\nexport function __asyncValues(o) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var m = o[Symbol.asyncIterator], i;\r\n return m ? m.call(o) : (o = typeof __values === \"function\" ? __values(o) : o[Symbol.iterator](), i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i);\r\n function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }\r\n function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }\r\n}\r\n\r\nexport function __makeTemplateObject(cooked, raw) {\r\n if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\r\n return cooked;\r\n};\r\n\r\nexport function __importStar(mod) {\r\n if (mod && mod.__esModule) return mod;\r\n var result = {};\r\n if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];\r\n result.default = mod;\r\n return result;\r\n}\r\n\r\nexport function __importDefault(mod) {\r\n return (mod && mod.__esModule) ? mod : { default: mod };\r\n}\r\n\r\nexport function __classPrivateFieldGet(receiver, privateMap) {\r\n if (!privateMap.has(receiver)) {\r\n throw new TypeError(\"attempted to get private field on non-instance\");\r\n }\r\n return privateMap.get(receiver);\r\n}\r\n\r\nexport function __classPrivateFieldSet(receiver, privateMap, value) {\r\n if (!privateMap.has(receiver)) {\r\n throw new TypeError(\"attempted to set private field on non-instance\");\r\n }\r\n privateMap.set(receiver, value);\r\n return value;\r\n}\r\n","'use strict'\n\nvar net = require('net')\n , tls = require('tls')\n , http = require('http')\n , https = require('https')\n , events = require('events')\n , assert = require('assert')\n , util = require('util')\n , Buffer = require('safe-buffer').Buffer\n ;\n\nexports.httpOverHttp = httpOverHttp\nexports.httpsOverHttp = httpsOverHttp\nexports.httpOverHttps = httpOverHttps\nexports.httpsOverHttps = httpsOverHttps\n\n\nfunction httpOverHttp(options) {\n var agent = new TunnelingAgent(options)\n agent.request = http.request\n return agent\n}\n\nfunction httpsOverHttp(options) {\n var agent = new TunnelingAgent(options)\n agent.request = http.request\n agent.createSocket = createSecureSocket\n agent.defaultPort = 443\n return agent\n}\n\nfunction httpOverHttps(options) {\n var agent = new TunnelingAgent(options)\n agent.request = https.request\n return agent\n}\n\nfunction httpsOverHttps(options) {\n var agent = new TunnelingAgent(options)\n agent.request = https.request\n agent.createSocket = createSecureSocket\n agent.defaultPort = 443\n return agent\n}\n\n\nfunction TunnelingAgent(options) {\n var self = this\n self.options = options || {}\n self.proxyOptions = self.options.proxy || {}\n self.maxSockets = self.options.maxSockets || http.Agent.defaultMaxSockets\n self.requests = []\n self.sockets = []\n\n self.on('free', function onFree(socket, host, port) {\n for (var i = 0, len = self.requests.length; i < len; ++i) {\n var pending = self.requests[i]\n if (pending.host === host && pending.port === port) {\n // Detect the request to connect same origin server,\n // reuse the connection.\n self.requests.splice(i, 1)\n pending.request.onSocket(socket)\n return\n }\n }\n socket.destroy()\n self.removeSocket(socket)\n })\n}\nutil.inherits(TunnelingAgent, events.EventEmitter)\n\nTunnelingAgent.prototype.addRequest = function addRequest(req, options) {\n var self = this\n\n // Legacy API: addRequest(req, host, port, path)\n if (typeof options === 'string') {\n options = {\n host: options,\n port: arguments[2],\n path: arguments[3]\n };\n }\n\n if (self.sockets.length >= this.maxSockets) {\n // We are over limit so we'll add it to the queue.\n self.requests.push({host: options.host, port: options.port, request: req})\n return\n }\n\n // If we are under maxSockets create a new one.\n self.createConnection({host: options.host, port: options.port, request: req})\n}\n\nTunnelingAgent.prototype.createConnection = function createConnection(pending) {\n var self = this\n\n self.createSocket(pending, function(socket) {\n socket.on('free', onFree)\n socket.on('close', onCloseOrRemove)\n socket.on('agentRemove', onCloseOrRemove)\n pending.request.onSocket(socket)\n\n function onFree() {\n self.emit('free', socket, pending.host, pending.port)\n }\n\n function onCloseOrRemove(err) {\n self.removeSocket(socket)\n socket.removeListener('free', onFree)\n socket.removeListener('close', onCloseOrRemove)\n socket.removeListener('agentRemove', onCloseOrRemove)\n }\n })\n}\n\nTunnelingAgent.prototype.createSocket = function createSocket(options, cb) {\n var self = this\n var placeholder = {}\n self.sockets.push(placeholder)\n\n var connectOptions = mergeOptions({}, self.proxyOptions,\n { method: 'CONNECT'\n , path: options.host + ':' + options.port\n , agent: false\n }\n )\n if (connectOptions.proxyAuth) {\n connectOptions.headers = connectOptions.headers || {}\n connectOptions.headers['Proxy-Authorization'] = 'Basic ' +\n Buffer.from(connectOptions.proxyAuth).toString('base64')\n }\n\n debug('making CONNECT request')\n var connectReq = self.request(connectOptions)\n connectReq.useChunkedEncodingByDefault = false // for v0.6\n connectReq.once('response', onResponse) // for v0.6\n connectReq.once('upgrade', onUpgrade) // for v0.6\n connectReq.once('connect', onConnect) // for v0.7 or later\n connectReq.once('error', onError)\n connectReq.end()\n\n function onResponse(res) {\n // Very hacky. This is necessary to avoid http-parser leaks.\n res.upgrade = true\n }\n\n function onUpgrade(res, socket, head) {\n // Hacky.\n process.nextTick(function() {\n onConnect(res, socket, head)\n })\n }\n\n function onConnect(res, socket, head) {\n connectReq.removeAllListeners()\n socket.removeAllListeners()\n\n if (res.statusCode === 200) {\n assert.equal(head.length, 0)\n debug('tunneling connection has established')\n self.sockets[self.sockets.indexOf(placeholder)] = socket\n cb(socket)\n } else {\n debug('tunneling socket could not be established, statusCode=%d', res.statusCode)\n var error = new Error('tunneling socket could not be established, ' + 'statusCode=' + res.statusCode)\n error.code = 'ECONNRESET'\n options.request.emit('error', error)\n self.removeSocket(placeholder)\n }\n }\n\n function onError(cause) {\n connectReq.removeAllListeners()\n\n debug('tunneling socket could not be established, cause=%s\\n', cause.message, cause.stack)\n var error = new Error('tunneling socket could not be established, ' + 'cause=' + cause.message)\n error.code = 'ECONNRESET'\n options.request.emit('error', error)\n self.removeSocket(placeholder)\n }\n}\n\nTunnelingAgent.prototype.removeSocket = function removeSocket(socket) {\n var pos = this.sockets.indexOf(socket)\n if (pos === -1) return\n\n this.sockets.splice(pos, 1)\n\n var pending = this.requests.shift()\n if (pending) {\n // If we have pending requests and a socket gets closed a new one\n // needs to be created to take over in the pool for the one that closed.\n this.createConnection(pending)\n }\n}\n\nfunction createSecureSocket(options, cb) {\n var self = this\n TunnelingAgent.prototype.createSocket.call(self, options, function(socket) {\n // 0 is dummy port for v0.6\n var secureSocket = tls.connect(0, mergeOptions({}, self.options,\n { servername: options.host\n , socket: socket\n }\n ))\n self.sockets[self.sockets.indexOf(socket)] = secureSocket\n cb(secureSocket)\n })\n}\n\n\nfunction mergeOptions(target) {\n for (var i = 1, len = arguments.length; i < len; ++i) {\n var overrides = arguments[i]\n if (typeof overrides === 'object') {\n var keys = Object.keys(overrides)\n for (var j = 0, keyLen = keys.length; j < keyLen; ++j) {\n var k = keys[j]\n if (overrides[k] !== undefined) {\n target[k] = overrides[k]\n }\n }\n }\n }\n return target\n}\n\n\nvar debug\nif (process.env.NODE_DEBUG && /\\btunnel\\b/.test(process.env.NODE_DEBUG)) {\n debug = function() {\n var args = Array.prototype.slice.call(arguments)\n if (typeof args[0] === 'string') {\n args[0] = 'TUNNEL: ' + args[0]\n } else {\n args.unshift('TUNNEL:')\n }\n console.error.apply(console, args)\n }\n} else {\n debug = function() {}\n}\nexports.debug = debug // for test\n","(function(nacl) {\n'use strict';\n\n// Ported in 2014 by Dmitry Chestnykh and Devi Mandiri.\n// Public domain.\n//\n// Implementation derived from TweetNaCl version 20140427.\n// See for details: http://tweetnacl.cr.yp.to/\n\nvar gf = function(init) {\n var i, r = new Float64Array(16);\n if (init) for (i = 0; i < init.length; i++) r[i] = init[i];\n return r;\n};\n\n// Pluggable, initialized in high-level API below.\nvar randombytes = function(/* x, n */) { throw new Error('no PRNG'); };\n\nvar _0 = new Uint8Array(16);\nvar _9 = new Uint8Array(32); _9[0] = 9;\n\nvar gf0 = gf(),\n gf1 = gf([1]),\n _121665 = gf([0xdb41, 1]),\n D = gf([0x78a3, 0x1359, 0x4dca, 0x75eb, 0xd8ab, 0x4141, 0x0a4d, 0x0070, 0xe898, 0x7779, 0x4079, 0x8cc7, 0xfe73, 0x2b6f, 0x6cee, 0x5203]),\n D2 = gf([0xf159, 0x26b2, 0x9b94, 0xebd6, 0xb156, 0x8283, 0x149a, 0x00e0, 0xd130, 0xeef3, 0x80f2, 0x198e, 0xfce7, 0x56df, 0xd9dc, 0x2406]),\n X = gf([0xd51a, 0x8f25, 0x2d60, 0xc956, 0xa7b2, 0x9525, 0xc760, 0x692c, 0xdc5c, 0xfdd6, 0xe231, 0xc0a4, 0x53fe, 0xcd6e, 0x36d3, 0x2169]),\n Y = gf([0x6658, 0x6666, 0x6666, 0x6666, 0x6666, 0x6666, 0x6666, 0x6666, 0x6666, 0x6666, 0x6666, 0x6666, 0x6666, 0x6666, 0x6666, 0x6666]),\n I = gf([0xa0b0, 0x4a0e, 0x1b27, 0xc4ee, 0xe478, 0xad2f, 0x1806, 0x2f43, 0xd7a7, 0x3dfb, 0x0099, 0x2b4d, 0xdf0b, 0x4fc1, 0x2480, 0x2b83]);\n\nfunction ts64(x, i, h, l) {\n x[i] = (h >> 24) & 0xff;\n x[i+1] = (h >> 16) & 0xff;\n x[i+2] = (h >> 8) & 0xff;\n x[i+3] = h & 0xff;\n x[i+4] = (l >> 24) & 0xff;\n x[i+5] = (l >> 16) & 0xff;\n x[i+6] = (l >> 8) & 0xff;\n x[i+7] = l & 0xff;\n}\n\nfunction vn(x, xi, y, yi, n) {\n var i,d = 0;\n for (i = 0; i < n; i++) d |= x[xi+i]^y[yi+i];\n return (1 & ((d - 1) >>> 8)) - 1;\n}\n\nfunction crypto_verify_16(x, xi, y, yi) {\n return vn(x,xi,y,yi,16);\n}\n\nfunction crypto_verify_32(x, xi, y, yi) {\n return vn(x,xi,y,yi,32);\n}\n\nfunction core_salsa20(o, p, k, c) {\n var j0 = c[ 0] & 0xff | (c[ 1] & 0xff)<<8 | (c[ 2] & 0xff)<<16 | (c[ 3] & 0xff)<<24,\n j1 = k[ 0] & 0xff | (k[ 1] & 0xff)<<8 | (k[ 2] & 0xff)<<16 | (k[ 3] & 0xff)<<24,\n j2 = k[ 4] & 0xff | (k[ 5] & 0xff)<<8 | (k[ 6] & 0xff)<<16 | (k[ 7] & 0xff)<<24,\n j3 = k[ 8] & 0xff | (k[ 9] & 0xff)<<8 | (k[10] & 0xff)<<16 | (k[11] & 0xff)<<24,\n j4 = k[12] & 0xff | (k[13] & 0xff)<<8 | (k[14] & 0xff)<<16 | (k[15] & 0xff)<<24,\n j5 = c[ 4] & 0xff | (c[ 5] & 0xff)<<8 | (c[ 6] & 0xff)<<16 | (c[ 7] & 0xff)<<24,\n j6 = p[ 0] & 0xff | (p[ 1] & 0xff)<<8 | (p[ 2] & 0xff)<<16 | (p[ 3] & 0xff)<<24,\n j7 = p[ 4] & 0xff | (p[ 5] & 0xff)<<8 | (p[ 6] & 0xff)<<16 | (p[ 7] & 0xff)<<24,\n j8 = p[ 8] & 0xff | (p[ 9] & 0xff)<<8 | (p[10] & 0xff)<<16 | (p[11] & 0xff)<<24,\n j9 = p[12] & 0xff | (p[13] & 0xff)<<8 | (p[14] & 0xff)<<16 | (p[15] & 0xff)<<24,\n j10 = c[ 8] & 0xff | (c[ 9] & 0xff)<<8 | (c[10] & 0xff)<<16 | (c[11] & 0xff)<<24,\n j11 = k[16] & 0xff | (k[17] & 0xff)<<8 | (k[18] & 0xff)<<16 | (k[19] & 0xff)<<24,\n j12 = k[20] & 0xff | (k[21] & 0xff)<<8 | (k[22] & 0xff)<<16 | (k[23] & 0xff)<<24,\n j13 = k[24] & 0xff | (k[25] & 0xff)<<8 | (k[26] & 0xff)<<16 | (k[27] & 0xff)<<24,\n j14 = k[28] & 0xff | (k[29] & 0xff)<<8 | (k[30] & 0xff)<<16 | (k[31] & 0xff)<<24,\n j15 = c[12] & 0xff | (c[13] & 0xff)<<8 | (c[14] & 0xff)<<16 | (c[15] & 0xff)<<24;\n\n var x0 = j0, x1 = j1, x2 = j2, x3 = j3, x4 = j4, x5 = j5, x6 = j6, x7 = j7,\n x8 = j8, x9 = j9, x10 = j10, x11 = j11, x12 = j12, x13 = j13, x14 = j14,\n x15 = j15, u;\n\n for (var i = 0; i < 20; i += 2) {\n u = x0 + x12 | 0;\n x4 ^= u<<7 | u>>>(32-7);\n u = x4 + x0 | 0;\n x8 ^= u<<9 | u>>>(32-9);\n u = x8 + x4 | 0;\n x12 ^= u<<13 | u>>>(32-13);\n u = x12 + x8 | 0;\n x0 ^= u<<18 | u>>>(32-18);\n\n u = x5 + x1 | 0;\n x9 ^= u<<7 | u>>>(32-7);\n u = x9 + x5 | 0;\n x13 ^= u<<9 | u>>>(32-9);\n u = x13 + x9 | 0;\n x1 ^= u<<13 | u>>>(32-13);\n u = x1 + x13 | 0;\n x5 ^= u<<18 | u>>>(32-18);\n\n u = x10 + x6 | 0;\n x14 ^= u<<7 | u>>>(32-7);\n u = x14 + x10 | 0;\n x2 ^= u<<9 | u>>>(32-9);\n u = x2 + x14 | 0;\n x6 ^= u<<13 | u>>>(32-13);\n u = x6 + x2 | 0;\n x10 ^= u<<18 | u>>>(32-18);\n\n u = x15 + x11 | 0;\n x3 ^= u<<7 | u>>>(32-7);\n u = x3 + x15 | 0;\n x7 ^= u<<9 | u>>>(32-9);\n u = x7 + x3 | 0;\n x11 ^= u<<13 | u>>>(32-13);\n u = x11 + x7 | 0;\n x15 ^= u<<18 | u>>>(32-18);\n\n u = x0 + x3 | 0;\n x1 ^= u<<7 | u>>>(32-7);\n u = x1 + x0 | 0;\n x2 ^= u<<9 | u>>>(32-9);\n u = x2 + x1 | 0;\n x3 ^= u<<13 | u>>>(32-13);\n u = x3 + x2 | 0;\n x0 ^= u<<18 | u>>>(32-18);\n\n u = x5 + x4 | 0;\n x6 ^= u<<7 | u>>>(32-7);\n u = x6 + x5 | 0;\n x7 ^= u<<9 | u>>>(32-9);\n u = x7 + x6 | 0;\n x4 ^= u<<13 | u>>>(32-13);\n u = x4 + x7 | 0;\n x5 ^= u<<18 | u>>>(32-18);\n\n u = x10 + x9 | 0;\n x11 ^= u<<7 | u>>>(32-7);\n u = x11 + x10 | 0;\n x8 ^= u<<9 | u>>>(32-9);\n u = x8 + x11 | 0;\n x9 ^= u<<13 | u>>>(32-13);\n u = x9 + x8 | 0;\n x10 ^= u<<18 | u>>>(32-18);\n\n u = x15 + x14 | 0;\n x12 ^= u<<7 | u>>>(32-7);\n u = x12 + x15 | 0;\n x13 ^= u<<9 | u>>>(32-9);\n u = x13 + x12 | 0;\n x14 ^= u<<13 | u>>>(32-13);\n u = x14 + x13 | 0;\n x15 ^= u<<18 | u>>>(32-18);\n }\n x0 = x0 + j0 | 0;\n x1 = x1 + j1 | 0;\n x2 = x2 + j2 | 0;\n x3 = x3 + j3 | 0;\n x4 = x4 + j4 | 0;\n x5 = x5 + j5 | 0;\n x6 = x6 + j6 | 0;\n x7 = x7 + j7 | 0;\n x8 = x8 + j8 | 0;\n x9 = x9 + j9 | 0;\n x10 = x10 + j10 | 0;\n x11 = x11 + j11 | 0;\n x12 = x12 + j12 | 0;\n x13 = x13 + j13 | 0;\n x14 = x14 + j14 | 0;\n x15 = x15 + j15 | 0;\n\n o[ 0] = x0 >>> 0 & 0xff;\n o[ 1] = x0 >>> 8 & 0xff;\n o[ 2] = x0 >>> 16 & 0xff;\n o[ 3] = x0 >>> 24 & 0xff;\n\n o[ 4] = x1 >>> 0 & 0xff;\n o[ 5] = x1 >>> 8 & 0xff;\n o[ 6] = x1 >>> 16 & 0xff;\n o[ 7] = x1 >>> 24 & 0xff;\n\n o[ 8] = x2 >>> 0 & 0xff;\n o[ 9] = x2 >>> 8 & 0xff;\n o[10] = x2 >>> 16 & 0xff;\n o[11] = x2 >>> 24 & 0xff;\n\n o[12] = x3 >>> 0 & 0xff;\n o[13] = x3 >>> 8 & 0xff;\n o[14] = x3 >>> 16 & 0xff;\n o[15] = x3 >>> 24 & 0xff;\n\n o[16] = x4 >>> 0 & 0xff;\n o[17] = x4 >>> 8 & 0xff;\n o[18] = x4 >>> 16 & 0xff;\n o[19] = x4 >>> 24 & 0xff;\n\n o[20] = x5 >>> 0 & 0xff;\n o[21] = x5 >>> 8 & 0xff;\n o[22] = x5 >>> 16 & 0xff;\n o[23] = x5 >>> 24 & 0xff;\n\n o[24] = x6 >>> 0 & 0xff;\n o[25] = x6 >>> 8 & 0xff;\n o[26] = x6 >>> 16 & 0xff;\n o[27] = x6 >>> 24 & 0xff;\n\n o[28] = x7 >>> 0 & 0xff;\n o[29] = x7 >>> 8 & 0xff;\n o[30] = x7 >>> 16 & 0xff;\n o[31] = x7 >>> 24 & 0xff;\n\n o[32] = x8 >>> 0 & 0xff;\n o[33] = x8 >>> 8 & 0xff;\n o[34] = x8 >>> 16 & 0xff;\n o[35] = x8 >>> 24 & 0xff;\n\n o[36] = x9 >>> 0 & 0xff;\n o[37] = x9 >>> 8 & 0xff;\n o[38] = x9 >>> 16 & 0xff;\n o[39] = x9 >>> 24 & 0xff;\n\n o[40] = x10 >>> 0 & 0xff;\n o[41] = x10 >>> 8 & 0xff;\n o[42] = x10 >>> 16 & 0xff;\n o[43] = x10 >>> 24 & 0xff;\n\n o[44] = x11 >>> 0 & 0xff;\n o[45] = x11 >>> 8 & 0xff;\n o[46] = x11 >>> 16 & 0xff;\n o[47] = x11 >>> 24 & 0xff;\n\n o[48] = x12 >>> 0 & 0xff;\n o[49] = x12 >>> 8 & 0xff;\n o[50] = x12 >>> 16 & 0xff;\n o[51] = x12 >>> 24 & 0xff;\n\n o[52] = x13 >>> 0 & 0xff;\n o[53] = x13 >>> 8 & 0xff;\n o[54] = x13 >>> 16 & 0xff;\n o[55] = x13 >>> 24 & 0xff;\n\n o[56] = x14 >>> 0 & 0xff;\n o[57] = x14 >>> 8 & 0xff;\n o[58] = x14 >>> 16 & 0xff;\n o[59] = x14 >>> 24 & 0xff;\n\n o[60] = x15 >>> 0 & 0xff;\n o[61] = x15 >>> 8 & 0xff;\n o[62] = x15 >>> 16 & 0xff;\n o[63] = x15 >>> 24 & 0xff;\n}\n\nfunction core_hsalsa20(o,p,k,c) {\n var j0 = c[ 0] & 0xff | (c[ 1] & 0xff)<<8 | (c[ 2] & 0xff)<<16 | (c[ 3] & 0xff)<<24,\n j1 = k[ 0] & 0xff | (k[ 1] & 0xff)<<8 | (k[ 2] & 0xff)<<16 | (k[ 3] & 0xff)<<24,\n j2 = k[ 4] & 0xff | (k[ 5] & 0xff)<<8 | (k[ 6] & 0xff)<<16 | (k[ 7] & 0xff)<<24,\n j3 = k[ 8] & 0xff | (k[ 9] & 0xff)<<8 | (k[10] & 0xff)<<16 | (k[11] & 0xff)<<24,\n j4 = k[12] & 0xff | (k[13] & 0xff)<<8 | (k[14] & 0xff)<<16 | (k[15] & 0xff)<<24,\n j5 = c[ 4] & 0xff | (c[ 5] & 0xff)<<8 | (c[ 6] & 0xff)<<16 | (c[ 7] & 0xff)<<24,\n j6 = p[ 0] & 0xff | (p[ 1] & 0xff)<<8 | (p[ 2] & 0xff)<<16 | (p[ 3] & 0xff)<<24,\n j7 = p[ 4] & 0xff | (p[ 5] & 0xff)<<8 | (p[ 6] & 0xff)<<16 | (p[ 7] & 0xff)<<24,\n j8 = p[ 8] & 0xff | (p[ 9] & 0xff)<<8 | (p[10] & 0xff)<<16 | (p[11] & 0xff)<<24,\n j9 = p[12] & 0xff | (p[13] & 0xff)<<8 | (p[14] & 0xff)<<16 | (p[15] & 0xff)<<24,\n j10 = c[ 8] & 0xff | (c[ 9] & 0xff)<<8 | (c[10] & 0xff)<<16 | (c[11] & 0xff)<<24,\n j11 = k[16] & 0xff | (k[17] & 0xff)<<8 | (k[18] & 0xff)<<16 | (k[19] & 0xff)<<24,\n j12 = k[20] & 0xff | (k[21] & 0xff)<<8 | (k[22] & 0xff)<<16 | (k[23] & 0xff)<<24,\n j13 = k[24] & 0xff | (k[25] & 0xff)<<8 | (k[26] & 0xff)<<16 | (k[27] & 0xff)<<24,\n j14 = k[28] & 0xff | (k[29] & 0xff)<<8 | (k[30] & 0xff)<<16 | (k[31] & 0xff)<<24,\n j15 = c[12] & 0xff | (c[13] & 0xff)<<8 | (c[14] & 0xff)<<16 | (c[15] & 0xff)<<24;\n\n var x0 = j0, x1 = j1, x2 = j2, x3 = j3, x4 = j4, x5 = j5, x6 = j6, x7 = j7,\n x8 = j8, x9 = j9, x10 = j10, x11 = j11, x12 = j12, x13 = j13, x14 = j14,\n x15 = j15, u;\n\n for (var i = 0; i < 20; i += 2) {\n u = x0 + x12 | 0;\n x4 ^= u<<7 | u>>>(32-7);\n u = x4 + x0 | 0;\n x8 ^= u<<9 | u>>>(32-9);\n u = x8 + x4 | 0;\n x12 ^= u<<13 | u>>>(32-13);\n u = x12 + x8 | 0;\n x0 ^= u<<18 | u>>>(32-18);\n\n u = x5 + x1 | 0;\n x9 ^= u<<7 | u>>>(32-7);\n u = x9 + x5 | 0;\n x13 ^= u<<9 | u>>>(32-9);\n u = x13 + x9 | 0;\n x1 ^= u<<13 | u>>>(32-13);\n u = x1 + x13 | 0;\n x5 ^= u<<18 | u>>>(32-18);\n\n u = x10 + x6 | 0;\n x14 ^= u<<7 | u>>>(32-7);\n u = x14 + x10 | 0;\n x2 ^= u<<9 | u>>>(32-9);\n u = x2 + x14 | 0;\n x6 ^= u<<13 | u>>>(32-13);\n u = x6 + x2 | 0;\n x10 ^= u<<18 | u>>>(32-18);\n\n u = x15 + x11 | 0;\n x3 ^= u<<7 | u>>>(32-7);\n u = x3 + x15 | 0;\n x7 ^= u<<9 | u>>>(32-9);\n u = x7 + x3 | 0;\n x11 ^= u<<13 | u>>>(32-13);\n u = x11 + x7 | 0;\n x15 ^= u<<18 | u>>>(32-18);\n\n u = x0 + x3 | 0;\n x1 ^= u<<7 | u>>>(32-7);\n u = x1 + x0 | 0;\n x2 ^= u<<9 | u>>>(32-9);\n u = x2 + x1 | 0;\n x3 ^= u<<13 | u>>>(32-13);\n u = x3 + x2 | 0;\n x0 ^= u<<18 | u>>>(32-18);\n\n u = x5 + x4 | 0;\n x6 ^= u<<7 | u>>>(32-7);\n u = x6 + x5 | 0;\n x7 ^= u<<9 | u>>>(32-9);\n u = x7 + x6 | 0;\n x4 ^= u<<13 | u>>>(32-13);\n u = x4 + x7 | 0;\n x5 ^= u<<18 | u>>>(32-18);\n\n u = x10 + x9 | 0;\n x11 ^= u<<7 | u>>>(32-7);\n u = x11 + x10 | 0;\n x8 ^= u<<9 | u>>>(32-9);\n u = x8 + x11 | 0;\n x9 ^= u<<13 | u>>>(32-13);\n u = x9 + x8 | 0;\n x10 ^= u<<18 | u>>>(32-18);\n\n u = x15 + x14 | 0;\n x12 ^= u<<7 | u>>>(32-7);\n u = x12 + x15 | 0;\n x13 ^= u<<9 | u>>>(32-9);\n u = x13 + x12 | 0;\n x14 ^= u<<13 | u>>>(32-13);\n u = x14 + x13 | 0;\n x15 ^= u<<18 | u>>>(32-18);\n }\n\n o[ 0] = x0 >>> 0 & 0xff;\n o[ 1] = x0 >>> 8 & 0xff;\n o[ 2] = x0 >>> 16 & 0xff;\n o[ 3] = x0 >>> 24 & 0xff;\n\n o[ 4] = x5 >>> 0 & 0xff;\n o[ 5] = x5 >>> 8 & 0xff;\n o[ 6] = x5 >>> 16 & 0xff;\n o[ 7] = x5 >>> 24 & 0xff;\n\n o[ 8] = x10 >>> 0 & 0xff;\n o[ 9] = x10 >>> 8 & 0xff;\n o[10] = x10 >>> 16 & 0xff;\n o[11] = x10 >>> 24 & 0xff;\n\n o[12] = x15 >>> 0 & 0xff;\n o[13] = x15 >>> 8 & 0xff;\n o[14] = x15 >>> 16 & 0xff;\n o[15] = x15 >>> 24 & 0xff;\n\n o[16] = x6 >>> 0 & 0xff;\n o[17] = x6 >>> 8 & 0xff;\n o[18] = x6 >>> 16 & 0xff;\n o[19] = x6 >>> 24 & 0xff;\n\n o[20] = x7 >>> 0 & 0xff;\n o[21] = x7 >>> 8 & 0xff;\n o[22] = x7 >>> 16 & 0xff;\n o[23] = x7 >>> 24 & 0xff;\n\n o[24] = x8 >>> 0 & 0xff;\n o[25] = x8 >>> 8 & 0xff;\n o[26] = x8 >>> 16 & 0xff;\n o[27] = x8 >>> 24 & 0xff;\n\n o[28] = x9 >>> 0 & 0xff;\n o[29] = x9 >>> 8 & 0xff;\n o[30] = x9 >>> 16 & 0xff;\n o[31] = x9 >>> 24 & 0xff;\n}\n\nfunction crypto_core_salsa20(out,inp,k,c) {\n core_salsa20(out,inp,k,c);\n}\n\nfunction crypto_core_hsalsa20(out,inp,k,c) {\n core_hsalsa20(out,inp,k,c);\n}\n\nvar sigma = new Uint8Array([101, 120, 112, 97, 110, 100, 32, 51, 50, 45, 98, 121, 116, 101, 32, 107]);\n // \"expand 32-byte k\"\n\nfunction crypto_stream_salsa20_xor(c,cpos,m,mpos,b,n,k) {\n var z = new Uint8Array(16), x = new Uint8Array(64);\n var u, i;\n for (i = 0; i < 16; i++) z[i] = 0;\n for (i = 0; i < 8; i++) z[i] = n[i];\n while (b >= 64) {\n crypto_core_salsa20(x,z,k,sigma);\n for (i = 0; i < 64; i++) c[cpos+i] = m[mpos+i] ^ x[i];\n u = 1;\n for (i = 8; i < 16; i++) {\n u = u + (z[i] & 0xff) | 0;\n z[i] = u & 0xff;\n u >>>= 8;\n }\n b -= 64;\n cpos += 64;\n mpos += 64;\n }\n if (b > 0) {\n crypto_core_salsa20(x,z,k,sigma);\n for (i = 0; i < b; i++) c[cpos+i] = m[mpos+i] ^ x[i];\n }\n return 0;\n}\n\nfunction crypto_stream_salsa20(c,cpos,b,n,k) {\n var z = new Uint8Array(16), x = new Uint8Array(64);\n var u, i;\n for (i = 0; i < 16; i++) z[i] = 0;\n for (i = 0; i < 8; i++) z[i] = n[i];\n while (b >= 64) {\n crypto_core_salsa20(x,z,k,sigma);\n for (i = 0; i < 64; i++) c[cpos+i] = x[i];\n u = 1;\n for (i = 8; i < 16; i++) {\n u = u + (z[i] & 0xff) | 0;\n z[i] = u & 0xff;\n u >>>= 8;\n }\n b -= 64;\n cpos += 64;\n }\n if (b > 0) {\n crypto_core_salsa20(x,z,k,sigma);\n for (i = 0; i < b; i++) c[cpos+i] = x[i];\n }\n return 0;\n}\n\nfunction crypto_stream(c,cpos,d,n,k) {\n var s = new Uint8Array(32);\n crypto_core_hsalsa20(s,n,k,sigma);\n var sn = new Uint8Array(8);\n for (var i = 0; i < 8; i++) sn[i] = n[i+16];\n return crypto_stream_salsa20(c,cpos,d,sn,s);\n}\n\nfunction crypto_stream_xor(c,cpos,m,mpos,d,n,k) {\n var s = new Uint8Array(32);\n crypto_core_hsalsa20(s,n,k,sigma);\n var sn = new Uint8Array(8);\n for (var i = 0; i < 8; i++) sn[i] = n[i+16];\n return crypto_stream_salsa20_xor(c,cpos,m,mpos,d,sn,s);\n}\n\n/*\n* Port of Andrew Moon's Poly1305-donna-16. Public domain.\n* https://github.com/floodyberry/poly1305-donna\n*/\n\nvar poly1305 = function(key) {\n this.buffer = new Uint8Array(16);\n this.r = new Uint16Array(10);\n this.h = new Uint16Array(10);\n this.pad = new Uint16Array(8);\n this.leftover = 0;\n this.fin = 0;\n\n var t0, t1, t2, t3, t4, t5, t6, t7;\n\n t0 = key[ 0] & 0xff | (key[ 1] & 0xff) << 8; this.r[0] = ( t0 ) & 0x1fff;\n t1 = key[ 2] & 0xff | (key[ 3] & 0xff) << 8; this.r[1] = ((t0 >>> 13) | (t1 << 3)) & 0x1fff;\n t2 = key[ 4] & 0xff | (key[ 5] & 0xff) << 8; this.r[2] = ((t1 >>> 10) | (t2 << 6)) & 0x1f03;\n t3 = key[ 6] & 0xff | (key[ 7] & 0xff) << 8; this.r[3] = ((t2 >>> 7) | (t3 << 9)) & 0x1fff;\n t4 = key[ 8] & 0xff | (key[ 9] & 0xff) << 8; this.r[4] = ((t3 >>> 4) | (t4 << 12)) & 0x00ff;\n this.r[5] = ((t4 >>> 1)) & 0x1ffe;\n t5 = key[10] & 0xff | (key[11] & 0xff) << 8; this.r[6] = ((t4 >>> 14) | (t5 << 2)) & 0x1fff;\n t6 = key[12] & 0xff | (key[13] & 0xff) << 8; this.r[7] = ((t5 >>> 11) | (t6 << 5)) & 0x1f81;\n t7 = key[14] & 0xff | (key[15] & 0xff) << 8; this.r[8] = ((t6 >>> 8) | (t7 << 8)) & 0x1fff;\n this.r[9] = ((t7 >>> 5)) & 0x007f;\n\n this.pad[0] = key[16] & 0xff | (key[17] & 0xff) << 8;\n this.pad[1] = key[18] & 0xff | (key[19] & 0xff) << 8;\n this.pad[2] = key[20] & 0xff | (key[21] & 0xff) << 8;\n this.pad[3] = key[22] & 0xff | (key[23] & 0xff) << 8;\n this.pad[4] = key[24] & 0xff | (key[25] & 0xff) << 8;\n this.pad[5] = key[26] & 0xff | (key[27] & 0xff) << 8;\n this.pad[6] = key[28] & 0xff | (key[29] & 0xff) << 8;\n this.pad[7] = key[30] & 0xff | (key[31] & 0xff) << 8;\n};\n\npoly1305.prototype.blocks = function(m, mpos, bytes) {\n var hibit = this.fin ? 0 : (1 << 11);\n var t0, t1, t2, t3, t4, t5, t6, t7, c;\n var d0, d1, d2, d3, d4, d5, d6, d7, d8, d9;\n\n var h0 = this.h[0],\n h1 = this.h[1],\n h2 = this.h[2],\n h3 = this.h[3],\n h4 = this.h[4],\n h5 = this.h[5],\n h6 = this.h[6],\n h7 = this.h[7],\n h8 = this.h[8],\n h9 = this.h[9];\n\n var r0 = this.r[0],\n r1 = this.r[1],\n r2 = this.r[2],\n r3 = this.r[3],\n r4 = this.r[4],\n r5 = this.r[5],\n r6 = this.r[6],\n r7 = this.r[7],\n r8 = this.r[8],\n r9 = this.r[9];\n\n while (bytes >= 16) {\n t0 = m[mpos+ 0] & 0xff | (m[mpos+ 1] & 0xff) << 8; h0 += ( t0 ) & 0x1fff;\n t1 = m[mpos+ 2] & 0xff | (m[mpos+ 3] & 0xff) << 8; h1 += ((t0 >>> 13) | (t1 << 3)) & 0x1fff;\n t2 = m[mpos+ 4] & 0xff | (m[mpos+ 5] & 0xff) << 8; h2 += ((t1 >>> 10) | (t2 << 6)) & 0x1fff;\n t3 = m[mpos+ 6] & 0xff | (m[mpos+ 7] & 0xff) << 8; h3 += ((t2 >>> 7) | (t3 << 9)) & 0x1fff;\n t4 = m[mpos+ 8] & 0xff | (m[mpos+ 9] & 0xff) << 8; h4 += ((t3 >>> 4) | (t4 << 12)) & 0x1fff;\n h5 += ((t4 >>> 1)) & 0x1fff;\n t5 = m[mpos+10] & 0xff | (m[mpos+11] & 0xff) << 8; h6 += ((t4 >>> 14) | (t5 << 2)) & 0x1fff;\n t6 = m[mpos+12] & 0xff | (m[mpos+13] & 0xff) << 8; h7 += ((t5 >>> 11) | (t6 << 5)) & 0x1fff;\n t7 = m[mpos+14] & 0xff | (m[mpos+15] & 0xff) << 8; h8 += ((t6 >>> 8) | (t7 << 8)) & 0x1fff;\n h9 += ((t7 >>> 5)) | hibit;\n\n c = 0;\n\n d0 = c;\n d0 += h0 * r0;\n d0 += h1 * (5 * r9);\n d0 += h2 * (5 * r8);\n d0 += h3 * (5 * r7);\n d0 += h4 * (5 * r6);\n c = (d0 >>> 13); d0 &= 0x1fff;\n d0 += h5 * (5 * r5);\n d0 += h6 * (5 * r4);\n d0 += h7 * (5 * r3);\n d0 += h8 * (5 * r2);\n d0 += h9 * (5 * r1);\n c += (d0 >>> 13); d0 &= 0x1fff;\n\n d1 = c;\n d1 += h0 * r1;\n d1 += h1 * r0;\n d1 += h2 * (5 * r9);\n d1 += h3 * (5 * r8);\n d1 += h4 * (5 * r7);\n c = (d1 >>> 13); d1 &= 0x1fff;\n d1 += h5 * (5 * r6);\n d1 += h6 * (5 * r5);\n d1 += h7 * (5 * r4);\n d1 += h8 * (5 * r3);\n d1 += h9 * (5 * r2);\n c += (d1 >>> 13); d1 &= 0x1fff;\n\n d2 = c;\n d2 += h0 * r2;\n d2 += h1 * r1;\n d2 += h2 * r0;\n d2 += h3 * (5 * r9);\n d2 += h4 * (5 * r8);\n c = (d2 >>> 13); d2 &= 0x1fff;\n d2 += h5 * (5 * r7);\n d2 += h6 * (5 * r6);\n d2 += h7 * (5 * r5);\n d2 += h8 * (5 * r4);\n d2 += h9 * (5 * r3);\n c += (d2 >>> 13); d2 &= 0x1fff;\n\n d3 = c;\n d3 += h0 * r3;\n d3 += h1 * r2;\n d3 += h2 * r1;\n d3 += h3 * r0;\n d3 += h4 * (5 * r9);\n c = (d3 >>> 13); d3 &= 0x1fff;\n d3 += h5 * (5 * r8);\n d3 += h6 * (5 * r7);\n d3 += h7 * (5 * r6);\n d3 += h8 * (5 * r5);\n d3 += h9 * (5 * r4);\n c += (d3 >>> 13); d3 &= 0x1fff;\n\n d4 = c;\n d4 += h0 * r4;\n d4 += h1 * r3;\n d4 += h2 * r2;\n d4 += h3 * r1;\n d4 += h4 * r0;\n c = (d4 >>> 13); d4 &= 0x1fff;\n d4 += h5 * (5 * r9);\n d4 += h6 * (5 * r8);\n d4 += h7 * (5 * r7);\n d4 += h8 * (5 * r6);\n d4 += h9 * (5 * r5);\n c += (d4 >>> 13); d4 &= 0x1fff;\n\n d5 = c;\n d5 += h0 * r5;\n d5 += h1 * r4;\n d5 += h2 * r3;\n d5 += h3 * r2;\n d5 += h4 * r1;\n c = (d5 >>> 13); d5 &= 0x1fff;\n d5 += h5 * r0;\n d5 += h6 * (5 * r9);\n d5 += h7 * (5 * r8);\n d5 += h8 * (5 * r7);\n d5 += h9 * (5 * r6);\n c += (d5 >>> 13); d5 &= 0x1fff;\n\n d6 = c;\n d6 += h0 * r6;\n d6 += h1 * r5;\n d6 += h2 * r4;\n d6 += h3 * r3;\n d6 += h4 * r2;\n c = (d6 >>> 13); d6 &= 0x1fff;\n d6 += h5 * r1;\n d6 += h6 * r0;\n d6 += h7 * (5 * r9);\n d6 += h8 * (5 * r8);\n d6 += h9 * (5 * r7);\n c += (d6 >>> 13); d6 &= 0x1fff;\n\n d7 = c;\n d7 += h0 * r7;\n d7 += h1 * r6;\n d7 += h2 * r5;\n d7 += h3 * r4;\n d7 += h4 * r3;\n c = (d7 >>> 13); d7 &= 0x1fff;\n d7 += h5 * r2;\n d7 += h6 * r1;\n d7 += h7 * r0;\n d7 += h8 * (5 * r9);\n d7 += h9 * (5 * r8);\n c += (d7 >>> 13); d7 &= 0x1fff;\n\n d8 = c;\n d8 += h0 * r8;\n d8 += h1 * r7;\n d8 += h2 * r6;\n d8 += h3 * r5;\n d8 += h4 * r4;\n c = (d8 >>> 13); d8 &= 0x1fff;\n d8 += h5 * r3;\n d8 += h6 * r2;\n d8 += h7 * r1;\n d8 += h8 * r0;\n d8 += h9 * (5 * r9);\n c += (d8 >>> 13); d8 &= 0x1fff;\n\n d9 = c;\n d9 += h0 * r9;\n d9 += h1 * r8;\n d9 += h2 * r7;\n d9 += h3 * r6;\n d9 += h4 * r5;\n c = (d9 >>> 13); d9 &= 0x1fff;\n d9 += h5 * r4;\n d9 += h6 * r3;\n d9 += h7 * r2;\n d9 += h8 * r1;\n d9 += h9 * r0;\n c += (d9 >>> 13); d9 &= 0x1fff;\n\n c = (((c << 2) + c)) | 0;\n c = (c + d0) | 0;\n d0 = c & 0x1fff;\n c = (c >>> 13);\n d1 += c;\n\n h0 = d0;\n h1 = d1;\n h2 = d2;\n h3 = d3;\n h4 = d4;\n h5 = d5;\n h6 = d6;\n h7 = d7;\n h8 = d8;\n h9 = d9;\n\n mpos += 16;\n bytes -= 16;\n }\n this.h[0] = h0;\n this.h[1] = h1;\n this.h[2] = h2;\n this.h[3] = h3;\n this.h[4] = h4;\n this.h[5] = h5;\n this.h[6] = h6;\n this.h[7] = h7;\n this.h[8] = h8;\n this.h[9] = h9;\n};\n\npoly1305.prototype.finish = function(mac, macpos) {\n var g = new Uint16Array(10);\n var c, mask, f, i;\n\n if (this.leftover) {\n i = this.leftover;\n this.buffer[i++] = 1;\n for (; i < 16; i++) this.buffer[i] = 0;\n this.fin = 1;\n this.blocks(this.buffer, 0, 16);\n }\n\n c = this.h[1] >>> 13;\n this.h[1] &= 0x1fff;\n for (i = 2; i < 10; i++) {\n this.h[i] += c;\n c = this.h[i] >>> 13;\n this.h[i] &= 0x1fff;\n }\n this.h[0] += (c * 5);\n c = this.h[0] >>> 13;\n this.h[0] &= 0x1fff;\n this.h[1] += c;\n c = this.h[1] >>> 13;\n this.h[1] &= 0x1fff;\n this.h[2] += c;\n\n g[0] = this.h[0] + 5;\n c = g[0] >>> 13;\n g[0] &= 0x1fff;\n for (i = 1; i < 10; i++) {\n g[i] = this.h[i] + c;\n c = g[i] >>> 13;\n g[i] &= 0x1fff;\n }\n g[9] -= (1 << 13);\n\n mask = (c ^ 1) - 1;\n for (i = 0; i < 10; i++) g[i] &= mask;\n mask = ~mask;\n for (i = 0; i < 10; i++) this.h[i] = (this.h[i] & mask) | g[i];\n\n this.h[0] = ((this.h[0] ) | (this.h[1] << 13) ) & 0xffff;\n this.h[1] = ((this.h[1] >>> 3) | (this.h[2] << 10) ) & 0xffff;\n this.h[2] = ((this.h[2] >>> 6) | (this.h[3] << 7) ) & 0xffff;\n this.h[3] = ((this.h[3] >>> 9) | (this.h[4] << 4) ) & 0xffff;\n this.h[4] = ((this.h[4] >>> 12) | (this.h[5] << 1) | (this.h[6] << 14)) & 0xffff;\n this.h[5] = ((this.h[6] >>> 2) | (this.h[7] << 11) ) & 0xffff;\n this.h[6] = ((this.h[7] >>> 5) | (this.h[8] << 8) ) & 0xffff;\n this.h[7] = ((this.h[8] >>> 8) | (this.h[9] << 5) ) & 0xffff;\n\n f = this.h[0] + this.pad[0];\n this.h[0] = f & 0xffff;\n for (i = 1; i < 8; i++) {\n f = (((this.h[i] + this.pad[i]) | 0) + (f >>> 16)) | 0;\n this.h[i] = f & 0xffff;\n }\n\n mac[macpos+ 0] = (this.h[0] >>> 0) & 0xff;\n mac[macpos+ 1] = (this.h[0] >>> 8) & 0xff;\n mac[macpos+ 2] = (this.h[1] >>> 0) & 0xff;\n mac[macpos+ 3] = (this.h[1] >>> 8) & 0xff;\n mac[macpos+ 4] = (this.h[2] >>> 0) & 0xff;\n mac[macpos+ 5] = (this.h[2] >>> 8) & 0xff;\n mac[macpos+ 6] = (this.h[3] >>> 0) & 0xff;\n mac[macpos+ 7] = (this.h[3] >>> 8) & 0xff;\n mac[macpos+ 8] = (this.h[4] >>> 0) & 0xff;\n mac[macpos+ 9] = (this.h[4] >>> 8) & 0xff;\n mac[macpos+10] = (this.h[5] >>> 0) & 0xff;\n mac[macpos+11] = (this.h[5] >>> 8) & 0xff;\n mac[macpos+12] = (this.h[6] >>> 0) & 0xff;\n mac[macpos+13] = (this.h[6] >>> 8) & 0xff;\n mac[macpos+14] = (this.h[7] >>> 0) & 0xff;\n mac[macpos+15] = (this.h[7] >>> 8) & 0xff;\n};\n\npoly1305.prototype.update = function(m, mpos, bytes) {\n var i, want;\n\n if (this.leftover) {\n want = (16 - this.leftover);\n if (want > bytes)\n want = bytes;\n for (i = 0; i < want; i++)\n this.buffer[this.leftover + i] = m[mpos+i];\n bytes -= want;\n mpos += want;\n this.leftover += want;\n if (this.leftover < 16)\n return;\n this.blocks(this.buffer, 0, 16);\n this.leftover = 0;\n }\n\n if (bytes >= 16) {\n want = bytes - (bytes % 16);\n this.blocks(m, mpos, want);\n mpos += want;\n bytes -= want;\n }\n\n if (bytes) {\n for (i = 0; i < bytes; i++)\n this.buffer[this.leftover + i] = m[mpos+i];\n this.leftover += bytes;\n }\n};\n\nfunction crypto_onetimeauth(out, outpos, m, mpos, n, k) {\n var s = new poly1305(k);\n s.update(m, mpos, n);\n s.finish(out, outpos);\n return 0;\n}\n\nfunction crypto_onetimeauth_verify(h, hpos, m, mpos, n, k) {\n var x = new Uint8Array(16);\n crypto_onetimeauth(x,0,m,mpos,n,k);\n return crypto_verify_16(h,hpos,x,0);\n}\n\nfunction crypto_secretbox(c,m,d,n,k) {\n var i;\n if (d < 32) return -1;\n crypto_stream_xor(c,0,m,0,d,n,k);\n crypto_onetimeauth(c, 16, c, 32, d - 32, c);\n for (i = 0; i < 16; i++) c[i] = 0;\n return 0;\n}\n\nfunction crypto_secretbox_open(m,c,d,n,k) {\n var i;\n var x = new Uint8Array(32);\n if (d < 32) return -1;\n crypto_stream(x,0,32,n,k);\n if (crypto_onetimeauth_verify(c, 16,c, 32,d - 32,x) !== 0) return -1;\n crypto_stream_xor(m,0,c,0,d,n,k);\n for (i = 0; i < 32; i++) m[i] = 0;\n return 0;\n}\n\nfunction set25519(r, a) {\n var i;\n for (i = 0; i < 16; i++) r[i] = a[i]|0;\n}\n\nfunction car25519(o) {\n var i, v, c = 1;\n for (i = 0; i < 16; i++) {\n v = o[i] + c + 65535;\n c = Math.floor(v / 65536);\n o[i] = v - c * 65536;\n }\n o[0] += c-1 + 37 * (c-1);\n}\n\nfunction sel25519(p, q, b) {\n var t, c = ~(b-1);\n for (var i = 0; i < 16; i++) {\n t = c & (p[i] ^ q[i]);\n p[i] ^= t;\n q[i] ^= t;\n }\n}\n\nfunction pack25519(o, n) {\n var i, j, b;\n var m = gf(), t = gf();\n for (i = 0; i < 16; i++) t[i] = n[i];\n car25519(t);\n car25519(t);\n car25519(t);\n for (j = 0; j < 2; j++) {\n m[0] = t[0] - 0xffed;\n for (i = 1; i < 15; i++) {\n m[i] = t[i] - 0xffff - ((m[i-1]>>16) & 1);\n m[i-1] &= 0xffff;\n }\n m[15] = t[15] - 0x7fff - ((m[14]>>16) & 1);\n b = (m[15]>>16) & 1;\n m[14] &= 0xffff;\n sel25519(t, m, 1-b);\n }\n for (i = 0; i < 16; i++) {\n o[2*i] = t[i] & 0xff;\n o[2*i+1] = t[i]>>8;\n }\n}\n\nfunction neq25519(a, b) {\n var c = new Uint8Array(32), d = new Uint8Array(32);\n pack25519(c, a);\n pack25519(d, b);\n return crypto_verify_32(c, 0, d, 0);\n}\n\nfunction par25519(a) {\n var d = new Uint8Array(32);\n pack25519(d, a);\n return d[0] & 1;\n}\n\nfunction unpack25519(o, n) {\n var i;\n for (i = 0; i < 16; i++) o[i] = n[2*i] + (n[2*i+1] << 8);\n o[15] &= 0x7fff;\n}\n\nfunction A(o, a, b) {\n for (var i = 0; i < 16; i++) o[i] = a[i] + b[i];\n}\n\nfunction Z(o, a, b) {\n for (var i = 0; i < 16; i++) o[i] = a[i] - b[i];\n}\n\nfunction M(o, a, b) {\n var v, c,\n t0 = 0, t1 = 0, t2 = 0, t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0,\n t8 = 0, t9 = 0, t10 = 0, t11 = 0, t12 = 0, t13 = 0, t14 = 0, t15 = 0,\n t16 = 0, t17 = 0, t18 = 0, t19 = 0, t20 = 0, t21 = 0, t22 = 0, t23 = 0,\n t24 = 0, t25 = 0, t26 = 0, t27 = 0, t28 = 0, t29 = 0, t30 = 0,\n b0 = b[0],\n b1 = b[1],\n b2 = b[2],\n b3 = b[3],\n b4 = b[4],\n b5 = b[5],\n b6 = b[6],\n b7 = b[7],\n b8 = b[8],\n b9 = b[9],\n b10 = b[10],\n b11 = b[11],\n b12 = b[12],\n b13 = b[13],\n b14 = b[14],\n b15 = b[15];\n\n v = a[0];\n t0 += v * b0;\n t1 += v * b1;\n t2 += v * b2;\n t3 += v * b3;\n t4 += v * b4;\n t5 += v * b5;\n t6 += v * b6;\n t7 += v * b7;\n t8 += v * b8;\n t9 += v * b9;\n t10 += v * b10;\n t11 += v * b11;\n t12 += v * b12;\n t13 += v * b13;\n t14 += v * b14;\n t15 += v * b15;\n v = a[1];\n t1 += v * b0;\n t2 += v * b1;\n t3 += v * b2;\n t4 += v * b3;\n t5 += v * b4;\n t6 += v * b5;\n t7 += v * b6;\n t8 += v * b7;\n t9 += v * b8;\n t10 += v * b9;\n t11 += v * b10;\n t12 += v * b11;\n t13 += v * b12;\n t14 += v * b13;\n t15 += v * b14;\n t16 += v * b15;\n v = a[2];\n t2 += v * b0;\n t3 += v * b1;\n t4 += v * b2;\n t5 += v * b3;\n t6 += v * b4;\n t7 += v * b5;\n t8 += v * b6;\n t9 += v * b7;\n t10 += v * b8;\n t11 += v * b9;\n t12 += v * b10;\n t13 += v * b11;\n t14 += v * b12;\n t15 += v * b13;\n t16 += v * b14;\n t17 += v * b15;\n v = a[3];\n t3 += v * b0;\n t4 += v * b1;\n t5 += v * b2;\n t6 += v * b3;\n t7 += v * b4;\n t8 += v * b5;\n t9 += v * b6;\n t10 += v * b7;\n t11 += v * b8;\n t12 += v * b9;\n t13 += v * b10;\n t14 += v * b11;\n t15 += v * b12;\n t16 += v * b13;\n t17 += v * b14;\n t18 += v * b15;\n v = a[4];\n t4 += v * b0;\n t5 += v * b1;\n t6 += v * b2;\n t7 += v * b3;\n t8 += v * b4;\n t9 += v * b5;\n t10 += v * b6;\n t11 += v * b7;\n t12 += v * b8;\n t13 += v * b9;\n t14 += v * b10;\n t15 += v * b11;\n t16 += v * b12;\n t17 += v * b13;\n t18 += v * b14;\n t19 += v * b15;\n v = a[5];\n t5 += v * b0;\n t6 += v * b1;\n t7 += v * b2;\n t8 += v * b3;\n t9 += v * b4;\n t10 += v * b5;\n t11 += v * b6;\n t12 += v * b7;\n t13 += v * b8;\n t14 += v * b9;\n t15 += v * b10;\n t16 += v * b11;\n t17 += v * b12;\n t18 += v * b13;\n t19 += v * b14;\n t20 += v * b15;\n v = a[6];\n t6 += v * b0;\n t7 += v * b1;\n t8 += v * b2;\n t9 += v * b3;\n t10 += v * b4;\n t11 += v * b5;\n t12 += v * b6;\n t13 += v * b7;\n t14 += v * b8;\n t15 += v * b9;\n t16 += v * b10;\n t17 += v * b11;\n t18 += v * b12;\n t19 += v * b13;\n t20 += v * b14;\n t21 += v * b15;\n v = a[7];\n t7 += v * b0;\n t8 += v * b1;\n t9 += v * b2;\n t10 += v * b3;\n t11 += v * b4;\n t12 += v * b5;\n t13 += v * b6;\n t14 += v * b7;\n t15 += v * b8;\n t16 += v * b9;\n t17 += v * b10;\n t18 += v * b11;\n t19 += v * b12;\n t20 += v * b13;\n t21 += v * b14;\n t22 += v * b15;\n v = a[8];\n t8 += v * b0;\n t9 += v * b1;\n t10 += v * b2;\n t11 += v * b3;\n t12 += v * b4;\n t13 += v * b5;\n t14 += v * b6;\n t15 += v * b7;\n t16 += v * b8;\n t17 += v * b9;\n t18 += v * b10;\n t19 += v * b11;\n t20 += v * b12;\n t21 += v * b13;\n t22 += v * b14;\n t23 += v * b15;\n v = a[9];\n t9 += v * b0;\n t10 += v * b1;\n t11 += v * b2;\n t12 += v * b3;\n t13 += v * b4;\n t14 += v * b5;\n t15 += v * b6;\n t16 += v * b7;\n t17 += v * b8;\n t18 += v * b9;\n t19 += v * b10;\n t20 += v * b11;\n t21 += v * b12;\n t22 += v * b13;\n t23 += v * b14;\n t24 += v * b15;\n v = a[10];\n t10 += v * b0;\n t11 += v * b1;\n t12 += v * b2;\n t13 += v * b3;\n t14 += v * b4;\n t15 += v * b5;\n t16 += v * b6;\n t17 += v * b7;\n t18 += v * b8;\n t19 += v * b9;\n t20 += v * b10;\n t21 += v * b11;\n t22 += v * b12;\n t23 += v * b13;\n t24 += v * b14;\n t25 += v * b15;\n v = a[11];\n t11 += v * b0;\n t12 += v * b1;\n t13 += v * b2;\n t14 += v * b3;\n t15 += v * b4;\n t16 += v * b5;\n t17 += v * b6;\n t18 += v * b7;\n t19 += v * b8;\n t20 += v * b9;\n t21 += v * b10;\n t22 += v * b11;\n t23 += v * b12;\n t24 += v * b13;\n t25 += v * b14;\n t26 += v * b15;\n v = a[12];\n t12 += v * b0;\n t13 += v * b1;\n t14 += v * b2;\n t15 += v * b3;\n t16 += v * b4;\n t17 += v * b5;\n t18 += v * b6;\n t19 += v * b7;\n t20 += v * b8;\n t21 += v * b9;\n t22 += v * b10;\n t23 += v * b11;\n t24 += v * b12;\n t25 += v * b13;\n t26 += v * b14;\n t27 += v * b15;\n v = a[13];\n t13 += v * b0;\n t14 += v * b1;\n t15 += v * b2;\n t16 += v * b3;\n t17 += v * b4;\n t18 += v * b5;\n t19 += v * b6;\n t20 += v * b7;\n t21 += v * b8;\n t22 += v * b9;\n t23 += v * b10;\n t24 += v * b11;\n t25 += v * b12;\n t26 += v * b13;\n t27 += v * b14;\n t28 += v * b15;\n v = a[14];\n t14 += v * b0;\n t15 += v * b1;\n t16 += v * b2;\n t17 += v * b3;\n t18 += v * b4;\n t19 += v * b5;\n t20 += v * b6;\n t21 += v * b7;\n t22 += v * b8;\n t23 += v * b9;\n t24 += v * b10;\n t25 += v * b11;\n t26 += v * b12;\n t27 += v * b13;\n t28 += v * b14;\n t29 += v * b15;\n v = a[15];\n t15 += v * b0;\n t16 += v * b1;\n t17 += v * b2;\n t18 += v * b3;\n t19 += v * b4;\n t20 += v * b5;\n t21 += v * b6;\n t22 += v * b7;\n t23 += v * b8;\n t24 += v * b9;\n t25 += v * b10;\n t26 += v * b11;\n t27 += v * b12;\n t28 += v * b13;\n t29 += v * b14;\n t30 += v * b15;\n\n t0 += 38 * t16;\n t1 += 38 * t17;\n t2 += 38 * t18;\n t3 += 38 * t19;\n t4 += 38 * t20;\n t5 += 38 * t21;\n t6 += 38 * t22;\n t7 += 38 * t23;\n t8 += 38 * t24;\n t9 += 38 * t25;\n t10 += 38 * t26;\n t11 += 38 * t27;\n t12 += 38 * t28;\n t13 += 38 * t29;\n t14 += 38 * t30;\n // t15 left as is\n\n // first car\n c = 1;\n v = t0 + c + 65535; c = Math.floor(v / 65536); t0 = v - c * 65536;\n v = t1 + c + 65535; c = Math.floor(v / 65536); t1 = v - c * 65536;\n v = t2 + c + 65535; c = Math.floor(v / 65536); t2 = v - c * 65536;\n v = t3 + c + 65535; c = Math.floor(v / 65536); t3 = v - c * 65536;\n v = t4 + c + 65535; c = Math.floor(v / 65536); t4 = v - c * 65536;\n v = t5 + c + 65535; c = Math.floor(v / 65536); t5 = v - c * 65536;\n v = t6 + c + 65535; c = Math.floor(v / 65536); t6 = v - c * 65536;\n v = t7 + c + 65535; c = Math.floor(v / 65536); t7 = v - c * 65536;\n v = t8 + c + 65535; c = Math.floor(v / 65536); t8 = v - c * 65536;\n v = t9 + c + 65535; c = Math.floor(v / 65536); t9 = v - c * 65536;\n v = t10 + c + 65535; c = Math.floor(v / 65536); t10 = v - c * 65536;\n v = t11 + c + 65535; c = Math.floor(v / 65536); t11 = v - c * 65536;\n v = t12 + c + 65535; c = Math.floor(v / 65536); t12 = v - c * 65536;\n v = t13 + c + 65535; c = Math.floor(v / 65536); t13 = v - c * 65536;\n v = t14 + c + 65535; c = Math.floor(v / 65536); t14 = v - c * 65536;\n v = t15 + c + 65535; c = Math.floor(v / 65536); t15 = v - c * 65536;\n t0 += c-1 + 37 * (c-1);\n\n // second car\n c = 1;\n v = t0 + c + 65535; c = Math.floor(v / 65536); t0 = v - c * 65536;\n v = t1 + c + 65535; c = Math.floor(v / 65536); t1 = v - c * 65536;\n v = t2 + c + 65535; c = Math.floor(v / 65536); t2 = v - c * 65536;\n v = t3 + c + 65535; c = Math.floor(v / 65536); t3 = v - c * 65536;\n v = t4 + c + 65535; c = Math.floor(v / 65536); t4 = v - c * 65536;\n v = t5 + c + 65535; c = Math.floor(v / 65536); t5 = v - c * 65536;\n v = t6 + c + 65535; c = Math.floor(v / 65536); t6 = v - c * 65536;\n v = t7 + c + 65535; c = Math.floor(v / 65536); t7 = v - c * 65536;\n v = t8 + c + 65535; c = Math.floor(v / 65536); t8 = v - c * 65536;\n v = t9 + c + 65535; c = Math.floor(v / 65536); t9 = v - c * 65536;\n v = t10 + c + 65535; c = Math.floor(v / 65536); t10 = v - c * 65536;\n v = t11 + c + 65535; c = Math.floor(v / 65536); t11 = v - c * 65536;\n v = t12 + c + 65535; c = Math.floor(v / 65536); t12 = v - c * 65536;\n v = t13 + c + 65535; c = Math.floor(v / 65536); t13 = v - c * 65536;\n v = t14 + c + 65535; c = Math.floor(v / 65536); t14 = v - c * 65536;\n v = t15 + c + 65535; c = Math.floor(v / 65536); t15 = v - c * 65536;\n t0 += c-1 + 37 * (c-1);\n\n o[ 0] = t0;\n o[ 1] = t1;\n o[ 2] = t2;\n o[ 3] = t3;\n o[ 4] = t4;\n o[ 5] = t5;\n o[ 6] = t6;\n o[ 7] = t7;\n o[ 8] = t8;\n o[ 9] = t9;\n o[10] = t10;\n o[11] = t11;\n o[12] = t12;\n o[13] = t13;\n o[14] = t14;\n o[15] = t15;\n}\n\nfunction S(o, a) {\n M(o, a, a);\n}\n\nfunction inv25519(o, i) {\n var c = gf();\n var a;\n for (a = 0; a < 16; a++) c[a] = i[a];\n for (a = 253; a >= 0; a--) {\n S(c, c);\n if(a !== 2 && a !== 4) M(c, c, i);\n }\n for (a = 0; a < 16; a++) o[a] = c[a];\n}\n\nfunction pow2523(o, i) {\n var c = gf();\n var a;\n for (a = 0; a < 16; a++) c[a] = i[a];\n for (a = 250; a >= 0; a--) {\n S(c, c);\n if(a !== 1) M(c, c, i);\n }\n for (a = 0; a < 16; a++) o[a] = c[a];\n}\n\nfunction crypto_scalarmult(q, n, p) {\n var z = new Uint8Array(32);\n var x = new Float64Array(80), r, i;\n var a = gf(), b = gf(), c = gf(),\n d = gf(), e = gf(), f = gf();\n for (i = 0; i < 31; i++) z[i] = n[i];\n z[31]=(n[31]&127)|64;\n z[0]&=248;\n unpack25519(x,p);\n for (i = 0; i < 16; i++) {\n b[i]=x[i];\n d[i]=a[i]=c[i]=0;\n }\n a[0]=d[0]=1;\n for (i=254; i>=0; --i) {\n r=(z[i>>>3]>>>(i&7))&1;\n sel25519(a,b,r);\n sel25519(c,d,r);\n A(e,a,c);\n Z(a,a,c);\n A(c,b,d);\n Z(b,b,d);\n S(d,e);\n S(f,a);\n M(a,c,a);\n M(c,b,e);\n A(e,a,c);\n Z(a,a,c);\n S(b,a);\n Z(c,d,f);\n M(a,c,_121665);\n A(a,a,d);\n M(c,c,a);\n M(a,d,f);\n M(d,b,x);\n S(b,e);\n sel25519(a,b,r);\n sel25519(c,d,r);\n }\n for (i = 0; i < 16; i++) {\n x[i+16]=a[i];\n x[i+32]=c[i];\n x[i+48]=b[i];\n x[i+64]=d[i];\n }\n var x32 = x.subarray(32);\n var x16 = x.subarray(16);\n inv25519(x32,x32);\n M(x16,x16,x32);\n pack25519(q,x16);\n return 0;\n}\n\nfunction crypto_scalarmult_base(q, n) {\n return crypto_scalarmult(q, n, _9);\n}\n\nfunction crypto_box_keypair(y, x) {\n randombytes(x, 32);\n return crypto_scalarmult_base(y, x);\n}\n\nfunction crypto_box_beforenm(k, y, x) {\n var s = new Uint8Array(32);\n crypto_scalarmult(s, x, y);\n return crypto_core_hsalsa20(k, _0, s, sigma);\n}\n\nvar crypto_box_afternm = crypto_secretbox;\nvar crypto_box_open_afternm = crypto_secretbox_open;\n\nfunction crypto_box(c, m, d, n, y, x) {\n var k = new Uint8Array(32);\n crypto_box_beforenm(k, y, x);\n return crypto_box_afternm(c, m, d, n, k);\n}\n\nfunction crypto_box_open(m, c, d, n, y, x) {\n var k = new Uint8Array(32);\n crypto_box_beforenm(k, y, x);\n return crypto_box_open_afternm(m, c, d, n, k);\n}\n\nvar K = [\n 0x428a2f98, 0xd728ae22, 0x71374491, 0x23ef65cd,\n 0xb5c0fbcf, 0xec4d3b2f, 0xe9b5dba5, 0x8189dbbc,\n 0x3956c25b, 0xf348b538, 0x59f111f1, 0xb605d019,\n 0x923f82a4, 0xaf194f9b, 0xab1c5ed5, 0xda6d8118,\n 0xd807aa98, 0xa3030242, 0x12835b01, 0x45706fbe,\n 0x243185be, 0x4ee4b28c, 0x550c7dc3, 0xd5ffb4e2,\n 0x72be5d74, 0xf27b896f, 0x80deb1fe, 0x3b1696b1,\n 0x9bdc06a7, 0x25c71235, 0xc19bf174, 0xcf692694,\n 0xe49b69c1, 0x9ef14ad2, 0xefbe4786, 0x384f25e3,\n 0x0fc19dc6, 0x8b8cd5b5, 0x240ca1cc, 0x77ac9c65,\n 0x2de92c6f, 0x592b0275, 0x4a7484aa, 0x6ea6e483,\n 0x5cb0a9dc, 0xbd41fbd4, 0x76f988da, 0x831153b5,\n 0x983e5152, 0xee66dfab, 0xa831c66d, 0x2db43210,\n 0xb00327c8, 0x98fb213f, 0xbf597fc7, 0xbeef0ee4,\n 0xc6e00bf3, 0x3da88fc2, 0xd5a79147, 0x930aa725,\n 0x06ca6351, 0xe003826f, 0x14292967, 0x0a0e6e70,\n 0x27b70a85, 0x46d22ffc, 0x2e1b2138, 0x5c26c926,\n 0x4d2c6dfc, 0x5ac42aed, 0x53380d13, 0x9d95b3df,\n 0x650a7354, 0x8baf63de, 0x766a0abb, 0x3c77b2a8,\n 0x81c2c92e, 0x47edaee6, 0x92722c85, 0x1482353b,\n 0xa2bfe8a1, 0x4cf10364, 0xa81a664b, 0xbc423001,\n 0xc24b8b70, 0xd0f89791, 0xc76c51a3, 0x0654be30,\n 0xd192e819, 0xd6ef5218, 0xd6990624, 0x5565a910,\n 0xf40e3585, 0x5771202a, 0x106aa070, 0x32bbd1b8,\n 0x19a4c116, 0xb8d2d0c8, 0x1e376c08, 0x5141ab53,\n 0x2748774c, 0xdf8eeb99, 0x34b0bcb5, 0xe19b48a8,\n 0x391c0cb3, 0xc5c95a63, 0x4ed8aa4a, 0xe3418acb,\n 0x5b9cca4f, 0x7763e373, 0x682e6ff3, 0xd6b2b8a3,\n 0x748f82ee, 0x5defb2fc, 0x78a5636f, 0x43172f60,\n 0x84c87814, 0xa1f0ab72, 0x8cc70208, 0x1a6439ec,\n 0x90befffa, 0x23631e28, 0xa4506ceb, 0xde82bde9,\n 0xbef9a3f7, 0xb2c67915, 0xc67178f2, 0xe372532b,\n 0xca273ece, 0xea26619c, 0xd186b8c7, 0x21c0c207,\n 0xeada7dd6, 0xcde0eb1e, 0xf57d4f7f, 0xee6ed178,\n 0x06f067aa, 0x72176fba, 0x0a637dc5, 0xa2c898a6,\n 0x113f9804, 0xbef90dae, 0x1b710b35, 0x131c471b,\n 0x28db77f5, 0x23047d84, 0x32caab7b, 0x40c72493,\n 0x3c9ebe0a, 0x15c9bebc, 0x431d67c4, 0x9c100d4c,\n 0x4cc5d4be, 0xcb3e42b6, 0x597f299c, 0xfc657e2a,\n 0x5fcb6fab, 0x3ad6faec, 0x6c44198c, 0x4a475817\n];\n\nfunction crypto_hashblocks_hl(hh, hl, m, n) {\n var wh = new Int32Array(16), wl = new Int32Array(16),\n bh0, bh1, bh2, bh3, bh4, bh5, bh6, bh7,\n bl0, bl1, bl2, bl3, bl4, bl5, bl6, bl7,\n th, tl, i, j, h, l, a, b, c, d;\n\n var ah0 = hh[0],\n ah1 = hh[1],\n ah2 = hh[2],\n ah3 = hh[3],\n ah4 = hh[4],\n ah5 = hh[5],\n ah6 = hh[6],\n ah7 = hh[7],\n\n al0 = hl[0],\n al1 = hl[1],\n al2 = hl[2],\n al3 = hl[3],\n al4 = hl[4],\n al5 = hl[5],\n al6 = hl[6],\n al7 = hl[7];\n\n var pos = 0;\n while (n >= 128) {\n for (i = 0; i < 16; i++) {\n j = 8 * i + pos;\n wh[i] = (m[j+0] << 24) | (m[j+1] << 16) | (m[j+2] << 8) | m[j+3];\n wl[i] = (m[j+4] << 24) | (m[j+5] << 16) | (m[j+6] << 8) | m[j+7];\n }\n for (i = 0; i < 80; i++) {\n bh0 = ah0;\n bh1 = ah1;\n bh2 = ah2;\n bh3 = ah3;\n bh4 = ah4;\n bh5 = ah5;\n bh6 = ah6;\n bh7 = ah7;\n\n bl0 = al0;\n bl1 = al1;\n bl2 = al2;\n bl3 = al3;\n bl4 = al4;\n bl5 = al5;\n bl6 = al6;\n bl7 = al7;\n\n // add\n h = ah7;\n l = al7;\n\n a = l & 0xffff; b = l >>> 16;\n c = h & 0xffff; d = h >>> 16;\n\n // Sigma1\n h = ((ah4 >>> 14) | (al4 << (32-14))) ^ ((ah4 >>> 18) | (al4 << (32-18))) ^ ((al4 >>> (41-32)) | (ah4 << (32-(41-32))));\n l = ((al4 >>> 14) | (ah4 << (32-14))) ^ ((al4 >>> 18) | (ah4 << (32-18))) ^ ((ah4 >>> (41-32)) | (al4 << (32-(41-32))));\n\n a += l & 0xffff; b += l >>> 16;\n c += h & 0xffff; d += h >>> 16;\n\n // Ch\n h = (ah4 & ah5) ^ (~ah4 & ah6);\n l = (al4 & al5) ^ (~al4 & al6);\n\n a += l & 0xffff; b += l >>> 16;\n c += h & 0xffff; d += h >>> 16;\n\n // K\n h = K[i*2];\n l = K[i*2+1];\n\n a += l & 0xffff; b += l >>> 16;\n c += h & 0xffff; d += h >>> 16;\n\n // w\n h = wh[i%16];\n l = wl[i%16];\n\n a += l & 0xffff; b += l >>> 16;\n c += h & 0xffff; d += h >>> 16;\n\n b += a >>> 16;\n c += b >>> 16;\n d += c >>> 16;\n\n th = c & 0xffff | d << 16;\n tl = a & 0xffff | b << 16;\n\n // add\n h = th;\n l = tl;\n\n a = l & 0xffff; b = l >>> 16;\n c = h & 0xffff; d = h >>> 16;\n\n // Sigma0\n h = ((ah0 >>> 28) | (al0 << (32-28))) ^ ((al0 >>> (34-32)) | (ah0 << (32-(34-32)))) ^ ((al0 >>> (39-32)) | (ah0 << (32-(39-32))));\n l = ((al0 >>> 28) | (ah0 << (32-28))) ^ ((ah0 >>> (34-32)) | (al0 << (32-(34-32)))) ^ ((ah0 >>> (39-32)) | (al0 << (32-(39-32))));\n\n a += l & 0xffff; b += l >>> 16;\n c += h & 0xffff; d += h >>> 16;\n\n // Maj\n h = (ah0 & ah1) ^ (ah0 & ah2) ^ (ah1 & ah2);\n l = (al0 & al1) ^ (al0 & al2) ^ (al1 & al2);\n\n a += l & 0xffff; b += l >>> 16;\n c += h & 0xffff; d += h >>> 16;\n\n b += a >>> 16;\n c += b >>> 16;\n d += c >>> 16;\n\n bh7 = (c & 0xffff) | (d << 16);\n bl7 = (a & 0xffff) | (b << 16);\n\n // add\n h = bh3;\n l = bl3;\n\n a = l & 0xffff; b = l >>> 16;\n c = h & 0xffff; d = h >>> 16;\n\n h = th;\n l = tl;\n\n a += l & 0xffff; b += l >>> 16;\n c += h & 0xffff; d += h >>> 16;\n\n b += a >>> 16;\n c += b >>> 16;\n d += c >>> 16;\n\n bh3 = (c & 0xffff) | (d << 16);\n bl3 = (a & 0xffff) | (b << 16);\n\n ah1 = bh0;\n ah2 = bh1;\n ah3 = bh2;\n ah4 = bh3;\n ah5 = bh4;\n ah6 = bh5;\n ah7 = bh6;\n ah0 = bh7;\n\n al1 = bl0;\n al2 = bl1;\n al3 = bl2;\n al4 = bl3;\n al5 = bl4;\n al6 = bl5;\n al7 = bl6;\n al0 = bl7;\n\n if (i%16 === 15) {\n for (j = 0; j < 16; j++) {\n // add\n h = wh[j];\n l = wl[j];\n\n a = l & 0xffff; b = l >>> 16;\n c = h & 0xffff; d = h >>> 16;\n\n h = wh[(j+9)%16];\n l = wl[(j+9)%16];\n\n a += l & 0xffff; b += l >>> 16;\n c += h & 0xffff; d += h >>> 16;\n\n // sigma0\n th = wh[(j+1)%16];\n tl = wl[(j+1)%16];\n h = ((th >>> 1) | (tl << (32-1))) ^ ((th >>> 8) | (tl << (32-8))) ^ (th >>> 7);\n l = ((tl >>> 1) | (th << (32-1))) ^ ((tl >>> 8) | (th << (32-8))) ^ ((tl >>> 7) | (th << (32-7)));\n\n a += l & 0xffff; b += l >>> 16;\n c += h & 0xffff; d += h >>> 16;\n\n // sigma1\n th = wh[(j+14)%16];\n tl = wl[(j+14)%16];\n h = ((th >>> 19) | (tl << (32-19))) ^ ((tl >>> (61-32)) | (th << (32-(61-32)))) ^ (th >>> 6);\n l = ((tl >>> 19) | (th << (32-19))) ^ ((th >>> (61-32)) | (tl << (32-(61-32)))) ^ ((tl >>> 6) | (th << (32-6)));\n\n a += l & 0xffff; b += l >>> 16;\n c += h & 0xffff; d += h >>> 16;\n\n b += a >>> 16;\n c += b >>> 16;\n d += c >>> 16;\n\n wh[j] = (c & 0xffff) | (d << 16);\n wl[j] = (a & 0xffff) | (b << 16);\n }\n }\n }\n\n // add\n h = ah0;\n l = al0;\n\n a = l & 0xffff; b = l >>> 16;\n c = h & 0xffff; d = h >>> 16;\n\n h = hh[0];\n l = hl[0];\n\n a += l & 0xffff; b += l >>> 16;\n c += h & 0xffff; d += h >>> 16;\n\n b += a >>> 16;\n c += b >>> 16;\n d += c >>> 16;\n\n hh[0] = ah0 = (c & 0xffff) | (d << 16);\n hl[0] = al0 = (a & 0xffff) | (b << 16);\n\n h = ah1;\n l = al1;\n\n a = l & 0xffff; b = l >>> 16;\n c = h & 0xffff; d = h >>> 16;\n\n h = hh[1];\n l = hl[1];\n\n a += l & 0xffff; b += l >>> 16;\n c += h & 0xffff; d += h >>> 16;\n\n b += a >>> 16;\n c += b >>> 16;\n d += c >>> 16;\n\n hh[1] = ah1 = (c & 0xffff) | (d << 16);\n hl[1] = al1 = (a & 0xffff) | (b << 16);\n\n h = ah2;\n l = al2;\n\n a = l & 0xffff; b = l >>> 16;\n c = h & 0xffff; d = h >>> 16;\n\n h = hh[2];\n l = hl[2];\n\n a += l & 0xffff; b += l >>> 16;\n c += h & 0xffff; d += h >>> 16;\n\n b += a >>> 16;\n c += b >>> 16;\n d += c >>> 16;\n\n hh[2] = ah2 = (c & 0xffff) | (d << 16);\n hl[2] = al2 = (a & 0xffff) | (b << 16);\n\n h = ah3;\n l = al3;\n\n a = l & 0xffff; b = l >>> 16;\n c = h & 0xffff; d = h >>> 16;\n\n h = hh[3];\n l = hl[3];\n\n a += l & 0xffff; b += l >>> 16;\n c += h & 0xffff; d += h >>> 16;\n\n b += a >>> 16;\n c += b >>> 16;\n d += c >>> 16;\n\n hh[3] = ah3 = (c & 0xffff) | (d << 16);\n hl[3] = al3 = (a & 0xffff) | (b << 16);\n\n h = ah4;\n l = al4;\n\n a = l & 0xffff; b = l >>> 16;\n c = h & 0xffff; d = h >>> 16;\n\n h = hh[4];\n l = hl[4];\n\n a += l & 0xffff; b += l >>> 16;\n c += h & 0xffff; d += h >>> 16;\n\n b += a >>> 16;\n c += b >>> 16;\n d += c >>> 16;\n\n hh[4] = ah4 = (c & 0xffff) | (d << 16);\n hl[4] = al4 = (a & 0xffff) | (b << 16);\n\n h = ah5;\n l = al5;\n\n a = l & 0xffff; b = l >>> 16;\n c = h & 0xffff; d = h >>> 16;\n\n h = hh[5];\n l = hl[5];\n\n a += l & 0xffff; b += l >>> 16;\n c += h & 0xffff; d += h >>> 16;\n\n b += a >>> 16;\n c += b >>> 16;\n d += c >>> 16;\n\n hh[5] = ah5 = (c & 0xffff) | (d << 16);\n hl[5] = al5 = (a & 0xffff) | (b << 16);\n\n h = ah6;\n l = al6;\n\n a = l & 0xffff; b = l >>> 16;\n c = h & 0xffff; d = h >>> 16;\n\n h = hh[6];\n l = hl[6];\n\n a += l & 0xffff; b += l >>> 16;\n c += h & 0xffff; d += h >>> 16;\n\n b += a >>> 16;\n c += b >>> 16;\n d += c >>> 16;\n\n hh[6] = ah6 = (c & 0xffff) | (d << 16);\n hl[6] = al6 = (a & 0xffff) | (b << 16);\n\n h = ah7;\n l = al7;\n\n a = l & 0xffff; b = l >>> 16;\n c = h & 0xffff; d = h >>> 16;\n\n h = hh[7];\n l = hl[7];\n\n a += l & 0xffff; b += l >>> 16;\n c += h & 0xffff; d += h >>> 16;\n\n b += a >>> 16;\n c += b >>> 16;\n d += c >>> 16;\n\n hh[7] = ah7 = (c & 0xffff) | (d << 16);\n hl[7] = al7 = (a & 0xffff) | (b << 16);\n\n pos += 128;\n n -= 128;\n }\n\n return n;\n}\n\nfunction crypto_hash(out, m, n) {\n var hh = new Int32Array(8),\n hl = new Int32Array(8),\n x = new Uint8Array(256),\n i, b = n;\n\n hh[0] = 0x6a09e667;\n hh[1] = 0xbb67ae85;\n hh[2] = 0x3c6ef372;\n hh[3] = 0xa54ff53a;\n hh[4] = 0x510e527f;\n hh[5] = 0x9b05688c;\n hh[6] = 0x1f83d9ab;\n hh[7] = 0x5be0cd19;\n\n hl[0] = 0xf3bcc908;\n hl[1] = 0x84caa73b;\n hl[2] = 0xfe94f82b;\n hl[3] = 0x5f1d36f1;\n hl[4] = 0xade682d1;\n hl[5] = 0x2b3e6c1f;\n hl[6] = 0xfb41bd6b;\n hl[7] = 0x137e2179;\n\n crypto_hashblocks_hl(hh, hl, m, n);\n n %= 128;\n\n for (i = 0; i < n; i++) x[i] = m[b-n+i];\n x[n] = 128;\n\n n = 256-128*(n<112?1:0);\n x[n-9] = 0;\n ts64(x, n-8, (b / 0x20000000) | 0, b << 3);\n crypto_hashblocks_hl(hh, hl, x, n);\n\n for (i = 0; i < 8; i++) ts64(out, 8*i, hh[i], hl[i]);\n\n return 0;\n}\n\nfunction add(p, q) {\n var a = gf(), b = gf(), c = gf(),\n d = gf(), e = gf(), f = gf(),\n g = gf(), h = gf(), t = gf();\n\n Z(a, p[1], p[0]);\n Z(t, q[1], q[0]);\n M(a, a, t);\n A(b, p[0], p[1]);\n A(t, q[0], q[1]);\n M(b, b, t);\n M(c, p[3], q[3]);\n M(c, c, D2);\n M(d, p[2], q[2]);\n A(d, d, d);\n Z(e, b, a);\n Z(f, d, c);\n A(g, d, c);\n A(h, b, a);\n\n M(p[0], e, f);\n M(p[1], h, g);\n M(p[2], g, f);\n M(p[3], e, h);\n}\n\nfunction cswap(p, q, b) {\n var i;\n for (i = 0; i < 4; i++) {\n sel25519(p[i], q[i], b);\n }\n}\n\nfunction pack(r, p) {\n var tx = gf(), ty = gf(), zi = gf();\n inv25519(zi, p[2]);\n M(tx, p[0], zi);\n M(ty, p[1], zi);\n pack25519(r, ty);\n r[31] ^= par25519(tx) << 7;\n}\n\nfunction scalarmult(p, q, s) {\n var b, i;\n set25519(p[0], gf0);\n set25519(p[1], gf1);\n set25519(p[2], gf1);\n set25519(p[3], gf0);\n for (i = 255; i >= 0; --i) {\n b = (s[(i/8)|0] >> (i&7)) & 1;\n cswap(p, q, b);\n add(q, p);\n add(p, p);\n cswap(p, q, b);\n }\n}\n\nfunction scalarbase(p, s) {\n var q = [gf(), gf(), gf(), gf()];\n set25519(q[0], X);\n set25519(q[1], Y);\n set25519(q[2], gf1);\n M(q[3], X, Y);\n scalarmult(p, q, s);\n}\n\nfunction crypto_sign_keypair(pk, sk, seeded) {\n var d = new Uint8Array(64);\n var p = [gf(), gf(), gf(), gf()];\n var i;\n\n if (!seeded) randombytes(sk, 32);\n crypto_hash(d, sk, 32);\n d[0] &= 248;\n d[31] &= 127;\n d[31] |= 64;\n\n scalarbase(p, d);\n pack(pk, p);\n\n for (i = 0; i < 32; i++) sk[i+32] = pk[i];\n return 0;\n}\n\nvar L = new Float64Array([0xed, 0xd3, 0xf5, 0x5c, 0x1a, 0x63, 0x12, 0x58, 0xd6, 0x9c, 0xf7, 0xa2, 0xde, 0xf9, 0xde, 0x14, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0x10]);\n\nfunction modL(r, x) {\n var carry, i, j, k;\n for (i = 63; i >= 32; --i) {\n carry = 0;\n for (j = i - 32, k = i - 12; j < k; ++j) {\n x[j] += carry - 16 * x[i] * L[j - (i - 32)];\n carry = (x[j] + 128) >> 8;\n x[j] -= carry * 256;\n }\n x[j] += carry;\n x[i] = 0;\n }\n carry = 0;\n for (j = 0; j < 32; j++) {\n x[j] += carry - (x[31] >> 4) * L[j];\n carry = x[j] >> 8;\n x[j] &= 255;\n }\n for (j = 0; j < 32; j++) x[j] -= carry * L[j];\n for (i = 0; i < 32; i++) {\n x[i+1] += x[i] >> 8;\n r[i] = x[i] & 255;\n }\n}\n\nfunction reduce(r) {\n var x = new Float64Array(64), i;\n for (i = 0; i < 64; i++) x[i] = r[i];\n for (i = 0; i < 64; i++) r[i] = 0;\n modL(r, x);\n}\n\n// Note: difference from C - smlen returned, not passed as argument.\nfunction crypto_sign(sm, m, n, sk) {\n var d = new Uint8Array(64), h = new Uint8Array(64), r = new Uint8Array(64);\n var i, j, x = new Float64Array(64);\n var p = [gf(), gf(), gf(), gf()];\n\n crypto_hash(d, sk, 32);\n d[0] &= 248;\n d[31] &= 127;\n d[31] |= 64;\n\n var smlen = n + 64;\n for (i = 0; i < n; i++) sm[64 + i] = m[i];\n for (i = 0; i < 32; i++) sm[32 + i] = d[32 + i];\n\n crypto_hash(r, sm.subarray(32), n+32);\n reduce(r);\n scalarbase(p, r);\n pack(sm, p);\n\n for (i = 32; i < 64; i++) sm[i] = sk[i];\n crypto_hash(h, sm, n + 64);\n reduce(h);\n\n for (i = 0; i < 64; i++) x[i] = 0;\n for (i = 0; i < 32; i++) x[i] = r[i];\n for (i = 0; i < 32; i++) {\n for (j = 0; j < 32; j++) {\n x[i+j] += h[i] * d[j];\n }\n }\n\n modL(sm.subarray(32), x);\n return smlen;\n}\n\nfunction unpackneg(r, p) {\n var t = gf(), chk = gf(), num = gf(),\n den = gf(), den2 = gf(), den4 = gf(),\n den6 = gf();\n\n set25519(r[2], gf1);\n unpack25519(r[1], p);\n S(num, r[1]);\n M(den, num, D);\n Z(num, num, r[2]);\n A(den, r[2], den);\n\n S(den2, den);\n S(den4, den2);\n M(den6, den4, den2);\n M(t, den6, num);\n M(t, t, den);\n\n pow2523(t, t);\n M(t, t, num);\n M(t, t, den);\n M(t, t, den);\n M(r[0], t, den);\n\n S(chk, r[0]);\n M(chk, chk, den);\n if (neq25519(chk, num)) M(r[0], r[0], I);\n\n S(chk, r[0]);\n M(chk, chk, den);\n if (neq25519(chk, num)) return -1;\n\n if (par25519(r[0]) === (p[31]>>7)) Z(r[0], gf0, r[0]);\n\n M(r[3], r[0], r[1]);\n return 0;\n}\n\nfunction crypto_sign_open(m, sm, n, pk) {\n var i, mlen;\n var t = new Uint8Array(32), h = new Uint8Array(64);\n var p = [gf(), gf(), gf(), gf()],\n q = [gf(), gf(), gf(), gf()];\n\n mlen = -1;\n if (n < 64) return -1;\n\n if (unpackneg(q, pk)) return -1;\n\n for (i = 0; i < n; i++) m[i] = sm[i];\n for (i = 0; i < 32; i++) m[i+32] = pk[i];\n crypto_hash(h, m, n);\n reduce(h);\n scalarmult(p, q, h);\n\n scalarbase(q, sm.subarray(32));\n add(p, q);\n pack(t, p);\n\n n -= 64;\n if (crypto_verify_32(sm, 0, t, 0)) {\n for (i = 0; i < n; i++) m[i] = 0;\n return -1;\n }\n\n for (i = 0; i < n; i++) m[i] = sm[i + 64];\n mlen = n;\n return mlen;\n}\n\nvar crypto_secretbox_KEYBYTES = 32,\n crypto_secretbox_NONCEBYTES = 24,\n crypto_secretbox_ZEROBYTES = 32,\n crypto_secretbox_BOXZEROBYTES = 16,\n crypto_scalarmult_BYTES = 32,\n crypto_scalarmult_SCALARBYTES = 32,\n crypto_box_PUBLICKEYBYTES = 32,\n crypto_box_SECRETKEYBYTES = 32,\n crypto_box_BEFORENMBYTES = 32,\n crypto_box_NONCEBYTES = crypto_secretbox_NONCEBYTES,\n crypto_box_ZEROBYTES = crypto_secretbox_ZEROBYTES,\n crypto_box_BOXZEROBYTES = crypto_secretbox_BOXZEROBYTES,\n crypto_sign_BYTES = 64,\n crypto_sign_PUBLICKEYBYTES = 32,\n crypto_sign_SECRETKEYBYTES = 64,\n crypto_sign_SEEDBYTES = 32,\n crypto_hash_BYTES = 64;\n\nnacl.lowlevel = {\n crypto_core_hsalsa20: crypto_core_hsalsa20,\n crypto_stream_xor: crypto_stream_xor,\n crypto_stream: crypto_stream,\n crypto_stream_salsa20_xor: crypto_stream_salsa20_xor,\n crypto_stream_salsa20: crypto_stream_salsa20,\n crypto_onetimeauth: crypto_onetimeauth,\n crypto_onetimeauth_verify: crypto_onetimeauth_verify,\n crypto_verify_16: crypto_verify_16,\n crypto_verify_32: crypto_verify_32,\n crypto_secretbox: crypto_secretbox,\n crypto_secretbox_open: crypto_secretbox_open,\n crypto_scalarmult: crypto_scalarmult,\n crypto_scalarmult_base: crypto_scalarmult_base,\n crypto_box_beforenm: crypto_box_beforenm,\n crypto_box_afternm: crypto_box_afternm,\n crypto_box: crypto_box,\n crypto_box_open: crypto_box_open,\n crypto_box_keypair: crypto_box_keypair,\n crypto_hash: crypto_hash,\n crypto_sign: crypto_sign,\n crypto_sign_keypair: crypto_sign_keypair,\n crypto_sign_open: crypto_sign_open,\n\n crypto_secretbox_KEYBYTES: crypto_secretbox_KEYBYTES,\n crypto_secretbox_NONCEBYTES: crypto_secretbox_NONCEBYTES,\n crypto_secretbox_ZEROBYTES: crypto_secretbox_ZEROBYTES,\n crypto_secretbox_BOXZEROBYTES: crypto_secretbox_BOXZEROBYTES,\n crypto_scalarmult_BYTES: crypto_scalarmult_BYTES,\n crypto_scalarmult_SCALARBYTES: crypto_scalarmult_SCALARBYTES,\n crypto_box_PUBLICKEYBYTES: crypto_box_PUBLICKEYBYTES,\n crypto_box_SECRETKEYBYTES: crypto_box_SECRETKEYBYTES,\n crypto_box_BEFORENMBYTES: crypto_box_BEFORENMBYTES,\n crypto_box_NONCEBYTES: crypto_box_NONCEBYTES,\n crypto_box_ZEROBYTES: crypto_box_ZEROBYTES,\n crypto_box_BOXZEROBYTES: crypto_box_BOXZEROBYTES,\n crypto_sign_BYTES: crypto_sign_BYTES,\n crypto_sign_PUBLICKEYBYTES: crypto_sign_PUBLICKEYBYTES,\n crypto_sign_SECRETKEYBYTES: crypto_sign_SECRETKEYBYTES,\n crypto_sign_SEEDBYTES: crypto_sign_SEEDBYTES,\n crypto_hash_BYTES: crypto_hash_BYTES\n};\n\n/* High-level API */\n\nfunction checkLengths(k, n) {\n if (k.length !== crypto_secretbox_KEYBYTES) throw new Error('bad key size');\n if (n.length !== crypto_secretbox_NONCEBYTES) throw new Error('bad nonce size');\n}\n\nfunction checkBoxLengths(pk, sk) {\n if (pk.length !== crypto_box_PUBLICKEYBYTES) throw new Error('bad public key size');\n if (sk.length !== crypto_box_SECRETKEYBYTES) throw new Error('bad secret key size');\n}\n\nfunction checkArrayTypes() {\n var t, i;\n for (i = 0; i < arguments.length; i++) {\n if ((t = Object.prototype.toString.call(arguments[i])) !== '[object Uint8Array]')\n throw new TypeError('unexpected type ' + t + ', use Uint8Array');\n }\n}\n\nfunction cleanup(arr) {\n for (var i = 0; i < arr.length; i++) arr[i] = 0;\n}\n\n// TODO: Completely remove this in v0.15.\nif (!nacl.util) {\n nacl.util = {};\n nacl.util.decodeUTF8 = nacl.util.encodeUTF8 = nacl.util.encodeBase64 = nacl.util.decodeBase64 = function() {\n throw new Error('nacl.util moved into separate package: https://github.com/dchest/tweetnacl-util-js');\n };\n}\n\nnacl.randomBytes = function(n) {\n var b = new Uint8Array(n);\n randombytes(b, n);\n return b;\n};\n\nnacl.secretbox = function(msg, nonce, key) {\n checkArrayTypes(msg, nonce, key);\n checkLengths(key, nonce);\n var m = new Uint8Array(crypto_secretbox_ZEROBYTES + msg.length);\n var c = new Uint8Array(m.length);\n for (var i = 0; i < msg.length; i++) m[i+crypto_secretbox_ZEROBYTES] = msg[i];\n crypto_secretbox(c, m, m.length, nonce, key);\n return c.subarray(crypto_secretbox_BOXZEROBYTES);\n};\n\nnacl.secretbox.open = function(box, nonce, key) {\n checkArrayTypes(box, nonce, key);\n checkLengths(key, nonce);\n var c = new Uint8Array(crypto_secretbox_BOXZEROBYTES + box.length);\n var m = new Uint8Array(c.length);\n for (var i = 0; i < box.length; i++) c[i+crypto_secretbox_BOXZEROBYTES] = box[i];\n if (c.length < 32) return false;\n if (crypto_secretbox_open(m, c, c.length, nonce, key) !== 0) return false;\n return m.subarray(crypto_secretbox_ZEROBYTES);\n};\n\nnacl.secretbox.keyLength = crypto_secretbox_KEYBYTES;\nnacl.secretbox.nonceLength = crypto_secretbox_NONCEBYTES;\nnacl.secretbox.overheadLength = crypto_secretbox_BOXZEROBYTES;\n\nnacl.scalarMult = function(n, p) {\n checkArrayTypes(n, p);\n if (n.length !== crypto_scalarmult_SCALARBYTES) throw new Error('bad n size');\n if (p.length !== crypto_scalarmult_BYTES) throw new Error('bad p size');\n var q = new Uint8Array(crypto_scalarmult_BYTES);\n crypto_scalarmult(q, n, p);\n return q;\n};\n\nnacl.scalarMult.base = function(n) {\n checkArrayTypes(n);\n if (n.length !== crypto_scalarmult_SCALARBYTES) throw new Error('bad n size');\n var q = new Uint8Array(crypto_scalarmult_BYTES);\n crypto_scalarmult_base(q, n);\n return q;\n};\n\nnacl.scalarMult.scalarLength = crypto_scalarmult_SCALARBYTES;\nnacl.scalarMult.groupElementLength = crypto_scalarmult_BYTES;\n\nnacl.box = function(msg, nonce, publicKey, secretKey) {\n var k = nacl.box.before(publicKey, secretKey);\n return nacl.secretbox(msg, nonce, k);\n};\n\nnacl.box.before = function(publicKey, secretKey) {\n checkArrayTypes(publicKey, secretKey);\n checkBoxLengths(publicKey, secretKey);\n var k = new Uint8Array(crypto_box_BEFORENMBYTES);\n crypto_box_beforenm(k, publicKey, secretKey);\n return k;\n};\n\nnacl.box.after = nacl.secretbox;\n\nnacl.box.open = function(msg, nonce, publicKey, secretKey) {\n var k = nacl.box.before(publicKey, secretKey);\n return nacl.secretbox.open(msg, nonce, k);\n};\n\nnacl.box.open.after = nacl.secretbox.open;\n\nnacl.box.keyPair = function() {\n var pk = new Uint8Array(crypto_box_PUBLICKEYBYTES);\n var sk = new Uint8Array(crypto_box_SECRETKEYBYTES);\n crypto_box_keypair(pk, sk);\n return {publicKey: pk, secretKey: sk};\n};\n\nnacl.box.keyPair.fromSecretKey = function(secretKey) {\n checkArrayTypes(secretKey);\n if (secretKey.length !== crypto_box_SECRETKEYBYTES)\n throw new Error('bad secret key size');\n var pk = new Uint8Array(crypto_box_PUBLICKEYBYTES);\n crypto_scalarmult_base(pk, secretKey);\n return {publicKey: pk, secretKey: new Uint8Array(secretKey)};\n};\n\nnacl.box.publicKeyLength = crypto_box_PUBLICKEYBYTES;\nnacl.box.secretKeyLength = crypto_box_SECRETKEYBYTES;\nnacl.box.sharedKeyLength = crypto_box_BEFORENMBYTES;\nnacl.box.nonceLength = crypto_box_NONCEBYTES;\nnacl.box.overheadLength = nacl.secretbox.overheadLength;\n\nnacl.sign = function(msg, secretKey) {\n checkArrayTypes(msg, secretKey);\n if (secretKey.length !== crypto_sign_SECRETKEYBYTES)\n throw new Error('bad secret key size');\n var signedMsg = new Uint8Array(crypto_sign_BYTES+msg.length);\n crypto_sign(signedMsg, msg, msg.length, secretKey);\n return signedMsg;\n};\n\nnacl.sign.open = function(signedMsg, publicKey) {\n if (arguments.length !== 2)\n throw new Error('nacl.sign.open accepts 2 arguments; did you mean to use nacl.sign.detached.verify?');\n checkArrayTypes(signedMsg, publicKey);\n if (publicKey.length !== crypto_sign_PUBLICKEYBYTES)\n throw new Error('bad public key size');\n var tmp = new Uint8Array(signedMsg.length);\n var mlen = crypto_sign_open(tmp, signedMsg, signedMsg.length, publicKey);\n if (mlen < 0) return null;\n var m = new Uint8Array(mlen);\n for (var i = 0; i < m.length; i++) m[i] = tmp[i];\n return m;\n};\n\nnacl.sign.detached = function(msg, secretKey) {\n var signedMsg = nacl.sign(msg, secretKey);\n var sig = new Uint8Array(crypto_sign_BYTES);\n for (var i = 0; i < sig.length; i++) sig[i] = signedMsg[i];\n return sig;\n};\n\nnacl.sign.detached.verify = function(msg, sig, publicKey) {\n checkArrayTypes(msg, sig, publicKey);\n if (sig.length !== crypto_sign_BYTES)\n throw new Error('bad signature size');\n if (publicKey.length !== crypto_sign_PUBLICKEYBYTES)\n throw new Error('bad public key size');\n var sm = new Uint8Array(crypto_sign_BYTES + msg.length);\n var m = new Uint8Array(crypto_sign_BYTES + msg.length);\n var i;\n for (i = 0; i < crypto_sign_BYTES; i++) sm[i] = sig[i];\n for (i = 0; i < msg.length; i++) sm[i+crypto_sign_BYTES] = msg[i];\n return (crypto_sign_open(m, sm, sm.length, publicKey) >= 0);\n};\n\nnacl.sign.keyPair = function() {\n var pk = new Uint8Array(crypto_sign_PUBLICKEYBYTES);\n var sk = new Uint8Array(crypto_sign_SECRETKEYBYTES);\n crypto_sign_keypair(pk, sk);\n return {publicKey: pk, secretKey: sk};\n};\n\nnacl.sign.keyPair.fromSecretKey = function(secretKey) {\n checkArrayTypes(secretKey);\n if (secretKey.length !== crypto_sign_SECRETKEYBYTES)\n throw new Error('bad secret key size');\n var pk = new Uint8Array(crypto_sign_PUBLICKEYBYTES);\n for (var i = 0; i < pk.length; i++) pk[i] = secretKey[32+i];\n return {publicKey: pk, secretKey: new Uint8Array(secretKey)};\n};\n\nnacl.sign.keyPair.fromSeed = function(seed) {\n checkArrayTypes(seed);\n if (seed.length !== crypto_sign_SEEDBYTES)\n throw new Error('bad seed size');\n var pk = new Uint8Array(crypto_sign_PUBLICKEYBYTES);\n var sk = new Uint8Array(crypto_sign_SECRETKEYBYTES);\n for (var i = 0; i < 32; i++) sk[i] = seed[i];\n crypto_sign_keypair(pk, sk, true);\n return {publicKey: pk, secretKey: sk};\n};\n\nnacl.sign.publicKeyLength = crypto_sign_PUBLICKEYBYTES;\nnacl.sign.secretKeyLength = crypto_sign_SECRETKEYBYTES;\nnacl.sign.seedLength = crypto_sign_SEEDBYTES;\nnacl.sign.signatureLength = crypto_sign_BYTES;\n\nnacl.hash = function(msg) {\n checkArrayTypes(msg);\n var h = new Uint8Array(crypto_hash_BYTES);\n crypto_hash(h, msg, msg.length);\n return h;\n};\n\nnacl.hash.hashLength = crypto_hash_BYTES;\n\nnacl.verify = function(x, y) {\n checkArrayTypes(x, y);\n // Zero length arguments are considered not equal.\n if (x.length === 0 || y.length === 0) return false;\n if (x.length !== y.length) return false;\n return (vn(x, 0, y, 0, x.length) === 0) ? true : false;\n};\n\nnacl.setPRNG = function(fn) {\n randombytes = fn;\n};\n\n(function() {\n // Initialize PRNG if environment provides CSPRNG.\n // If not, methods calling randombytes will throw.\n var crypto = typeof self !== 'undefined' ? (self.crypto || self.msCrypto) : null;\n if (crypto && crypto.getRandomValues) {\n // Browsers.\n var QUOTA = 65536;\n nacl.setPRNG(function(x, n) {\n var i, v = new Uint8Array(n);\n for (i = 0; i < n; i += QUOTA) {\n crypto.getRandomValues(v.subarray(i, i + Math.min(n - i, QUOTA)));\n }\n for (i = 0; i < n; i++) x[i] = v[i];\n cleanup(v);\n });\n } else if (typeof require !== 'undefined') {\n // Node.js.\n crypto = require('crypto');\n if (crypto && crypto.randomBytes) {\n nacl.setPRNG(function(x, n) {\n var i, v = crypto.randomBytes(n);\n for (i = 0; i < n; i++) x[i] = v[i];\n cleanup(v);\n });\n }\n }\n})();\n\n})(typeof module !== 'undefined' && module.exports ? module.exports : (self.nacl = self.nacl || {}));\n","/** @license URI.js v4.4.1 (c) 2011 Gary Court. License: http://github.com/garycourt/uri-js */\n(function (global, factory) {\n\ttypeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) :\n\ttypeof define === 'function' && define.amd ? define(['exports'], factory) :\n\t(factory((global.URI = global.URI || {})));\n}(this, (function (exports) { 'use strict';\n\nfunction merge() {\n for (var _len = arguments.length, sets = Array(_len), _key = 0; _key < _len; _key++) {\n sets[_key] = arguments[_key];\n }\n\n if (sets.length > 1) {\n sets[0] = sets[0].slice(0, -1);\n var xl = sets.length - 1;\n for (var x = 1; x < xl; ++x) {\n sets[x] = sets[x].slice(1, -1);\n }\n sets[xl] = sets[xl].slice(1);\n return sets.join('');\n } else {\n return sets[0];\n }\n}\nfunction subexp(str) {\n return \"(?:\" + str + \")\";\n}\nfunction typeOf(o) {\n return o === undefined ? \"undefined\" : o === null ? \"null\" : Object.prototype.toString.call(o).split(\" \").pop().split(\"]\").shift().toLowerCase();\n}\nfunction toUpperCase(str) {\n return str.toUpperCase();\n}\nfunction toArray(obj) {\n return obj !== undefined && obj !== null ? obj instanceof Array ? obj : typeof obj.length !== \"number\" || obj.split || obj.setInterval || obj.call ? [obj] : Array.prototype.slice.call(obj) : [];\n}\nfunction assign(target, source) {\n var obj = target;\n if (source) {\n for (var key in source) {\n obj[key] = source[key];\n }\n }\n return obj;\n}\n\nfunction buildExps(isIRI) {\n var ALPHA$$ = \"[A-Za-z]\",\n CR$ = \"[\\\\x0D]\",\n DIGIT$$ = \"[0-9]\",\n DQUOTE$$ = \"[\\\\x22]\",\n HEXDIG$$ = merge(DIGIT$$, \"[A-Fa-f]\"),\n //case-insensitive\n LF$$ = \"[\\\\x0A]\",\n SP$$ = \"[\\\\x20]\",\n PCT_ENCODED$ = subexp(subexp(\"%[EFef]\" + HEXDIG$$ + \"%\" + HEXDIG$$ + HEXDIG$$ + \"%\" + HEXDIG$$ + HEXDIG$$) + \"|\" + subexp(\"%[89A-Fa-f]\" + HEXDIG$$ + \"%\" + HEXDIG$$ + HEXDIG$$) + \"|\" + subexp(\"%\" + HEXDIG$$ + HEXDIG$$)),\n //expanded\n GEN_DELIMS$$ = \"[\\\\:\\\\/\\\\?\\\\#\\\\[\\\\]\\\\@]\",\n SUB_DELIMS$$ = \"[\\\\!\\\\$\\\\&\\\\'\\\\(\\\\)\\\\*\\\\+\\\\,\\\\;\\\\=]\",\n RESERVED$$ = merge(GEN_DELIMS$$, SUB_DELIMS$$),\n UCSCHAR$$ = isIRI ? \"[\\\\xA0-\\\\u200D\\\\u2010-\\\\u2029\\\\u202F-\\\\uD7FF\\\\uF900-\\\\uFDCF\\\\uFDF0-\\\\uFFEF]\" : \"[]\",\n //subset, excludes bidi control characters\n IPRIVATE$$ = isIRI ? \"[\\\\uE000-\\\\uF8FF]\" : \"[]\",\n //subset\n UNRESERVED$$ = merge(ALPHA$$, DIGIT$$, \"[\\\\-\\\\.\\\\_\\\\~]\", UCSCHAR$$),\n SCHEME$ = subexp(ALPHA$$ + merge(ALPHA$$, DIGIT$$, \"[\\\\+\\\\-\\\\.]\") + \"*\"),\n USERINFO$ = subexp(subexp(PCT_ENCODED$ + \"|\" + merge(UNRESERVED$$, SUB_DELIMS$$, \"[\\\\:]\")) + \"*\"),\n DEC_OCTET$ = subexp(subexp(\"25[0-5]\") + \"|\" + subexp(\"2[0-4]\" + DIGIT$$) + \"|\" + subexp(\"1\" + DIGIT$$ + DIGIT$$) + \"|\" + subexp(\"[1-9]\" + DIGIT$$) + \"|\" + DIGIT$$),\n DEC_OCTET_RELAXED$ = subexp(subexp(\"25[0-5]\") + \"|\" + subexp(\"2[0-4]\" + DIGIT$$) + \"|\" + subexp(\"1\" + DIGIT$$ + DIGIT$$) + \"|\" + subexp(\"0?[1-9]\" + DIGIT$$) + \"|0?0?\" + DIGIT$$),\n //relaxed parsing rules\n IPV4ADDRESS$ = subexp(DEC_OCTET_RELAXED$ + \"\\\\.\" + DEC_OCTET_RELAXED$ + \"\\\\.\" + DEC_OCTET_RELAXED$ + \"\\\\.\" + DEC_OCTET_RELAXED$),\n H16$ = subexp(HEXDIG$$ + \"{1,4}\"),\n LS32$ = subexp(subexp(H16$ + \"\\\\:\" + H16$) + \"|\" + IPV4ADDRESS$),\n IPV6ADDRESS1$ = subexp(subexp(H16$ + \"\\\\:\") + \"{6}\" + LS32$),\n // 6( h16 \":\" ) ls32\n IPV6ADDRESS2$ = subexp(\"\\\\:\\\\:\" + subexp(H16$ + \"\\\\:\") + \"{5}\" + LS32$),\n // \"::\" 5( h16 \":\" ) ls32\n IPV6ADDRESS3$ = subexp(subexp(H16$) + \"?\\\\:\\\\:\" + subexp(H16$ + \"\\\\:\") + \"{4}\" + LS32$),\n //[ h16 ] \"::\" 4( h16 \":\" ) ls32\n IPV6ADDRESS4$ = subexp(subexp(subexp(H16$ + \"\\\\:\") + \"{0,1}\" + H16$) + \"?\\\\:\\\\:\" + subexp(H16$ + \"\\\\:\") + \"{3}\" + LS32$),\n //[ *1( h16 \":\" ) h16 ] \"::\" 3( h16 \":\" ) ls32\n IPV6ADDRESS5$ = subexp(subexp(subexp(H16$ + \"\\\\:\") + \"{0,2}\" + H16$) + \"?\\\\:\\\\:\" + subexp(H16$ + \"\\\\:\") + \"{2}\" + LS32$),\n //[ *2( h16 \":\" ) h16 ] \"::\" 2( h16 \":\" ) ls32\n IPV6ADDRESS6$ = subexp(subexp(subexp(H16$ + \"\\\\:\") + \"{0,3}\" + H16$) + \"?\\\\:\\\\:\" + H16$ + \"\\\\:\" + LS32$),\n //[ *3( h16 \":\" ) h16 ] \"::\" h16 \":\" ls32\n IPV6ADDRESS7$ = subexp(subexp(subexp(H16$ + \"\\\\:\") + \"{0,4}\" + H16$) + \"?\\\\:\\\\:\" + LS32$),\n //[ *4( h16 \":\" ) h16 ] \"::\" ls32\n IPV6ADDRESS8$ = subexp(subexp(subexp(H16$ + \"\\\\:\") + \"{0,5}\" + H16$) + \"?\\\\:\\\\:\" + H16$),\n //[ *5( h16 \":\" ) h16 ] \"::\" h16\n IPV6ADDRESS9$ = subexp(subexp(subexp(H16$ + \"\\\\:\") + \"{0,6}\" + H16$) + \"?\\\\:\\\\:\"),\n //[ *6( h16 \":\" ) h16 ] \"::\"\n IPV6ADDRESS$ = subexp([IPV6ADDRESS1$, IPV6ADDRESS2$, IPV6ADDRESS3$, IPV6ADDRESS4$, IPV6ADDRESS5$, IPV6ADDRESS6$, IPV6ADDRESS7$, IPV6ADDRESS8$, IPV6ADDRESS9$].join(\"|\")),\n ZONEID$ = subexp(subexp(UNRESERVED$$ + \"|\" + PCT_ENCODED$) + \"+\"),\n //RFC 6874\n IPV6ADDRZ$ = subexp(IPV6ADDRESS$ + \"\\\\%25\" + ZONEID$),\n //RFC 6874\n IPV6ADDRZ_RELAXED$ = subexp(IPV6ADDRESS$ + subexp(\"\\\\%25|\\\\%(?!\" + HEXDIG$$ + \"{2})\") + ZONEID$),\n //RFC 6874, with relaxed parsing rules\n IPVFUTURE$ = subexp(\"[vV]\" + HEXDIG$$ + \"+\\\\.\" + merge(UNRESERVED$$, SUB_DELIMS$$, \"[\\\\:]\") + \"+\"),\n IP_LITERAL$ = subexp(\"\\\\[\" + subexp(IPV6ADDRZ_RELAXED$ + \"|\" + IPV6ADDRESS$ + \"|\" + IPVFUTURE$) + \"\\\\]\"),\n //RFC 6874\n REG_NAME$ = subexp(subexp(PCT_ENCODED$ + \"|\" + merge(UNRESERVED$$, SUB_DELIMS$$)) + \"*\"),\n HOST$ = subexp(IP_LITERAL$ + \"|\" + IPV4ADDRESS$ + \"(?!\" + REG_NAME$ + \")\" + \"|\" + REG_NAME$),\n PORT$ = subexp(DIGIT$$ + \"*\"),\n AUTHORITY$ = subexp(subexp(USERINFO$ + \"@\") + \"?\" + HOST$ + subexp(\"\\\\:\" + PORT$) + \"?\"),\n PCHAR$ = subexp(PCT_ENCODED$ + \"|\" + merge(UNRESERVED$$, SUB_DELIMS$$, \"[\\\\:\\\\@]\")),\n SEGMENT$ = subexp(PCHAR$ + \"*\"),\n SEGMENT_NZ$ = subexp(PCHAR$ + \"+\"),\n SEGMENT_NZ_NC$ = subexp(subexp(PCT_ENCODED$ + \"|\" + merge(UNRESERVED$$, SUB_DELIMS$$, \"[\\\\@]\")) + \"+\"),\n PATH_ABEMPTY$ = subexp(subexp(\"\\\\/\" + SEGMENT$) + \"*\"),\n PATH_ABSOLUTE$ = subexp(\"\\\\/\" + subexp(SEGMENT_NZ$ + PATH_ABEMPTY$) + \"?\"),\n //simplified\n PATH_NOSCHEME$ = subexp(SEGMENT_NZ_NC$ + PATH_ABEMPTY$),\n //simplified\n PATH_ROOTLESS$ = subexp(SEGMENT_NZ$ + PATH_ABEMPTY$),\n //simplified\n PATH_EMPTY$ = \"(?!\" + PCHAR$ + \")\",\n PATH$ = subexp(PATH_ABEMPTY$ + \"|\" + PATH_ABSOLUTE$ + \"|\" + PATH_NOSCHEME$ + \"|\" + PATH_ROOTLESS$ + \"|\" + PATH_EMPTY$),\n QUERY$ = subexp(subexp(PCHAR$ + \"|\" + merge(\"[\\\\/\\\\?]\", IPRIVATE$$)) + \"*\"),\n FRAGMENT$ = subexp(subexp(PCHAR$ + \"|[\\\\/\\\\?]\") + \"*\"),\n HIER_PART$ = subexp(subexp(\"\\\\/\\\\/\" + AUTHORITY$ + PATH_ABEMPTY$) + \"|\" + PATH_ABSOLUTE$ + \"|\" + PATH_ROOTLESS$ + \"|\" + PATH_EMPTY$),\n URI$ = subexp(SCHEME$ + \"\\\\:\" + HIER_PART$ + subexp(\"\\\\?\" + QUERY$) + \"?\" + subexp(\"\\\\#\" + FRAGMENT$) + \"?\"),\n RELATIVE_PART$ = subexp(subexp(\"\\\\/\\\\/\" + AUTHORITY$ + PATH_ABEMPTY$) + \"|\" + PATH_ABSOLUTE$ + \"|\" + PATH_NOSCHEME$ + \"|\" + PATH_EMPTY$),\n RELATIVE$ = subexp(RELATIVE_PART$ + subexp(\"\\\\?\" + QUERY$) + \"?\" + subexp(\"\\\\#\" + FRAGMENT$) + \"?\"),\n URI_REFERENCE$ = subexp(URI$ + \"|\" + RELATIVE$),\n ABSOLUTE_URI$ = subexp(SCHEME$ + \"\\\\:\" + HIER_PART$ + subexp(\"\\\\?\" + QUERY$) + \"?\"),\n GENERIC_REF$ = \"^(\" + SCHEME$ + \")\\\\:\" + subexp(subexp(\"\\\\/\\\\/(\" + subexp(\"(\" + USERINFO$ + \")@\") + \"?(\" + HOST$ + \")\" + subexp(\"\\\\:(\" + PORT$ + \")\") + \"?)\") + \"?(\" + PATH_ABEMPTY$ + \"|\" + PATH_ABSOLUTE$ + \"|\" + PATH_ROOTLESS$ + \"|\" + PATH_EMPTY$ + \")\") + subexp(\"\\\\?(\" + QUERY$ + \")\") + \"?\" + subexp(\"\\\\#(\" + FRAGMENT$ + \")\") + \"?$\",\n RELATIVE_REF$ = \"^(){0}\" + subexp(subexp(\"\\\\/\\\\/(\" + subexp(\"(\" + USERINFO$ + \")@\") + \"?(\" + HOST$ + \")\" + subexp(\"\\\\:(\" + PORT$ + \")\") + \"?)\") + \"?(\" + PATH_ABEMPTY$ + \"|\" + PATH_ABSOLUTE$ + \"|\" + PATH_NOSCHEME$ + \"|\" + PATH_EMPTY$ + \")\") + subexp(\"\\\\?(\" + QUERY$ + \")\") + \"?\" + subexp(\"\\\\#(\" + FRAGMENT$ + \")\") + \"?$\",\n ABSOLUTE_REF$ = \"^(\" + SCHEME$ + \")\\\\:\" + subexp(subexp(\"\\\\/\\\\/(\" + subexp(\"(\" + USERINFO$ + \")@\") + \"?(\" + HOST$ + \")\" + subexp(\"\\\\:(\" + PORT$ + \")\") + \"?)\") + \"?(\" + PATH_ABEMPTY$ + \"|\" + PATH_ABSOLUTE$ + \"|\" + PATH_ROOTLESS$ + \"|\" + PATH_EMPTY$ + \")\") + subexp(\"\\\\?(\" + QUERY$ + \")\") + \"?$\",\n SAMEDOC_REF$ = \"^\" + subexp(\"\\\\#(\" + FRAGMENT$ + \")\") + \"?$\",\n AUTHORITY_REF$ = \"^\" + subexp(\"(\" + USERINFO$ + \")@\") + \"?(\" + HOST$ + \")\" + subexp(\"\\\\:(\" + PORT$ + \")\") + \"?$\";\n return {\n NOT_SCHEME: new RegExp(merge(\"[^]\", ALPHA$$, DIGIT$$, \"[\\\\+\\\\-\\\\.]\"), \"g\"),\n NOT_USERINFO: new RegExp(merge(\"[^\\\\%\\\\:]\", UNRESERVED$$, SUB_DELIMS$$), \"g\"),\n NOT_HOST: new RegExp(merge(\"[^\\\\%\\\\[\\\\]\\\\:]\", UNRESERVED$$, SUB_DELIMS$$), \"g\"),\n NOT_PATH: new RegExp(merge(\"[^\\\\%\\\\/\\\\:\\\\@]\", UNRESERVED$$, SUB_DELIMS$$), \"g\"),\n NOT_PATH_NOSCHEME: new RegExp(merge(\"[^\\\\%\\\\/\\\\@]\", UNRESERVED$$, SUB_DELIMS$$), \"g\"),\n NOT_QUERY: new RegExp(merge(\"[^\\\\%]\", UNRESERVED$$, SUB_DELIMS$$, \"[\\\\:\\\\@\\\\/\\\\?]\", IPRIVATE$$), \"g\"),\n NOT_FRAGMENT: new RegExp(merge(\"[^\\\\%]\", UNRESERVED$$, SUB_DELIMS$$, \"[\\\\:\\\\@\\\\/\\\\?]\"), \"g\"),\n ESCAPE: new RegExp(merge(\"[^]\", UNRESERVED$$, SUB_DELIMS$$), \"g\"),\n UNRESERVED: new RegExp(UNRESERVED$$, \"g\"),\n OTHER_CHARS: new RegExp(merge(\"[^\\\\%]\", UNRESERVED$$, RESERVED$$), \"g\"),\n PCT_ENCODED: new RegExp(PCT_ENCODED$, \"g\"),\n IPV4ADDRESS: new RegExp(\"^(\" + IPV4ADDRESS$ + \")$\"),\n IPV6ADDRESS: new RegExp(\"^\\\\[?(\" + IPV6ADDRESS$ + \")\" + subexp(subexp(\"\\\\%25|\\\\%(?!\" + HEXDIG$$ + \"{2})\") + \"(\" + ZONEID$ + \")\") + \"?\\\\]?$\") //RFC 6874, with relaxed parsing rules\n };\n}\nvar URI_PROTOCOL = buildExps(false);\n\nvar IRI_PROTOCOL = buildExps(true);\n\nvar slicedToArray = function () {\n function sliceIterator(arr, i) {\n var _arr = [];\n var _n = true;\n var _d = false;\n var _e = undefined;\n\n try {\n for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) {\n _arr.push(_s.value);\n\n if (i && _arr.length === i) break;\n }\n } catch (err) {\n _d = true;\n _e = err;\n } finally {\n try {\n if (!_n && _i[\"return\"]) _i[\"return\"]();\n } finally {\n if (_d) throw _e;\n }\n }\n\n return _arr;\n }\n\n return function (arr, i) {\n if (Array.isArray(arr)) {\n return arr;\n } else if (Symbol.iterator in Object(arr)) {\n return sliceIterator(arr, i);\n } else {\n throw new TypeError(\"Invalid attempt to destructure non-iterable instance\");\n }\n };\n}();\n\n\n\n\n\n\n\n\n\n\n\n\n\nvar toConsumableArray = function (arr) {\n if (Array.isArray(arr)) {\n for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) arr2[i] = arr[i];\n\n return arr2;\n } else {\n return Array.from(arr);\n }\n};\n\n/** Highest positive signed 32-bit float value */\n\nvar maxInt = 2147483647; // aka. 0x7FFFFFFF or 2^31-1\n\n/** Bootstring parameters */\nvar base = 36;\nvar tMin = 1;\nvar tMax = 26;\nvar skew = 38;\nvar damp = 700;\nvar initialBias = 72;\nvar initialN = 128; // 0x80\nvar delimiter = '-'; // '\\x2D'\n\n/** Regular expressions */\nvar regexPunycode = /^xn--/;\nvar regexNonASCII = /[^\\0-\\x7E]/; // non-ASCII chars\nvar regexSeparators = /[\\x2E\\u3002\\uFF0E\\uFF61]/g; // RFC 3490 separators\n\n/** Error messages */\nvar errors = {\n\t'overflow': 'Overflow: input needs wider integers to process',\n\t'not-basic': 'Illegal input >= 0x80 (not a basic code point)',\n\t'invalid-input': 'Invalid input'\n};\n\n/** Convenience shortcuts */\nvar baseMinusTMin = base - tMin;\nvar floor = Math.floor;\nvar stringFromCharCode = String.fromCharCode;\n\n/*--------------------------------------------------------------------------*/\n\n/**\n * A generic error utility function.\n * @private\n * @param {String} type The error type.\n * @returns {Error} Throws a `RangeError` with the applicable error message.\n */\nfunction error$1(type) {\n\tthrow new RangeError(errors[type]);\n}\n\n/**\n * A generic `Array#map` utility function.\n * @private\n * @param {Array} array The array to iterate over.\n * @param {Function} callback The function that gets called for every array\n * item.\n * @returns {Array} A new array of values returned by the callback function.\n */\nfunction map(array, fn) {\n\tvar result = [];\n\tvar length = array.length;\n\twhile (length--) {\n\t\tresult[length] = fn(array[length]);\n\t}\n\treturn result;\n}\n\n/**\n * A simple `Array#map`-like wrapper to work with domain name strings or email\n * addresses.\n * @private\n * @param {String} domain The domain name or email address.\n * @param {Function} callback The function that gets called for every\n * character.\n * @returns {Array} A new string of characters returned by the callback\n * function.\n */\nfunction mapDomain(string, fn) {\n\tvar parts = string.split('@');\n\tvar result = '';\n\tif (parts.length > 1) {\n\t\t// In email addresses, only the domain name should be punycoded. Leave\n\t\t// the local part (i.e. everything up to `@`) intact.\n\t\tresult = parts[0] + '@';\n\t\tstring = parts[1];\n\t}\n\t// Avoid `split(regex)` for IE8 compatibility. See #17.\n\tstring = string.replace(regexSeparators, '\\x2E');\n\tvar labels = string.split('.');\n\tvar encoded = map(labels, fn).join('.');\n\treturn result + encoded;\n}\n\n/**\n * Creates an array containing the numeric code points of each Unicode\n * character in the string. While JavaScript uses UCS-2 internally,\n * this function will convert a pair of surrogate halves (each of which\n * UCS-2 exposes as separate characters) into a single code point,\n * matching UTF-16.\n * @see `punycode.ucs2.encode`\n * @see \n * @memberOf punycode.ucs2\n * @name decode\n * @param {String} string The Unicode input string (UCS-2).\n * @returns {Array} The new array of code points.\n */\nfunction ucs2decode(string) {\n\tvar output = [];\n\tvar counter = 0;\n\tvar length = string.length;\n\twhile (counter < length) {\n\t\tvar value = string.charCodeAt(counter++);\n\t\tif (value >= 0xD800 && value <= 0xDBFF && counter < length) {\n\t\t\t// It's a high surrogate, and there is a next character.\n\t\t\tvar extra = string.charCodeAt(counter++);\n\t\t\tif ((extra & 0xFC00) == 0xDC00) {\n\t\t\t\t// Low surrogate.\n\t\t\t\toutput.push(((value & 0x3FF) << 10) + (extra & 0x3FF) + 0x10000);\n\t\t\t} else {\n\t\t\t\t// It's an unmatched surrogate; only append this code unit, in case the\n\t\t\t\t// next code unit is the high surrogate of a surrogate pair.\n\t\t\t\toutput.push(value);\n\t\t\t\tcounter--;\n\t\t\t}\n\t\t} else {\n\t\t\toutput.push(value);\n\t\t}\n\t}\n\treturn output;\n}\n\n/**\n * Creates a string based on an array of numeric code points.\n * @see `punycode.ucs2.decode`\n * @memberOf punycode.ucs2\n * @name encode\n * @param {Array} codePoints The array of numeric code points.\n * @returns {String} The new Unicode string (UCS-2).\n */\nvar ucs2encode = function ucs2encode(array) {\n\treturn String.fromCodePoint.apply(String, toConsumableArray(array));\n};\n\n/**\n * Converts a basic code point into a digit/integer.\n * @see `digitToBasic()`\n * @private\n * @param {Number} codePoint The basic numeric code point value.\n * @returns {Number} The numeric value of a basic code point (for use in\n * representing integers) in the range `0` to `base - 1`, or `base` if\n * the code point does not represent a value.\n */\nvar basicToDigit = function basicToDigit(codePoint) {\n\tif (codePoint - 0x30 < 0x0A) {\n\t\treturn codePoint - 0x16;\n\t}\n\tif (codePoint - 0x41 < 0x1A) {\n\t\treturn codePoint - 0x41;\n\t}\n\tif (codePoint - 0x61 < 0x1A) {\n\t\treturn codePoint - 0x61;\n\t}\n\treturn base;\n};\n\n/**\n * Converts a digit/integer into a basic code point.\n * @see `basicToDigit()`\n * @private\n * @param {Number} digit The numeric value of a basic code point.\n * @returns {Number} The basic code point whose value (when used for\n * representing integers) is `digit`, which needs to be in the range\n * `0` to `base - 1`. If `flag` is non-zero, the uppercase form is\n * used; else, the lowercase form is used. The behavior is undefined\n * if `flag` is non-zero and `digit` has no uppercase form.\n */\nvar digitToBasic = function digitToBasic(digit, flag) {\n\t// 0..25 map to ASCII a..z or A..Z\n\t// 26..35 map to ASCII 0..9\n\treturn digit + 22 + 75 * (digit < 26) - ((flag != 0) << 5);\n};\n\n/**\n * Bias adaptation function as per section 3.4 of RFC 3492.\n * https://tools.ietf.org/html/rfc3492#section-3.4\n * @private\n */\nvar adapt = function adapt(delta, numPoints, firstTime) {\n\tvar k = 0;\n\tdelta = firstTime ? floor(delta / damp) : delta >> 1;\n\tdelta += floor(delta / numPoints);\n\tfor (; /* no initialization */delta > baseMinusTMin * tMax >> 1; k += base) {\n\t\tdelta = floor(delta / baseMinusTMin);\n\t}\n\treturn floor(k + (baseMinusTMin + 1) * delta / (delta + skew));\n};\n\n/**\n * Converts a Punycode string of ASCII-only symbols to a string of Unicode\n * symbols.\n * @memberOf punycode\n * @param {String} input The Punycode string of ASCII-only symbols.\n * @returns {String} The resulting string of Unicode symbols.\n */\nvar decode = function decode(input) {\n\t// Don't use UCS-2.\n\tvar output = [];\n\tvar inputLength = input.length;\n\tvar i = 0;\n\tvar n = initialN;\n\tvar bias = initialBias;\n\n\t// Handle the basic code points: let `basic` be the number of input code\n\t// points before the last delimiter, or `0` if there is none, then copy\n\t// the first basic code points to the output.\n\n\tvar basic = input.lastIndexOf(delimiter);\n\tif (basic < 0) {\n\t\tbasic = 0;\n\t}\n\n\tfor (var j = 0; j < basic; ++j) {\n\t\t// if it's not a basic code point\n\t\tif (input.charCodeAt(j) >= 0x80) {\n\t\t\terror$1('not-basic');\n\t\t}\n\t\toutput.push(input.charCodeAt(j));\n\t}\n\n\t// Main decoding loop: start just after the last delimiter if any basic code\n\t// points were copied; start at the beginning otherwise.\n\n\tfor (var index = basic > 0 ? basic + 1 : 0; index < inputLength;) /* no final expression */{\n\n\t\t// `index` is the index of the next character to be consumed.\n\t\t// Decode a generalized variable-length integer into `delta`,\n\t\t// which gets added to `i`. The overflow checking is easier\n\t\t// if we increase `i` as we go, then subtract off its starting\n\t\t// value at the end to obtain `delta`.\n\t\tvar oldi = i;\n\t\tfor (var w = 1, k = base;; /* no condition */k += base) {\n\n\t\t\tif (index >= inputLength) {\n\t\t\t\terror$1('invalid-input');\n\t\t\t}\n\n\t\t\tvar digit = basicToDigit(input.charCodeAt(index++));\n\n\t\t\tif (digit >= base || digit > floor((maxInt - i) / w)) {\n\t\t\t\terror$1('overflow');\n\t\t\t}\n\n\t\t\ti += digit * w;\n\t\t\tvar t = k <= bias ? tMin : k >= bias + tMax ? tMax : k - bias;\n\n\t\t\tif (digit < t) {\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\tvar baseMinusT = base - t;\n\t\t\tif (w > floor(maxInt / baseMinusT)) {\n\t\t\t\terror$1('overflow');\n\t\t\t}\n\n\t\t\tw *= baseMinusT;\n\t\t}\n\n\t\tvar out = output.length + 1;\n\t\tbias = adapt(i - oldi, out, oldi == 0);\n\n\t\t// `i` was supposed to wrap around from `out` to `0`,\n\t\t// incrementing `n` each time, so we'll fix that now:\n\t\tif (floor(i / out) > maxInt - n) {\n\t\t\terror$1('overflow');\n\t\t}\n\n\t\tn += floor(i / out);\n\t\ti %= out;\n\n\t\t// Insert `n` at position `i` of the output.\n\t\toutput.splice(i++, 0, n);\n\t}\n\n\treturn String.fromCodePoint.apply(String, output);\n};\n\n/**\n * Converts a string of Unicode symbols (e.g. a domain name label) to a\n * Punycode string of ASCII-only symbols.\n * @memberOf punycode\n * @param {String} input The string of Unicode symbols.\n * @returns {String} The resulting Punycode string of ASCII-only symbols.\n */\nvar encode = function encode(input) {\n\tvar output = [];\n\n\t// Convert the input in UCS-2 to an array of Unicode code points.\n\tinput = ucs2decode(input);\n\n\t// Cache the length.\n\tvar inputLength = input.length;\n\n\t// Initialize the state.\n\tvar n = initialN;\n\tvar delta = 0;\n\tvar bias = initialBias;\n\n\t// Handle the basic code points.\n\tvar _iteratorNormalCompletion = true;\n\tvar _didIteratorError = false;\n\tvar _iteratorError = undefined;\n\n\ttry {\n\t\tfor (var _iterator = input[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {\n\t\t\tvar _currentValue2 = _step.value;\n\n\t\t\tif (_currentValue2 < 0x80) {\n\t\t\t\toutput.push(stringFromCharCode(_currentValue2));\n\t\t\t}\n\t\t}\n\t} catch (err) {\n\t\t_didIteratorError = true;\n\t\t_iteratorError = err;\n\t} finally {\n\t\ttry {\n\t\t\tif (!_iteratorNormalCompletion && _iterator.return) {\n\t\t\t\t_iterator.return();\n\t\t\t}\n\t\t} finally {\n\t\t\tif (_didIteratorError) {\n\t\t\t\tthrow _iteratorError;\n\t\t\t}\n\t\t}\n\t}\n\n\tvar basicLength = output.length;\n\tvar handledCPCount = basicLength;\n\n\t// `handledCPCount` is the number of code points that have been handled;\n\t// `basicLength` is the number of basic code points.\n\n\t// Finish the basic string with a delimiter unless it's empty.\n\tif (basicLength) {\n\t\toutput.push(delimiter);\n\t}\n\n\t// Main encoding loop:\n\twhile (handledCPCount < inputLength) {\n\n\t\t// All non-basic code points < n have been handled already. Find the next\n\t\t// larger one:\n\t\tvar m = maxInt;\n\t\tvar _iteratorNormalCompletion2 = true;\n\t\tvar _didIteratorError2 = false;\n\t\tvar _iteratorError2 = undefined;\n\n\t\ttry {\n\t\t\tfor (var _iterator2 = input[Symbol.iterator](), _step2; !(_iteratorNormalCompletion2 = (_step2 = _iterator2.next()).done); _iteratorNormalCompletion2 = true) {\n\t\t\t\tvar currentValue = _step2.value;\n\n\t\t\t\tif (currentValue >= n && currentValue < m) {\n\t\t\t\t\tm = currentValue;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Increase `delta` enough to advance the decoder's state to ,\n\t\t\t// but guard against overflow.\n\t\t} catch (err) {\n\t\t\t_didIteratorError2 = true;\n\t\t\t_iteratorError2 = err;\n\t\t} finally {\n\t\t\ttry {\n\t\t\t\tif (!_iteratorNormalCompletion2 && _iterator2.return) {\n\t\t\t\t\t_iterator2.return();\n\t\t\t\t}\n\t\t\t} finally {\n\t\t\t\tif (_didIteratorError2) {\n\t\t\t\t\tthrow _iteratorError2;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tvar handledCPCountPlusOne = handledCPCount + 1;\n\t\tif (m - n > floor((maxInt - delta) / handledCPCountPlusOne)) {\n\t\t\terror$1('overflow');\n\t\t}\n\n\t\tdelta += (m - n) * handledCPCountPlusOne;\n\t\tn = m;\n\n\t\tvar _iteratorNormalCompletion3 = true;\n\t\tvar _didIteratorError3 = false;\n\t\tvar _iteratorError3 = undefined;\n\n\t\ttry {\n\t\t\tfor (var _iterator3 = input[Symbol.iterator](), _step3; !(_iteratorNormalCompletion3 = (_step3 = _iterator3.next()).done); _iteratorNormalCompletion3 = true) {\n\t\t\t\tvar _currentValue = _step3.value;\n\n\t\t\t\tif (_currentValue < n && ++delta > maxInt) {\n\t\t\t\t\terror$1('overflow');\n\t\t\t\t}\n\t\t\t\tif (_currentValue == n) {\n\t\t\t\t\t// Represent delta as a generalized variable-length integer.\n\t\t\t\t\tvar q = delta;\n\t\t\t\t\tfor (var k = base;; /* no condition */k += base) {\n\t\t\t\t\t\tvar t = k <= bias ? tMin : k >= bias + tMax ? tMax : k - bias;\n\t\t\t\t\t\tif (q < t) {\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tvar qMinusT = q - t;\n\t\t\t\t\t\tvar baseMinusT = base - t;\n\t\t\t\t\t\toutput.push(stringFromCharCode(digitToBasic(t + qMinusT % baseMinusT, 0)));\n\t\t\t\t\t\tq = floor(qMinusT / baseMinusT);\n\t\t\t\t\t}\n\n\t\t\t\t\toutput.push(stringFromCharCode(digitToBasic(q, 0)));\n\t\t\t\t\tbias = adapt(delta, handledCPCountPlusOne, handledCPCount == basicLength);\n\t\t\t\t\tdelta = 0;\n\t\t\t\t\t++handledCPCount;\n\t\t\t\t}\n\t\t\t}\n\t\t} catch (err) {\n\t\t\t_didIteratorError3 = true;\n\t\t\t_iteratorError3 = err;\n\t\t} finally {\n\t\t\ttry {\n\t\t\t\tif (!_iteratorNormalCompletion3 && _iterator3.return) {\n\t\t\t\t\t_iterator3.return();\n\t\t\t\t}\n\t\t\t} finally {\n\t\t\t\tif (_didIteratorError3) {\n\t\t\t\t\tthrow _iteratorError3;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t++delta;\n\t\t++n;\n\t}\n\treturn output.join('');\n};\n\n/**\n * Converts a Punycode string representing a domain name or an email address\n * to Unicode. Only the Punycoded parts of the input will be converted, i.e.\n * it doesn't matter if you call it on a string that has already been\n * converted to Unicode.\n * @memberOf punycode\n * @param {String} input The Punycoded domain name or email address to\n * convert to Unicode.\n * @returns {String} The Unicode representation of the given Punycode\n * string.\n */\nvar toUnicode = function toUnicode(input) {\n\treturn mapDomain(input, function (string) {\n\t\treturn regexPunycode.test(string) ? decode(string.slice(4).toLowerCase()) : string;\n\t});\n};\n\n/**\n * Converts a Unicode string representing a domain name or an email address to\n * Punycode. Only the non-ASCII parts of the domain name will be converted,\n * i.e. it doesn't matter if you call it with a domain that's already in\n * ASCII.\n * @memberOf punycode\n * @param {String} input The domain name or email address to convert, as a\n * Unicode string.\n * @returns {String} The Punycode representation of the given domain name or\n * email address.\n */\nvar toASCII = function toASCII(input) {\n\treturn mapDomain(input, function (string) {\n\t\treturn regexNonASCII.test(string) ? 'xn--' + encode(string) : string;\n\t});\n};\n\n/*--------------------------------------------------------------------------*/\n\n/** Define the public API */\nvar punycode = {\n\t/**\n * A string representing the current Punycode.js version number.\n * @memberOf punycode\n * @type String\n */\n\t'version': '2.1.0',\n\t/**\n * An object of methods to convert from JavaScript's internal character\n * representation (UCS-2) to Unicode code points, and back.\n * @see \n * @memberOf punycode\n * @type Object\n */\n\t'ucs2': {\n\t\t'decode': ucs2decode,\n\t\t'encode': ucs2encode\n\t},\n\t'decode': decode,\n\t'encode': encode,\n\t'toASCII': toASCII,\n\t'toUnicode': toUnicode\n};\n\n/**\n * URI.js\n *\n * @fileoverview An RFC 3986 compliant, scheme extendable URI parsing/validating/resolving library for JavaScript.\n * @author Gary Court\n * @see http://github.com/garycourt/uri-js\n */\n/**\n * Copyright 2011 Gary Court. All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or without modification, are\n * permitted provided that the following conditions are met:\n *\n * 1. Redistributions of source code must retain the above copyright notice, this list of\n * conditions and the following disclaimer.\n *\n * 2. Redistributions in binary form must reproduce the above copyright notice, this list\n * of conditions and the following disclaimer in the documentation and/or other materials\n * provided with the distribution.\n *\n * THIS SOFTWARE IS PROVIDED BY GARY COURT ``AS IS'' AND ANY EXPRESS OR IMPLIED\n * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND\n * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL GARY COURT OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR\n * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR\n * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON\n * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING\n * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n *\n * The views and conclusions contained in the software and documentation are those of the\n * authors and should not be interpreted as representing official policies, either expressed\n * or implied, of Gary Court.\n */\nvar SCHEMES = {};\nfunction pctEncChar(chr) {\n var c = chr.charCodeAt(0);\n var e = void 0;\n if (c < 16) e = \"%0\" + c.toString(16).toUpperCase();else if (c < 128) e = \"%\" + c.toString(16).toUpperCase();else if (c < 2048) e = \"%\" + (c >> 6 | 192).toString(16).toUpperCase() + \"%\" + (c & 63 | 128).toString(16).toUpperCase();else e = \"%\" + (c >> 12 | 224).toString(16).toUpperCase() + \"%\" + (c >> 6 & 63 | 128).toString(16).toUpperCase() + \"%\" + (c & 63 | 128).toString(16).toUpperCase();\n return e;\n}\nfunction pctDecChars(str) {\n var newStr = \"\";\n var i = 0;\n var il = str.length;\n while (i < il) {\n var c = parseInt(str.substr(i + 1, 2), 16);\n if (c < 128) {\n newStr += String.fromCharCode(c);\n i += 3;\n } else if (c >= 194 && c < 224) {\n if (il - i >= 6) {\n var c2 = parseInt(str.substr(i + 4, 2), 16);\n newStr += String.fromCharCode((c & 31) << 6 | c2 & 63);\n } else {\n newStr += str.substr(i, 6);\n }\n i += 6;\n } else if (c >= 224) {\n if (il - i >= 9) {\n var _c = parseInt(str.substr(i + 4, 2), 16);\n var c3 = parseInt(str.substr(i + 7, 2), 16);\n newStr += String.fromCharCode((c & 15) << 12 | (_c & 63) << 6 | c3 & 63);\n } else {\n newStr += str.substr(i, 9);\n }\n i += 9;\n } else {\n newStr += str.substr(i, 3);\n i += 3;\n }\n }\n return newStr;\n}\nfunction _normalizeComponentEncoding(components, protocol) {\n function decodeUnreserved(str) {\n var decStr = pctDecChars(str);\n return !decStr.match(protocol.UNRESERVED) ? str : decStr;\n }\n if (components.scheme) components.scheme = String(components.scheme).replace(protocol.PCT_ENCODED, decodeUnreserved).toLowerCase().replace(protocol.NOT_SCHEME, \"\");\n if (components.userinfo !== undefined) components.userinfo = String(components.userinfo).replace(protocol.PCT_ENCODED, decodeUnreserved).replace(protocol.NOT_USERINFO, pctEncChar).replace(protocol.PCT_ENCODED, toUpperCase);\n if (components.host !== undefined) components.host = String(components.host).replace(protocol.PCT_ENCODED, decodeUnreserved).toLowerCase().replace(protocol.NOT_HOST, pctEncChar).replace(protocol.PCT_ENCODED, toUpperCase);\n if (components.path !== undefined) components.path = String(components.path).replace(protocol.PCT_ENCODED, decodeUnreserved).replace(components.scheme ? protocol.NOT_PATH : protocol.NOT_PATH_NOSCHEME, pctEncChar).replace(protocol.PCT_ENCODED, toUpperCase);\n if (components.query !== undefined) components.query = String(components.query).replace(protocol.PCT_ENCODED, decodeUnreserved).replace(protocol.NOT_QUERY, pctEncChar).replace(protocol.PCT_ENCODED, toUpperCase);\n if (components.fragment !== undefined) components.fragment = String(components.fragment).replace(protocol.PCT_ENCODED, decodeUnreserved).replace(protocol.NOT_FRAGMENT, pctEncChar).replace(protocol.PCT_ENCODED, toUpperCase);\n return components;\n}\n\nfunction _stripLeadingZeros(str) {\n return str.replace(/^0*(.*)/, \"$1\") || \"0\";\n}\nfunction _normalizeIPv4(host, protocol) {\n var matches = host.match(protocol.IPV4ADDRESS) || [];\n\n var _matches = slicedToArray(matches, 2),\n address = _matches[1];\n\n if (address) {\n return address.split(\".\").map(_stripLeadingZeros).join(\".\");\n } else {\n return host;\n }\n}\nfunction _normalizeIPv6(host, protocol) {\n var matches = host.match(protocol.IPV6ADDRESS) || [];\n\n var _matches2 = slicedToArray(matches, 3),\n address = _matches2[1],\n zone = _matches2[2];\n\n if (address) {\n var _address$toLowerCase$ = address.toLowerCase().split('::').reverse(),\n _address$toLowerCase$2 = slicedToArray(_address$toLowerCase$, 2),\n last = _address$toLowerCase$2[0],\n first = _address$toLowerCase$2[1];\n\n var firstFields = first ? first.split(\":\").map(_stripLeadingZeros) : [];\n var lastFields = last.split(\":\").map(_stripLeadingZeros);\n var isLastFieldIPv4Address = protocol.IPV4ADDRESS.test(lastFields[lastFields.length - 1]);\n var fieldCount = isLastFieldIPv4Address ? 7 : 8;\n var lastFieldsStart = lastFields.length - fieldCount;\n var fields = Array(fieldCount);\n for (var x = 0; x < fieldCount; ++x) {\n fields[x] = firstFields[x] || lastFields[lastFieldsStart + x] || '';\n }\n if (isLastFieldIPv4Address) {\n fields[fieldCount - 1] = _normalizeIPv4(fields[fieldCount - 1], protocol);\n }\n var allZeroFields = fields.reduce(function (acc, field, index) {\n if (!field || field === \"0\") {\n var lastLongest = acc[acc.length - 1];\n if (lastLongest && lastLongest.index + lastLongest.length === index) {\n lastLongest.length++;\n } else {\n acc.push({ index: index, length: 1 });\n }\n }\n return acc;\n }, []);\n var longestZeroFields = allZeroFields.sort(function (a, b) {\n return b.length - a.length;\n })[0];\n var newHost = void 0;\n if (longestZeroFields && longestZeroFields.length > 1) {\n var newFirst = fields.slice(0, longestZeroFields.index);\n var newLast = fields.slice(longestZeroFields.index + longestZeroFields.length);\n newHost = newFirst.join(\":\") + \"::\" + newLast.join(\":\");\n } else {\n newHost = fields.join(\":\");\n }\n if (zone) {\n newHost += \"%\" + zone;\n }\n return newHost;\n } else {\n return host;\n }\n}\nvar URI_PARSE = /^(?:([^:\\/?#]+):)?(?:\\/\\/((?:([^\\/?#@]*)@)?(\\[[^\\/?#\\]]+\\]|[^\\/?#:]*)(?:\\:(\\d*))?))?([^?#]*)(?:\\?([^#]*))?(?:#((?:.|\\n|\\r)*))?/i;\nvar NO_MATCH_IS_UNDEFINED = \"\".match(/(){0}/)[1] === undefined;\nfunction parse(uriString) {\n var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n\n var components = {};\n var protocol = options.iri !== false ? IRI_PROTOCOL : URI_PROTOCOL;\n if (options.reference === \"suffix\") uriString = (options.scheme ? options.scheme + \":\" : \"\") + \"//\" + uriString;\n var matches = uriString.match(URI_PARSE);\n if (matches) {\n if (NO_MATCH_IS_UNDEFINED) {\n //store each component\n components.scheme = matches[1];\n components.userinfo = matches[3];\n components.host = matches[4];\n components.port = parseInt(matches[5], 10);\n components.path = matches[6] || \"\";\n components.query = matches[7];\n components.fragment = matches[8];\n //fix port number\n if (isNaN(components.port)) {\n components.port = matches[5];\n }\n } else {\n //IE FIX for improper RegExp matching\n //store each component\n components.scheme = matches[1] || undefined;\n components.userinfo = uriString.indexOf(\"@\") !== -1 ? matches[3] : undefined;\n components.host = uriString.indexOf(\"//\") !== -1 ? matches[4] : undefined;\n components.port = parseInt(matches[5], 10);\n components.path = matches[6] || \"\";\n components.query = uriString.indexOf(\"?\") !== -1 ? matches[7] : undefined;\n components.fragment = uriString.indexOf(\"#\") !== -1 ? matches[8] : undefined;\n //fix port number\n if (isNaN(components.port)) {\n components.port = uriString.match(/\\/\\/(?:.|\\n)*\\:(?:\\/|\\?|\\#|$)/) ? matches[4] : undefined;\n }\n }\n if (components.host) {\n //normalize IP hosts\n components.host = _normalizeIPv6(_normalizeIPv4(components.host, protocol), protocol);\n }\n //determine reference type\n if (components.scheme === undefined && components.userinfo === undefined && components.host === undefined && components.port === undefined && !components.path && components.query === undefined) {\n components.reference = \"same-document\";\n } else if (components.scheme === undefined) {\n components.reference = \"relative\";\n } else if (components.fragment === undefined) {\n components.reference = \"absolute\";\n } else {\n components.reference = \"uri\";\n }\n //check for reference errors\n if (options.reference && options.reference !== \"suffix\" && options.reference !== components.reference) {\n components.error = components.error || \"URI is not a \" + options.reference + \" reference.\";\n }\n //find scheme handler\n var schemeHandler = SCHEMES[(options.scheme || components.scheme || \"\").toLowerCase()];\n //check if scheme can't handle IRIs\n if (!options.unicodeSupport && (!schemeHandler || !schemeHandler.unicodeSupport)) {\n //if host component is a domain name\n if (components.host && (options.domainHost || schemeHandler && schemeHandler.domainHost)) {\n //convert Unicode IDN -> ASCII IDN\n try {\n components.host = punycode.toASCII(components.host.replace(protocol.PCT_ENCODED, pctDecChars).toLowerCase());\n } catch (e) {\n components.error = components.error || \"Host's domain name can not be converted to ASCII via punycode: \" + e;\n }\n }\n //convert IRI -> URI\n _normalizeComponentEncoding(components, URI_PROTOCOL);\n } else {\n //normalize encodings\n _normalizeComponentEncoding(components, protocol);\n }\n //perform scheme specific parsing\n if (schemeHandler && schemeHandler.parse) {\n schemeHandler.parse(components, options);\n }\n } else {\n components.error = components.error || \"URI can not be parsed.\";\n }\n return components;\n}\n\nfunction _recomposeAuthority(components, options) {\n var protocol = options.iri !== false ? IRI_PROTOCOL : URI_PROTOCOL;\n var uriTokens = [];\n if (components.userinfo !== undefined) {\n uriTokens.push(components.userinfo);\n uriTokens.push(\"@\");\n }\n if (components.host !== undefined) {\n //normalize IP hosts, add brackets and escape zone separator for IPv6\n uriTokens.push(_normalizeIPv6(_normalizeIPv4(String(components.host), protocol), protocol).replace(protocol.IPV6ADDRESS, function (_, $1, $2) {\n return \"[\" + $1 + ($2 ? \"%25\" + $2 : \"\") + \"]\";\n }));\n }\n if (typeof components.port === \"number\" || typeof components.port === \"string\") {\n uriTokens.push(\":\");\n uriTokens.push(String(components.port));\n }\n return uriTokens.length ? uriTokens.join(\"\") : undefined;\n}\n\nvar RDS1 = /^\\.\\.?\\//;\nvar RDS2 = /^\\/\\.(\\/|$)/;\nvar RDS3 = /^\\/\\.\\.(\\/|$)/;\nvar RDS5 = /^\\/?(?:.|\\n)*?(?=\\/|$)/;\nfunction removeDotSegments(input) {\n var output = [];\n while (input.length) {\n if (input.match(RDS1)) {\n input = input.replace(RDS1, \"\");\n } else if (input.match(RDS2)) {\n input = input.replace(RDS2, \"/\");\n } else if (input.match(RDS3)) {\n input = input.replace(RDS3, \"/\");\n output.pop();\n } else if (input === \".\" || input === \"..\") {\n input = \"\";\n } else {\n var im = input.match(RDS5);\n if (im) {\n var s = im[0];\n input = input.slice(s.length);\n output.push(s);\n } else {\n throw new Error(\"Unexpected dot segment condition\");\n }\n }\n }\n return output.join(\"\");\n}\n\nfunction serialize(components) {\n var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n\n var protocol = options.iri ? IRI_PROTOCOL : URI_PROTOCOL;\n var uriTokens = [];\n //find scheme handler\n var schemeHandler = SCHEMES[(options.scheme || components.scheme || \"\").toLowerCase()];\n //perform scheme specific serialization\n if (schemeHandler && schemeHandler.serialize) schemeHandler.serialize(components, options);\n if (components.host) {\n //if host component is an IPv6 address\n if (protocol.IPV6ADDRESS.test(components.host)) {}\n //TODO: normalize IPv6 address as per RFC 5952\n\n //if host component is a domain name\n else if (options.domainHost || schemeHandler && schemeHandler.domainHost) {\n //convert IDN via punycode\n try {\n components.host = !options.iri ? punycode.toASCII(components.host.replace(protocol.PCT_ENCODED, pctDecChars).toLowerCase()) : punycode.toUnicode(components.host);\n } catch (e) {\n components.error = components.error || \"Host's domain name can not be converted to \" + (!options.iri ? \"ASCII\" : \"Unicode\") + \" via punycode: \" + e;\n }\n }\n }\n //normalize encoding\n _normalizeComponentEncoding(components, protocol);\n if (options.reference !== \"suffix\" && components.scheme) {\n uriTokens.push(components.scheme);\n uriTokens.push(\":\");\n }\n var authority = _recomposeAuthority(components, options);\n if (authority !== undefined) {\n if (options.reference !== \"suffix\") {\n uriTokens.push(\"//\");\n }\n uriTokens.push(authority);\n if (components.path && components.path.charAt(0) !== \"/\") {\n uriTokens.push(\"/\");\n }\n }\n if (components.path !== undefined) {\n var s = components.path;\n if (!options.absolutePath && (!schemeHandler || !schemeHandler.absolutePath)) {\n s = removeDotSegments(s);\n }\n if (authority === undefined) {\n s = s.replace(/^\\/\\//, \"/%2F\"); //don't allow the path to start with \"//\"\n }\n uriTokens.push(s);\n }\n if (components.query !== undefined) {\n uriTokens.push(\"?\");\n uriTokens.push(components.query);\n }\n if (components.fragment !== undefined) {\n uriTokens.push(\"#\");\n uriTokens.push(components.fragment);\n }\n return uriTokens.join(\"\"); //merge tokens into a string\n}\n\nfunction resolveComponents(base, relative) {\n var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};\n var skipNormalization = arguments[3];\n\n var target = {};\n if (!skipNormalization) {\n base = parse(serialize(base, options), options); //normalize base components\n relative = parse(serialize(relative, options), options); //normalize relative components\n }\n options = options || {};\n if (!options.tolerant && relative.scheme) {\n target.scheme = relative.scheme;\n //target.authority = relative.authority;\n target.userinfo = relative.userinfo;\n target.host = relative.host;\n target.port = relative.port;\n target.path = removeDotSegments(relative.path || \"\");\n target.query = relative.query;\n } else {\n if (relative.userinfo !== undefined || relative.host !== undefined || relative.port !== undefined) {\n //target.authority = relative.authority;\n target.userinfo = relative.userinfo;\n target.host = relative.host;\n target.port = relative.port;\n target.path = removeDotSegments(relative.path || \"\");\n target.query = relative.query;\n } else {\n if (!relative.path) {\n target.path = base.path;\n if (relative.query !== undefined) {\n target.query = relative.query;\n } else {\n target.query = base.query;\n }\n } else {\n if (relative.path.charAt(0) === \"/\") {\n target.path = removeDotSegments(relative.path);\n } else {\n if ((base.userinfo !== undefined || base.host !== undefined || base.port !== undefined) && !base.path) {\n target.path = \"/\" + relative.path;\n } else if (!base.path) {\n target.path = relative.path;\n } else {\n target.path = base.path.slice(0, base.path.lastIndexOf(\"/\") + 1) + relative.path;\n }\n target.path = removeDotSegments(target.path);\n }\n target.query = relative.query;\n }\n //target.authority = base.authority;\n target.userinfo = base.userinfo;\n target.host = base.host;\n target.port = base.port;\n }\n target.scheme = base.scheme;\n }\n target.fragment = relative.fragment;\n return target;\n}\n\nfunction resolve(baseURI, relativeURI, options) {\n var schemelessOptions = assign({ scheme: 'null' }, options);\n return serialize(resolveComponents(parse(baseURI, schemelessOptions), parse(relativeURI, schemelessOptions), schemelessOptions, true), schemelessOptions);\n}\n\nfunction normalize(uri, options) {\n if (typeof uri === \"string\") {\n uri = serialize(parse(uri, options), options);\n } else if (typeOf(uri) === \"object\") {\n uri = parse(serialize(uri, options), options);\n }\n return uri;\n}\n\nfunction equal(uriA, uriB, options) {\n if (typeof uriA === \"string\") {\n uriA = serialize(parse(uriA, options), options);\n } else if (typeOf(uriA) === \"object\") {\n uriA = serialize(uriA, options);\n }\n if (typeof uriB === \"string\") {\n uriB = serialize(parse(uriB, options), options);\n } else if (typeOf(uriB) === \"object\") {\n uriB = serialize(uriB, options);\n }\n return uriA === uriB;\n}\n\nfunction escapeComponent(str, options) {\n return str && str.toString().replace(!options || !options.iri ? URI_PROTOCOL.ESCAPE : IRI_PROTOCOL.ESCAPE, pctEncChar);\n}\n\nfunction unescapeComponent(str, options) {\n return str && str.toString().replace(!options || !options.iri ? URI_PROTOCOL.PCT_ENCODED : IRI_PROTOCOL.PCT_ENCODED, pctDecChars);\n}\n\nvar handler = {\n scheme: \"http\",\n domainHost: true,\n parse: function parse(components, options) {\n //report missing host\n if (!components.host) {\n components.error = components.error || \"HTTP URIs must have a host.\";\n }\n return components;\n },\n serialize: function serialize(components, options) {\n var secure = String(components.scheme).toLowerCase() === \"https\";\n //normalize the default port\n if (components.port === (secure ? 443 : 80) || components.port === \"\") {\n components.port = undefined;\n }\n //normalize the empty path\n if (!components.path) {\n components.path = \"/\";\n }\n //NOTE: We do not parse query strings for HTTP URIs\n //as WWW Form Url Encoded query strings are part of the HTML4+ spec,\n //and not the HTTP spec.\n return components;\n }\n};\n\nvar handler$1 = {\n scheme: \"https\",\n domainHost: handler.domainHost,\n parse: handler.parse,\n serialize: handler.serialize\n};\n\nfunction isSecure(wsComponents) {\n return typeof wsComponents.secure === 'boolean' ? wsComponents.secure : String(wsComponents.scheme).toLowerCase() === \"wss\";\n}\n//RFC 6455\nvar handler$2 = {\n scheme: \"ws\",\n domainHost: true,\n parse: function parse(components, options) {\n var wsComponents = components;\n //indicate if the secure flag is set\n wsComponents.secure = isSecure(wsComponents);\n //construct resouce name\n wsComponents.resourceName = (wsComponents.path || '/') + (wsComponents.query ? '?' + wsComponents.query : '');\n wsComponents.path = undefined;\n wsComponents.query = undefined;\n return wsComponents;\n },\n serialize: function serialize(wsComponents, options) {\n //normalize the default port\n if (wsComponents.port === (isSecure(wsComponents) ? 443 : 80) || wsComponents.port === \"\") {\n wsComponents.port = undefined;\n }\n //ensure scheme matches secure flag\n if (typeof wsComponents.secure === 'boolean') {\n wsComponents.scheme = wsComponents.secure ? 'wss' : 'ws';\n wsComponents.secure = undefined;\n }\n //reconstruct path from resource name\n if (wsComponents.resourceName) {\n var _wsComponents$resourc = wsComponents.resourceName.split('?'),\n _wsComponents$resourc2 = slicedToArray(_wsComponents$resourc, 2),\n path = _wsComponents$resourc2[0],\n query = _wsComponents$resourc2[1];\n\n wsComponents.path = path && path !== '/' ? path : undefined;\n wsComponents.query = query;\n wsComponents.resourceName = undefined;\n }\n //forbid fragment component\n wsComponents.fragment = undefined;\n return wsComponents;\n }\n};\n\nvar handler$3 = {\n scheme: \"wss\",\n domainHost: handler$2.domainHost,\n parse: handler$2.parse,\n serialize: handler$2.serialize\n};\n\nvar O = {};\nvar isIRI = true;\n//RFC 3986\nvar UNRESERVED$$ = \"[A-Za-z0-9\\\\-\\\\.\\\\_\\\\~\" + (isIRI ? \"\\\\xA0-\\\\u200D\\\\u2010-\\\\u2029\\\\u202F-\\\\uD7FF\\\\uF900-\\\\uFDCF\\\\uFDF0-\\\\uFFEF\" : \"\") + \"]\";\nvar HEXDIG$$ = \"[0-9A-Fa-f]\"; //case-insensitive\nvar PCT_ENCODED$ = subexp(subexp(\"%[EFef]\" + HEXDIG$$ + \"%\" + HEXDIG$$ + HEXDIG$$ + \"%\" + HEXDIG$$ + HEXDIG$$) + \"|\" + subexp(\"%[89A-Fa-f]\" + HEXDIG$$ + \"%\" + HEXDIG$$ + HEXDIG$$) + \"|\" + subexp(\"%\" + HEXDIG$$ + HEXDIG$$)); //expanded\n//RFC 5322, except these symbols as per RFC 6068: @ : / ? # [ ] & ; =\n//const ATEXT$$ = \"[A-Za-z0-9\\\\!\\\\#\\\\$\\\\%\\\\&\\\\'\\\\*\\\\+\\\\-\\\\/\\\\=\\\\?\\\\^\\\\_\\\\`\\\\{\\\\|\\\\}\\\\~]\";\n//const WSP$$ = \"[\\\\x20\\\\x09]\";\n//const OBS_QTEXT$$ = \"[\\\\x01-\\\\x08\\\\x0B\\\\x0C\\\\x0E-\\\\x1F\\\\x7F]\"; //(%d1-8 / %d11-12 / %d14-31 / %d127)\n//const QTEXT$$ = merge(\"[\\\\x21\\\\x23-\\\\x5B\\\\x5D-\\\\x7E]\", OBS_QTEXT$$); //%d33 / %d35-91 / %d93-126 / obs-qtext\n//const VCHAR$$ = \"[\\\\x21-\\\\x7E]\";\n//const WSP$$ = \"[\\\\x20\\\\x09]\";\n//const OBS_QP$ = subexp(\"\\\\\\\\\" + merge(\"[\\\\x00\\\\x0D\\\\x0A]\", OBS_QTEXT$$)); //%d0 / CR / LF / obs-qtext\n//const FWS$ = subexp(subexp(WSP$$ + \"*\" + \"\\\\x0D\\\\x0A\") + \"?\" + WSP$$ + \"+\");\n//const QUOTED_PAIR$ = subexp(subexp(\"\\\\\\\\\" + subexp(VCHAR$$ + \"|\" + WSP$$)) + \"|\" + OBS_QP$);\n//const QUOTED_STRING$ = subexp('\\\\\"' + subexp(FWS$ + \"?\" + QCONTENT$) + \"*\" + FWS$ + \"?\" + '\\\\\"');\nvar ATEXT$$ = \"[A-Za-z0-9\\\\!\\\\$\\\\%\\\\'\\\\*\\\\+\\\\-\\\\^\\\\_\\\\`\\\\{\\\\|\\\\}\\\\~]\";\nvar QTEXT$$ = \"[\\\\!\\\\$\\\\%\\\\'\\\\(\\\\)\\\\*\\\\+\\\\,\\\\-\\\\.0-9\\\\<\\\\>A-Z\\\\x5E-\\\\x7E]\";\nvar VCHAR$$ = merge(QTEXT$$, \"[\\\\\\\"\\\\\\\\]\");\nvar SOME_DELIMS$$ = \"[\\\\!\\\\$\\\\'\\\\(\\\\)\\\\*\\\\+\\\\,\\\\;\\\\:\\\\@]\";\nvar UNRESERVED = new RegExp(UNRESERVED$$, \"g\");\nvar PCT_ENCODED = new RegExp(PCT_ENCODED$, \"g\");\nvar NOT_LOCAL_PART = new RegExp(merge(\"[^]\", ATEXT$$, \"[\\\\.]\", '[\\\\\"]', VCHAR$$), \"g\");\nvar NOT_HFNAME = new RegExp(merge(\"[^]\", UNRESERVED$$, SOME_DELIMS$$), \"g\");\nvar NOT_HFVALUE = NOT_HFNAME;\nfunction decodeUnreserved(str) {\n var decStr = pctDecChars(str);\n return !decStr.match(UNRESERVED) ? str : decStr;\n}\nvar handler$4 = {\n scheme: \"mailto\",\n parse: function parse$$1(components, options) {\n var mailtoComponents = components;\n var to = mailtoComponents.to = mailtoComponents.path ? mailtoComponents.path.split(\",\") : [];\n mailtoComponents.path = undefined;\n if (mailtoComponents.query) {\n var unknownHeaders = false;\n var headers = {};\n var hfields = mailtoComponents.query.split(\"&\");\n for (var x = 0, xl = hfields.length; x < xl; ++x) {\n var hfield = hfields[x].split(\"=\");\n switch (hfield[0]) {\n case \"to\":\n var toAddrs = hfield[1].split(\",\");\n for (var _x = 0, _xl = toAddrs.length; _x < _xl; ++_x) {\n to.push(toAddrs[_x]);\n }\n break;\n case \"subject\":\n mailtoComponents.subject = unescapeComponent(hfield[1], options);\n break;\n case \"body\":\n mailtoComponents.body = unescapeComponent(hfield[1], options);\n break;\n default:\n unknownHeaders = true;\n headers[unescapeComponent(hfield[0], options)] = unescapeComponent(hfield[1], options);\n break;\n }\n }\n if (unknownHeaders) mailtoComponents.headers = headers;\n }\n mailtoComponents.query = undefined;\n for (var _x2 = 0, _xl2 = to.length; _x2 < _xl2; ++_x2) {\n var addr = to[_x2].split(\"@\");\n addr[0] = unescapeComponent(addr[0]);\n if (!options.unicodeSupport) {\n //convert Unicode IDN -> ASCII IDN\n try {\n addr[1] = punycode.toASCII(unescapeComponent(addr[1], options).toLowerCase());\n } catch (e) {\n mailtoComponents.error = mailtoComponents.error || \"Email address's domain name can not be converted to ASCII via punycode: \" + e;\n }\n } else {\n addr[1] = unescapeComponent(addr[1], options).toLowerCase();\n }\n to[_x2] = addr.join(\"@\");\n }\n return mailtoComponents;\n },\n serialize: function serialize$$1(mailtoComponents, options) {\n var components = mailtoComponents;\n var to = toArray(mailtoComponents.to);\n if (to) {\n for (var x = 0, xl = to.length; x < xl; ++x) {\n var toAddr = String(to[x]);\n var atIdx = toAddr.lastIndexOf(\"@\");\n var localPart = toAddr.slice(0, atIdx).replace(PCT_ENCODED, decodeUnreserved).replace(PCT_ENCODED, toUpperCase).replace(NOT_LOCAL_PART, pctEncChar);\n var domain = toAddr.slice(atIdx + 1);\n //convert IDN via punycode\n try {\n domain = !options.iri ? punycode.toASCII(unescapeComponent(domain, options).toLowerCase()) : punycode.toUnicode(domain);\n } catch (e) {\n components.error = components.error || \"Email address's domain name can not be converted to \" + (!options.iri ? \"ASCII\" : \"Unicode\") + \" via punycode: \" + e;\n }\n to[x] = localPart + \"@\" + domain;\n }\n components.path = to.join(\",\");\n }\n var headers = mailtoComponents.headers = mailtoComponents.headers || {};\n if (mailtoComponents.subject) headers[\"subject\"] = mailtoComponents.subject;\n if (mailtoComponents.body) headers[\"body\"] = mailtoComponents.body;\n var fields = [];\n for (var name in headers) {\n if (headers[name] !== O[name]) {\n fields.push(name.replace(PCT_ENCODED, decodeUnreserved).replace(PCT_ENCODED, toUpperCase).replace(NOT_HFNAME, pctEncChar) + \"=\" + headers[name].replace(PCT_ENCODED, decodeUnreserved).replace(PCT_ENCODED, toUpperCase).replace(NOT_HFVALUE, pctEncChar));\n }\n }\n if (fields.length) {\n components.query = fields.join(\"&\");\n }\n return components;\n }\n};\n\nvar URN_PARSE = /^([^\\:]+)\\:(.*)/;\n//RFC 2141\nvar handler$5 = {\n scheme: \"urn\",\n parse: function parse$$1(components, options) {\n var matches = components.path && components.path.match(URN_PARSE);\n var urnComponents = components;\n if (matches) {\n var scheme = options.scheme || urnComponents.scheme || \"urn\";\n var nid = matches[1].toLowerCase();\n var nss = matches[2];\n var urnScheme = scheme + \":\" + (options.nid || nid);\n var schemeHandler = SCHEMES[urnScheme];\n urnComponents.nid = nid;\n urnComponents.nss = nss;\n urnComponents.path = undefined;\n if (schemeHandler) {\n urnComponents = schemeHandler.parse(urnComponents, options);\n }\n } else {\n urnComponents.error = urnComponents.error || \"URN can not be parsed.\";\n }\n return urnComponents;\n },\n serialize: function serialize$$1(urnComponents, options) {\n var scheme = options.scheme || urnComponents.scheme || \"urn\";\n var nid = urnComponents.nid;\n var urnScheme = scheme + \":\" + (options.nid || nid);\n var schemeHandler = SCHEMES[urnScheme];\n if (schemeHandler) {\n urnComponents = schemeHandler.serialize(urnComponents, options);\n }\n var uriComponents = urnComponents;\n var nss = urnComponents.nss;\n uriComponents.path = (nid || options.nid) + \":\" + nss;\n return uriComponents;\n }\n};\n\nvar UUID = /^[0-9A-Fa-f]{8}(?:\\-[0-9A-Fa-f]{4}){3}\\-[0-9A-Fa-f]{12}$/;\n//RFC 4122\nvar handler$6 = {\n scheme: \"urn:uuid\",\n parse: function parse(urnComponents, options) {\n var uuidComponents = urnComponents;\n uuidComponents.uuid = uuidComponents.nss;\n uuidComponents.nss = undefined;\n if (!options.tolerant && (!uuidComponents.uuid || !uuidComponents.uuid.match(UUID))) {\n uuidComponents.error = uuidComponents.error || \"UUID is not valid.\";\n }\n return uuidComponents;\n },\n serialize: function serialize(uuidComponents, options) {\n var urnComponents = uuidComponents;\n //normalize UUID\n urnComponents.nss = (uuidComponents.uuid || \"\").toLowerCase();\n return urnComponents;\n }\n};\n\nSCHEMES[handler.scheme] = handler;\nSCHEMES[handler$1.scheme] = handler$1;\nSCHEMES[handler$2.scheme] = handler$2;\nSCHEMES[handler$3.scheme] = handler$3;\nSCHEMES[handler$4.scheme] = handler$4;\nSCHEMES[handler$5.scheme] = handler$5;\nSCHEMES[handler$6.scheme] = handler$6;\n\nexports.SCHEMES = SCHEMES;\nexports.pctEncChar = pctEncChar;\nexports.pctDecChars = pctDecChars;\nexports.parse = parse;\nexports.removeDotSegments = removeDotSegments;\nexports.serialize = serialize;\nexports.resolveComponents = resolveComponents;\nexports.resolve = resolve;\nexports.normalize = normalize;\nexports.equal = equal;\nexports.escapeComponent = escapeComponent;\nexports.unescapeComponent = unescapeComponent;\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\n})));\n//# sourceMappingURL=uri.all.js.map\n","(function (name, context, definition) {\n if (typeof module !== 'undefined' && module.exports) module.exports = definition();\n else if (typeof define === 'function' && define.amd) define(definition);\n else context[name] = definition();\n})('urljoin', this, function () {\n\n function normalize (strArray) {\n var resultArray = [];\n if (strArray.length === 0) { return ''; }\n\n if (typeof strArray[0] !== 'string') {\n throw new TypeError('Url must be a string. Received ' + strArray[0]);\n }\n\n // If the first part is a plain protocol, we combine it with the next part.\n if (strArray[0].match(/^[^/:]+:\\/*$/) && strArray.length > 1) {\n var first = strArray.shift();\n strArray[0] = first + strArray[0];\n }\n\n // There must be two or three slashes in the file protocol, two slashes in anything else.\n if (strArray[0].match(/^file:\\/\\/\\//)) {\n strArray[0] = strArray[0].replace(/^([^/:]+):\\/*/, '$1:///');\n } else {\n strArray[0] = strArray[0].replace(/^([^/:]+):\\/*/, '$1://');\n }\n\n for (var i = 0; i < strArray.length; i++) {\n var component = strArray[i];\n\n if (typeof component !== 'string') {\n throw new TypeError('Url must be a string. Received ' + component);\n }\n\n if (component === '') { continue; }\n\n if (i > 0) {\n // Removing the starting slashes for each component but the first.\n component = component.replace(/^[\\/]+/, '');\n }\n if (i < strArray.length - 1) {\n // Removing the ending slashes for each component but the last.\n component = component.replace(/[\\/]+$/, '');\n } else {\n // For the last component we will combine multiple slashes to a single one.\n component = component.replace(/[\\/]+$/, '/');\n }\n\n resultArray.push(component);\n\n }\n\n var str = resultArray.join('/');\n // Each input component is now separated by a single slash except the possible first plain protocol part.\n\n // remove trailing slash before parameters or hash\n str = str.replace(/\\/(\\?|&|#[^!])/g, '$1');\n\n // replace ? in parameters with &\n var parts = str.split('?');\n str = parts.shift() + (parts.length > 0 ? '?': '') + parts.join('&');\n\n return str;\n }\n\n return function () {\n var input;\n\n if (typeof arguments[0] === 'object') {\n input = arguments[0];\n } else {\n input = [].slice.call(arguments);\n }\n\n return normalize(input);\n };\n\n});\n","'use strict';\nconst url = require('url');\nconst prependHttp = require('prepend-http');\n\nmodule.exports = (input, options) => {\n\tif (typeof input !== 'string') {\n\t\tthrow new TypeError(`Expected \\`url\\` to be of type \\`string\\`, got \\`${typeof input}\\` instead.`);\n\t}\n\n\tconst finalUrl = prependHttp(input, Object.assign({https: true}, options));\n\treturn url.parse(finalUrl);\n};\n","var v1 = require('./v1');\nvar v4 = require('./v4');\n\nvar uuid = v4;\nuuid.v1 = v1;\nuuid.v4 = v4;\n\nmodule.exports = uuid;\n","/**\n * Convert array of 16 byte values to UUID string format of the form:\n * XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX\n */\nvar byteToHex = [];\nfor (var i = 0; i < 256; ++i) {\n byteToHex[i] = (i + 0x100).toString(16).substr(1);\n}\n\nfunction bytesToUuid(buf, offset) {\n var i = offset || 0;\n var bth = byteToHex;\n // join used to fix memory issue caused by concatenation: https://bugs.chromium.org/p/v8/issues/detail?id=3175#c4\n return ([bth[buf[i++]], bth[buf[i++]], \n\tbth[buf[i++]], bth[buf[i++]], '-',\n\tbth[buf[i++]], bth[buf[i++]], '-',\n\tbth[buf[i++]], bth[buf[i++]], '-',\n\tbth[buf[i++]], bth[buf[i++]], '-',\n\tbth[buf[i++]], bth[buf[i++]],\n\tbth[buf[i++]], bth[buf[i++]],\n\tbth[buf[i++]], bth[buf[i++]]]).join('');\n}\n\nmodule.exports = bytesToUuid;\n","// Unique ID creation requires a high quality random # generator. In node.js\n// this is pretty straight-forward - we use the crypto API.\n\nvar crypto = require('crypto');\n\nmodule.exports = function nodeRNG() {\n return crypto.randomBytes(16);\n};\n","var rng = require('./lib/rng');\nvar bytesToUuid = require('./lib/bytesToUuid');\n\n// **`v1()` - Generate time-based UUID**\n//\n// Inspired by https://github.com/LiosK/UUID.js\n// and http://docs.python.org/library/uuid.html\n\nvar _nodeId;\nvar _clockseq;\n\n// Previous uuid creation time\nvar _lastMSecs = 0;\nvar _lastNSecs = 0;\n\n// See https://github.com/broofa/node-uuid for API details\nfunction v1(options, buf, offset) {\n var i = buf && offset || 0;\n var b = buf || [];\n\n options = options || {};\n var node = options.node || _nodeId;\n var clockseq = options.clockseq !== undefined ? options.clockseq : _clockseq;\n\n // node and clockseq need to be initialized to random values if they're not\n // specified. We do this lazily to minimize issues related to insufficient\n // system entropy. See #189\n if (node == null || clockseq == null) {\n var seedBytes = rng();\n if (node == null) {\n // Per 4.5, create and 48-bit node id, (47 random bits + multicast bit = 1)\n node = _nodeId = [\n seedBytes[0] | 0x01,\n seedBytes[1], seedBytes[2], seedBytes[3], seedBytes[4], seedBytes[5]\n ];\n }\n if (clockseq == null) {\n // Per 4.2.2, randomize (14 bit) clockseq\n clockseq = _clockseq = (seedBytes[6] << 8 | seedBytes[7]) & 0x3fff;\n }\n }\n\n // UUID timestamps are 100 nano-second units since the Gregorian epoch,\n // (1582-10-15 00:00). JSNumbers aren't precise enough for this, so\n // time is handled internally as 'msecs' (integer milliseconds) and 'nsecs'\n // (100-nanoseconds offset from msecs) since unix epoch, 1970-01-01 00:00.\n var msecs = options.msecs !== undefined ? options.msecs : new Date().getTime();\n\n // Per 4.2.1.2, use count of uuid's generated during the current clock\n // cycle to simulate higher resolution clock\n var nsecs = options.nsecs !== undefined ? options.nsecs : _lastNSecs + 1;\n\n // Time since last uuid creation (in msecs)\n var dt = (msecs - _lastMSecs) + (nsecs - _lastNSecs)/10000;\n\n // Per 4.2.1.2, Bump clockseq on clock regression\n if (dt < 0 && options.clockseq === undefined) {\n clockseq = clockseq + 1 & 0x3fff;\n }\n\n // Reset nsecs if clock regresses (new clockseq) or we've moved onto a new\n // time interval\n if ((dt < 0 || msecs > _lastMSecs) && options.nsecs === undefined) {\n nsecs = 0;\n }\n\n // Per 4.2.1.2 Throw error if too many uuids are requested\n if (nsecs >= 10000) {\n throw new Error('uuid.v1(): Can\\'t create more than 10M uuids/sec');\n }\n\n _lastMSecs = msecs;\n _lastNSecs = nsecs;\n _clockseq = clockseq;\n\n // Per 4.1.4 - Convert from unix epoch to Gregorian epoch\n msecs += 12219292800000;\n\n // `time_low`\n var tl = ((msecs & 0xfffffff) * 10000 + nsecs) % 0x100000000;\n b[i++] = tl >>> 24 & 0xff;\n b[i++] = tl >>> 16 & 0xff;\n b[i++] = tl >>> 8 & 0xff;\n b[i++] = tl & 0xff;\n\n // `time_mid`\n var tmh = (msecs / 0x100000000 * 10000) & 0xfffffff;\n b[i++] = tmh >>> 8 & 0xff;\n b[i++] = tmh & 0xff;\n\n // `time_high_and_version`\n b[i++] = tmh >>> 24 & 0xf | 0x10; // include version\n b[i++] = tmh >>> 16 & 0xff;\n\n // `clock_seq_hi_and_reserved` (Per 4.2.2 - include variant)\n b[i++] = clockseq >>> 8 | 0x80;\n\n // `clock_seq_low`\n b[i++] = clockseq & 0xff;\n\n // `node`\n for (var n = 0; n < 6; ++n) {\n b[i + n] = node[n];\n }\n\n return buf ? buf : bytesToUuid(b);\n}\n\nmodule.exports = v1;\n","var rng = require('./lib/rng');\nvar bytesToUuid = require('./lib/bytesToUuid');\n\nfunction v4(options, buf, offset) {\n var i = buf && offset || 0;\n\n if (typeof(options) == 'string') {\n buf = options === 'binary' ? new Array(16) : null;\n options = null;\n }\n options = options || {};\n\n var rnds = options.random || (options.rng || rng)();\n\n // Per 4.4, set bits for version and `clock_seq_hi_and_reserved`\n rnds[6] = (rnds[6] & 0x0f) | 0x40;\n rnds[8] = (rnds[8] & 0x3f) | 0x80;\n\n // Copy bytes to buffer, if provided\n if (buf) {\n for (var ii = 0; ii < 16; ++ii) {\n buf[i + ii] = rnds[ii];\n }\n }\n\n return buf || bytesToUuid(rnds);\n}\n\nmodule.exports = v4;\n","/*\n * verror.js: richer JavaScript errors\n */\n\nvar mod_assertplus = require('assert-plus');\nvar mod_util = require('util');\n\nvar mod_extsprintf = require('extsprintf');\nvar mod_isError = require('core-util-is').isError;\nvar sprintf = mod_extsprintf.sprintf;\n\n/*\n * Public interface\n */\n\n/* So you can 'var VError = require('verror')' */\nmodule.exports = VError;\n/* For compatibility */\nVError.VError = VError;\n/* Other exported classes */\nVError.SError = SError;\nVError.WError = WError;\nVError.MultiError = MultiError;\n\n/*\n * Common function used to parse constructor arguments for VError, WError, and\n * SError. Named arguments to this function:\n *\n * strict\t\tforce strict interpretation of sprintf arguments, even\n * \t\t\tif the options in \"argv\" don't say so\n *\n * argv\t\terror's constructor arguments, which are to be\n * \t\t\tinterpreted as described in README.md. For quick\n * \t\t\treference, \"argv\" has one of the following forms:\n *\n * [ sprintf_args... ] (argv[0] is a string)\n * [ cause, sprintf_args... ] (argv[0] is an Error)\n * [ options, sprintf_args... ] (argv[0] is an object)\n *\n * This function normalizes these forms, producing an object with the following\n * properties:\n *\n * options equivalent to \"options\" in third form. This will never\n * \t\t\tbe a direct reference to what the caller passed in\n * \t\t\t(i.e., it may be a shallow copy), so it can be freely\n * \t\t\tmodified.\n *\n * shortmessage result of sprintf(sprintf_args), taking options.strict\n * \t\t\tinto account as described in README.md.\n */\nfunction parseConstructorArguments(args)\n{\n\tvar argv, options, sprintf_args, shortmessage, k;\n\n\tmod_assertplus.object(args, 'args');\n\tmod_assertplus.bool(args.strict, 'args.strict');\n\tmod_assertplus.array(args.argv, 'args.argv');\n\targv = args.argv;\n\n\t/*\n\t * First, figure out which form of invocation we've been given.\n\t */\n\tif (argv.length === 0) {\n\t\toptions = {};\n\t\tsprintf_args = [];\n\t} else if (mod_isError(argv[0])) {\n\t\toptions = { 'cause': argv[0] };\n\t\tsprintf_args = argv.slice(1);\n\t} else if (typeof (argv[0]) === 'object') {\n\t\toptions = {};\n\t\tfor (k in argv[0]) {\n\t\t\toptions[k] = argv[0][k];\n\t\t}\n\t\tsprintf_args = argv.slice(1);\n\t} else {\n\t\tmod_assertplus.string(argv[0],\n\t\t 'first argument to VError, SError, or WError ' +\n\t\t 'constructor must be a string, object, or Error');\n\t\toptions = {};\n\t\tsprintf_args = argv;\n\t}\n\n\t/*\n\t * Now construct the error's message.\n\t *\n\t * extsprintf (which we invoke here with our caller's arguments in order\n\t * to construct this Error's message) is strict in its interpretation of\n\t * values to be processed by the \"%s\" specifier. The value passed to\n\t * extsprintf must actually be a string or something convertible to a\n\t * String using .toString(). Passing other values (notably \"null\" and\n\t * \"undefined\") is considered a programmer error. The assumption is\n\t * that if you actually want to print the string \"null\" or \"undefined\",\n\t * then that's easy to do that when you're calling extsprintf; on the\n\t * other hand, if you did NOT want that (i.e., there's actually a bug\n\t * where the program assumes some variable is non-null and tries to\n\t * print it, which might happen when constructing a packet or file in\n\t * some specific format), then it's better to stop immediately than\n\t * produce bogus output.\n\t *\n\t * However, sometimes the bug is only in the code calling VError, and a\n\t * programmer might prefer to have the error message contain \"null\" or\n\t * \"undefined\" rather than have the bug in the error path crash the\n\t * program (making the first bug harder to identify). For that reason,\n\t * by default VError converts \"null\" or \"undefined\" arguments to their\n\t * string representations and passes those to extsprintf. Programmers\n\t * desiring the strict behavior can use the SError class or pass the\n\t * \"strict\" option to the VError constructor.\n\t */\n\tmod_assertplus.object(options);\n\tif (!options.strict && !args.strict) {\n\t\tsprintf_args = sprintf_args.map(function (a) {\n\t\t\treturn (a === null ? 'null' :\n\t\t\t a === undefined ? 'undefined' : a);\n\t\t});\n\t}\n\n\tif (sprintf_args.length === 0) {\n\t\tshortmessage = '';\n\t} else {\n\t\tshortmessage = sprintf.apply(null, sprintf_args);\n\t}\n\n\treturn ({\n\t 'options': options,\n\t 'shortmessage': shortmessage\n\t});\n}\n\n/*\n * See README.md for reference documentation.\n */\nfunction VError()\n{\n\tvar args, obj, parsed, cause, ctor, message, k;\n\n\targs = Array.prototype.slice.call(arguments, 0);\n\n\t/*\n\t * This is a regrettable pattern, but JavaScript's built-in Error class\n\t * is defined to work this way, so we allow the constructor to be called\n\t * without \"new\".\n\t */\n\tif (!(this instanceof VError)) {\n\t\tobj = Object.create(VError.prototype);\n\t\tVError.apply(obj, arguments);\n\t\treturn (obj);\n\t}\n\n\t/*\n\t * For convenience and backwards compatibility, we support several\n\t * different calling forms. Normalize them here.\n\t */\n\tparsed = parseConstructorArguments({\n\t 'argv': args,\n\t 'strict': false\n\t});\n\n\t/*\n\t * If we've been given a name, apply it now.\n\t */\n\tif (parsed.options.name) {\n\t\tmod_assertplus.string(parsed.options.name,\n\t\t 'error\\'s \"name\" must be a string');\n\t\tthis.name = parsed.options.name;\n\t}\n\n\t/*\n\t * For debugging, we keep track of the original short message (attached\n\t * this Error particularly) separately from the complete message (which\n\t * includes the messages of our cause chain).\n\t */\n\tthis.jse_shortmsg = parsed.shortmessage;\n\tmessage = parsed.shortmessage;\n\n\t/*\n\t * If we've been given a cause, record a reference to it and update our\n\t * message appropriately.\n\t */\n\tcause = parsed.options.cause;\n\tif (cause) {\n\t\tmod_assertplus.ok(mod_isError(cause), 'cause is not an Error');\n\t\tthis.jse_cause = cause;\n\n\t\tif (!parsed.options.skipCauseMessage) {\n\t\t\tmessage += ': ' + cause.message;\n\t\t}\n\t}\n\n\t/*\n\t * If we've been given an object with properties, shallow-copy that\n\t * here. We don't want to use a deep copy in case there are non-plain\n\t * objects here, but we don't want to use the original object in case\n\t * the caller modifies it later.\n\t */\n\tthis.jse_info = {};\n\tif (parsed.options.info) {\n\t\tfor (k in parsed.options.info) {\n\t\t\tthis.jse_info[k] = parsed.options.info[k];\n\t\t}\n\t}\n\n\tthis.message = message;\n\tError.call(this, message);\n\n\tif (Error.captureStackTrace) {\n\t\tctor = parsed.options.constructorOpt || this.constructor;\n\t\tError.captureStackTrace(this, ctor);\n\t}\n\n\treturn (this);\n}\n\nmod_util.inherits(VError, Error);\nVError.prototype.name = 'VError';\n\nVError.prototype.toString = function ve_toString()\n{\n\tvar str = (this.hasOwnProperty('name') && this.name ||\n\t\tthis.constructor.name || this.constructor.prototype.name);\n\tif (this.message)\n\t\tstr += ': ' + this.message;\n\n\treturn (str);\n};\n\n/*\n * This method is provided for compatibility. New callers should use\n * VError.cause() instead. That method also uses the saner `null` return value\n * when there is no cause.\n */\nVError.prototype.cause = function ve_cause()\n{\n\tvar cause = VError.cause(this);\n\treturn (cause === null ? undefined : cause);\n};\n\n/*\n * Static methods\n *\n * These class-level methods are provided so that callers can use them on\n * instances of Errors that are not VErrors. New interfaces should be provided\n * only using static methods to eliminate the class of programming mistake where\n * people fail to check whether the Error object has the corresponding methods.\n */\n\nVError.cause = function (err)\n{\n\tmod_assertplus.ok(mod_isError(err), 'err must be an Error');\n\treturn (mod_isError(err.jse_cause) ? err.jse_cause : null);\n};\n\nVError.info = function (err)\n{\n\tvar rv, cause, k;\n\n\tmod_assertplus.ok(mod_isError(err), 'err must be an Error');\n\tcause = VError.cause(err);\n\tif (cause !== null) {\n\t\trv = VError.info(cause);\n\t} else {\n\t\trv = {};\n\t}\n\n\tif (typeof (err.jse_info) == 'object' && err.jse_info !== null) {\n\t\tfor (k in err.jse_info) {\n\t\t\trv[k] = err.jse_info[k];\n\t\t}\n\t}\n\n\treturn (rv);\n};\n\nVError.findCauseByName = function (err, name)\n{\n\tvar cause;\n\n\tmod_assertplus.ok(mod_isError(err), 'err must be an Error');\n\tmod_assertplus.string(name, 'name');\n\tmod_assertplus.ok(name.length > 0, 'name cannot be empty');\n\n\tfor (cause = err; cause !== null; cause = VError.cause(cause)) {\n\t\tmod_assertplus.ok(mod_isError(cause));\n\t\tif (cause.name == name) {\n\t\t\treturn (cause);\n\t\t}\n\t}\n\n\treturn (null);\n};\n\nVError.hasCauseWithName = function (err, name)\n{\n\treturn (VError.findCauseByName(err, name) !== null);\n};\n\nVError.fullStack = function (err)\n{\n\tmod_assertplus.ok(mod_isError(err), 'err must be an Error');\n\n\tvar cause = VError.cause(err);\n\n\tif (cause) {\n\t\treturn (err.stack + '\\ncaused by: ' + VError.fullStack(cause));\n\t}\n\n\treturn (err.stack);\n};\n\nVError.errorFromList = function (errors)\n{\n\tmod_assertplus.arrayOfObject(errors, 'errors');\n\n\tif (errors.length === 0) {\n\t\treturn (null);\n\t}\n\n\terrors.forEach(function (e) {\n\t\tmod_assertplus.ok(mod_isError(e));\n\t});\n\n\tif (errors.length == 1) {\n\t\treturn (errors[0]);\n\t}\n\n\treturn (new MultiError(errors));\n};\n\nVError.errorForEach = function (err, func)\n{\n\tmod_assertplus.ok(mod_isError(err), 'err must be an Error');\n\tmod_assertplus.func(func, 'func');\n\n\tif (err instanceof MultiError) {\n\t\terr.errors().forEach(function iterError(e) { func(e); });\n\t} else {\n\t\tfunc(err);\n\t}\n};\n\n\n/*\n * SError is like VError, but stricter about types. You cannot pass \"null\" or\n * \"undefined\" as string arguments to the formatter.\n */\nfunction SError()\n{\n\tvar args, obj, parsed, options;\n\n\targs = Array.prototype.slice.call(arguments, 0);\n\tif (!(this instanceof SError)) {\n\t\tobj = Object.create(SError.prototype);\n\t\tSError.apply(obj, arguments);\n\t\treturn (obj);\n\t}\n\n\tparsed = parseConstructorArguments({\n\t 'argv': args,\n\t 'strict': true\n\t});\n\n\toptions = parsed.options;\n\tVError.call(this, options, '%s', parsed.shortmessage);\n\n\treturn (this);\n}\n\n/*\n * We don't bother setting SError.prototype.name because once constructed,\n * SErrors are just like VErrors.\n */\nmod_util.inherits(SError, VError);\n\n\n/*\n * Represents a collection of errors for the purpose of consumers that generally\n * only deal with one error. Callers can extract the individual errors\n * contained in this object, but may also just treat it as a normal single\n * error, in which case a summary message will be printed.\n */\nfunction MultiError(errors)\n{\n\tmod_assertplus.array(errors, 'list of errors');\n\tmod_assertplus.ok(errors.length > 0, 'must be at least one error');\n\tthis.ase_errors = errors;\n\n\tVError.call(this, {\n\t 'cause': errors[0]\n\t}, 'first of %d error%s', errors.length, errors.length == 1 ? '' : 's');\n}\n\nmod_util.inherits(MultiError, VError);\nMultiError.prototype.name = 'MultiError';\n\nMultiError.prototype.errors = function me_errors()\n{\n\treturn (this.ase_errors.slice(0));\n};\n\n\n/*\n * See README.md for reference details.\n */\nfunction WError()\n{\n\tvar args, obj, parsed, options;\n\n\targs = Array.prototype.slice.call(arguments, 0);\n\tif (!(this instanceof WError)) {\n\t\tobj = Object.create(WError.prototype);\n\t\tWError.apply(obj, args);\n\t\treturn (obj);\n\t}\n\n\tparsed = parseConstructorArguments({\n\t 'argv': args,\n\t 'strict': false\n\t});\n\n\toptions = parsed.options;\n\toptions['skipCauseMessage'] = true;\n\tVError.call(this, options, '%s', parsed.shortmessage);\n\n\treturn (this);\n}\n\nmod_util.inherits(WError, VError);\nWError.prototype.name = 'WError';\n\nWError.prototype.toString = function we_toString()\n{\n\tvar str = (this.hasOwnProperty('name') && this.name ||\n\t\tthis.constructor.name || this.constructor.prototype.name);\n\tif (this.message)\n\t\tstr += ': ' + this.message;\n\tif (this.jse_cause && this.jse_cause.message)\n\t\tstr += '; caused by ' + this.jse_cause.toString();\n\n\treturn (str);\n};\n\n/*\n * For purely historical reasons, WError's cause() function allows you to set\n * the cause.\n */\nWError.prototype.cause = function we_cause(c)\n{\n\tif (mod_isError(c))\n\t\tthis.jse_cause = c;\n\n\treturn (this.jse_cause);\n};\n","/*\n * extsprintf.js: extended POSIX-style sprintf\n */\n\nvar mod_assert = require('assert');\nvar mod_util = require('util');\n\n/*\n * Public interface\n */\nexports.sprintf = jsSprintf;\nexports.printf = jsPrintf;\nexports.fprintf = jsFprintf;\n\n/*\n * Stripped down version of s[n]printf(3c). We make a best effort to throw an\n * exception when given a format string we don't understand, rather than\n * ignoring it, so that we won't break existing programs if/when we go implement\n * the rest of this.\n *\n * This implementation currently supports specifying\n *\t- field alignment ('-' flag),\n * \t- zero-pad ('0' flag)\n *\t- always show numeric sign ('+' flag),\n *\t- field width\n *\t- conversions for strings, decimal integers, and floats (numbers).\n *\t- argument size specifiers. These are all accepted but ignored, since\n *\t Javascript has no notion of the physical size of an argument.\n *\n * Everything else is currently unsupported, most notably precision, unsigned\n * numbers, non-decimal numbers, and characters.\n */\nfunction jsSprintf(ofmt)\n{\n\tvar regex = [\n\t '([^%]*)',\t\t\t\t/* normal text */\n\t '%',\t\t\t\t/* start of format */\n\t '([\\'\\\\-+ #0]*?)',\t\t\t/* flags (optional) */\n\t '([1-9]\\\\d*)?',\t\t\t/* width (optional) */\n\t '(\\\\.([1-9]\\\\d*))?',\t\t/* precision (optional) */\n\t '[lhjztL]*?',\t\t\t/* length mods (ignored) */\n\t '([diouxXfFeEgGaAcCsSp%jr])'\t/* conversion */\n\t].join('');\n\n\tvar re = new RegExp(regex);\n\n\t/* variadic arguments used to fill in conversion specifiers */\n\tvar args = Array.prototype.slice.call(arguments, 1);\n\t/* remaining format string */\n\tvar fmt = ofmt;\n\n\t/* components of the current conversion specifier */\n\tvar flags, width, precision, conversion;\n\tvar left, pad, sign, arg, match;\n\n\t/* return value */\n\tvar ret = '';\n\n\t/* current variadic argument (1-based) */\n\tvar argn = 1;\n\t/* 0-based position in the format string that we've read */\n\tvar posn = 0;\n\t/* 1-based position in the format string of the current conversion */\n\tvar convposn;\n\t/* current conversion specifier */\n\tvar curconv;\n\n\tmod_assert.equal('string', typeof (fmt),\n\t 'first argument must be a format string');\n\n\twhile ((match = re.exec(fmt)) !== null) {\n\t\tret += match[1];\n\t\tfmt = fmt.substring(match[0].length);\n\n\t\t/*\n\t\t * Update flags related to the current conversion specifier's\n\t\t * position so that we can report clear error messages.\n\t\t */\n\t\tcurconv = match[0].substring(match[1].length);\n\t\tconvposn = posn + match[1].length + 1;\n\t\tposn += match[0].length;\n\n\t\tflags = match[2] || '';\n\t\twidth = match[3] || 0;\n\t\tprecision = match[4] || '';\n\t\tconversion = match[6];\n\t\tleft = false;\n\t\tsign = false;\n\t\tpad = ' ';\n\n\t\tif (conversion == '%') {\n\t\t\tret += '%';\n\t\t\tcontinue;\n\t\t}\n\n\t\tif (args.length === 0) {\n\t\t\tthrow (jsError(ofmt, convposn, curconv,\n\t\t\t 'has no matching argument ' +\n\t\t\t '(too few arguments passed)'));\n\t\t}\n\n\t\targ = args.shift();\n\t\targn++;\n\n\t\tif (flags.match(/[\\' #]/)) {\n\t\t\tthrow (jsError(ofmt, convposn, curconv,\n\t\t\t 'uses unsupported flags'));\n\t\t}\n\n\t\tif (precision.length > 0) {\n\t\t\tthrow (jsError(ofmt, convposn, curconv,\n\t\t\t 'uses non-zero precision (not supported)'));\n\t\t}\n\n\t\tif (flags.match(/-/))\n\t\t\tleft = true;\n\n\t\tif (flags.match(/0/))\n\t\t\tpad = '0';\n\n\t\tif (flags.match(/\\+/))\n\t\t\tsign = true;\n\n\t\tswitch (conversion) {\n\t\tcase 's':\n\t\t\tif (arg === undefined || arg === null) {\n\t\t\t\tthrow (jsError(ofmt, convposn, curconv,\n\t\t\t\t 'attempted to print undefined or null ' +\n\t\t\t\t 'as a string (argument ' + argn + ' to ' +\n\t\t\t\t 'sprintf)'));\n\t\t\t}\n\t\t\tret += doPad(pad, width, left, arg.toString());\n\t\t\tbreak;\n\n\t\tcase 'd':\n\t\t\targ = Math.floor(arg);\n\t\t\t/*jsl:fallthru*/\n\t\tcase 'f':\n\t\t\tsign = sign && arg > 0 ? '+' : '';\n\t\t\tret += sign + doPad(pad, width, left,\n\t\t\t arg.toString());\n\t\t\tbreak;\n\n\t\tcase 'x':\n\t\t\tret += doPad(pad, width, left, arg.toString(16));\n\t\t\tbreak;\n\n\t\tcase 'j': /* non-standard */\n\t\t\tif (width === 0)\n\t\t\t\twidth = 10;\n\t\t\tret += mod_util.inspect(arg, false, width);\n\t\t\tbreak;\n\n\t\tcase 'r': /* non-standard */\n\t\t\tret += dumpException(arg);\n\t\t\tbreak;\n\n\t\tdefault:\n\t\t\tthrow (jsError(ofmt, convposn, curconv,\n\t\t\t 'is not supported'));\n\t\t}\n\t}\n\n\tret += fmt;\n\treturn (ret);\n}\n\nfunction jsError(fmtstr, convposn, curconv, reason) {\n\tmod_assert.equal(typeof (fmtstr), 'string');\n\tmod_assert.equal(typeof (curconv), 'string');\n\tmod_assert.equal(typeof (convposn), 'number');\n\tmod_assert.equal(typeof (reason), 'string');\n\treturn (new Error('format string \"' + fmtstr +\n\t '\": conversion specifier \"' + curconv + '\" at character ' +\n\t convposn + ' ' + reason));\n}\n\nfunction jsPrintf() {\n\tvar args = Array.prototype.slice.call(arguments);\n\targs.unshift(process.stdout);\n\tjsFprintf.apply(null, args);\n}\n\nfunction jsFprintf(stream) {\n\tvar args = Array.prototype.slice.call(arguments, 1);\n\treturn (stream.write(jsSprintf.apply(this, args)));\n}\n\nfunction doPad(chr, width, left, str)\n{\n\tvar ret = str;\n\n\twhile (ret.length < width) {\n\t\tif (left)\n\t\t\tret += chr;\n\t\telse\n\t\t\tret = chr + ret;\n\t}\n\n\treturn (ret);\n}\n\n/*\n * This function dumps long stack traces for exceptions having a cause() method.\n * See node-verror for an example.\n */\nfunction dumpException(ex)\n{\n\tvar ret;\n\n\tif (!(ex instanceof Error))\n\t\tthrow (new Error(jsSprintf('invalid type for %%r: %j', ex)));\n\n\t/* Note that V8 prepends \"ex.stack\" with ex.toString(). */\n\tret = 'EXCEPTION: ' + ex.constructor.name + ': ' + ex.stack;\n\n\tif (ex.cause && typeof (ex.cause) === 'function') {\n\t\tvar cex = ex.cause();\n\t\tif (cex) {\n\t\t\tret += '\\nCaused by: ' + dumpException(cex);\n\t\t}\n\t}\n\n\treturn (ret);\n}\n","// Returns a wrapper function that returns a wrapped callback\n// The wrapper function should do some stuff, and return a\n// presumably different callback function.\n// This makes sure that own properties are retained, so that\n// decorations and such are not lost along the way.\nmodule.exports = wrappy\nfunction wrappy (fn, cb) {\n if (fn && cb) return wrappy(fn)(cb)\n\n if (typeof fn !== 'function')\n throw new TypeError('need wrapper function')\n\n Object.keys(fn).forEach(function (k) {\n wrapper[k] = fn[k]\n })\n\n return wrapper\n\n function wrapper() {\n var args = new Array(arguments.length)\n for (var i = 0; i < args.length; i++) {\n args[i] = arguments[i]\n }\n var ret = fn.apply(this, args)\n var cb = args[args.length-1]\n if (typeof ret === 'function' && ret !== cb) {\n Object.keys(cb).forEach(function (k) {\n ret[k] = cb[k]\n })\n }\n return ret\n }\n}\n","'use strict';\n\nconst WebSocket = require('./lib/websocket');\n\nWebSocket.Server = require('./lib/websocket-server');\nWebSocket.Receiver = require('./lib/receiver');\nWebSocket.Sender = require('./lib/sender');\n\nmodule.exports = WebSocket;\n","'use strict';\n\nconst { EMPTY_BUFFER } = require('./constants');\n\n/**\n * Merges an array of buffers into a new buffer.\n *\n * @param {Buffer[]} list The array of buffers to concat\n * @param {Number} totalLength The total length of buffers in the list\n * @return {Buffer} The resulting buffer\n * @public\n */\nfunction concat(list, totalLength) {\n if (list.length === 0) return EMPTY_BUFFER;\n if (list.length === 1) return list[0];\n\n const target = Buffer.allocUnsafe(totalLength);\n var offset = 0;\n\n for (var i = 0; i < list.length; i++) {\n const buf = list[i];\n buf.copy(target, offset);\n offset += buf.length;\n }\n\n return target;\n}\n\n/**\n * Masks a buffer using the given mask.\n *\n * @param {Buffer} source The buffer to mask\n * @param {Buffer} mask The mask to use\n * @param {Buffer} output The buffer where to store the result\n * @param {Number} offset The offset at which to start writing\n * @param {Number} length The number of bytes to mask.\n * @public\n */\nfunction _mask(source, mask, output, offset, length) {\n for (var i = 0; i < length; i++) {\n output[offset + i] = source[i] ^ mask[i & 3];\n }\n}\n\n/**\n * Unmasks a buffer using the given mask.\n *\n * @param {Buffer} buffer The buffer to unmask\n * @param {Buffer} mask The mask to use\n * @public\n */\nfunction _unmask(buffer, mask) {\n // Required until https://github.com/nodejs/node/issues/9006 is resolved.\n const length = buffer.length;\n for (var i = 0; i < length; i++) {\n buffer[i] ^= mask[i & 3];\n }\n}\n\n/**\n * Converts a buffer to an `ArrayBuffer`.\n *\n * @param {Buffer} buf The buffer to convert\n * @return {ArrayBuffer} Converted buffer\n * @public\n */\nfunction toArrayBuffer(buf) {\n if (buf.byteLength === buf.buffer.byteLength) {\n return buf.buffer;\n }\n\n return buf.buffer.slice(buf.byteOffset, buf.byteOffset + buf.byteLength);\n}\n\n/**\n * Converts `data` to a `Buffer`.\n *\n * @param {*} data The data to convert\n * @return {Buffer} The buffer\n * @throws {TypeError}\n * @public\n */\nfunction toBuffer(data) {\n toBuffer.readOnly = true;\n\n if (Buffer.isBuffer(data)) return data;\n\n var buf;\n\n if (data instanceof ArrayBuffer) {\n buf = Buffer.from(data);\n } else if (ArrayBuffer.isView(data)) {\n buf = viewToBuffer(data);\n } else {\n buf = Buffer.from(data);\n toBuffer.readOnly = false;\n }\n\n return buf;\n}\n\n/**\n * Converts an `ArrayBuffer` view into a buffer.\n *\n * @param {(DataView|TypedArray)} view The view to convert\n * @return {Buffer} Converted view\n * @private\n */\nfunction viewToBuffer(view) {\n const buf = Buffer.from(view.buffer);\n\n if (view.byteLength !== view.buffer.byteLength) {\n return buf.slice(view.byteOffset, view.byteOffset + view.byteLength);\n }\n\n return buf;\n}\n\ntry {\n const bufferUtil = require('bufferutil');\n const bu = bufferUtil.BufferUtil || bufferUtil;\n\n module.exports = {\n concat,\n mask(source, mask, output, offset, length) {\n if (length < 48) _mask(source, mask, output, offset, length);\n else bu.mask(source, mask, output, offset, length);\n },\n toArrayBuffer,\n toBuffer,\n unmask(buffer, mask) {\n if (buffer.length < 32) _unmask(buffer, mask);\n else bu.unmask(buffer, mask);\n }\n };\n} catch (e) /* istanbul ignore next */ {\n module.exports = {\n concat,\n mask: _mask,\n toArrayBuffer,\n toBuffer,\n unmask: _unmask\n };\n}\n","'use strict';\n\nmodule.exports = {\n BINARY_TYPES: ['nodebuffer', 'arraybuffer', 'fragments'],\n GUID: '258EAFA5-E914-47DA-95CA-C5AB0DC85B11',\n kStatusCode: Symbol('status-code'),\n kWebSocket: Symbol('websocket'),\n EMPTY_BUFFER: Buffer.alloc(0),\n NOOP: () => {}\n};\n","'use strict';\n\n/**\n * Class representing an event.\n *\n * @private\n */\nclass Event {\n /**\n * Create a new `Event`.\n *\n * @param {String} type The name of the event\n * @param {Object} target A reference to the target to which the event was dispatched\n */\n constructor(type, target) {\n this.target = target;\n this.type = type;\n }\n}\n\n/**\n * Class representing a message event.\n *\n * @extends Event\n * @private\n */\nclass MessageEvent extends Event {\n /**\n * Create a new `MessageEvent`.\n *\n * @param {(String|Buffer|ArrayBuffer|Buffer[])} data The received data\n * @param {WebSocket} target A reference to the target to which the event was dispatched\n */\n constructor(data, target) {\n super('message', target);\n\n this.data = data;\n }\n}\n\n/**\n * Class representing a close event.\n *\n * @extends Event\n * @private\n */\nclass CloseEvent extends Event {\n /**\n * Create a new `CloseEvent`.\n *\n * @param {Number} code The status code explaining why the connection is being closed\n * @param {String} reason A human-readable string explaining why the connection is closing\n * @param {WebSocket} target A reference to the target to which the event was dispatched\n */\n constructor(code, reason, target) {\n super('close', target);\n\n this.wasClean = target._closeFrameReceived && target._closeFrameSent;\n this.reason = reason;\n this.code = code;\n }\n}\n\n/**\n * Class representing an open event.\n *\n * @extends Event\n * @private\n */\nclass OpenEvent extends Event {\n /**\n * Create a new `OpenEvent`.\n *\n * @param {WebSocket} target A reference to the target to which the event was dispatched\n */\n constructor(target) {\n super('open', target);\n }\n}\n\n/**\n * Class representing an error event.\n *\n * @extends Event\n * @private\n */\nclass ErrorEvent extends Event {\n /**\n * Create a new `ErrorEvent`.\n *\n * @param {Object} error The error that generated this event\n * @param {WebSocket} target A reference to the target to which the event was dispatched\n */\n constructor(error, target) {\n super('error', target);\n\n this.message = error.message;\n this.error = error;\n }\n}\n\n/**\n * This provides methods for emulating the `EventTarget` interface. It's not\n * meant to be used directly.\n *\n * @mixin\n */\nconst EventTarget = {\n /**\n * Register an event listener.\n *\n * @param {String} method A string representing the event type to listen for\n * @param {Function} listener The listener to add\n * @public\n */\n addEventListener(method, listener) {\n if (typeof listener !== 'function') return;\n\n function onMessage(data) {\n listener.call(this, new MessageEvent(data, this));\n }\n\n function onClose(code, message) {\n listener.call(this, new CloseEvent(code, message, this));\n }\n\n function onError(error) {\n listener.call(this, new ErrorEvent(error, this));\n }\n\n function onOpen() {\n listener.call(this, new OpenEvent(this));\n }\n\n if (method === 'message') {\n onMessage._listener = listener;\n this.on(method, onMessage);\n } else if (method === 'close') {\n onClose._listener = listener;\n this.on(method, onClose);\n } else if (method === 'error') {\n onError._listener = listener;\n this.on(method, onError);\n } else if (method === 'open') {\n onOpen._listener = listener;\n this.on(method, onOpen);\n } else {\n this.on(method, listener);\n }\n },\n\n /**\n * Remove an event listener.\n *\n * @param {String} method A string representing the event type to remove\n * @param {Function} listener The listener to remove\n * @public\n */\n removeEventListener(method, listener) {\n const listeners = this.listeners(method);\n\n for (var i = 0; i < listeners.length; i++) {\n if (listeners[i] === listener || listeners[i]._listener === listener) {\n this.removeListener(method, listeners[i]);\n }\n }\n }\n};\n\nmodule.exports = EventTarget;\n","'use strict';\n\n//\n// Allowed token characters:\n//\n// '!', '#', '$', '%', '&', ''', '*', '+', '-',\n// '.', 0-9, A-Z, '^', '_', '`', a-z, '|', '~'\n//\n// tokenChars[32] === 0 // ' '\n// tokenChars[33] === 1 // '!'\n// tokenChars[34] === 0 // '\"'\n// ...\n//\n// prettier-ignore\nconst tokenChars = [\n 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 0 - 15\n 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 16 - 31\n 0, 1, 0, 1, 1, 1, 1, 1, 0, 0, 1, 1, 0, 1, 1, 0, // 32 - 47\n 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, // 48 - 63\n 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 64 - 79\n 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 1, 1, // 80 - 95\n 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 96 - 111\n 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 0, 1, 0 // 112 - 127\n];\n\n/**\n * Adds an offer to the map of extension offers or a parameter to the map of\n * parameters.\n *\n * @param {Object} dest The map of extension offers or parameters\n * @param {String} name The extension or parameter name\n * @param {(Object|Boolean|String)} elem The extension parameters or the\n * parameter value\n * @private\n */\nfunction push(dest, name, elem) {\n if (Object.prototype.hasOwnProperty.call(dest, name)) dest[name].push(elem);\n else dest[name] = [elem];\n}\n\n/**\n * Parses the `Sec-WebSocket-Extensions` header into an object.\n *\n * @param {String} header The field value of the header\n * @return {Object} The parsed object\n * @public\n */\nfunction parse(header) {\n const offers = {};\n\n if (header === undefined || header === '') return offers;\n\n var params = {};\n var mustUnescape = false;\n var isEscaping = false;\n var inQuotes = false;\n var extensionName;\n var paramName;\n var start = -1;\n var end = -1;\n\n for (var i = 0; i < header.length; i++) {\n const code = header.charCodeAt(i);\n\n if (extensionName === undefined) {\n if (end === -1 && tokenChars[code] === 1) {\n if (start === -1) start = i;\n } else if (code === 0x20 /* ' ' */ || code === 0x09 /* '\\t' */) {\n if (end === -1 && start !== -1) end = i;\n } else if (code === 0x3b /* ';' */ || code === 0x2c /* ',' */) {\n if (start === -1) {\n throw new SyntaxError(`Unexpected character at index ${i}`);\n }\n\n if (end === -1) end = i;\n const name = header.slice(start, end);\n if (code === 0x2c) {\n push(offers, name, params);\n params = {};\n } else {\n extensionName = name;\n }\n\n start = end = -1;\n } else {\n throw new SyntaxError(`Unexpected character at index ${i}`);\n }\n } else if (paramName === undefined) {\n if (end === -1 && tokenChars[code] === 1) {\n if (start === -1) start = i;\n } else if (code === 0x20 || code === 0x09) {\n if (end === -1 && start !== -1) end = i;\n } else if (code === 0x3b || code === 0x2c) {\n if (start === -1) {\n throw new SyntaxError(`Unexpected character at index ${i}`);\n }\n\n if (end === -1) end = i;\n push(params, header.slice(start, end), true);\n if (code === 0x2c) {\n push(offers, extensionName, params);\n params = {};\n extensionName = undefined;\n }\n\n start = end = -1;\n } else if (code === 0x3d /* '=' */ && start !== -1 && end === -1) {\n paramName = header.slice(start, i);\n start = end = -1;\n } else {\n throw new SyntaxError(`Unexpected character at index ${i}`);\n }\n } else {\n //\n // The value of a quoted-string after unescaping must conform to the\n // token ABNF, so only token characters are valid.\n // Ref: https://tools.ietf.org/html/rfc6455#section-9.1\n //\n if (isEscaping) {\n if (tokenChars[code] !== 1) {\n throw new SyntaxError(`Unexpected character at index ${i}`);\n }\n if (start === -1) start = i;\n else if (!mustUnescape) mustUnescape = true;\n isEscaping = false;\n } else if (inQuotes) {\n if (tokenChars[code] === 1) {\n if (start === -1) start = i;\n } else if (code === 0x22 /* '\"' */ && start !== -1) {\n inQuotes = false;\n end = i;\n } else if (code === 0x5c /* '\\' */) {\n isEscaping = true;\n } else {\n throw new SyntaxError(`Unexpected character at index ${i}`);\n }\n } else if (code === 0x22 && header.charCodeAt(i - 1) === 0x3d) {\n inQuotes = true;\n } else if (end === -1 && tokenChars[code] === 1) {\n if (start === -1) start = i;\n } else if (start !== -1 && (code === 0x20 || code === 0x09)) {\n if (end === -1) end = i;\n } else if (code === 0x3b || code === 0x2c) {\n if (start === -1) {\n throw new SyntaxError(`Unexpected character at index ${i}`);\n }\n\n if (end === -1) end = i;\n var value = header.slice(start, end);\n if (mustUnescape) {\n value = value.replace(/\\\\/g, '');\n mustUnescape = false;\n }\n push(params, paramName, value);\n if (code === 0x2c) {\n push(offers, extensionName, params);\n params = {};\n extensionName = undefined;\n }\n\n paramName = undefined;\n start = end = -1;\n } else {\n throw new SyntaxError(`Unexpected character at index ${i}`);\n }\n }\n }\n\n if (start === -1 || inQuotes) {\n throw new SyntaxError('Unexpected end of input');\n }\n\n if (end === -1) end = i;\n const token = header.slice(start, end);\n if (extensionName === undefined) {\n push(offers, token, {});\n } else {\n if (paramName === undefined) {\n push(params, token, true);\n } else if (mustUnescape) {\n push(params, paramName, token.replace(/\\\\/g, ''));\n } else {\n push(params, paramName, token);\n }\n push(offers, extensionName, params);\n }\n\n return offers;\n}\n\n/**\n * Builds the `Sec-WebSocket-Extensions` header field value.\n *\n * @param {Object} extensions The map of extensions and parameters to format\n * @return {String} A string representing the given object\n * @public\n */\nfunction format(extensions) {\n return Object.keys(extensions)\n .map((extension) => {\n var configurations = extensions[extension];\n if (!Array.isArray(configurations)) configurations = [configurations];\n return configurations\n .map((params) => {\n return [extension]\n .concat(\n Object.keys(params).map((k) => {\n var values = params[k];\n if (!Array.isArray(values)) values = [values];\n return values\n .map((v) => (v === true ? k : `${k}=${v}`))\n .join('; ');\n })\n )\n .join('; ');\n })\n .join(', ');\n })\n .join(', ');\n}\n\nmodule.exports = { format, parse };\n","'use strict';\n\nconst Limiter = require('async-limiter');\nconst zlib = require('zlib');\n\nconst bufferUtil = require('./buffer-util');\nconst { kStatusCode, NOOP } = require('./constants');\n\nconst TRAILER = Buffer.from([0x00, 0x00, 0xff, 0xff]);\nconst EMPTY_BLOCK = Buffer.from([0x00]);\n\nconst kPerMessageDeflate = Symbol('permessage-deflate');\nconst kTotalLength = Symbol('total-length');\nconst kCallback = Symbol('callback');\nconst kBuffers = Symbol('buffers');\nconst kError = Symbol('error');\n\n//\n// We limit zlib concurrency, which prevents severe memory fragmentation\n// as documented in https://github.com/nodejs/node/issues/8871#issuecomment-250915913\n// and https://github.com/websockets/ws/issues/1202\n//\n// Intentionally global; it's the global thread pool that's an issue.\n//\nlet zlibLimiter;\n\n/**\n * permessage-deflate implementation.\n */\nclass PerMessageDeflate {\n /**\n * Creates a PerMessageDeflate instance.\n *\n * @param {Object} options Configuration options\n * @param {Boolean} options.serverNoContextTakeover Request/accept disabling\n * of server context takeover\n * @param {Boolean} options.clientNoContextTakeover Advertise/acknowledge\n * disabling of client context takeover\n * @param {(Boolean|Number)} options.serverMaxWindowBits Request/confirm the\n * use of a custom server window size\n * @param {(Boolean|Number)} options.clientMaxWindowBits Advertise support\n * for, or request, a custom client window size\n * @param {Object} options.zlibDeflateOptions Options to pass to zlib on deflate\n * @param {Object} options.zlibInflateOptions Options to pass to zlib on inflate\n * @param {Number} options.threshold Size (in bytes) below which messages\n * should not be compressed\n * @param {Number} options.concurrencyLimit The number of concurrent calls to\n * zlib\n * @param {Boolean} isServer Create the instance in either server or client\n * mode\n * @param {Number} maxPayload The maximum allowed message length\n */\n constructor(options, isServer, maxPayload) {\n this._maxPayload = maxPayload | 0;\n this._options = options || {};\n this._threshold =\n this._options.threshold !== undefined ? this._options.threshold : 1024;\n this._isServer = !!isServer;\n this._deflate = null;\n this._inflate = null;\n\n this.params = null;\n\n if (!zlibLimiter) {\n const concurrency =\n this._options.concurrencyLimit !== undefined\n ? this._options.concurrencyLimit\n : 10;\n zlibLimiter = new Limiter({ concurrency });\n }\n }\n\n /**\n * @type {String}\n */\n static get extensionName() {\n return 'permessage-deflate';\n }\n\n /**\n * Create an extension negotiation offer.\n *\n * @return {Object} Extension parameters\n * @public\n */\n offer() {\n const params = {};\n\n if (this._options.serverNoContextTakeover) {\n params.server_no_context_takeover = true;\n }\n if (this._options.clientNoContextTakeover) {\n params.client_no_context_takeover = true;\n }\n if (this._options.serverMaxWindowBits) {\n params.server_max_window_bits = this._options.serverMaxWindowBits;\n }\n if (this._options.clientMaxWindowBits) {\n params.client_max_window_bits = this._options.clientMaxWindowBits;\n } else if (this._options.clientMaxWindowBits == null) {\n params.client_max_window_bits = true;\n }\n\n return params;\n }\n\n /**\n * Accept an extension negotiation offer/response.\n *\n * @param {Array} configurations The extension negotiation offers/reponse\n * @return {Object} Accepted configuration\n * @public\n */\n accept(configurations) {\n configurations = this.normalizeParams(configurations);\n\n this.params = this._isServer\n ? this.acceptAsServer(configurations)\n : this.acceptAsClient(configurations);\n\n return this.params;\n }\n\n /**\n * Releases all resources used by the extension.\n *\n * @public\n */\n cleanup() {\n if (this._inflate) {\n this._inflate.close();\n this._inflate = null;\n }\n\n if (this._deflate) {\n this._deflate.close();\n this._deflate = null;\n }\n }\n\n /**\n * Accept an extension negotiation offer.\n *\n * @param {Array} offers The extension negotiation offers\n * @return {Object} Accepted configuration\n * @private\n */\n acceptAsServer(offers) {\n const opts = this._options;\n const accepted = offers.find((params) => {\n if (\n (opts.serverNoContextTakeover === false &&\n params.server_no_context_takeover) ||\n (params.server_max_window_bits &&\n (opts.serverMaxWindowBits === false ||\n (typeof opts.serverMaxWindowBits === 'number' &&\n opts.serverMaxWindowBits > params.server_max_window_bits))) ||\n (typeof opts.clientMaxWindowBits === 'number' &&\n !params.client_max_window_bits)\n ) {\n return false;\n }\n\n return true;\n });\n\n if (!accepted) {\n throw new Error('None of the extension offers can be accepted');\n }\n\n if (opts.serverNoContextTakeover) {\n accepted.server_no_context_takeover = true;\n }\n if (opts.clientNoContextTakeover) {\n accepted.client_no_context_takeover = true;\n }\n if (typeof opts.serverMaxWindowBits === 'number') {\n accepted.server_max_window_bits = opts.serverMaxWindowBits;\n }\n if (typeof opts.clientMaxWindowBits === 'number') {\n accepted.client_max_window_bits = opts.clientMaxWindowBits;\n } else if (\n accepted.client_max_window_bits === true ||\n opts.clientMaxWindowBits === false\n ) {\n delete accepted.client_max_window_bits;\n }\n\n return accepted;\n }\n\n /**\n * Accept the extension negotiation response.\n *\n * @param {Array} response The extension negotiation response\n * @return {Object} Accepted configuration\n * @private\n */\n acceptAsClient(response) {\n const params = response[0];\n\n if (\n this._options.clientNoContextTakeover === false &&\n params.client_no_context_takeover\n ) {\n throw new Error('Unexpected parameter \"client_no_context_takeover\"');\n }\n\n if (!params.client_max_window_bits) {\n if (typeof this._options.clientMaxWindowBits === 'number') {\n params.client_max_window_bits = this._options.clientMaxWindowBits;\n }\n } else if (\n this._options.clientMaxWindowBits === false ||\n (typeof this._options.clientMaxWindowBits === 'number' &&\n params.client_max_window_bits > this._options.clientMaxWindowBits)\n ) {\n throw new Error(\n 'Unexpected or invalid parameter \"client_max_window_bits\"'\n );\n }\n\n return params;\n }\n\n /**\n * Normalize parameters.\n *\n * @param {Array} configurations The extension negotiation offers/reponse\n * @return {Array} The offers/response with normalized parameters\n * @private\n */\n normalizeParams(configurations) {\n configurations.forEach((params) => {\n Object.keys(params).forEach((key) => {\n var value = params[key];\n\n if (value.length > 1) {\n throw new Error(`Parameter \"${key}\" must have only a single value`);\n }\n\n value = value[0];\n\n if (key === 'client_max_window_bits') {\n if (value !== true) {\n const num = +value;\n if (!Number.isInteger(num) || num < 8 || num > 15) {\n throw new TypeError(\n `Invalid value for parameter \"${key}\": ${value}`\n );\n }\n value = num;\n } else if (!this._isServer) {\n throw new TypeError(\n `Invalid value for parameter \"${key}\": ${value}`\n );\n }\n } else if (key === 'server_max_window_bits') {\n const num = +value;\n if (!Number.isInteger(num) || num < 8 || num > 15) {\n throw new TypeError(\n `Invalid value for parameter \"${key}\": ${value}`\n );\n }\n value = num;\n } else if (\n key === 'client_no_context_takeover' ||\n key === 'server_no_context_takeover'\n ) {\n if (value !== true) {\n throw new TypeError(\n `Invalid value for parameter \"${key}\": ${value}`\n );\n }\n } else {\n throw new Error(`Unknown parameter \"${key}\"`);\n }\n\n params[key] = value;\n });\n });\n\n return configurations;\n }\n\n /**\n * Decompress data. Concurrency limited by async-limiter.\n *\n * @param {Buffer} data Compressed data\n * @param {Boolean} fin Specifies whether or not this is the last fragment\n * @param {Function} callback Callback\n * @public\n */\n decompress(data, fin, callback) {\n zlibLimiter.push((done) => {\n this._decompress(data, fin, (err, result) => {\n done();\n callback(err, result);\n });\n });\n }\n\n /**\n * Compress data. Concurrency limited by async-limiter.\n *\n * @param {Buffer} data Data to compress\n * @param {Boolean} fin Specifies whether or not this is the last fragment\n * @param {Function} callback Callback\n * @public\n */\n compress(data, fin, callback) {\n zlibLimiter.push((done) => {\n this._compress(data, fin, (err, result) => {\n done();\n callback(err, result);\n });\n });\n }\n\n /**\n * Decompress data.\n *\n * @param {Buffer} data Compressed data\n * @param {Boolean} fin Specifies whether or not this is the last fragment\n * @param {Function} callback Callback\n * @private\n */\n _decompress(data, fin, callback) {\n const endpoint = this._isServer ? 'client' : 'server';\n\n if (!this._inflate) {\n const key = `${endpoint}_max_window_bits`;\n const windowBits =\n typeof this.params[key] !== 'number'\n ? zlib.Z_DEFAULT_WINDOWBITS\n : this.params[key];\n\n this._inflate = zlib.createInflateRaw(\n Object.assign({}, this._options.zlibInflateOptions, { windowBits })\n );\n this._inflate[kPerMessageDeflate] = this;\n this._inflate[kTotalLength] = 0;\n this._inflate[kBuffers] = [];\n this._inflate.on('error', inflateOnError);\n this._inflate.on('data', inflateOnData);\n }\n\n this._inflate[kCallback] = callback;\n\n this._inflate.write(data);\n if (fin) this._inflate.write(TRAILER);\n\n this._inflate.flush(() => {\n const err = this._inflate[kError];\n\n if (err) {\n this._inflate.close();\n this._inflate = null;\n callback(err);\n return;\n }\n\n const data = bufferUtil.concat(\n this._inflate[kBuffers],\n this._inflate[kTotalLength]\n );\n\n if (fin && this.params[`${endpoint}_no_context_takeover`]) {\n this._inflate.close();\n this._inflate = null;\n } else {\n this._inflate[kTotalLength] = 0;\n this._inflate[kBuffers] = [];\n }\n\n callback(null, data);\n });\n }\n\n /**\n * Compress data.\n *\n * @param {Buffer} data Data to compress\n * @param {Boolean} fin Specifies whether or not this is the last fragment\n * @param {Function} callback Callback\n * @private\n */\n _compress(data, fin, callback) {\n if (!data || data.length === 0) {\n process.nextTick(callback, null, EMPTY_BLOCK);\n return;\n }\n\n const endpoint = this._isServer ? 'server' : 'client';\n\n if (!this._deflate) {\n const key = `${endpoint}_max_window_bits`;\n const windowBits =\n typeof this.params[key] !== 'number'\n ? zlib.Z_DEFAULT_WINDOWBITS\n : this.params[key];\n\n this._deflate = zlib.createDeflateRaw(\n Object.assign({}, this._options.zlibDeflateOptions, { windowBits })\n );\n\n this._deflate[kTotalLength] = 0;\n this._deflate[kBuffers] = [];\n\n //\n // An `'error'` event is emitted, only on Node.js < 10.0.0, if the\n // `zlib.DeflateRaw` instance is closed while data is being processed.\n // This can happen if `PerMessageDeflate#cleanup()` is called at the wrong\n // time due to an abnormal WebSocket closure.\n //\n this._deflate.on('error', NOOP);\n this._deflate.on('data', deflateOnData);\n }\n\n this._deflate.write(data);\n this._deflate.flush(zlib.Z_SYNC_FLUSH, () => {\n if (!this._deflate) {\n //\n // This `if` statement is only needed for Node.js < 10.0.0 because as of\n // commit https://github.com/nodejs/node/commit/5e3f5164, the flush\n // callback is no longer called if the deflate stream is closed while\n // data is being processed.\n //\n return;\n }\n\n var data = bufferUtil.concat(\n this._deflate[kBuffers],\n this._deflate[kTotalLength]\n );\n\n if (fin) data = data.slice(0, data.length - 4);\n\n if (fin && this.params[`${endpoint}_no_context_takeover`]) {\n this._deflate.close();\n this._deflate = null;\n } else {\n this._deflate[kTotalLength] = 0;\n this._deflate[kBuffers] = [];\n }\n\n callback(null, data);\n });\n }\n}\n\nmodule.exports = PerMessageDeflate;\n\n/**\n * The listener of the `zlib.DeflateRaw` stream `'data'` event.\n *\n * @param {Buffer} chunk A chunk of data\n * @private\n */\nfunction deflateOnData(chunk) {\n this[kBuffers].push(chunk);\n this[kTotalLength] += chunk.length;\n}\n\n/**\n * The listener of the `zlib.InflateRaw` stream `'data'` event.\n *\n * @param {Buffer} chunk A chunk of data\n * @private\n */\nfunction inflateOnData(chunk) {\n this[kTotalLength] += chunk.length;\n\n if (\n this[kPerMessageDeflate]._maxPayload < 1 ||\n this[kTotalLength] <= this[kPerMessageDeflate]._maxPayload\n ) {\n this[kBuffers].push(chunk);\n return;\n }\n\n this[kError] = new RangeError('Max payload size exceeded');\n this[kError][kStatusCode] = 1009;\n this.removeListener('data', inflateOnData);\n this.reset();\n}\n\n/**\n * The listener of the `zlib.InflateRaw` stream `'error'` event.\n *\n * @param {Error} err The emitted error\n * @private\n */\nfunction inflateOnError(err) {\n //\n // There is no need to call `Zlib#close()` as the handle is automatically\n // closed when an error is emitted.\n //\n this[kPerMessageDeflate]._inflate = null;\n err[kStatusCode] = 1007;\n this[kCallback](err);\n}\n","'use strict';\n\nconst { Writable } = require('stream');\n\nconst PerMessageDeflate = require('./permessage-deflate');\nconst {\n BINARY_TYPES,\n EMPTY_BUFFER,\n kStatusCode,\n kWebSocket\n} = require('./constants');\nconst { concat, toArrayBuffer, unmask } = require('./buffer-util');\nconst { isValidStatusCode, isValidUTF8 } = require('./validation');\n\nconst GET_INFO = 0;\nconst GET_PAYLOAD_LENGTH_16 = 1;\nconst GET_PAYLOAD_LENGTH_64 = 2;\nconst GET_MASK = 3;\nconst GET_DATA = 4;\nconst INFLATING = 5;\n\n/**\n * HyBi Receiver implementation.\n *\n * @extends stream.Writable\n */\nclass Receiver extends Writable {\n /**\n * Creates a Receiver instance.\n *\n * @param {String} binaryType The type for binary data\n * @param {Object} extensions An object containing the negotiated extensions\n * @param {Number} maxPayload The maximum allowed message length\n */\n constructor(binaryType, extensions, maxPayload) {\n super();\n\n this._binaryType = binaryType || BINARY_TYPES[0];\n this[kWebSocket] = undefined;\n this._extensions = extensions || {};\n this._maxPayload = maxPayload | 0;\n\n this._bufferedBytes = 0;\n this._buffers = [];\n\n this._compressed = false;\n this._payloadLength = 0;\n this._mask = undefined;\n this._fragmented = 0;\n this._masked = false;\n this._fin = false;\n this._opcode = 0;\n\n this._totalPayloadLength = 0;\n this._messageLength = 0;\n this._fragments = [];\n\n this._state = GET_INFO;\n this._loop = false;\n }\n\n /**\n * Implements `Writable.prototype._write()`.\n *\n * @param {Buffer} chunk The chunk of data to write\n * @param {String} encoding The character encoding of `chunk`\n * @param {Function} cb Callback\n */\n _write(chunk, encoding, cb) {\n if (this._opcode === 0x08 && this._state == GET_INFO) return cb();\n\n this._bufferedBytes += chunk.length;\n this._buffers.push(chunk);\n this.startLoop(cb);\n }\n\n /**\n * Consumes `n` bytes from the buffered data.\n *\n * @param {Number} n The number of bytes to consume\n * @return {Buffer} The consumed bytes\n * @private\n */\n consume(n) {\n this._bufferedBytes -= n;\n\n if (n === this._buffers[0].length) return this._buffers.shift();\n\n if (n < this._buffers[0].length) {\n const buf = this._buffers[0];\n this._buffers[0] = buf.slice(n);\n return buf.slice(0, n);\n }\n\n const dst = Buffer.allocUnsafe(n);\n\n do {\n const buf = this._buffers[0];\n\n if (n >= buf.length) {\n this._buffers.shift().copy(dst, dst.length - n);\n } else {\n buf.copy(dst, dst.length - n, 0, n);\n this._buffers[0] = buf.slice(n);\n }\n\n n -= buf.length;\n } while (n > 0);\n\n return dst;\n }\n\n /**\n * Starts the parsing loop.\n *\n * @param {Function} cb Callback\n * @private\n */\n startLoop(cb) {\n var err;\n this._loop = true;\n\n do {\n switch (this._state) {\n case GET_INFO:\n err = this.getInfo();\n break;\n case GET_PAYLOAD_LENGTH_16:\n err = this.getPayloadLength16();\n break;\n case GET_PAYLOAD_LENGTH_64:\n err = this.getPayloadLength64();\n break;\n case GET_MASK:\n this.getMask();\n break;\n case GET_DATA:\n err = this.getData(cb);\n break;\n default:\n // `INFLATING`\n this._loop = false;\n return;\n }\n } while (this._loop);\n\n cb(err);\n }\n\n /**\n * Reads the first two bytes of a frame.\n *\n * @return {(RangeError|undefined)} A possible error\n * @private\n */\n getInfo() {\n if (this._bufferedBytes < 2) {\n this._loop = false;\n return;\n }\n\n const buf = this.consume(2);\n\n if ((buf[0] & 0x30) !== 0x00) {\n this._loop = false;\n return error(RangeError, 'RSV2 and RSV3 must be clear', true, 1002);\n }\n\n const compressed = (buf[0] & 0x40) === 0x40;\n\n if (compressed && !this._extensions[PerMessageDeflate.extensionName]) {\n this._loop = false;\n return error(RangeError, 'RSV1 must be clear', true, 1002);\n }\n\n this._fin = (buf[0] & 0x80) === 0x80;\n this._opcode = buf[0] & 0x0f;\n this._payloadLength = buf[1] & 0x7f;\n\n if (this._opcode === 0x00) {\n if (compressed) {\n this._loop = false;\n return error(RangeError, 'RSV1 must be clear', true, 1002);\n }\n\n if (!this._fragmented) {\n this._loop = false;\n return error(RangeError, 'invalid opcode 0', true, 1002);\n }\n\n this._opcode = this._fragmented;\n } else if (this._opcode === 0x01 || this._opcode === 0x02) {\n if (this._fragmented) {\n this._loop = false;\n return error(RangeError, `invalid opcode ${this._opcode}`, true, 1002);\n }\n\n this._compressed = compressed;\n } else if (this._opcode > 0x07 && this._opcode < 0x0b) {\n if (!this._fin) {\n this._loop = false;\n return error(RangeError, 'FIN must be set', true, 1002);\n }\n\n if (compressed) {\n this._loop = false;\n return error(RangeError, 'RSV1 must be clear', true, 1002);\n }\n\n if (this._payloadLength > 0x7d) {\n this._loop = false;\n return error(\n RangeError,\n `invalid payload length ${this._payloadLength}`,\n true,\n 1002\n );\n }\n } else {\n this._loop = false;\n return error(RangeError, `invalid opcode ${this._opcode}`, true, 1002);\n }\n\n if (!this._fin && !this._fragmented) this._fragmented = this._opcode;\n this._masked = (buf[1] & 0x80) === 0x80;\n\n if (this._payloadLength === 126) this._state = GET_PAYLOAD_LENGTH_16;\n else if (this._payloadLength === 127) this._state = GET_PAYLOAD_LENGTH_64;\n else return this.haveLength();\n }\n\n /**\n * Gets extended payload length (7+16).\n *\n * @return {(RangeError|undefined)} A possible error\n * @private\n */\n getPayloadLength16() {\n if (this._bufferedBytes < 2) {\n this._loop = false;\n return;\n }\n\n this._payloadLength = this.consume(2).readUInt16BE(0);\n return this.haveLength();\n }\n\n /**\n * Gets extended payload length (7+64).\n *\n * @return {(RangeError|undefined)} A possible error\n * @private\n */\n getPayloadLength64() {\n if (this._bufferedBytes < 8) {\n this._loop = false;\n return;\n }\n\n const buf = this.consume(8);\n const num = buf.readUInt32BE(0);\n\n //\n // The maximum safe integer in JavaScript is 2^53 - 1. An error is returned\n // if payload length is greater than this number.\n //\n if (num > Math.pow(2, 53 - 32) - 1) {\n this._loop = false;\n return error(\n RangeError,\n 'Unsupported WebSocket frame: payload length > 2^53 - 1',\n false,\n 1009\n );\n }\n\n this._payloadLength = num * Math.pow(2, 32) + buf.readUInt32BE(4);\n return this.haveLength();\n }\n\n /**\n * Payload length has been read.\n *\n * @return {(RangeError|undefined)} A possible error\n * @private\n */\n haveLength() {\n if (this._payloadLength && this._opcode < 0x08) {\n this._totalPayloadLength += this._payloadLength;\n if (this._totalPayloadLength > this._maxPayload && this._maxPayload > 0) {\n this._loop = false;\n return error(RangeError, 'Max payload size exceeded', false, 1009);\n }\n }\n\n if (this._masked) this._state = GET_MASK;\n else this._state = GET_DATA;\n }\n\n /**\n * Reads mask bytes.\n *\n * @private\n */\n getMask() {\n if (this._bufferedBytes < 4) {\n this._loop = false;\n return;\n }\n\n this._mask = this.consume(4);\n this._state = GET_DATA;\n }\n\n /**\n * Reads data bytes.\n *\n * @param {Function} cb Callback\n * @return {(Error|RangeError|undefined)} A possible error\n * @private\n */\n getData(cb) {\n var data = EMPTY_BUFFER;\n\n if (this._payloadLength) {\n if (this._bufferedBytes < this._payloadLength) {\n this._loop = false;\n return;\n }\n\n data = this.consume(this._payloadLength);\n if (this._masked) unmask(data, this._mask);\n }\n\n if (this._opcode > 0x07) return this.controlMessage(data);\n\n if (this._compressed) {\n this._state = INFLATING;\n this.decompress(data, cb);\n return;\n }\n\n if (data.length) {\n //\n // This message is not compressed so its lenght is the sum of the payload\n // length of all fragments.\n //\n this._messageLength = this._totalPayloadLength;\n this._fragments.push(data);\n }\n\n return this.dataMessage();\n }\n\n /**\n * Decompresses data.\n *\n * @param {Buffer} data Compressed data\n * @param {Function} cb Callback\n * @private\n */\n decompress(data, cb) {\n const perMessageDeflate = this._extensions[PerMessageDeflate.extensionName];\n\n perMessageDeflate.decompress(data, this._fin, (err, buf) => {\n if (err) return cb(err);\n\n if (buf.length) {\n this._messageLength += buf.length;\n if (this._messageLength > this._maxPayload && this._maxPayload > 0) {\n return cb(\n error(RangeError, 'Max payload size exceeded', false, 1009)\n );\n }\n\n this._fragments.push(buf);\n }\n\n const er = this.dataMessage();\n if (er) return cb(er);\n\n this.startLoop(cb);\n });\n }\n\n /**\n * Handles a data message.\n *\n * @return {(Error|undefined)} A possible error\n * @private\n */\n dataMessage() {\n if (this._fin) {\n const messageLength = this._messageLength;\n const fragments = this._fragments;\n\n this._totalPayloadLength = 0;\n this._messageLength = 0;\n this._fragmented = 0;\n this._fragments = [];\n\n if (this._opcode === 2) {\n var data;\n\n if (this._binaryType === 'nodebuffer') {\n data = concat(fragments, messageLength);\n } else if (this._binaryType === 'arraybuffer') {\n data = toArrayBuffer(concat(fragments, messageLength));\n } else {\n data = fragments;\n }\n\n this.emit('message', data);\n } else {\n const buf = concat(fragments, messageLength);\n\n if (!isValidUTF8(buf)) {\n this._loop = false;\n return error(Error, 'invalid UTF-8 sequence', true, 1007);\n }\n\n this.emit('message', buf.toString());\n }\n }\n\n this._state = GET_INFO;\n }\n\n /**\n * Handles a control message.\n *\n * @param {Buffer} data Data to handle\n * @return {(Error|RangeError|undefined)} A possible error\n * @private\n */\n controlMessage(data) {\n if (this._opcode === 0x08) {\n this._loop = false;\n\n if (data.length === 0) {\n this.emit('conclude', 1005, '');\n this.end();\n } else if (data.length === 1) {\n return error(RangeError, 'invalid payload length 1', true, 1002);\n } else {\n const code = data.readUInt16BE(0);\n\n if (!isValidStatusCode(code)) {\n return error(RangeError, `invalid status code ${code}`, true, 1002);\n }\n\n const buf = data.slice(2);\n\n if (!isValidUTF8(buf)) {\n return error(Error, 'invalid UTF-8 sequence', true, 1007);\n }\n\n this.emit('conclude', code, buf.toString());\n this.end();\n }\n } else if (this._opcode === 0x09) {\n this.emit('ping', data);\n } else {\n this.emit('pong', data);\n }\n\n this._state = GET_INFO;\n }\n}\n\nmodule.exports = Receiver;\n\n/**\n * Builds an error object.\n *\n * @param {(Error|RangeError)} ErrorCtor The error constructor\n * @param {String} message The error message\n * @param {Boolean} prefix Specifies whether or not to add a default prefix to\n * `message`\n * @param {Number} statusCode The status code\n * @return {(Error|RangeError)} The error\n * @private\n */\nfunction error(ErrorCtor, message, prefix, statusCode) {\n const err = new ErrorCtor(\n prefix ? `Invalid WebSocket frame: ${message}` : message\n );\n\n Error.captureStackTrace(err, error);\n err[kStatusCode] = statusCode;\n return err;\n}\n","'use strict';\n\nconst { randomBytes } = require('crypto');\n\nconst PerMessageDeflate = require('./permessage-deflate');\nconst { EMPTY_BUFFER } = require('./constants');\nconst { isValidStatusCode } = require('./validation');\nconst { mask: applyMask, toBuffer } = require('./buffer-util');\n\n/**\n * HyBi Sender implementation.\n */\nclass Sender {\n /**\n * Creates a Sender instance.\n *\n * @param {net.Socket} socket The connection socket\n * @param {Object} extensions An object containing the negotiated extensions\n */\n constructor(socket, extensions) {\n this._extensions = extensions || {};\n this._socket = socket;\n\n this._firstFragment = true;\n this._compress = false;\n\n this._bufferedBytes = 0;\n this._deflating = false;\n this._queue = [];\n }\n\n /**\n * Frames a piece of data according to the HyBi WebSocket protocol.\n *\n * @param {Buffer} data The data to frame\n * @param {Object} options Options object\n * @param {Number} options.opcode The opcode\n * @param {Boolean} options.readOnly Specifies whether `data` can be modified\n * @param {Boolean} options.fin Specifies whether or not to set the FIN bit\n * @param {Boolean} options.mask Specifies whether or not to mask `data`\n * @param {Boolean} options.rsv1 Specifies whether or not to set the RSV1 bit\n * @return {Buffer[]} The framed data as a list of `Buffer` instances\n * @public\n */\n static frame(data, options) {\n const merge = options.mask && options.readOnly;\n var offset = options.mask ? 6 : 2;\n var payloadLength = data.length;\n\n if (data.length >= 65536) {\n offset += 8;\n payloadLength = 127;\n } else if (data.length > 125) {\n offset += 2;\n payloadLength = 126;\n }\n\n const target = Buffer.allocUnsafe(merge ? data.length + offset : offset);\n\n target[0] = options.fin ? options.opcode | 0x80 : options.opcode;\n if (options.rsv1) target[0] |= 0x40;\n\n target[1] = payloadLength;\n\n if (payloadLength === 126) {\n target.writeUInt16BE(data.length, 2);\n } else if (payloadLength === 127) {\n target.writeUInt32BE(0, 2);\n target.writeUInt32BE(data.length, 6);\n }\n\n if (!options.mask) return [target, data];\n\n const mask = randomBytes(4);\n\n target[1] |= 0x80;\n target[offset - 4] = mask[0];\n target[offset - 3] = mask[1];\n target[offset - 2] = mask[2];\n target[offset - 1] = mask[3];\n\n if (merge) {\n applyMask(data, mask, target, offset, data.length);\n return [target];\n }\n\n applyMask(data, mask, data, 0, data.length);\n return [target, data];\n }\n\n /**\n * Sends a close message to the other peer.\n *\n * @param {(Number|undefined)} code The status code component of the body\n * @param {String} data The message component of the body\n * @param {Boolean} mask Specifies whether or not to mask the message\n * @param {Function} cb Callback\n * @public\n */\n close(code, data, mask, cb) {\n var buf;\n\n if (code === undefined) {\n buf = EMPTY_BUFFER;\n } else if (typeof code !== 'number' || !isValidStatusCode(code)) {\n throw new TypeError('First argument must be a valid error code number');\n } else if (data === undefined || data === '') {\n buf = Buffer.allocUnsafe(2);\n buf.writeUInt16BE(code, 0);\n } else {\n buf = Buffer.allocUnsafe(2 + Buffer.byteLength(data));\n buf.writeUInt16BE(code, 0);\n buf.write(data, 2);\n }\n\n if (this._deflating) {\n this.enqueue([this.doClose, buf, mask, cb]);\n } else {\n this.doClose(buf, mask, cb);\n }\n }\n\n /**\n * Frames and sends a close message.\n *\n * @param {Buffer} data The message to send\n * @param {Boolean} mask Specifies whether or not to mask `data`\n * @param {Function} cb Callback\n * @private\n */\n doClose(data, mask, cb) {\n this.sendFrame(\n Sender.frame(data, {\n fin: true,\n rsv1: false,\n opcode: 0x08,\n mask,\n readOnly: false\n }),\n cb\n );\n }\n\n /**\n * Sends a ping message to the other peer.\n *\n * @param {*} data The message to send\n * @param {Boolean} mask Specifies whether or not to mask `data`\n * @param {Function} cb Callback\n * @public\n */\n ping(data, mask, cb) {\n const buf = toBuffer(data);\n\n if (this._deflating) {\n this.enqueue([this.doPing, buf, mask, toBuffer.readOnly, cb]);\n } else {\n this.doPing(buf, mask, toBuffer.readOnly, cb);\n }\n }\n\n /**\n * Frames and sends a ping message.\n *\n * @param {*} data The message to send\n * @param {Boolean} mask Specifies whether or not to mask `data`\n * @param {Boolean} readOnly Specifies whether `data` can be modified\n * @param {Function} cb Callback\n * @private\n */\n doPing(data, mask, readOnly, cb) {\n this.sendFrame(\n Sender.frame(data, {\n fin: true,\n rsv1: false,\n opcode: 0x09,\n mask,\n readOnly\n }),\n cb\n );\n }\n\n /**\n * Sends a pong message to the other peer.\n *\n * @param {*} data The message to send\n * @param {Boolean} mask Specifies whether or not to mask `data`\n * @param {Function} cb Callback\n * @public\n */\n pong(data, mask, cb) {\n const buf = toBuffer(data);\n\n if (this._deflating) {\n this.enqueue([this.doPong, buf, mask, toBuffer.readOnly, cb]);\n } else {\n this.doPong(buf, mask, toBuffer.readOnly, cb);\n }\n }\n\n /**\n * Frames and sends a pong message.\n *\n * @param {*} data The message to send\n * @param {Boolean} mask Specifies whether or not to mask `data`\n * @param {Boolean} readOnly Specifies whether `data` can be modified\n * @param {Function} cb Callback\n * @private\n */\n doPong(data, mask, readOnly, cb) {\n this.sendFrame(\n Sender.frame(data, {\n fin: true,\n rsv1: false,\n opcode: 0x0a,\n mask,\n readOnly\n }),\n cb\n );\n }\n\n /**\n * Sends a data message to the other peer.\n *\n * @param {*} data The message to send\n * @param {Object} options Options object\n * @param {Boolean} options.compress Specifies whether or not to compress `data`\n * @param {Boolean} options.binary Specifies whether `data` is binary or text\n * @param {Boolean} options.fin Specifies whether the fragment is the last one\n * @param {Boolean} options.mask Specifies whether or not to mask `data`\n * @param {Function} cb Callback\n * @public\n */\n send(data, options, cb) {\n const buf = toBuffer(data);\n const perMessageDeflate = this._extensions[PerMessageDeflate.extensionName];\n var opcode = options.binary ? 2 : 1;\n var rsv1 = options.compress;\n\n if (this._firstFragment) {\n this._firstFragment = false;\n if (rsv1 && perMessageDeflate) {\n rsv1 = buf.length >= perMessageDeflate._threshold;\n }\n this._compress = rsv1;\n } else {\n rsv1 = false;\n opcode = 0;\n }\n\n if (options.fin) this._firstFragment = true;\n\n if (perMessageDeflate) {\n const opts = {\n fin: options.fin,\n rsv1,\n opcode,\n mask: options.mask,\n readOnly: toBuffer.readOnly\n };\n\n if (this._deflating) {\n this.enqueue([this.dispatch, buf, this._compress, opts, cb]);\n } else {\n this.dispatch(buf, this._compress, opts, cb);\n }\n } else {\n this.sendFrame(\n Sender.frame(buf, {\n fin: options.fin,\n rsv1: false,\n opcode,\n mask: options.mask,\n readOnly: toBuffer.readOnly\n }),\n cb\n );\n }\n }\n\n /**\n * Dispatches a data message.\n *\n * @param {Buffer} data The message to send\n * @param {Boolean} compress Specifies whether or not to compress `data`\n * @param {Object} options Options object\n * @param {Number} options.opcode The opcode\n * @param {Boolean} options.readOnly Specifies whether `data` can be modified\n * @param {Boolean} options.fin Specifies whether or not to set the FIN bit\n * @param {Boolean} options.mask Specifies whether or not to mask `data`\n * @param {Boolean} options.rsv1 Specifies whether or not to set the RSV1 bit\n * @param {Function} cb Callback\n * @private\n */\n dispatch(data, compress, options, cb) {\n if (!compress) {\n this.sendFrame(Sender.frame(data, options), cb);\n return;\n }\n\n const perMessageDeflate = this._extensions[PerMessageDeflate.extensionName];\n\n this._deflating = true;\n perMessageDeflate.compress(data, options.fin, (_, buf) => {\n this._deflating = false;\n options.readOnly = false;\n this.sendFrame(Sender.frame(buf, options), cb);\n this.dequeue();\n });\n }\n\n /**\n * Executes queued send operations.\n *\n * @private\n */\n dequeue() {\n while (!this._deflating && this._queue.length) {\n const params = this._queue.shift();\n\n this._bufferedBytes -= params[1].length;\n params[0].apply(this, params.slice(1));\n }\n }\n\n /**\n * Enqueues a send operation.\n *\n * @param {Array} params Send operation parameters.\n * @private\n */\n enqueue(params) {\n this._bufferedBytes += params[1].length;\n this._queue.push(params);\n }\n\n /**\n * Sends a frame.\n *\n * @param {Buffer[]} list The frame to send\n * @param {Function} cb Callback\n * @private\n */\n sendFrame(list, cb) {\n if (list.length === 2) {\n this._socket.cork();\n this._socket.write(list[0]);\n this._socket.write(list[1], cb);\n this._socket.uncork();\n } else {\n this._socket.write(list[0], cb);\n }\n }\n}\n\nmodule.exports = Sender;\n","'use strict';\n\ntry {\n const isValidUTF8 = require('utf-8-validate');\n\n exports.isValidUTF8 =\n typeof isValidUTF8 === 'object'\n ? isValidUTF8.Validation.isValidUTF8 // utf-8-validate@<3.0.0\n : isValidUTF8;\n} catch (e) /* istanbul ignore next */ {\n exports.isValidUTF8 = () => true;\n}\n\n/**\n * Checks if a status code is allowed in a close frame.\n *\n * @param {Number} code The status code\n * @return {Boolean} `true` if the status code is valid, else `false`\n * @public\n */\nexports.isValidStatusCode = (code) => {\n return (\n (code >= 1000 &&\n code <= 1013 &&\n code !== 1004 &&\n code !== 1005 &&\n code !== 1006) ||\n (code >= 3000 && code <= 4999)\n );\n};\n","'use strict';\n\nconst EventEmitter = require('events');\nconst crypto = require('crypto');\nconst http = require('http');\n\nconst PerMessageDeflate = require('./permessage-deflate');\nconst extension = require('./extension');\nconst WebSocket = require('./websocket');\nconst { GUID } = require('./constants');\n\nconst keyRegex = /^[+/0-9A-Za-z]{22}==$/;\n\n/**\n * Class representing a WebSocket server.\n *\n * @extends EventEmitter\n */\nclass WebSocketServer extends EventEmitter {\n /**\n * Create a `WebSocketServer` instance.\n *\n * @param {Object} options Configuration options\n * @param {Number} options.backlog The maximum length of the queue of pending\n * connections\n * @param {Boolean} options.clientTracking Specifies whether or not to track\n * clients\n * @param {Function} options.handleProtocols An hook to handle protocols\n * @param {String} options.host The hostname where to bind the server\n * @param {Number} options.maxPayload The maximum allowed message size\n * @param {Boolean} options.noServer Enable no server mode\n * @param {String} options.path Accept only connections matching this path\n * @param {(Boolean|Object)} options.perMessageDeflate Enable/disable\n * permessage-deflate\n * @param {Number} options.port The port where to bind the server\n * @param {http.Server} options.server A pre-created HTTP/S server to use\n * @param {Function} options.verifyClient An hook to reject connections\n * @param {Function} callback A listener for the `listening` event\n */\n constructor(options, callback) {\n super();\n\n options = Object.assign(\n {\n maxPayload: 100 * 1024 * 1024,\n perMessageDeflate: false,\n handleProtocols: null,\n clientTracking: true,\n verifyClient: null,\n noServer: false,\n backlog: null, // use default (511 as implemented in net.js)\n server: null,\n host: null,\n path: null,\n port: null\n },\n options\n );\n\n if (options.port == null && !options.server && !options.noServer) {\n throw new TypeError(\n 'One of the \"port\", \"server\", or \"noServer\" options must be specified'\n );\n }\n\n if (options.port != null) {\n this._server = http.createServer((req, res) => {\n const body = http.STATUS_CODES[426];\n\n res.writeHead(426, {\n 'Content-Length': body.length,\n 'Content-Type': 'text/plain'\n });\n res.end(body);\n });\n this._server.listen(\n options.port,\n options.host,\n options.backlog,\n callback\n );\n } else if (options.server) {\n this._server = options.server;\n }\n\n if (this._server) {\n this._removeListeners = addListeners(this._server, {\n listening: this.emit.bind(this, 'listening'),\n error: this.emit.bind(this, 'error'),\n upgrade: (req, socket, head) => {\n this.handleUpgrade(req, socket, head, (ws) => {\n this.emit('connection', ws, req);\n });\n }\n });\n }\n\n if (options.perMessageDeflate === true) options.perMessageDeflate = {};\n if (options.clientTracking) this.clients = new Set();\n this.options = options;\n }\n\n /**\n * Returns the bound address, the address family name, and port of the server\n * as reported by the operating system if listening on an IP socket.\n * If the server is listening on a pipe or UNIX domain socket, the name is\n * returned as a string.\n *\n * @return {(Object|String|null)} The address of the server\n * @public\n */\n address() {\n if (this.options.noServer) {\n throw new Error('The server is operating in \"noServer\" mode');\n }\n\n if (!this._server) return null;\n return this._server.address();\n }\n\n /**\n * Close the server.\n *\n * @param {Function} cb Callback\n * @public\n */\n close(cb) {\n if (cb) this.once('close', cb);\n\n //\n // Terminate all associated clients.\n //\n if (this.clients) {\n for (const client of this.clients) client.terminate();\n }\n\n const server = this._server;\n\n if (server) {\n this._removeListeners();\n this._removeListeners = this._server = null;\n\n //\n // Close the http server if it was internally created.\n //\n if (this.options.port != null) {\n server.close(() => this.emit('close'));\n return;\n }\n }\n\n process.nextTick(emitClose, this);\n }\n\n /**\n * See if a given request should be handled by this server instance.\n *\n * @param {http.IncomingMessage} req Request object to inspect\n * @return {Boolean} `true` if the request is valid, else `false`\n * @public\n */\n shouldHandle(req) {\n if (this.options.path) {\n const index = req.url.indexOf('?');\n const pathname = index !== -1 ? req.url.slice(0, index) : req.url;\n\n if (pathname !== this.options.path) return false;\n }\n\n return true;\n }\n\n /**\n * Handle a HTTP Upgrade request.\n *\n * @param {http.IncomingMessage} req The request object\n * @param {net.Socket} socket The network socket between the server and client\n * @param {Buffer} head The first packet of the upgraded stream\n * @param {Function} cb Callback\n * @public\n */\n handleUpgrade(req, socket, head, cb) {\n socket.on('error', socketOnError);\n\n const key =\n req.headers['sec-websocket-key'] !== undefined\n ? req.headers['sec-websocket-key'].trim()\n : false;\n const version = +req.headers['sec-websocket-version'];\n const extensions = {};\n\n if (\n req.method !== 'GET' ||\n req.headers.upgrade.toLowerCase() !== 'websocket' ||\n !key ||\n !keyRegex.test(key) ||\n (version !== 8 && version !== 13) ||\n !this.shouldHandle(req)\n ) {\n return abortHandshake(socket, 400);\n }\n\n if (this.options.perMessageDeflate) {\n const perMessageDeflate = new PerMessageDeflate(\n this.options.perMessageDeflate,\n true,\n this.options.maxPayload\n );\n\n try {\n const offers = extension.parse(req.headers['sec-websocket-extensions']);\n\n if (offers[PerMessageDeflate.extensionName]) {\n perMessageDeflate.accept(offers[PerMessageDeflate.extensionName]);\n extensions[PerMessageDeflate.extensionName] = perMessageDeflate;\n }\n } catch (err) {\n return abortHandshake(socket, 400);\n }\n }\n\n //\n // Optionally call external client verification handler.\n //\n if (this.options.verifyClient) {\n const info = {\n origin:\n req.headers[`${version === 8 ? 'sec-websocket-origin' : 'origin'}`],\n secure: !!(req.connection.authorized || req.connection.encrypted),\n req\n };\n\n if (this.options.verifyClient.length === 2) {\n this.options.verifyClient(info, (verified, code, message, headers) => {\n if (!verified) {\n return abortHandshake(socket, code || 401, message, headers);\n }\n\n this.completeUpgrade(key, extensions, req, socket, head, cb);\n });\n return;\n }\n\n if (!this.options.verifyClient(info)) return abortHandshake(socket, 401);\n }\n\n this.completeUpgrade(key, extensions, req, socket, head, cb);\n }\n\n /**\n * Upgrade the connection to WebSocket.\n *\n * @param {String} key The value of the `Sec-WebSocket-Key` header\n * @param {Object} extensions The accepted extensions\n * @param {http.IncomingMessage} req The request object\n * @param {net.Socket} socket The network socket between the server and client\n * @param {Buffer} head The first packet of the upgraded stream\n * @param {Function} cb Callback\n * @private\n */\n completeUpgrade(key, extensions, req, socket, head, cb) {\n //\n // Destroy the socket if the client has already sent a FIN packet.\n //\n if (!socket.readable || !socket.writable) return socket.destroy();\n\n const digest = crypto\n .createHash('sha1')\n .update(key + GUID)\n .digest('base64');\n\n const headers = [\n 'HTTP/1.1 101 Switching Protocols',\n 'Upgrade: websocket',\n 'Connection: Upgrade',\n `Sec-WebSocket-Accept: ${digest}`\n ];\n\n const ws = new WebSocket(null);\n var protocol = req.headers['sec-websocket-protocol'];\n\n if (protocol) {\n protocol = protocol.trim().split(/ *, */);\n\n //\n // Optionally call external protocol selection handler.\n //\n if (this.options.handleProtocols) {\n protocol = this.options.handleProtocols(protocol, req);\n } else {\n protocol = protocol[0];\n }\n\n if (protocol) {\n headers.push(`Sec-WebSocket-Protocol: ${protocol}`);\n ws.protocol = protocol;\n }\n }\n\n if (extensions[PerMessageDeflate.extensionName]) {\n const params = extensions[PerMessageDeflate.extensionName].params;\n const value = extension.format({\n [PerMessageDeflate.extensionName]: [params]\n });\n headers.push(`Sec-WebSocket-Extensions: ${value}`);\n ws._extensions = extensions;\n }\n\n //\n // Allow external modification/inspection of handshake headers.\n //\n this.emit('headers', headers, req);\n\n socket.write(headers.concat('\\r\\n').join('\\r\\n'));\n socket.removeListener('error', socketOnError);\n\n ws.setSocket(socket, head, this.options.maxPayload);\n\n if (this.clients) {\n this.clients.add(ws);\n ws.on('close', () => this.clients.delete(ws));\n }\n\n cb(ws);\n }\n}\n\nmodule.exports = WebSocketServer;\n\n/**\n * Add event listeners on an `EventEmitter` using a map of \n * pairs.\n *\n * @param {EventEmitter} server The event emitter\n * @param {Object.} map The listeners to add\n * @return {Function} A function that will remove the added listeners when called\n * @private\n */\nfunction addListeners(server, map) {\n for (const event of Object.keys(map)) server.on(event, map[event]);\n\n return function removeListeners() {\n for (const event of Object.keys(map)) {\n server.removeListener(event, map[event]);\n }\n };\n}\n\n/**\n * Emit a `'close'` event on an `EventEmitter`.\n *\n * @param {EventEmitter} server The event emitter\n * @private\n */\nfunction emitClose(server) {\n server.emit('close');\n}\n\n/**\n * Handle premature socket errors.\n *\n * @private\n */\nfunction socketOnError() {\n this.destroy();\n}\n\n/**\n * Close the connection when preconditions are not fulfilled.\n *\n * @param {net.Socket} socket The socket of the upgrade request\n * @param {Number} code The HTTP response status code\n * @param {String} [message] The HTTP response body\n * @param {Object} [headers] Additional HTTP response headers\n * @private\n */\nfunction abortHandshake(socket, code, message, headers) {\n if (socket.writable) {\n message = message || http.STATUS_CODES[code];\n headers = Object.assign(\n {\n Connection: 'close',\n 'Content-type': 'text/html',\n 'Content-Length': Buffer.byteLength(message)\n },\n headers\n );\n\n socket.write(\n `HTTP/1.1 ${code} ${http.STATUS_CODES[code]}\\r\\n` +\n Object.keys(headers)\n .map((h) => `${h}: ${headers[h]}`)\n .join('\\r\\n') +\n '\\r\\n\\r\\n' +\n message\n );\n }\n\n socket.removeListener('error', socketOnError);\n socket.destroy();\n}\n","'use strict';\n\nconst EventEmitter = require('events');\nconst crypto = require('crypto');\nconst https = require('https');\nconst http = require('http');\nconst net = require('net');\nconst tls = require('tls');\nconst url = require('url');\n\nconst PerMessageDeflate = require('./permessage-deflate');\nconst EventTarget = require('./event-target');\nconst extension = require('./extension');\nconst Receiver = require('./receiver');\nconst Sender = require('./sender');\nconst {\n BINARY_TYPES,\n EMPTY_BUFFER,\n GUID,\n kStatusCode,\n kWebSocket,\n NOOP\n} = require('./constants');\n\nconst readyStates = ['CONNECTING', 'OPEN', 'CLOSING', 'CLOSED'];\nconst protocolVersions = [8, 13];\nconst closeTimeout = 30 * 1000;\n\n/**\n * Class representing a WebSocket.\n *\n * @extends EventEmitter\n */\nclass WebSocket extends EventEmitter {\n /**\n * Create a new `WebSocket`.\n *\n * @param {(String|url.Url|url.URL)} address The URL to which to connect\n * @param {(String|String[])} protocols The subprotocols\n * @param {Object} options Connection options\n */\n constructor(address, protocols, options) {\n super();\n\n this.readyState = WebSocket.CONNECTING;\n this.protocol = '';\n\n this._binaryType = BINARY_TYPES[0];\n this._closeFrameReceived = false;\n this._closeFrameSent = false;\n this._closeMessage = '';\n this._closeTimer = null;\n this._closeCode = 1006;\n this._extensions = {};\n this._receiver = null;\n this._sender = null;\n this._socket = null;\n\n if (address !== null) {\n this._isServer = false;\n this._redirects = 0;\n\n if (Array.isArray(protocols)) {\n protocols = protocols.join(', ');\n } else if (typeof protocols === 'object' && protocols !== null) {\n options = protocols;\n protocols = undefined;\n }\n\n initAsClient(this, address, protocols, options);\n } else {\n this._isServer = true;\n }\n }\n\n get CONNECTING() {\n return WebSocket.CONNECTING;\n }\n get CLOSING() {\n return WebSocket.CLOSING;\n }\n get CLOSED() {\n return WebSocket.CLOSED;\n }\n get OPEN() {\n return WebSocket.OPEN;\n }\n\n /**\n * This deviates from the WHATWG interface since ws doesn't support the\n * required default \"blob\" type (instead we define a custom \"nodebuffer\"\n * type).\n *\n * @type {String}\n */\n get binaryType() {\n return this._binaryType;\n }\n\n set binaryType(type) {\n if (!BINARY_TYPES.includes(type)) return;\n\n this._binaryType = type;\n\n //\n // Allow to change `binaryType` on the fly.\n //\n if (this._receiver) this._receiver._binaryType = type;\n }\n\n /**\n * @type {Number}\n */\n get bufferedAmount() {\n if (!this._socket) return 0;\n\n //\n // `socket.bufferSize` is `undefined` if the socket is closed.\n //\n return (this._socket.bufferSize || 0) + this._sender._bufferedBytes;\n }\n\n /**\n * @type {String}\n */\n get extensions() {\n return Object.keys(this._extensions).join();\n }\n\n /**\n * Set up the socket and the internal resources.\n *\n * @param {net.Socket} socket The network socket between the server and client\n * @param {Buffer} head The first packet of the upgraded stream\n * @param {Number} maxPayload The maximum allowed message size\n * @private\n */\n setSocket(socket, head, maxPayload) {\n const receiver = new Receiver(\n this._binaryType,\n this._extensions,\n maxPayload\n );\n\n this._sender = new Sender(socket, this._extensions);\n this._receiver = receiver;\n this._socket = socket;\n\n receiver[kWebSocket] = this;\n socket[kWebSocket] = this;\n\n receiver.on('conclude', receiverOnConclude);\n receiver.on('drain', receiverOnDrain);\n receiver.on('error', receiverOnError);\n receiver.on('message', receiverOnMessage);\n receiver.on('ping', receiverOnPing);\n receiver.on('pong', receiverOnPong);\n\n socket.setTimeout(0);\n socket.setNoDelay();\n\n if (head.length > 0) socket.unshift(head);\n\n socket.on('close', socketOnClose);\n socket.on('data', socketOnData);\n socket.on('end', socketOnEnd);\n socket.on('error', socketOnError);\n\n this.readyState = WebSocket.OPEN;\n this.emit('open');\n }\n\n /**\n * Emit the `'close'` event.\n *\n * @private\n */\n emitClose() {\n this.readyState = WebSocket.CLOSED;\n\n if (!this._socket) {\n this.emit('close', this._closeCode, this._closeMessage);\n return;\n }\n\n if (this._extensions[PerMessageDeflate.extensionName]) {\n this._extensions[PerMessageDeflate.extensionName].cleanup();\n }\n\n this._receiver.removeAllListeners();\n this.emit('close', this._closeCode, this._closeMessage);\n }\n\n /**\n * Start a closing handshake.\n *\n * +----------+ +-----------+ +----------+\n * - - -|ws.close()|-->|close frame|-->|ws.close()|- - -\n * | +----------+ +-----------+ +----------+ |\n * +----------+ +-----------+ |\n * CLOSING |ws.close()|<--|close frame|<--+-----+ CLOSING\n * +----------+ +-----------+ |\n * | | | +---+ |\n * +------------------------+-->|fin| - - - -\n * | +---+ | +---+\n * - - - - -|fin|<---------------------+\n * +---+\n *\n * @param {Number} code Status code explaining why the connection is closing\n * @param {String} data A string explaining why the connection is closing\n * @public\n */\n close(code, data) {\n if (this.readyState === WebSocket.CLOSED) return;\n if (this.readyState === WebSocket.CONNECTING) {\n const msg = 'WebSocket was closed before the connection was established';\n return abortHandshake(this, this._req, msg);\n }\n\n if (this.readyState === WebSocket.CLOSING) {\n if (this._closeFrameSent && this._closeFrameReceived) this._socket.end();\n return;\n }\n\n this.readyState = WebSocket.CLOSING;\n this._sender.close(code, data, !this._isServer, (err) => {\n //\n // This error is handled by the `'error'` listener on the socket. We only\n // want to know if the close frame has been sent here.\n //\n if (err) return;\n\n this._closeFrameSent = true;\n if (this._closeFrameReceived) this._socket.end();\n });\n\n //\n // Specify a timeout for the closing handshake to complete.\n //\n this._closeTimer = setTimeout(\n this._socket.destroy.bind(this._socket),\n closeTimeout\n );\n }\n\n /**\n * Send a ping.\n *\n * @param {*} data The data to send\n * @param {Boolean} mask Indicates whether or not to mask `data`\n * @param {Function} cb Callback which is executed when the ping is sent\n * @public\n */\n ping(data, mask, cb) {\n if (typeof data === 'function') {\n cb = data;\n data = mask = undefined;\n } else if (typeof mask === 'function') {\n cb = mask;\n mask = undefined;\n }\n\n if (this.readyState !== WebSocket.OPEN) {\n const err = new Error(\n `WebSocket is not open: readyState ${this.readyState} ` +\n `(${readyStates[this.readyState]})`\n );\n\n if (cb) return cb(err);\n throw err;\n }\n\n if (typeof data === 'number') data = data.toString();\n if (mask === undefined) mask = !this._isServer;\n this._sender.ping(data || EMPTY_BUFFER, mask, cb);\n }\n\n /**\n * Send a pong.\n *\n * @param {*} data The data to send\n * @param {Boolean} mask Indicates whether or not to mask `data`\n * @param {Function} cb Callback which is executed when the pong is sent\n * @public\n */\n pong(data, mask, cb) {\n if (typeof data === 'function') {\n cb = data;\n data = mask = undefined;\n } else if (typeof mask === 'function') {\n cb = mask;\n mask = undefined;\n }\n\n if (this.readyState !== WebSocket.OPEN) {\n const err = new Error(\n `WebSocket is not open: readyState ${this.readyState} ` +\n `(${readyStates[this.readyState]})`\n );\n\n if (cb) return cb(err);\n throw err;\n }\n\n if (typeof data === 'number') data = data.toString();\n if (mask === undefined) mask = !this._isServer;\n this._sender.pong(data || EMPTY_BUFFER, mask, cb);\n }\n\n /**\n * Send a data message.\n *\n * @param {*} data The message to send\n * @param {Object} options Options object\n * @param {Boolean} options.compress Specifies whether or not to compress `data`\n * @param {Boolean} options.binary Specifies whether `data` is binary or text\n * @param {Boolean} options.fin Specifies whether the fragment is the last one\n * @param {Boolean} options.mask Specifies whether or not to mask `data`\n * @param {Function} cb Callback which is executed when data is written out\n * @public\n */\n send(data, options, cb) {\n if (typeof options === 'function') {\n cb = options;\n options = {};\n }\n\n if (this.readyState !== WebSocket.OPEN) {\n const err = new Error(\n `WebSocket is not open: readyState ${this.readyState} ` +\n `(${readyStates[this.readyState]})`\n );\n\n if (cb) return cb(err);\n throw err;\n }\n\n if (typeof data === 'number') data = data.toString();\n\n const opts = Object.assign(\n {\n binary: typeof data !== 'string',\n mask: !this._isServer,\n compress: true,\n fin: true\n },\n options\n );\n\n if (!this._extensions[PerMessageDeflate.extensionName]) {\n opts.compress = false;\n }\n\n this._sender.send(data || EMPTY_BUFFER, opts, cb);\n }\n\n /**\n * Forcibly close the connection.\n *\n * @public\n */\n terminate() {\n if (this.readyState === WebSocket.CLOSED) return;\n if (this.readyState === WebSocket.CONNECTING) {\n const msg = 'WebSocket was closed before the connection was established';\n return abortHandshake(this, this._req, msg);\n }\n\n if (this._socket) {\n this.readyState = WebSocket.CLOSING;\n this._socket.destroy();\n }\n }\n}\n\nreadyStates.forEach((readyState, i) => {\n WebSocket[readyState] = i;\n});\n\n//\n// Add the `onopen`, `onerror`, `onclose`, and `onmessage` attributes.\n// See https://html.spec.whatwg.org/multipage/comms.html#the-websocket-interface\n//\n['open', 'error', 'close', 'message'].forEach((method) => {\n Object.defineProperty(WebSocket.prototype, `on${method}`, {\n /**\n * Return the listener of the event.\n *\n * @return {(Function|undefined)} The event listener or `undefined`\n * @public\n */\n get() {\n const listeners = this.listeners(method);\n for (var i = 0; i < listeners.length; i++) {\n if (listeners[i]._listener) return listeners[i]._listener;\n }\n\n return undefined;\n },\n /**\n * Add a listener for the event.\n *\n * @param {Function} listener The listener to add\n * @public\n */\n set(listener) {\n const listeners = this.listeners(method);\n for (var i = 0; i < listeners.length; i++) {\n //\n // Remove only the listeners added via `addEventListener`.\n //\n if (listeners[i]._listener) this.removeListener(method, listeners[i]);\n }\n this.addEventListener(method, listener);\n }\n });\n});\n\nWebSocket.prototype.addEventListener = EventTarget.addEventListener;\nWebSocket.prototype.removeEventListener = EventTarget.removeEventListener;\n\nmodule.exports = WebSocket;\n\n/**\n * Initialize a WebSocket client.\n *\n * @param {WebSocket} websocket The client to initialize\n * @param {(String|url.Url|url.URL)} address The URL to which to connect\n * @param {String} protocols The subprotocols\n * @param {Object} options Connection options\n * @param {(Boolean|Object)} options.perMessageDeflate Enable/disable\n * permessage-deflate\n * @param {Number} options.handshakeTimeout Timeout in milliseconds for the\n * handshake request\n * @param {Number} options.protocolVersion Value of the `Sec-WebSocket-Version`\n * header\n * @param {String} options.origin Value of the `Origin` or\n * `Sec-WebSocket-Origin` header\n * @param {Number} options.maxPayload The maximum allowed message size\n * @param {Boolean} options.followRedirects Whether or not to follow redirects\n * @param {Number} options.maxRedirects The maximum number of redirects allowed\n * @private\n */\nfunction initAsClient(websocket, address, protocols, options) {\n const opts = Object.assign(\n {\n protocolVersion: protocolVersions[1],\n maxPayload: 100 * 1024 * 1024,\n perMessageDeflate: true,\n followRedirects: false,\n maxRedirects: 10\n },\n options,\n {\n createConnection: undefined,\n socketPath: undefined,\n hostname: undefined,\n protocol: undefined,\n timeout: undefined,\n method: undefined,\n auth: undefined,\n host: undefined,\n path: undefined,\n port: undefined\n }\n );\n\n if (!protocolVersions.includes(opts.protocolVersion)) {\n throw new RangeError(\n `Unsupported protocol version: ${opts.protocolVersion} ` +\n `(supported versions: ${protocolVersions.join(', ')})`\n );\n }\n\n var parsedUrl;\n\n if (typeof address === 'object' && address.href !== undefined) {\n parsedUrl = address;\n websocket.url = address.href;\n } else {\n //\n // The WHATWG URL constructor is not available on Node.js < 6.13.0\n //\n parsedUrl = url.URL ? new url.URL(address) : url.parse(address);\n websocket.url = address;\n }\n\n const isUnixSocket = parsedUrl.protocol === 'ws+unix:';\n\n if (!parsedUrl.host && (!isUnixSocket || !parsedUrl.pathname)) {\n throw new Error(`Invalid URL: ${websocket.url}`);\n }\n\n const isSecure =\n parsedUrl.protocol === 'wss:' || parsedUrl.protocol === 'https:';\n const defaultPort = isSecure ? 443 : 80;\n const key = crypto.randomBytes(16).toString('base64');\n const get = isSecure ? https.get : http.get;\n const path = parsedUrl.search\n ? `${parsedUrl.pathname || '/'}${parsedUrl.search}`\n : parsedUrl.pathname || '/';\n var perMessageDeflate;\n\n opts.createConnection = isSecure ? tlsConnect : netConnect;\n opts.defaultPort = opts.defaultPort || defaultPort;\n opts.port = parsedUrl.port || defaultPort;\n opts.host = parsedUrl.hostname.startsWith('[')\n ? parsedUrl.hostname.slice(1, -1)\n : parsedUrl.hostname;\n opts.headers = Object.assign(\n {\n 'Sec-WebSocket-Version': opts.protocolVersion,\n 'Sec-WebSocket-Key': key,\n Connection: 'Upgrade',\n Upgrade: 'websocket'\n },\n opts.headers\n );\n opts.path = path;\n opts.timeout = opts.handshakeTimeout;\n\n if (opts.perMessageDeflate) {\n perMessageDeflate = new PerMessageDeflate(\n opts.perMessageDeflate !== true ? opts.perMessageDeflate : {},\n false,\n opts.maxPayload\n );\n opts.headers['Sec-WebSocket-Extensions'] = extension.format({\n [PerMessageDeflate.extensionName]: perMessageDeflate.offer()\n });\n }\n if (protocols) {\n opts.headers['Sec-WebSocket-Protocol'] = protocols;\n }\n if (opts.origin) {\n if (opts.protocolVersion < 13) {\n opts.headers['Sec-WebSocket-Origin'] = opts.origin;\n } else {\n opts.headers.Origin = opts.origin;\n }\n }\n if (parsedUrl.auth) {\n opts.auth = parsedUrl.auth;\n } else if (parsedUrl.username || parsedUrl.password) {\n opts.auth = `${parsedUrl.username}:${parsedUrl.password}`;\n }\n\n if (isUnixSocket) {\n const parts = path.split(':');\n\n opts.socketPath = parts[0];\n opts.path = parts[1];\n }\n\n var req = (websocket._req = get(opts));\n\n if (opts.timeout) {\n req.on('timeout', () => {\n abortHandshake(websocket, req, 'Opening handshake has timed out');\n });\n }\n\n req.on('error', (err) => {\n if (websocket._req.aborted) return;\n\n req = websocket._req = null;\n websocket.readyState = WebSocket.CLOSING;\n websocket.emit('error', err);\n websocket.emitClose();\n });\n\n req.on('response', (res) => {\n const location = res.headers.location;\n const statusCode = res.statusCode;\n\n if (\n location &&\n opts.followRedirects &&\n statusCode >= 300 &&\n statusCode < 400\n ) {\n if (++websocket._redirects > opts.maxRedirects) {\n abortHandshake(websocket, req, 'Maximum redirects exceeded');\n return;\n }\n\n req.abort();\n\n const addr = url.URL\n ? new url.URL(location, address)\n : url.resolve(address, location);\n\n initAsClient(websocket, addr, protocols, options);\n } else if (!websocket.emit('unexpected-response', req, res)) {\n abortHandshake(\n websocket,\n req,\n `Unexpected server response: ${res.statusCode}`\n );\n }\n });\n\n req.on('upgrade', (res, socket, head) => {\n websocket.emit('upgrade', res);\n\n //\n // The user may have closed the connection from a listener of the `upgrade`\n // event.\n //\n if (websocket.readyState !== WebSocket.CONNECTING) return;\n\n req = websocket._req = null;\n\n const digest = crypto\n .createHash('sha1')\n .update(key + GUID)\n .digest('base64');\n\n if (res.headers['sec-websocket-accept'] !== digest) {\n abortHandshake(websocket, socket, 'Invalid Sec-WebSocket-Accept header');\n return;\n }\n\n const serverProt = res.headers['sec-websocket-protocol'];\n const protList = (protocols || '').split(/, */);\n var protError;\n\n if (!protocols && serverProt) {\n protError = 'Server sent a subprotocol but none was requested';\n } else if (protocols && !serverProt) {\n protError = 'Server sent no subprotocol';\n } else if (serverProt && !protList.includes(serverProt)) {\n protError = 'Server sent an invalid subprotocol';\n }\n\n if (protError) {\n abortHandshake(websocket, socket, protError);\n return;\n }\n\n if (serverProt) websocket.protocol = serverProt;\n\n if (perMessageDeflate) {\n try {\n const extensions = extension.parse(\n res.headers['sec-websocket-extensions']\n );\n\n if (extensions[PerMessageDeflate.extensionName]) {\n perMessageDeflate.accept(extensions[PerMessageDeflate.extensionName]);\n websocket._extensions[\n PerMessageDeflate.extensionName\n ] = perMessageDeflate;\n }\n } catch (err) {\n abortHandshake(\n websocket,\n socket,\n 'Invalid Sec-WebSocket-Extensions header'\n );\n return;\n }\n }\n\n websocket.setSocket(socket, head, opts.maxPayload);\n });\n}\n\n/**\n * Create a `net.Socket` and initiate a connection.\n *\n * @param {Object} options Connection options\n * @return {net.Socket} The newly created socket used to start the connection\n * @private\n */\nfunction netConnect(options) {\n //\n // Override `options.path` only if `options` is a copy of the original options\n // object. This is always true on Node.js >= 8 but not on Node.js 6 where\n // `options.socketPath` might be `undefined` even if the `socketPath` option\n // was originally set.\n //\n if (options.protocolVersion) options.path = options.socketPath;\n return net.connect(options);\n}\n\n/**\n * Create a `tls.TLSSocket` and initiate a connection.\n *\n * @param {Object} options Connection options\n * @return {tls.TLSSocket} The newly created socket used to start the connection\n * @private\n */\nfunction tlsConnect(options) {\n options.path = undefined;\n options.servername = options.servername || options.host;\n return tls.connect(options);\n}\n\n/**\n * Abort the handshake and emit an error.\n *\n * @param {WebSocket} websocket The WebSocket instance\n * @param {(http.ClientRequest|net.Socket)} stream The request to abort or the\n * socket to destroy\n * @param {String} message The error message\n * @private\n */\nfunction abortHandshake(websocket, stream, message) {\n websocket.readyState = WebSocket.CLOSING;\n\n const err = new Error(message);\n Error.captureStackTrace(err, abortHandshake);\n\n if (stream.setHeader) {\n stream.abort();\n stream.once('abort', websocket.emitClose.bind(websocket));\n websocket.emit('error', err);\n } else {\n stream.destroy(err);\n stream.once('error', websocket.emit.bind(websocket, 'error'));\n stream.once('close', websocket.emitClose.bind(websocket));\n }\n}\n\n/**\n * The listener of the `Receiver` `'conclude'` event.\n *\n * @param {Number} code The status code\n * @param {String} reason The reason for closing\n * @private\n */\nfunction receiverOnConclude(code, reason) {\n const websocket = this[kWebSocket];\n\n websocket._socket.removeListener('data', socketOnData);\n websocket._socket.resume();\n\n websocket._closeFrameReceived = true;\n websocket._closeMessage = reason;\n websocket._closeCode = code;\n\n if (code === 1005) websocket.close();\n else websocket.close(code, reason);\n}\n\n/**\n * The listener of the `Receiver` `'drain'` event.\n *\n * @private\n */\nfunction receiverOnDrain() {\n this[kWebSocket]._socket.resume();\n}\n\n/**\n * The listener of the `Receiver` `'error'` event.\n *\n * @param {(RangeError|Error)} err The emitted error\n * @private\n */\nfunction receiverOnError(err) {\n const websocket = this[kWebSocket];\n\n websocket._socket.removeListener('data', socketOnData);\n\n websocket.readyState = WebSocket.CLOSING;\n websocket._closeCode = err[kStatusCode];\n websocket.emit('error', err);\n websocket._socket.destroy();\n}\n\n/**\n * The listener of the `Receiver` `'finish'` event.\n *\n * @private\n */\nfunction receiverOnFinish() {\n this[kWebSocket].emitClose();\n}\n\n/**\n * The listener of the `Receiver` `'message'` event.\n *\n * @param {(String|Buffer|ArrayBuffer|Buffer[])} data The message\n * @private\n */\nfunction receiverOnMessage(data) {\n this[kWebSocket].emit('message', data);\n}\n\n/**\n * The listener of the `Receiver` `'ping'` event.\n *\n * @param {Buffer} data The data included in the ping frame\n * @private\n */\nfunction receiverOnPing(data) {\n const websocket = this[kWebSocket];\n\n websocket.pong(data, !websocket._isServer, NOOP);\n websocket.emit('ping', data);\n}\n\n/**\n * The listener of the `Receiver` `'pong'` event.\n *\n * @param {Buffer} data The data included in the pong frame\n * @private\n */\nfunction receiverOnPong(data) {\n this[kWebSocket].emit('pong', data);\n}\n\n/**\n * The listener of the `net.Socket` `'close'` event.\n *\n * @private\n */\nfunction socketOnClose() {\n const websocket = this[kWebSocket];\n\n this.removeListener('close', socketOnClose);\n this.removeListener('end', socketOnEnd);\n\n websocket.readyState = WebSocket.CLOSING;\n\n //\n // The close frame might not have been received or the `'end'` event emitted,\n // for example, if the socket was destroyed due to an error. Ensure that the\n // `receiver` stream is closed after writing any remaining buffered data to\n // it. If the readable side of the socket is in flowing mode then there is no\n // buffered data as everything has been already written and `readable.read()`\n // will return `null`. If instead, the socket is paused, any possible buffered\n // data will be read as a single chunk and emitted synchronously in a single\n // `'data'` event.\n //\n websocket._socket.read();\n websocket._receiver.end();\n\n this.removeListener('data', socketOnData);\n this[kWebSocket] = undefined;\n\n clearTimeout(websocket._closeTimer);\n\n if (\n websocket._receiver._writableState.finished ||\n websocket._receiver._writableState.errorEmitted\n ) {\n websocket.emitClose();\n } else {\n websocket._receiver.on('error', receiverOnFinish);\n websocket._receiver.on('finish', receiverOnFinish);\n }\n}\n\n/**\n * The listener of the `net.Socket` `'data'` event.\n *\n * @param {Buffer} chunk A chunk of data\n * @private\n */\nfunction socketOnData(chunk) {\n if (!this[kWebSocket]._receiver.write(chunk)) {\n this.pause();\n }\n}\n\n/**\n * The listener of the `net.Socket` `'end'` event.\n *\n * @private\n */\nfunction socketOnEnd() {\n const websocket = this[kWebSocket];\n\n websocket.readyState = WebSocket.CLOSING;\n websocket._receiver.end();\n this.end();\n}\n\n/**\n * The listener of the `net.Socket` `'error'` event.\n *\n * @private\n */\nfunction socketOnError() {\n const websocket = this[kWebSocket];\n\n this.removeListener('error', socketOnError);\n this.on('error', NOOP);\n\n websocket.readyState = WebSocket.CLOSING;\n this.destroy();\n}\n","// Generated by CoffeeScript 1.12.7\n(function() {\n \"use strict\";\n exports.stripBOM = function(str) {\n if (str[0] === '\\uFEFF') {\n return str.substring(1);\n } else {\n return str;\n }\n };\n\n}).call(this);\n","// Generated by CoffeeScript 1.12.7\n(function() {\n \"use strict\";\n var builder, defaults, escapeCDATA, requiresCDATA, wrapCDATA,\n hasProp = {}.hasOwnProperty;\n\n builder = require('xmlbuilder');\n\n defaults = require('./defaults').defaults;\n\n requiresCDATA = function(entry) {\n return typeof entry === \"string\" && (entry.indexOf('&') >= 0 || entry.indexOf('>') >= 0 || entry.indexOf('<') >= 0);\n };\n\n wrapCDATA = function(entry) {\n return \"\";\n };\n\n escapeCDATA = function(entry) {\n return entry.replace(']]>', ']]]]>');\n };\n\n exports.Builder = (function() {\n function Builder(opts) {\n var key, ref, value;\n this.options = {};\n ref = defaults[\"0.2\"];\n for (key in ref) {\n if (!hasProp.call(ref, key)) continue;\n value = ref[key];\n this.options[key] = value;\n }\n for (key in opts) {\n if (!hasProp.call(opts, key)) continue;\n value = opts[key];\n this.options[key] = value;\n }\n }\n\n Builder.prototype.buildObject = function(rootObj) {\n var attrkey, charkey, render, rootElement, rootName;\n attrkey = this.options.attrkey;\n charkey = this.options.charkey;\n if ((Object.keys(rootObj).length === 1) && (this.options.rootName === defaults['0.2'].rootName)) {\n rootName = Object.keys(rootObj)[0];\n rootObj = rootObj[rootName];\n } else {\n rootName = this.options.rootName;\n }\n render = (function(_this) {\n return function(element, obj) {\n var attr, child, entry, index, key, value;\n if (typeof obj !== 'object') {\n if (_this.options.cdata && requiresCDATA(obj)) {\n element.raw(wrapCDATA(obj));\n } else {\n element.txt(obj);\n }\n } else if (Array.isArray(obj)) {\n for (index in obj) {\n if (!hasProp.call(obj, index)) continue;\n child = obj[index];\n for (key in child) {\n entry = child[key];\n element = render(element.ele(key), entry).up();\n }\n }\n } else {\n for (key in obj) {\n if (!hasProp.call(obj, key)) continue;\n child = obj[key];\n if (key === attrkey) {\n if (typeof child === \"object\") {\n for (attr in child) {\n value = child[attr];\n element = element.att(attr, value);\n }\n }\n } else if (key === charkey) {\n if (_this.options.cdata && requiresCDATA(child)) {\n element = element.raw(wrapCDATA(child));\n } else {\n element = element.txt(child);\n }\n } else if (Array.isArray(child)) {\n for (index in child) {\n if (!hasProp.call(child, index)) continue;\n entry = child[index];\n if (typeof entry === 'string') {\n if (_this.options.cdata && requiresCDATA(entry)) {\n element = element.ele(key).raw(wrapCDATA(entry)).up();\n } else {\n element = element.ele(key, entry).up();\n }\n } else {\n element = render(element.ele(key), entry).up();\n }\n }\n } else if (typeof child === \"object\") {\n element = render(element.ele(key), child).up();\n } else {\n if (typeof child === 'string' && _this.options.cdata && requiresCDATA(child)) {\n element = element.ele(key).raw(wrapCDATA(child)).up();\n } else {\n if (child == null) {\n child = '';\n }\n element = element.ele(key, child.toString()).up();\n }\n }\n }\n }\n return element;\n };\n })(this);\n rootElement = builder.create(rootName, this.options.xmldec, this.options.doctype, {\n headless: this.options.headless,\n allowSurrogateChars: this.options.allowSurrogateChars\n });\n return render(rootElement, rootObj).end(this.options.renderOpts);\n };\n\n return Builder;\n\n })();\n\n}).call(this);\n","// Generated by CoffeeScript 1.12.7\n(function() {\n exports.defaults = {\n \"0.1\": {\n explicitCharkey: false,\n trim: true,\n normalize: true,\n normalizeTags: false,\n attrkey: \"@\",\n charkey: \"#\",\n explicitArray: false,\n ignoreAttrs: false,\n mergeAttrs: false,\n explicitRoot: false,\n validator: null,\n xmlns: false,\n explicitChildren: false,\n childkey: '@@',\n charsAsChildren: false,\n includeWhiteChars: false,\n async: false,\n strict: true,\n attrNameProcessors: null,\n attrValueProcessors: null,\n tagNameProcessors: null,\n valueProcessors: null,\n emptyTag: ''\n },\n \"0.2\": {\n explicitCharkey: false,\n trim: false,\n normalize: false,\n normalizeTags: false,\n attrkey: \"$\",\n charkey: \"_\",\n explicitArray: true,\n ignoreAttrs: false,\n mergeAttrs: false,\n explicitRoot: true,\n validator: null,\n xmlns: false,\n explicitChildren: false,\n preserveChildrenOrder: false,\n childkey: '$$',\n charsAsChildren: false,\n includeWhiteChars: false,\n async: false,\n strict: true,\n attrNameProcessors: null,\n attrValueProcessors: null,\n tagNameProcessors: null,\n valueProcessors: null,\n rootName: 'root',\n xmldec: {\n 'version': '1.0',\n 'encoding': 'UTF-8',\n 'standalone': true\n },\n doctype: null,\n renderOpts: {\n 'pretty': true,\n 'indent': ' ',\n 'newline': '\\n'\n },\n headless: false,\n chunkSize: 10000,\n emptyTag: '',\n cdata: false\n }\n };\n\n}).call(this);\n","// Generated by CoffeeScript 1.12.7\n(function() {\n \"use strict\";\n var bom, defaults, events, isEmpty, processItem, processors, sax, setImmediate,\n bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; },\n extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; },\n hasProp = {}.hasOwnProperty;\n\n sax = require('sax');\n\n events = require('events');\n\n bom = require('./bom');\n\n processors = require('./processors');\n\n setImmediate = require('timers').setImmediate;\n\n defaults = require('./defaults').defaults;\n\n isEmpty = function(thing) {\n return typeof thing === \"object\" && (thing != null) && Object.keys(thing).length === 0;\n };\n\n processItem = function(processors, item, key) {\n var i, len, process;\n for (i = 0, len = processors.length; i < len; i++) {\n process = processors[i];\n item = process(item, key);\n }\n return item;\n };\n\n exports.Parser = (function(superClass) {\n extend(Parser, superClass);\n\n function Parser(opts) {\n this.parseString = bind(this.parseString, this);\n this.reset = bind(this.reset, this);\n this.assignOrPush = bind(this.assignOrPush, this);\n this.processAsync = bind(this.processAsync, this);\n var key, ref, value;\n if (!(this instanceof exports.Parser)) {\n return new exports.Parser(opts);\n }\n this.options = {};\n ref = defaults[\"0.2\"];\n for (key in ref) {\n if (!hasProp.call(ref, key)) continue;\n value = ref[key];\n this.options[key] = value;\n }\n for (key in opts) {\n if (!hasProp.call(opts, key)) continue;\n value = opts[key];\n this.options[key] = value;\n }\n if (this.options.xmlns) {\n this.options.xmlnskey = this.options.attrkey + \"ns\";\n }\n if (this.options.normalizeTags) {\n if (!this.options.tagNameProcessors) {\n this.options.tagNameProcessors = [];\n }\n this.options.tagNameProcessors.unshift(processors.normalize);\n }\n this.reset();\n }\n\n Parser.prototype.processAsync = function() {\n var chunk, err;\n try {\n if (this.remaining.length <= this.options.chunkSize) {\n chunk = this.remaining;\n this.remaining = '';\n this.saxParser = this.saxParser.write(chunk);\n return this.saxParser.close();\n } else {\n chunk = this.remaining.substr(0, this.options.chunkSize);\n this.remaining = this.remaining.substr(this.options.chunkSize, this.remaining.length);\n this.saxParser = this.saxParser.write(chunk);\n return setImmediate(this.processAsync);\n }\n } catch (error1) {\n err = error1;\n if (!this.saxParser.errThrown) {\n this.saxParser.errThrown = true;\n return this.emit(err);\n }\n }\n };\n\n Parser.prototype.assignOrPush = function(obj, key, newValue) {\n if (!(key in obj)) {\n if (!this.options.explicitArray) {\n return obj[key] = newValue;\n } else {\n return obj[key] = [newValue];\n }\n } else {\n if (!(obj[key] instanceof Array)) {\n obj[key] = [obj[key]];\n }\n return obj[key].push(newValue);\n }\n };\n\n Parser.prototype.reset = function() {\n var attrkey, charkey, ontext, stack;\n this.removeAllListeners();\n this.saxParser = sax.parser(this.options.strict, {\n trim: false,\n normalize: false,\n xmlns: this.options.xmlns\n });\n this.saxParser.errThrown = false;\n this.saxParser.onerror = (function(_this) {\n return function(error) {\n _this.saxParser.resume();\n if (!_this.saxParser.errThrown) {\n _this.saxParser.errThrown = true;\n return _this.emit(\"error\", error);\n }\n };\n })(this);\n this.saxParser.onend = (function(_this) {\n return function() {\n if (!_this.saxParser.ended) {\n _this.saxParser.ended = true;\n return _this.emit(\"end\", _this.resultObject);\n }\n };\n })(this);\n this.saxParser.ended = false;\n this.EXPLICIT_CHARKEY = this.options.explicitCharkey;\n this.resultObject = null;\n stack = [];\n attrkey = this.options.attrkey;\n charkey = this.options.charkey;\n this.saxParser.onopentag = (function(_this) {\n return function(node) {\n var key, newValue, obj, processedKey, ref;\n obj = {};\n obj[charkey] = \"\";\n if (!_this.options.ignoreAttrs) {\n ref = node.attributes;\n for (key in ref) {\n if (!hasProp.call(ref, key)) continue;\n if (!(attrkey in obj) && !_this.options.mergeAttrs) {\n obj[attrkey] = {};\n }\n newValue = _this.options.attrValueProcessors ? processItem(_this.options.attrValueProcessors, node.attributes[key], key) : node.attributes[key];\n processedKey = _this.options.attrNameProcessors ? processItem(_this.options.attrNameProcessors, key) : key;\n if (_this.options.mergeAttrs) {\n _this.assignOrPush(obj, processedKey, newValue);\n } else {\n obj[attrkey][processedKey] = newValue;\n }\n }\n }\n obj[\"#name\"] = _this.options.tagNameProcessors ? processItem(_this.options.tagNameProcessors, node.name) : node.name;\n if (_this.options.xmlns) {\n obj[_this.options.xmlnskey] = {\n uri: node.uri,\n local: node.local\n };\n }\n return stack.push(obj);\n };\n })(this);\n this.saxParser.onclosetag = (function(_this) {\n return function() {\n var cdata, emptyStr, key, node, nodeName, obj, objClone, old, s, xpath;\n obj = stack.pop();\n nodeName = obj[\"#name\"];\n if (!_this.options.explicitChildren || !_this.options.preserveChildrenOrder) {\n delete obj[\"#name\"];\n }\n if (obj.cdata === true) {\n cdata = obj.cdata;\n delete obj.cdata;\n }\n s = stack[stack.length - 1];\n if (obj[charkey].match(/^\\s*$/) && !cdata) {\n emptyStr = obj[charkey];\n delete obj[charkey];\n } else {\n if (_this.options.trim) {\n obj[charkey] = obj[charkey].trim();\n }\n if (_this.options.normalize) {\n obj[charkey] = obj[charkey].replace(/\\s{2,}/g, \" \").trim();\n }\n obj[charkey] = _this.options.valueProcessors ? processItem(_this.options.valueProcessors, obj[charkey], nodeName) : obj[charkey];\n if (Object.keys(obj).length === 1 && charkey in obj && !_this.EXPLICIT_CHARKEY) {\n obj = obj[charkey];\n }\n }\n if (isEmpty(obj)) {\n obj = _this.options.emptyTag !== '' ? _this.options.emptyTag : emptyStr;\n }\n if (_this.options.validator != null) {\n xpath = \"/\" + ((function() {\n var i, len, results;\n results = [];\n for (i = 0, len = stack.length; i < len; i++) {\n node = stack[i];\n results.push(node[\"#name\"]);\n }\n return results;\n })()).concat(nodeName).join(\"/\");\n (function() {\n var err;\n try {\n return obj = _this.options.validator(xpath, s && s[nodeName], obj);\n } catch (error1) {\n err = error1;\n return _this.emit(\"error\", err);\n }\n })();\n }\n if (_this.options.explicitChildren && !_this.options.mergeAttrs && typeof obj === 'object') {\n if (!_this.options.preserveChildrenOrder) {\n node = {};\n if (_this.options.attrkey in obj) {\n node[_this.options.attrkey] = obj[_this.options.attrkey];\n delete obj[_this.options.attrkey];\n }\n if (!_this.options.charsAsChildren && _this.options.charkey in obj) {\n node[_this.options.charkey] = obj[_this.options.charkey];\n delete obj[_this.options.charkey];\n }\n if (Object.getOwnPropertyNames(obj).length > 0) {\n node[_this.options.childkey] = obj;\n }\n obj = node;\n } else if (s) {\n s[_this.options.childkey] = s[_this.options.childkey] || [];\n objClone = {};\n for (key in obj) {\n if (!hasProp.call(obj, key)) continue;\n objClone[key] = obj[key];\n }\n s[_this.options.childkey].push(objClone);\n delete obj[\"#name\"];\n if (Object.keys(obj).length === 1 && charkey in obj && !_this.EXPLICIT_CHARKEY) {\n obj = obj[charkey];\n }\n }\n }\n if (stack.length > 0) {\n return _this.assignOrPush(s, nodeName, obj);\n } else {\n if (_this.options.explicitRoot) {\n old = obj;\n obj = {};\n obj[nodeName] = old;\n }\n _this.resultObject = obj;\n _this.saxParser.ended = true;\n return _this.emit(\"end\", _this.resultObject);\n }\n };\n })(this);\n ontext = (function(_this) {\n return function(text) {\n var charChild, s;\n s = stack[stack.length - 1];\n if (s) {\n s[charkey] += text;\n if (_this.options.explicitChildren && _this.options.preserveChildrenOrder && _this.options.charsAsChildren && (_this.options.includeWhiteChars || text.replace(/\\\\n/g, '').trim() !== '')) {\n s[_this.options.childkey] = s[_this.options.childkey] || [];\n charChild = {\n '#name': '__text__'\n };\n charChild[charkey] = text;\n if (_this.options.normalize) {\n charChild[charkey] = charChild[charkey].replace(/\\s{2,}/g, \" \").trim();\n }\n s[_this.options.childkey].push(charChild);\n }\n return s;\n }\n };\n })(this);\n this.saxParser.ontext = ontext;\n return this.saxParser.oncdata = (function(_this) {\n return function(text) {\n var s;\n s = ontext(text);\n if (s) {\n return s.cdata = true;\n }\n };\n })(this);\n };\n\n Parser.prototype.parseString = function(str, cb) {\n var err;\n if ((cb != null) && typeof cb === \"function\") {\n this.on(\"end\", function(result) {\n this.reset();\n return cb(null, result);\n });\n this.on(\"error\", function(err) {\n this.reset();\n return cb(err);\n });\n }\n try {\n str = str.toString();\n if (str.trim() === '') {\n this.emit(\"end\", null);\n return true;\n }\n str = bom.stripBOM(str);\n if (this.options.async) {\n this.remaining = str;\n setImmediate(this.processAsync);\n return this.saxParser;\n }\n return this.saxParser.write(str).close();\n } catch (error1) {\n err = error1;\n if (!(this.saxParser.errThrown || this.saxParser.ended)) {\n this.emit('error', err);\n return this.saxParser.errThrown = true;\n } else if (this.saxParser.ended) {\n throw err;\n }\n }\n };\n\n return Parser;\n\n })(events.EventEmitter);\n\n exports.parseString = function(str, a, b) {\n var cb, options, parser;\n if (b != null) {\n if (typeof b === 'function') {\n cb = b;\n }\n if (typeof a === 'object') {\n options = a;\n }\n } else {\n if (typeof a === 'function') {\n cb = a;\n }\n options = {};\n }\n parser = new exports.Parser(options);\n return parser.parseString(str, cb);\n };\n\n}).call(this);\n","// Generated by CoffeeScript 1.12.7\n(function() {\n \"use strict\";\n var prefixMatch;\n\n prefixMatch = new RegExp(/(?!xmlns)^.*:/);\n\n exports.normalize = function(str) {\n return str.toLowerCase();\n };\n\n exports.firstCharLowerCase = function(str) {\n return str.charAt(0).toLowerCase() + str.slice(1);\n };\n\n exports.stripPrefix = function(str) {\n return str.replace(prefixMatch, '');\n };\n\n exports.parseNumbers = function(str) {\n if (!isNaN(str)) {\n str = str % 1 === 0 ? parseInt(str, 10) : parseFloat(str);\n }\n return str;\n };\n\n exports.parseBooleans = function(str) {\n if (/^(?:true|false)$/i.test(str)) {\n str = str.toLowerCase() === 'true';\n }\n return str;\n };\n\n}).call(this);\n","// Generated by CoffeeScript 1.12.7\n(function() {\n \"use strict\";\n var builder, defaults, parser, processors,\n extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; },\n hasProp = {}.hasOwnProperty;\n\n defaults = require('./defaults');\n\n builder = require('./builder');\n\n parser = require('./parser');\n\n processors = require('./processors');\n\n exports.defaults = defaults.defaults;\n\n exports.processors = processors;\n\n exports.ValidationError = (function(superClass) {\n extend(ValidationError, superClass);\n\n function ValidationError(message) {\n this.message = message;\n }\n\n return ValidationError;\n\n })(Error);\n\n exports.Builder = builder.Builder;\n\n exports.Parser = parser.Parser;\n\n exports.parseString = parser.parseString;\n\n}).call(this);\n",";(function (sax) { // wrapper for non-node envs\n sax.parser = function (strict, opt) { return new SAXParser(strict, opt) }\n sax.SAXParser = SAXParser\n sax.SAXStream = SAXStream\n sax.createStream = createStream\n\n // When we pass the MAX_BUFFER_LENGTH position, start checking for buffer overruns.\n // When we check, schedule the next check for MAX_BUFFER_LENGTH - (max(buffer lengths)),\n // since that's the earliest that a buffer overrun could occur. This way, checks are\n // as rare as required, but as often as necessary to ensure never crossing this bound.\n // Furthermore, buffers are only tested at most once per write(), so passing a very\n // large string into write() might have undesirable effects, but this is manageable by\n // the caller, so it is assumed to be safe. Thus, a call to write() may, in the extreme\n // edge case, result in creating at most one complete copy of the string passed in.\n // Set to Infinity to have unlimited buffers.\n sax.MAX_BUFFER_LENGTH = 64 * 1024\n\n var buffers = [\n 'comment', 'sgmlDecl', 'textNode', 'tagName', 'doctype',\n 'procInstName', 'procInstBody', 'entity', 'attribName',\n 'attribValue', 'cdata', 'script'\n ]\n\n sax.EVENTS = [\n 'text',\n 'processinginstruction',\n 'sgmldeclaration',\n 'doctype',\n 'comment',\n 'opentagstart',\n 'attribute',\n 'opentag',\n 'closetag',\n 'opencdata',\n 'cdata',\n 'closecdata',\n 'error',\n 'end',\n 'ready',\n 'script',\n 'opennamespace',\n 'closenamespace'\n ]\n\n function SAXParser (strict, opt) {\n if (!(this instanceof SAXParser)) {\n return new SAXParser(strict, opt)\n }\n\n var parser = this\n clearBuffers(parser)\n parser.q = parser.c = ''\n parser.bufferCheckPosition = sax.MAX_BUFFER_LENGTH\n parser.opt = opt || {}\n parser.opt.lowercase = parser.opt.lowercase || parser.opt.lowercasetags\n parser.looseCase = parser.opt.lowercase ? 'toLowerCase' : 'toUpperCase'\n parser.tags = []\n parser.closed = parser.closedRoot = parser.sawRoot = false\n parser.tag = parser.error = null\n parser.strict = !!strict\n parser.noscript = !!(strict || parser.opt.noscript)\n parser.state = S.BEGIN\n parser.strictEntities = parser.opt.strictEntities\n parser.ENTITIES = parser.strictEntities ? Object.create(sax.XML_ENTITIES) : Object.create(sax.ENTITIES)\n parser.attribList = []\n\n // namespaces form a prototype chain.\n // it always points at the current tag,\n // which protos to its parent tag.\n if (parser.opt.xmlns) {\n parser.ns = Object.create(rootNS)\n }\n\n // mostly just for error reporting\n parser.trackPosition = parser.opt.position !== false\n if (parser.trackPosition) {\n parser.position = parser.line = parser.column = 0\n }\n emit(parser, 'onready')\n }\n\n if (!Object.create) {\n Object.create = function (o) {\n function F () {}\n F.prototype = o\n var newf = new F()\n return newf\n }\n }\n\n if (!Object.keys) {\n Object.keys = function (o) {\n var a = []\n for (var i in o) if (o.hasOwnProperty(i)) a.push(i)\n return a\n }\n }\n\n function checkBufferLength (parser) {\n var maxAllowed = Math.max(sax.MAX_BUFFER_LENGTH, 10)\n var maxActual = 0\n for (var i = 0, l = buffers.length; i < l; i++) {\n var len = parser[buffers[i]].length\n if (len > maxAllowed) {\n // Text/cdata nodes can get big, and since they're buffered,\n // we can get here under normal conditions.\n // Avoid issues by emitting the text node now,\n // so at least it won't get any bigger.\n switch (buffers[i]) {\n case 'textNode':\n closeText(parser)\n break\n\n case 'cdata':\n emitNode(parser, 'oncdata', parser.cdata)\n parser.cdata = ''\n break\n\n case 'script':\n emitNode(parser, 'onscript', parser.script)\n parser.script = ''\n break\n\n default:\n error(parser, 'Max buffer length exceeded: ' + buffers[i])\n }\n }\n maxActual = Math.max(maxActual, len)\n }\n // schedule the next check for the earliest possible buffer overrun.\n var m = sax.MAX_BUFFER_LENGTH - maxActual\n parser.bufferCheckPosition = m + parser.position\n }\n\n function clearBuffers (parser) {\n for (var i = 0, l = buffers.length; i < l; i++) {\n parser[buffers[i]] = ''\n }\n }\n\n function flushBuffers (parser) {\n closeText(parser)\n if (parser.cdata !== '') {\n emitNode(parser, 'oncdata', parser.cdata)\n parser.cdata = ''\n }\n if (parser.script !== '') {\n emitNode(parser, 'onscript', parser.script)\n parser.script = ''\n }\n }\n\n SAXParser.prototype = {\n end: function () { end(this) },\n write: write,\n resume: function () { this.error = null; return this },\n close: function () { return this.write(null) },\n flush: function () { flushBuffers(this) }\n }\n\n var Stream\n try {\n Stream = require('stream').Stream\n } catch (ex) {\n Stream = function () {}\n }\n\n var streamWraps = sax.EVENTS.filter(function (ev) {\n return ev !== 'error' && ev !== 'end'\n })\n\n function createStream (strict, opt) {\n return new SAXStream(strict, opt)\n }\n\n function SAXStream (strict, opt) {\n if (!(this instanceof SAXStream)) {\n return new SAXStream(strict, opt)\n }\n\n Stream.apply(this)\n\n this._parser = new SAXParser(strict, opt)\n this.writable = true\n this.readable = true\n\n var me = this\n\n this._parser.onend = function () {\n me.emit('end')\n }\n\n this._parser.onerror = function (er) {\n me.emit('error', er)\n\n // if didn't throw, then means error was handled.\n // go ahead and clear error, so we can write again.\n me._parser.error = null\n }\n\n this._decoder = null\n\n streamWraps.forEach(function (ev) {\n Object.defineProperty(me, 'on' + ev, {\n get: function () {\n return me._parser['on' + ev]\n },\n set: function (h) {\n if (!h) {\n me.removeAllListeners(ev)\n me._parser['on' + ev] = h\n return h\n }\n me.on(ev, h)\n },\n enumerable: true,\n configurable: false\n })\n })\n }\n\n SAXStream.prototype = Object.create(Stream.prototype, {\n constructor: {\n value: SAXStream\n }\n })\n\n SAXStream.prototype.write = function (data) {\n if (typeof Buffer === 'function' &&\n typeof Buffer.isBuffer === 'function' &&\n Buffer.isBuffer(data)) {\n if (!this._decoder) {\n var SD = require('string_decoder').StringDecoder\n this._decoder = new SD('utf8')\n }\n data = this._decoder.write(data)\n }\n\n this._parser.write(data.toString())\n this.emit('data', data)\n return true\n }\n\n SAXStream.prototype.end = function (chunk) {\n if (chunk && chunk.length) {\n this.write(chunk)\n }\n this._parser.end()\n return true\n }\n\n SAXStream.prototype.on = function (ev, handler) {\n var me = this\n if (!me._parser['on' + ev] && streamWraps.indexOf(ev) !== -1) {\n me._parser['on' + ev] = function () {\n var args = arguments.length === 1 ? [arguments[0]] : Array.apply(null, arguments)\n args.splice(0, 0, ev)\n me.emit.apply(me, args)\n }\n }\n\n return Stream.prototype.on.call(me, ev, handler)\n }\n\n // this really needs to be replaced with character classes.\n // XML allows all manner of ridiculous numbers and digits.\n var CDATA = '[CDATA['\n var DOCTYPE = 'DOCTYPE'\n var XML_NAMESPACE = 'http://www.w3.org/XML/1998/namespace'\n var XMLNS_NAMESPACE = 'http://www.w3.org/2000/xmlns/'\n var rootNS = { xml: XML_NAMESPACE, xmlns: XMLNS_NAMESPACE }\n\n // http://www.w3.org/TR/REC-xml/#NT-NameStartChar\n // This implementation works on strings, a single character at a time\n // as such, it cannot ever support astral-plane characters (10000-EFFFF)\n // without a significant breaking change to either this parser, or the\n // JavaScript language. Implementation of an emoji-capable xml parser\n // is left as an exercise for the reader.\n var nameStart = /[:_A-Za-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD]/\n\n var nameBody = /[:_A-Za-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\u00B7\\u0300-\\u036F\\u203F-\\u2040.\\d-]/\n\n var entityStart = /[#:_A-Za-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD]/\n var entityBody = /[#:_A-Za-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\u00B7\\u0300-\\u036F\\u203F-\\u2040.\\d-]/\n\n function isWhitespace (c) {\n return c === ' ' || c === '\\n' || c === '\\r' || c === '\\t'\n }\n\n function isQuote (c) {\n return c === '\"' || c === '\\''\n }\n\n function isAttribEnd (c) {\n return c === '>' || isWhitespace(c)\n }\n\n function isMatch (regex, c) {\n return regex.test(c)\n }\n\n function notMatch (regex, c) {\n return !isMatch(regex, c)\n }\n\n var S = 0\n sax.STATE = {\n BEGIN: S++, // leading byte order mark or whitespace\n BEGIN_WHITESPACE: S++, // leading whitespace\n TEXT: S++, // general stuff\n TEXT_ENTITY: S++, // & and such.\n OPEN_WAKA: S++, // <\n SGML_DECL: S++, // \n SCRIPT: S++, //